BJT Switch Calculator

Calculate base resistor, saturation check, and power dissipation for NPN and PNP transistor switch circuits.

NPN Transistor Switch

NPN: Base HIGH → transistor ON (collector current flows). Base LOW → OFF.
Load is connected between Vcc and collector. Emitter to GND.
Or enter load current directly below
Typical: BC547=110, 2N2222=75, BC337=100
Logic HIGH (e.g. 3.3V, 5V)
Typically 2–5× to ensure full saturation

PNP Transistor Switch

PNP: Base LOW (pulled below emitter) → transistor ON. Base HIGH (= emitter) → OFF.
Load between collector and GND. Emitter to Vcc.
Logic LOW (e.g. 0V from GPIO)

📐 BJT Switch Design Formulas

Saturation Current

IC_sat = Vcc / RC
(assuming Vce_sat ≈ 0)

Min. Base Current

IB_min = IC_sat / hFE

Base Resistor (NPN)

RB = (Vin − Vbe) / IB
Vbe ≈ 0.7V (Si)

Overdrive

IB = k × IC / hFE
k = 2…5 (overdrive)
Ensures saturation

Collector Power

P = Vce_sat × IC
Vce_sat ≈ 0.2V (sat.)

Check

Is IB × hFE > IC?
→ Yes: saturated ✓
→ No: active region

NPN Switch: Vcc │ RC (load) │ C ─── transistor (NPN) B ─── RB ─── Vin E ─── GND

❓ FAQ

What is saturation in a BJT switch?

Saturation means both junctions are forward biased. The transistor is fully ON with Vce ≈ 0.1–0.3V. To guarantee saturation, the base current must exceed IC/hFE — typically by 2–5× (overdrive factor) to account for hFE variation and ensure fast switching.

Why does hFE vary so much?

hFE (DC current gain) varies with temperature, collector current, and manufacturing. A transistor rated at hFE=100 might actually have 50–300 in practice. Always design for the minimum hFE from the datasheet, and use an overdrive factor ≥ 2 for robust switching.

Can I drive a relay with a BJT switch?

Yes. Connect a flyback diode (1N4001 or similar) in reverse across the relay coil to protect the transistor from voltage spikes when the relay turns off. Calculate base resistor for the relay coil current.

NPN or PNP — which to use?

NPN is more common and preferred for low-side switching (load between Vcc and collector, emitter to GND). PNP is used for high-side switching. NPN transistors generally have higher speed and are more available.