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
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
here's a basic relay that uses 5 volts to switch it: Relay SPDT Sealed - COM-00100 - SparkFun Electronics. 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: SparkFun Beefcake Relay Control Kit (Ver. 2.0) - KIT-13815 - SparkFun Electronics
You can power this relay from the 5v from your arduino, but switch it on and off through a transistor for safety.
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
Anyways, what if I just put a diode from arduino to relay? Doesn't a diode prevent feedback?
TRex:
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.
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. NewbyAnyways, 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
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?
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?
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!
Really appreciate it.
Foudn the diodes I knew I had somewhere. Built the circuit and it worked. Thank you all. I have learned something new today.