It took some staring at the cryptic documentation and the web site below to figure out the circuit, so I drew it up, since the drawings elsewhere were awful and had errors.
Thanks to http://hcgilje.wordpress.com/resources/rfid_id12_tagreader/ for the head start.
- Rewrote the code so that it keeps a list of tags to be granted access.
- Upgraded to arduino-0021, and replaced the add on NewSoftSerial library with the built in SoftwareSerial libarary. The built in library is not as good as the add on, but it makes it easier for others to get my code running.
- Used a prototype shield and made a permanent hardware version with some LEDs
Photo of the Arduino with the proto shield stacked on top. The RFID module is soldered to a breakout board which is in turn soldered to the prototype shield. Indicator LEDs are installed sticking up high so they will poke out of the box when done.
The unit placed inside the bottom half of the Sparkfun project box. This box fits an Arduino perfectly. If I had the project to do over again, I'd have put the RFID module on the other end of the prototype board so it was centered in the box. I built the unit while i was waiting for the box to come, and didn't plan this ahead properly. I was thinking I might put a small LCD readout on the end of the prototype board, that is why I did it this way. In the end the LCD wasn't really useful and I deleted it.
I'm going to repeat information in the previous post on the prototype version, so the writeup is all in one place.
The RFID module reads out serial ASCII data, and all you have to do is connect that output to a pin on the Arduino. You use the SoftwareSerial library to be able to define any pin as a serial input. Otherwise you have to use the TX/RX pins, and that interferes with serial communication to the computer. Set the RFID reader serial speed to 9600 baud. Other speeds i found spewed garbage.
The sketch looks for codes and compares them to a valid list. I can't imagine anyone could pull the compiled code off the microcontroller to see the list of valid tags. Plus the RFID reader has a good 5 inches of range, so you can put the reader INSIDE the door if you want. It even reads from the back of the RFID module.
I found the reader only reads the tags from Sparkfun. It does not read HID tags (at least the ones I have), it does not read pet chips, or Metro smartcards. I was disappointed as a hacker, but the project still works great.You could add a data logger or an ethernet shield if you want to save a record of what tags were read or send that information across the internet.
Parts List:
The datasheet is here:
http://www.sparkfun.com/datasheets/Sensors/ID-12-Datasheet.pdf
The ID-12 is functionally identical, with a smaller range and uses less power. Pick that one for a battery operated project, or if range isn't important.
http://www.sparkfun.com/commerce/product_info.php?products_id=8310
Parts List:
- Used the RFID Reader ID-20 from Sparkfun:
The datasheet is here:
http://www.sparkfun.com/datasheets/Sensors/ID-12-Datasheet.pdf
The ID-12 is functionally identical, with a smaller range and uses less power. Pick that one for a battery operated project, or if range isn't important.
- This little breakout board for the RFID module is worth the $0.95 to make the pins plug into the breadboard.
- I got a couple of these tags for $1.95 each. RFID Tag - 125kHz. Even if you have your own tags, i'd get one to be sure the reader is working when you build it.
http://www.sparkfun.com/commerce/product_info.php?products_id=8310- Of course you need an Arduino Duemilanove or Uno from http://www.sparkfun.com/commerce/product_info.php?products_id=666 for $25,
- My favorite prototype shield from adafruit $6
- stacking headers $1.50
- A red LED, a green LED, 2 1kohm resistors and a switch for reset. If you don't have the miscellaneous stuff, you can get all this with the protoboard from Adafruit if you buy the proto kit for $12.50.
- A project box. This box is made for the Arduino and is easy to drill. Kinda pricey at 11.95 but I needed something I wouldn't be embarrassed to see hanging on my wall. Arduino and shield drop right in. http://www.sparkfun.com/commerce/product_info.php?products_id=10088
These electric door locks look like they should work, I haven't tried yet. Likely it will need a relay or transistor to boost the current to activate the lock, like an LM293
Electric Door Strike - Mortise Type
This was much cheaper, so i ended up getting this instead. It is really for autos but worked fine.
The sketch code follows the break...