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.)