Relay Driver That Never Saturates
A fuel-pump relay is switched by a BC337 NPN driven from a 3.3 V microcontroller GPIO. The relay coil is 12 V, 120 Ω, inductance 0.4 H. The transistor datasheet gives hFE(min) = 100 at IC = 100 mA, VBE(sat) = 0.8 V, VCE(sat) = 0.3 V at IB = 10 mA, VCEO = 45 V, and a TO-92 junction-to-ambient thermal resistance of 200 °C/W. The existing design uses a 10 kΩ base resistor. On the bench the relay does pull in, but the transistor case measures 78 °C in a 40 °C ambient, and three units have failed short-circuit after several months in service. There is no component connected across the coil. The GPIO is rated 20 mA absolute maximum source current, 8 mA recommended.
1. Calculate the base current with the 10 kΩ resistor and the resulting forced beta. Is the transistor guaranteed to saturate?
Read the worked answer
Coil current: I_C = 12 / 120 = 100 mA (VCE neglected for a first pass).
Base current: I_B = (3.3 − 0.7) / 10 000 = 0.26 mA
Forced beta: I_C / I_B = 100 mA / 0.26 mA = 385
The datasheet guarantees hFE ≥ 100 at 100 mA, and a typical part may reach 200–250. A forced beta of 385 is well above either figure, so the device cannot be driven into saturation: it settles wherever the load line crosses the output characteristic, typically VCE = 1–3 V. The relay still pulls in (coil sees 9–11 V, above the usual 75 % must-operate level), which is exactly why the fault survived bench testing and only appeared as field returns. The 10 kΩ value is a design error, not a component tolerance issue - no batch of BC337 will fix it.
2. Determine a base resistor that guarantees saturation, and assess whether it is acceptable for the GPIO. What alternative would you recommend?
Read the worked answer
Rule of thumb for a switching BJT: use a forced beta of 10 or less, so I_B = 100 mA / 10 = 10 mA.
R_B = (V_OH − VBE(sat)) / I_B = (3.3 − 0.8) / 0.010 = 250 Ω → nearest E24 value below it is 220 Ω
With 220 Ω: I_B = 2.5 / 220 = 11.4 mA, forced beta 8.8, so VCE(sat) is genuinely reached and dissipation falls to 0.3 × 0.1 = 30 mW.
But 11.4 mA is above the GPIO's 8 mA recommended figure (it is inside the 20 mA absolute maximum, so it will work, but the pin will drop below 3.3 V and the design would be relying on a stress rating). Options, in order of preference:
- Replace the BJT with a logic-level N-channel MOSFET (e.g. a small SOT-23 part with RDS(on) specified at 2.5 V): gate current is essentially zero, dissipation is I²R, and the GPIO is not stressed.
- Keep the BC337 and insert a buffer/driver gate.
- Keep the BC337 with 220 Ω only if the pin's 3.3 V is confirmed at 12 mA and the absolute-maximum margin is formally accepted.
3. Estimate the junction temperature in the unsaturated state, and explain what will destroy the transistor at turn-off with no coil suppression.
Read the worked answer
Junction temperature (unsaturated). Take VCE ≈ 2.5 V in the worst case:
- P = 2.5 V × 100 mA = 250 mW
- Rise = 0.250 × 200 °C/W = 50 °C
- T_J = 40 °C ambient + 50 = 90 °C (plus a hot-spot allowance, so realistically 100 °C+)
That is inside the 150 °C limit, so the part does not fail immediately - which is why the units survived months. It is a life-reduction mechanism: every °C of junction temperature roughly halves life for a 10 °C rise, and the higher VCE also means the coil is under-driven.
Turn-off without suppression. The coil current cannot change instantaneously: V = L·di/dt = 0.4 H × 0.100 A / 1 µs = 40 kV if taken literally. Stray capacitance and the coil's own winding capacitance clamp that to a few hundred volts - still far above VCEO = 45 V. The transistor goes into avalanche breakdown, and the energy is dumped into the junction, which is the direct cause of the short-circuit failures. Fix: a freewheel diode across the coil (1N4148 for this current, 1N4007 acceptable), cathode to +12 V, plus a 220 Ω base resistor or a MOSFET as above.