Arduino Duemilanove
HID ProxPoint RFID Card Reader
SPDT Relay
Electronic Door Strike (opens on 5v, 2a of current)
5v Power Supply (powers door strike)
I modify lines 8 and 9 of the sketch to match Serial Number and Site Code of my HID Key Fob and upload it to the Arduino. When I scan the fob the strike opens for three seconds and closes as it should. My problem is when I try to repeat the process with the same fob the strike will not open unless I scan it at least three times. When I unplug the power supply for the door strike and just have the relay with nothing live attached to it I am able to scan the fob multiple times and the relay will switch on and off normally. This leads me to believe I need a diode or a resistor somewhere but I'm not sure what i need exactly or where I should put it. Can someone help me out here? I have attached a drawing to get a better idea what I have now.
That looks like exactly what I have. Its interesting because I have tried two Arduino's in the same scenario and they both work fine after being connected to the relay with no diodes whatsoever. It looks like I need to put the diode between the positive and negative terminals of the coil, right? Also, what kind of diode should I use?
Aren't pins 5 and 2 the positive and negative terminals of the coil?
Yes but is pin 5 positive or is pin 2 positive?
It usually doesn't mater. However some relays have + & - marked on them, if that is the case then they normally have an internal diode fitted, in which case it will matter because if you get it wrong you short out your supply with the diode.
If your picture is accurate then it doesn't matter what way round they are and so we say it doesn't have a pin that has to be connected to positive. So we say it has no positive input to the relay.
If there is a diode inside the device, then, as Mike has said, it will be important to get things right. Isolate the device, test the resistance through it, and then reverse your leads, test again. Same readings? No internal diode.
At that point, the "negtive" side of the relay is whichever side you connect to your circuit's ground.
But wait a minute... just take a step back. Think about how the circuit will work, ignoring the diode. Imagine the circuit without the diode. Then put it in "the right way 'round" to avoid screwing things up... put it in so that when the voltage is applied, it will NOT go through the diode, thus it will go through the relay coil.