Transistor as a Switch Circuit Diagram
This is a free printable transistor as a switch circuit diagram: download the diagram as SVG or open it and print to paper or PDF.
A transistor-as-a-switch circuit diagram shows how a BJT (Bipolar Junction Transistor) can be driven between two extreme states — cut-off (switch open) and saturation (switch closed) — using a small base current to control a much larger collector current. Unlike a linear amplifier, the transistor in switching applications operates only at the two ends of its characteristic curves. This makes it ideal for digital logic outputs, relay drivers, LED drivers, and motor control.
The most common switching configuration uses an NPN BJT such as the 2N2222, BC547, or 2N3904. The collector is connected to the load (e.g. an LED, relay coil, or motor) which is in series with the supply voltage VCC. The emitter is tied to ground. The base receives the control signal through a current-limiting base resistor RB.
Two operating regions define switching behaviour:
Cut-off region (switch OFF): When the base-emitter voltage VBE is below approximately 0.6 V, no base current flows, the collector-emitter junction appears as an open circuit, and effectively no collector current IC passes. The load is de-energised. For digital inputs, a logic LOW (0 V) keeps the transistor cut off.
Saturation region (switch ON): When sufficient base current IB is supplied, the transistor is driven into saturation. Both junctions are forward biased. The collector-emitter voltage VCE(sat) drops to approximately 0.1–0.3 V, which is close enough to zero that the transistor looks like a closed switch. The collector current is limited by the external load resistance, not by the transistor.
Base resistor calculation: The design goal is to ensure IC(sat) = VCC / RC (approximately) while providing enough base current. The minimum base current needed is IB(min) = IC(sat) / hFE, where hFE is the DC current gain (β) of the transistor. In practice, drive the transistor with IB ≈ IC/10 (forced β = 10) to guarantee saturation across production spread. The base resistor is RB = (Vin − VBE) / IB, where VBE ≈ 0.7 V for silicon.
Example: VCC = 5 V, load resistance RC = 500 Ω. IC(sat) = 5 / 500 = 10 mA. With hFE(min) = 100, IB(min) = 0.1 mA. Use IB = 1 mA for guaranteed saturation. RB = (5 − 0.7) / 0.001 = 4.3 kΩ → use 4.7 kΩ standard.
Flyback diode for inductive loads: When switching relay coils, motor windings, or any inductor, the collapsing magnetic field produces a large reverse voltage spike (back-EMF) that can destroy the transistor. A flyback (freewheeling) diode (e.g. 1N4007) is connected in parallel with the inductive load, cathode to VCC and anode to the collector, to clamp this spike.
PNP transistor switch: A PNP BJT (e.g. BC557, 2N3906) is used for high-side switching. The emitter connects to VCC, the load is between the collector and ground, and a LOW base signal (base driven below emitter by at least 0.7 V) turns the switch ON. The analysis is symmetric but polarities are inverted.
MOSFET as a switch: For higher currents and logic-level driving, an N-channel MOSFET (e.g. 2N7000, IRLZ44N) replaces the BJT. The gate-source voltage VGS must exceed the threshold VGS(th) to turn on the channel. MOSFETs have essentially zero gate current (controlled by voltage, not current), which simplifies drive resistor design, and have lower on-state resistance RDS(on) for high-current applications.
Switching speed considerations: BJTs have a storage time when coming out of deep saturation because minority carriers must clear from the base region. This limits switching speed. Schottky transistors (e.g. MMSS8050) or a small Schottky diode from base to collector (Baker clamp) prevents deep saturation and improves switching speed. MOSFETs switch faster but their gate capacitance must be driven through a gate resistor.
You can draw and simulate a transistor switching circuit on circuitdiagrammaker.com — place an NPN BJT, add RC and RB, connect a supply and load, and trace the collector voltage states visually in the free editor.
How to wire transistor as a switch circuit diagram
- Choose the transistor Select an NPN BJT (e.g. 2N2222) whose maximum IC and VCEO ratings exceed your load current and supply voltage by at least 2×.
- Calculate collector resistor Determine the load resistance RC from the load specifications. If driving an LED, RC = (VCC − VLED − VCE(sat)) / IF.
- Calculate base resistor Compute IB = IC / 10 for forced saturation. Then RB = (Vin_high − 0.7) / IB. Choose the nearest standard resistor value that is equal to or smaller.
- Add flyback diode if needed For inductive loads (relay coil, motor), solder a 1N4007 across the load with the cathode to VCC and anode to the collector node.
- Build and apply control signal Apply a logic HIGH (3.3 V or 5 V) to RB-base junction and measure VCE with a multimeter — it should read below 0.3 V, confirming saturation.
- Verify cut-off Pull the base low (0 V). Measure VCE — it should equal VCC, confirming the switch is open and the load is off.
- Test switching speed if required For fast switching applications, use an oscilloscope to observe rise/fall times and add a Baker clamp or replace with a MOSFET if speed is inadequate.
Specifications
| VBE (silicon NPN, ON) | ≈ 0.6 – 0.7 V |
|---|---|
| VCE(sat) at saturation | ≈ 0.1 – 0.3 V |
| VBE (cut-off threshold) | < 0.5 V |
| Base resistor formula | RB = (Vin − 0.7) / IB |
| Forced beta (guaranteed saturation) | βforced = IC / IB ≈ 10 |
| IC at saturation (approx) | IC(sat) ≈ VCC / RC |
| Flyback diode required for | Any inductive load (relay, motor, solenoid) |
| Common NPN switch ICs | 2N2222, BC547, 2N3904, BC337 |
| Common PNP switch ICs | BC557, 2N3906, BC327 |
| N-MOSFET alternative | 2N7000 (200 mA), IRLZ44N (47 A logic-level) |
Safety warnings
- Never exceed the transistor's absolute maximum VCEO, VCE, or IC ratings even briefly — overvoltage or overcurrent causes instant junction breakdown.
- Always include a flyback diode when switching inductive loads; the back-EMF spike can reach hundreds of volts and destroy the transistor and nearby components.
Tools needed
- NPN BJT (2N2222, BC547, or similar)
- Resistors for RB and RC (standard 1/4 W)
- Digital multimeter
- 5 V or 12 V DC regulated supply
- Breadboard and jumper wires
- Oscilloscope (for switching speed verification)
Common mistakes
- Omitting the base resistor, which can burn out the transistor or the driving GPIO pin by sinking too much current.
- Forgetting the flyback diode when switching relay coils — the back-EMF spike can destroy the transistor in milliseconds.
- Using too large a base resistor so that IB is insufficient for saturation, leaving the transistor in the active region where it dissipates large power and heats up.
- Choosing a transistor with VCE(max) lower than the supply voltage, risking breakdown when the transistor is in cut-off.
- Confusing the pinout of TO-92 transistors — always verify E/B/C pin order from the datasheet, as it varies by manufacturer.
Troubleshooting
- Transistor gets very hot even when load is light
- Cause: Transistor is operating in the active region rather than saturation — base current is too low to drive it fully on. Fix: Reduce the base resistor value to increase IB. Aim for IB ≥ IC/10 using forced β = 10 in the calculation.
- Load stays on even when control signal is LOW
- Cause: Base-emitter leakage or floating base is holding the transistor partially on. Fix: Add a 10 kΩ pull-down resistor from base to emitter to ensure VBE is firmly zero when the control signal is removed.
- Relay clicks but transistor does not switch load reliably
- Cause: Relay coil back-EMF is resetting the microcontroller or generating noise on the supply rail. Fix: Add a 1N4007 flyback diode across the relay coil and add a 100 nF decoupling capacitor between VCC and GND near the transistor.
Frequently asked questions
How does a transistor as a switch circuit diagram work?
When sufficient base current (VBE ≥ 0.7 V) is applied, the NPN BJT enters saturation and the collector-emitter path conducts, closing the switch. When VBE < 0.5 V, the transistor is in cut-off and the collector-emitter path is open, breaking the circuit.
Why do I need a base resistor in a transistor switch circuit?
The base-emitter junction is a forward-biased diode with VBE ≈ 0.7 V. Without a base resistor, the driving source would see a near-short and supply excessive current, potentially damaging both the source and the transistor. The resistor limits base current to the value needed for saturation.
What is the difference between saturation and cut-off?
In cut-off, no base current flows and the transistor blocks collector current — it behaves as an open switch. In saturation, the base is overdriven with sufficient current so the collector-emitter voltage drops to nearly 0 V — it behaves as a closed switch with low resistance.
Do I need a flyback diode for an LED load?
No. LEDs are resistive/capacitive loads and do not store magnetic energy. A flyback diode is only required when the transistor switches an inductive load such as a relay coil, solenoid, or motor winding.
Can I use a 3.3 V logic signal to drive a 5 V transistor switch?
Yes. With a 3.3 V logic HIGH as Vin, RB = (3.3 − 0.7) / IB = 2.6 / IB. As long as the calculated RB delivers enough IB to satisfy IC/10, the transistor saturates fully.
When should I use a MOSFET instead of a BJT for switching?
Use a logic-level N-channel MOSFET (e.g. IRLZ44N) when switching currents above 500 mA, when you need very low on-state voltage drop, or when the drive circuit can only supply microamps of gate current (no base current is needed).
What is a transistor switch IC number for general use?
The 2N2222 (TO-18/TO-92) handles 600 mA and 40 V and is the most widely used small-signal NPN switch. The BC547 (TO-92) is a popular European equivalent rated 100 mA/45 V. For surface mount, use MMBT2222A or MMBT3904.
Related diagrams
- common emitter amplifier circuit diagram
- led blinking circuit diagram
- astable multivibrator circuit diagram