SparkFun Forums 

Where electronics enthusiasts find answers.

Your source for all things Atmel.
By nagmier
#100164
I'm looking to interface an rfid reader with my garage door opener but I'm not sure how to get the arduino to "press" the switch... I was thinking I would probably need a relay to do this but I'm not sure it there is a way to do it with just code on the arduino?


See 4th Post
Last edited by nagmier on Thu May 06, 2010 5:26 pm, edited 2 times in total.
By nagmier
#100310
ok to be a little more clear...

The switch I'm trying to "bypass" or replicate however you want to imagine it is a simple SPST momentary switch.

Pressing it the garage door activates... press it again the door stops, 3rd time starts again in opposite direction or initial press

If I completely remove the switch mechanism and just have the 2 bare wires that lead into it I get the same results when "pressing" the wires together.

I need to close the circuit when the correct RFID tag is read and the "access granted" function executes...
Can this be done purely with the arduino? (I don't think so...)

If I need a relay(which I believe I do) which of these rat shack beauties would work?
5v 1a SPDThttp://www.radioshack.com/product/index ... nSession=1
12v 1a SPDThttp://www.radioshack.com/product/index ... nSession=1
12V/125V 10a SPDThttp://www.radioshack.com/product/index ... nSession=1
7-9v 12a SPDThttp://www.radioshack.com/product/index ... nSession=1
5v 1a SPST Reedhttp://www.radioshack.com/product/index ... nSession=1

And finally... should my circuit look like this one in figure one: http://www.dnatechindia.com/index.php/T ... acing.html
I have some 1n4004 diodes and npn transitors I just want to make sure thats correct
#102202
Either 5V relay should do your job. I'd try the reed relay (.5A, not 1A) first. The way it might fail is for the contacts to stick - too much current will do that. You don't want to require another power supply, so that's why you choose a 5V relay instead of a 12V one.

Yes, you need a circuit as shown in the Relay-Interfacing.html to drive the relay. The conventional relay is too much for a port to drive directly, nothing for an external transistor to drive. You can skip R1 and D2 - they are just an indicator but DON'T miss D1. Your 1N4004 diode should be fine. The specified transistor BC547 is equivalent to a 2N2222 or 2N3904 - small signal NPN. You want to switch 5V and perhaps 90mA and these are rated for much more.

One thing that I don't understand - do you REALLY want the state of the garage door to change every time you walk near the reader with the RFID thing? I think you should enable a button whenever you are close to the reader but NOT move the door until the button is also pressed. Sound good?