Maharashtra HSC Electronics (Bifocal) study materials
Maharashtra HSC Electronics (Bifocal) study resources

Relay Driver That Buzzes and Then Destroys Its Transistor

Maharashtra HSC Electronics (Bifocal) · Put your knowledge to work in context.

All case studies

Relay Driver That Buzzes and Then Destroys Its Transistor

A student builds a relay driver for a 12 V relay whose coil measures 250 ohm (48 mA) using a BC547 (hFE minimum 100 at 48 mA, VCEO 45 V, Ptot 500 mW) driven from a 3.3 V microcontroller GPIO through a 10 kohm base resistor. No freewheel diode is fitted anywhere in the circuit. In firmware the pin goes high when an optical beam is broken. On the bench the relay sometimes pulls in and sometimes buzzes, the collector sits at about 5.6 V when the pin is high instead of the 0.2 V the student expected, and after a few dozen operations the transistor is found with collector-emitter shorted. The microcontroller and relay supply share a common ground. The GPIO is specified for 4 mA recommended and 8 mA absolute maximum. On the bench there are BC547, BC337, 1N4007 diodes, 2N7000 MOSFETs and resistors.

1. Calculate the base current and the maximum collector current the 10 kohm resistor allows, and use the 5.6 V measurement to confirm the operating region.

Read the worked answer
  • I_B = (3.3 V - 0.7 V) / 10 kohm = 260 uA
  • Maximum collector current the device can support in saturation: I_C = hFE(min) x I_B = 100 x 0.26 mA = 26 mA
  • The coil needs 12 V / 250 ohm = 48 mA
  • Required forced beta = 48 / 0.26 = 185, while the guaranteed hFE is 100. Saturation is therefore not guaranteed; the transistor is a current limiter in the active region.

Check against the measurement: if I_C is limited to 26 mA, V_CE = 12 - (0.026 x 250) = 5.5 V, which matches the 5.6 V seen. In true saturation V_CE would be 0.2-0.3 V.

The transistor dissipation is only 5.6 x 0.026 = 0.15 W, inside the 500 mW rating, so heating is not the cause of death. But because the coil current depends on hFE and temperature, the relay hovers near its pull-in point, which explains the buzzing and the chattering contacts.

2. Choose a base resistor for reliable saturation and check it against the GPIO specification. State any alternative you would consider.

Read the worked answer

Design for a forced beta of 10 (the standard overdrive rule for a switching transistor):

  • I_B = I_C / 10 = 48 / 10 = 4.8 mA
  • R_B = (3.3 - 0.8) / 4.8 mA = 520 ohm, so the nearest preferred value is 470 ohm
  • Resulting base current: (3.3 - 0.8) / 470 = 5.3 mA; forced beta = 48 / 5.3 = 9, which is well inside the device's capability
  • Dissipation in saturation: 0.25 V x 0.048 A = 12 mW, so the transistor runs cold

GPIO check: 5.3 mA is below the 8 mA absolute maximum but above the 4 mA recommended figure. That is usually acceptable for a modern MCU pin, but if the pin also drives other loads or the 3.3 V rail sags, use 560 ohm (4.5 mA) and accept a forced beta of 11, still fine.

Alternatives: a 2N7000 has no gate current but its R_DS(on) is specified at V_GS = 4.5 V, so at a 3.3 V gate it is marginal for 48 mA and needs checking on the datasheet; a logic-level MOSFET or a ULN2003 darlington array (which also contains the freewheel diodes) is the cleaner solution.

3. Explain why the transistor ends up shorted and specify the protection, including its effect on the collector voltage.

Read the worked answer

When the transistor switches off, the coil current cannot change instantly. With no path, dI/dt is limited only by stray capacitance and the collector voltage rises until something breaks down. The BC547 has V_CEO = 45 V, and a 12 V coil of a few tenths of a henry will easily generate spikes of well over 100 V at turn-off. The junction avalanches and the energy, although small (0.5 x L x I^2 is of the order of 0.2-0.5 mJ), is dumped into the same tiny region thousands of times; the classic end point is a collector-emitter short. The spike also couples into the 3.3 V side through the base-collector capacitance, which is why relay switching often upsets the microcontroller as well.

Fix: a 1N4007 across the coil with the cathode to +12 V. During normal operation it is reverse biased and does nothing. At turn-off it becomes forward biased and clamps the collector to about 12.7 V, so the transistor never sees more than a few volts above the supply. 48 mA is far inside the diode's rating.

A 1N4148 would also work at this current but a 1N4007 is more rugged. The diode must be across the coil, not across the transistor, and the cathode orientation must be checked, otherwise the relay is permanently energised or the supply is shorted.