Go Down

Topic: Relay - 12v switch with 5v coil? (Read 20289 times) previous topic - next topic

hunter2379

Hello
I'm looking for a relay that has a switch that can carry 12v at 1 or 2 amps. I'm a newby when it comes to relays, but I would like to power this relay with the 5 volts from the arduino.
Is this possible? Does anyone have any ideas?

Thank you

TRex

here's a basic relay that uses 5 volts to switch it: http://www.sparkfun.com/products/100. It is capable of switching up to 25vAC 5A, or up to 30v DC, so can handle your 12 volt  2 amp easily.

Relays usually take a fair amount of current to switch, plus you get back EMF, which means that when you switch the relay off, the coild discharges a current in the opposite direction back into your circuit. For this reason, you would usually drive a relay through a transistor, with an optional diode across the coil. this will prevent damage to your microprocessor. You can see this in action in this product: http://www.sparkfun.com/products/11042

You can power this relay from the 5v from your arduino, but switch it on and off through a transistor for safety.


hunter2379

Thank you. I went ahead and purchased the relay. I'm not sure how to use the transistor circuit with the diode. When I tried using a 5v relay with a 5 volt transistor with no diode or resistor between arduino and transistor, the circuit did not work. Newby :D

Anyways, what if I just put a diode from arduino to relay? Doesn't a diode prevent feedback?

MarkT

plus you get back EMF, which means that when you switch the relay off, the coild discharges a current in the opposite direction back into your circuit.


No, it keeps the current going in the same direction and creates high voltages if necessary to ensure this.  Inductors resist current changes.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

winner10920


Thank you. I went ahead and purchased the relay. I'm not sure how to use the transistor circuit with the diode. When I tried using a 5v relay with a 5 volt transistor with no diode or resistor between arduino and transistor, the circuit did not work. Newby :D

Anyways, what if I just put a diode from arduino to relay? Doesn't a diode prevent feedback?

absolutly no resistors between arduino and transistor? That could burn out the transistor but more likely the arduino pin, you should have atleast 220ohm resistor on the transistor base to an arduino pin, probably higher value depending on the transistor


hunter2379

Ok so if the I have the 5v coil relay and a 5v transistor what should the resistor to the transistor be? Someone said 220ohm's but is that for 5volts or for another voltage?
I also have a few diode but I don't know their exact strength. A diode from arduino to relay won't work correct?

buteman

Look at the circuit magician suggested. With a 1k resistor you would have a little less than 5 milliamps flowing into the base of the transistor. The gain of the transistor would cause a higher current to flow through the relay coil and this would activate it. The 1N4004 diode would protect the transistor from the back emf when the transistor switches off. Many diodes would work fine in this circuit from the tiny 1N4148 to the 1N4004 suggested.
What diodes do you have?

hunter2379

I had misplaced the resistors in the diodes pouch. No diodes, just a bunch of 1w resistors. Looks like I don;t have any after all.

Thank you all for your help! :D
Really appreciate it.

hunter2379

Foudn the diodes I knew I had somewhere. Built the circuit and it worked. Thank you all. I have learned something new today.  :smiley-mr-green:

Go Up