A bipolar junction transistor (BJT) is usually taught as an amplifier, but in digital circuits, relay drivers and LED drivers it is used as a switch — fully ON or fully OFF, never in between. Used this way it has only two states: cutoff, where it blocks all current, and saturation, where it conducts as hard as the load allows. This post explains both states and how to choose the base resistor so the transistor saturates properly.
Figure 1: NPN transistor switching a relay (a), and the output characteristics with the load line (b). (Schematic, not to scale.)
The two states
OFF — cutoff: with no base current (Ib = 0), the collector current is practically zero, the full supply voltage appears across the transistor (Vce ≈ Vcc), and no power is delivered to the load. The transistor behaves like an open switch.
ON — saturation: with enough base current, the transistor turns fully on. The collector current is then limited only by the load, Ic(sat) = Vcc / RL, and the collector-emitter voltage collapses to Vce(sat) ≈ 0.2 V. The transistor behaves like a closed switch, dissipating very little power (P = Vce(sat) × Ic).
Between the two lies the active region, where Ic = β × Ib. A switching transistor must pass through the active region quickly and never rest there — in the active region both Vce and Ic are large, so the transistor heats up.
How to choose the base resistor
The minimum base current for saturation is Ib(min) = Ic(sat) / β. But β varies between transistors of the same type and falls with temperature, so a good design drives the base much harder — typically 5 to 10 times the minimum. This "overdrive" guarantees deep saturation for any transistor of that type. The base resistor is then Rb = (Vbb − Vbe) / Ib, where Vbe ≈ 0.7 V for a silicon transistor and Vbb is the control voltage.
One more essential component when the load is a relay, motor or solenoid: a flyback diode across the coil, cathode to the positive supply. When the transistor switches off, the coil current cannot stop instantly, and the inductor generates a voltage spike (V = L × di/dt) that can reach hundreds of volts and destroy the transistor. The diode gives that current a safe path to circulate and die away.
Worked example — driving a 12 V relay from a 5 V logic output
An NPN transistor (2N2222, β = 100) drives a 12 V relay whose coil resistance is 400 Ω, controlled from a 5 V logic output.
Step 1 — collector current in saturation: Ic(sat) = 12 / 400 = 30 mA.
Step 2 — base current: minimum Ib = Ic(sat) / β = 30 / 100 = 0.3 mA. With an overdrive factor of 5, design for Ib = 5 × 0.3 = 1.5 mA.
Step 3 — base resistor: Rb = (Vbb − Vbe) / Ib = (5 − 0.7) / 0.0015 = 4.3 / 0.0015 = 2867 Ω. The nearest standard value is 2.7 kΩ.
Step 4 — check: with Rb = 2.7 kΩ, Ib = (5 − 0.7) / 2700 = 1.59 mA — more than five times the 0.3 mA minimum, so saturation is guaranteed. Vce(sat) ≈ 0.2 V, so the transistor dissipates only P = 0.2 × 0.03 = 6 mW, and the relay sees 12 − 0.2 = 11.8 V, which is ample to pull it in.
Key points to remember
- A switching transistor has two states: cutoff (Ib = 0, Ic ≈ 0, Vce ≈ Vcc) and saturation (Ic = Vcc / RL, Vce(sat) ≈ 0.2 V).
- Design the base current 5–10 times the minimum Ib = Ic(sat) / β, so saturation is guaranteed despite β spread.
- Worked example: 12 V relay, 400 Ω coil, β = 100, 5 V drive → Ic = 30 mA, Ib = 1.5 mA, Rb = 2.7 kΩ.
- Always fit a flyback diode across an inductive load — the switch-off voltage spike can destroy the transistor.
- Without a base resistor, the base-emitter junction would draw excessive current, just like a diode with no series resistor.
