I'm working on a project that currently has 3 relays (will need more as time goes on). I have a bunch of these 5v micro-relays that will switch over on 3v (these relays are not solid state). I'm having a problem powering them with the Arduino's pins. All I need is for the arduino to supply the electromagnet with enough power to move the sawitch over, as state 3v. However, When I hook them all up along with the IR receiver, I'm in the area of 2.5v per pin. Why is it droping? Is there anything I can do other than an H-bridge that will power the relays? I also looked at a couple of examples useing a 2n2222 transistor and a TIP102. I had no luck making it work with a 2n2222 transistor and I can't find a TIP102 in the area for the life of me, however I did come across a TIP120, but I'm not to sure how this will work with it. Any ideas?
What is the rated current draw of the relay coil? It it's more than 30mA you shouldn't connect them directly between an Arduino pin and ground. Connect one end to +5, the other end to the Emitter of the 2n2222, the Collector to Ground and the Base through a 1K resistor to an Arduino pin. Be sure to put a diode across the relay coil to protect the transistor from reverse voltage spikes.
Yea, it's pulling 89mA. So, if I put the 2n2222 on there, how big of a cap should I put on the collector? .1uf or should I go higher? Also, I will need to make this little set up per relay on each pin?
You got me confused, I did exactly what you have said to do, however now I'm not getting any reading for mA, when I check it. Also, what part is going to the relay?
Peter9DO:
You got me confused, I did exactly what you have said to do, however now I'm not getting any reading for mA, when I check it. Also, what part is going to the relay?
Okay, so seeing all day today I have been anticipating coming home from work, to give this a shot. I made it home and straight to my work bench I went, with no luck... Going off of the setup on this drawing it was giving me a constant voltage at the relay, regarless if it was high or low. I'm using pin #13 for the input, then I'm giving it power at Vcc from an external battery eliminator, so I can adjust the voltage. I'm getting proper mA and voltage readings however as I said it doesn't matter if I'm in the high or low state I get a constant voltage. By the way I'm using a MPS 2222A transistor. The only thing I can think of to try is to put the external power supply at the input and put pin #13 at the Vcc. I was a little skeptical to do this without a little advise first so, here we are... Again, thank you for the help!
Okay, so I think I got it! This was a little messed up. So, I purchased a package of assorted transistors from Radio Shack, that was labled as NPN that has this MPS-2222A in there, I checked the schematics on the MPS-2222A and it claims it to be a NPN, now when seeing that I was getting the wrong results when I hooked it up, I decided to give it a shot and try hooking it up as a PNP, sure enough, it's switching now! DAMN YOU RADIO SHACK, DAMN YOU!
If you look at "SWITCHING TIME EQUIVALENT TEST CIRCUIT" section you will see when they have it showing the emitter as an input, which would make it PNP, even though it says NPN at the top of the page. As I said though, I hooked it up right as an NPN and I was getting a constant supply voltage regardless if the pin was high or low. Now, it's working properly and I set it up as the image shows for PNP. This leads me to believe somone messed up somewhere... Anyway you look at it, VICTORY IS MIINE!!!!! I get to continue working on my project! lol!!!!
That PCBheaven website has proven itself to be quite a valueable resource that I will be using for future questions I might have. Again, thank you everyone who has made a contrabution to this thread!