okay, so I have a relay, this one here: http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_174450_-1
and I want to turn on a lamp with my arduino. So, when I connect the the 5v and ground to the relay, on the coil part, the arduino "turns off" all the lights go off, I thought it would be something to do with short circuiting the arduino but the coil has a resistance of 125?. Why is this happening? Thanks for the answers, I really do appreciate it
Look in the playground section for the the section on using relays, if you did not use the correct circuit then you may well need a new Arduino.
Mark
5/125 = 40mA, bang on the absolute maximum rating for an I/O pin.
Could have been the back EMF spike causing the Arduino to crash.
Difficult to say, without a schematic or any code.
holmes4:
Look in the playground section for the the section on using relays, if you did not use the correct circuit then you may well need a new Arduino.Mark
So I just looked it up, and I found this Arduino Playground - HomePage Does this mean I should use a 2N2222 transistor where the coil is connected to and that is it?
AWOL:
5/125 = 40mA, bang on the absolute maximum rating for an I/O pin.Could have been the back EMF spike causing the Arduino to crash.
Difficult to say, without a schematic or any code.
What does this mean, I'm a newbie haha, and I'm not using any code at the moment, i'm just testing it out with the 5V and Ground pins, but I'm going to use the digital pins after
In the schematic you just linked, there's a diode across the relay coil - it's there to prevent damage to the rest of the circuit when the relay is turned off.
Have you got a diode across your relay coil?
AWOL:
In the schematic you just linked, there's a diode across the relay coil - it's there to prevent damage to the rest of the circuit when the relay is turned off.
Have you got a diode across your relay coil?
No I havent got one, which doide would you recommend and is there anything else I would need other then a diode?
PavSidhu:
which doide would you recommend
The one listed in the already linked schematic.
is there anything else I would need other then a diode?
The other stuff in the already linked schematic.
Or ditch the relay and just use a transistor to control the lamp (for the right type of course) there should be examples in the playground.
Mark