Relay and transistor issue

Hi. I seems to be having a problem with a relay(SRD-5VDC-SL-C) controlled by a transistor (PN2222). I know your suppose to have a resistor connected to the base of the transistor to limit the current that you make your arduino pins give. The problem is that if I put a resistor the relay wont turn on. If I connect the pin directly to the base (or use a 10 ohm resistor max) it turn on just fine, but if I use anything higher it wont turn on the relay. Is this normal for relays? What would happen if I just leave it with the 10 ohm resistor. How else could I activate the relay?


How are the relay and transistor connected? post a diagram.

Here is the schematic( hope I did it right). I don't know if this matters, but I'm using an arduino nano, not an UNO.

It's normal to put the relay in the collector in this application, and to fit a flywheel diode to prevent high voltage spikes destroying the transistor on turn-off..

See enclosed


rldr.pdf (17.7 KB)

Thank you. I'll do that and see if it works. Out of curiosity, why does it matter if a component is conected to the collector vs emiter? Does it affect anything or is it just the convention?

It makes a huge difference. The way you have it wired is flat out wrong - you'll have a terrible time trying to get the transistor to turn on the way you have it wired - as you've found. How do you expect to get enough current into the base whilest applying anything like 5v to the coil of the relay like that?!

I changed the relay from emittor to collector and now it works! Now it turns on with a > 550 ohm resistor. And I put the diode in. Thanks for your help. But I'm sorry I dont understand why it makes a difference. If it's the same circuit shouldn't the current be the same on the emmiter or collecotr? My project now works, but I wish to know why. Just a curios guy stating in electronics.


You need to realize, an NPN transistor is a current activated device. Not a voltage activated device. The more current that flows from the emitter, to the base, The more current that can flow from the emitter to the collector. By putting the relay coil after the emitter, You are putting a resistive/inductive element there. this will resist the current flow for a NPN transistor. The PNP transistor will work in that orientation. A PNP transistor draws its current from the base to the collector. remember electricity flows from negative to positive.