Electronic – Understanding driving a relay with a transistor

relaytransistors

For an embedded application, I'd like to drive a relay using a transistor. At the moment I'm experimenting with a BC547, but only because I've still got some of them lying around.

The transistor I am using is rated at a max of 100mA continuous for the collector (or collector-emitter) current (if I exceed that it gets really hot and would eventually get destroyed, I guess). A typical relay that I'd probably use would have a coil resistance of e.g. 225 Ω and a nominal switching current of 53 mA at 12 V (I'd opt to use a 12 V relay, because I already have 3.3 V and 12 V in my circuit).

I'd guess that the nominal switching current simply equates to the voltage devided by the resistance, am I right? Hence I assume that it would be safe driving the relay with the transistor, because the current should not exceed the 53 mV, which is well below the maximum current the transistor can bear. Am I correct?

(I am aware that the description only holds for the static state when the relay is shut. I do know that there will be spikes induced by the coil when the relay switches, that have to be buffered using a diode.)

Best Answer

For reasons that have little to do with the static calculations in the other answers, I would use a beefier transistor such as the 600mA 2N4401 or a MOSFET. Switching an inductive load is harder on the transistor than switching a resistive load, even with the diode. At some point the full relay coil current is flowing through the transistor for a short period of time with more than 12V across it. SOA is unspecified on many of the small transistors.

Give a 2N4401 a few mA of base current and it will be happy switching your inductive 53mA load, and don't forget the diode across the coil. If you need to operate in extreme cold conditions, 5 or 6mA would be better.