I wanted to make an easy and secure way to enter my garage. RFID was the best way to unlock my door, even with my hands full I can unlock the door and push it open! I built a simple circuit with a basic ATMega 168 arduino chip and a ID-20 RFID reader to control an electronic door lock.
The circuit consists of 3 separate parts, a Reader to read RFID tags, a Controller to accept data from the reader and control the output of the RGB LED and the Electric door lock. The door lock is first installed in a door and tested with a 9v battery to ensure correct installation. In most cases you want a Normally Open circuit on the door lock, or Fail Secure. This means the door stays locked when no current passes through it. When 12vDC is passed through the electromagnet in the door lock, a plate in the lock gives way and allows the door to be pushed open freely.
The reader is placed on the outside of the door and is separate from the controller on the inside so that no one can circumvent the security by breaking open the Reader and trying to short circuit the reader. The controller receives serial data from the Reader and controls the RGB led and the Door lock. In this case I have put both on separate bread boards for testing. Here is a video overview of the system in action Read on to see how to build one for your self!
**Update**
All of the code, schematics, and PCB designs have been tested and refined. They are all posted here as of 8/9/2010
Updated video of the final system installed and working.
Remove these ads by
Signing UpStep 1Parts Needed
Arduino Stuff
ATmega168 with Arduino Bootloader $4.95
Crystal 16MHz $1.50
Capacitor Ceramic 22pF $0.25 (x2)
Resistor 10k Ohm 1/6th Watt PTH $0.25
Mini Push Button Switch $0.35
Triple Output LED RGB - Diffused $1.95
RFID stuff
Either one of these, 20 has better range, 12 is smaller
RFID Reader ID-12 $29.95
RFID Reader ID-20 $34.95
RFID Reader Breakout $0.95
Break Away Headers - Straight $2.50
RFID Tag - 125kHz $1.95
Other
TIP31A transistor (radio shack/local electronics store $1.50)
Door Lock is from ebay.
Door Fail Secure access control Electric Strike v5 NO $17.50 (kawamall, bay)
| « Previous Step | Download PDFView All Steps | Next Step » |












































If there is anyone who decides to do anything else with this code I would really love to see it or even help you test it.
The vid link doesnt show up as a reply. I'll make another post with it.
The "outside board" with the rfid reader... I enclosed it in a water proof box, but I also took the time to "paint" all the connection with "Liquid Electrical tape" to help water/moisture proof the whole thing.
Like I had said before if anyone had an additions to the code or design, I would love to see it. Maybe even impliment some of it.
I designed the circuit diagram so you can still connect a programmer and reprogram it. I really like the idea of a master erase card. One idea I thought of is to have a "programming" master card... then a function card, like... "Add" "Erase" "Erase All" etc. which would allow more customized programming. I'm thinking stuff like one-time-access, access at a specific time of day or span of days.... say someone is coming to do electrical work.. they can go in and out all day but the card wont work the next day etc....
Also planning on using a networked RFID system to track and identify customers/beers we are brewing in the brewery.... so planning on using the same readers and tags for everything.... such that anyone carrying a empty keg into the brewery gets access via the keg because clearly they are helping carry heavy things and dont have time to mess with keys.... or the same tag for a friend may allow them to pour as much beer as they want and pay later but not access into the brewery unless I authorize it etc....
So basically I have lots of plans for RFID and this door reader is only the beginning.
Working on an arduino remote car starter next... may or may not have RFID... but I expect to be playing around with both sets of code regardless soon.
That is a feature I would like.
I also think im going to put a simple switch push button on the Arduino RX line so that I can push the button and break the connection between the ardunio and the ID-12 so that I can just jack in to the black box inside housing the ardunio to change the code. instead of having to curently open the box and disconnect the wire.
I was going to use software serial, but I just wanted to get the project done.
Please let me know as you make any new code. I would love you review it and possibly even help test it.
Also I hope you have this hooked up to back up power!
I am doing this for a college project and have never used arduino before we are building it to interface it with computer help would really be appreciated is there part of the code i am missing?
many thanks
Jamie!
Regards
Mikkel
thanks
would this code work just fine straight in the arduino software?
Please help.
if so can you guys teach me how, im really bad at programming
Also, if you put your rfid tag in a retractable thumbdrive (lined with aluminum), would that prevent people from passively thieving your rfid?
iv got it working on a bread board and iv made a PCB i just need to drill and assemble. I cant get the newer code to work but oh well ill live
anyway iv been in discussion with someone and realised it would be a good idea to include a high voltage diode across the door lock pins.
when the door lock is closed the magnetic feald collapses in the door strike and this can cause quite high voltages to be produced as it collapses. these voltages will try and discharge through your tip31a transistor and can damage it over time
putting a diode there will allow the the door strike to loop back through itself and discharge. its not needed but it might help improve the reliability of the system
Is it the 1N4007 ?
Hope this helped!
im getting a
"eeprom was not declared in this scope" error
any way to fix this im stuck
it refrences the "EEPROM.write(i, 0);" line about a 5th off the way down