loading

This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)

Fumbling to reach for you keys and then having to find the right one for the corresponding door is usually the first or last headache of the day and it only gets worse if you're carrying something. An RFID door lock can lock and unlock doors with a swipe of a RFID keychain or card. My design uses an Arduino Uno the RFID reader and a servo. The servo that controls the door is being controlled by the micro controller and the arduino is being told when to unlock and lock the door with the RFID reader. When someone swipes the corresponding RFID card in front of the reader, the reader lets the arduino know that the correct card has been read and to then operate the servo, unlocking and locking the door.

Step 1: Parts List

Heres what you'll need:

1 Arduino Uno

1 USB printer cable

10 Jumper Cables

1 SG90 Micro Servo

1 MF522-AN RFID kit (comes with the RFID reader, card and keychain)

1 small breadboard

Optional: For demonstration purposes I 3D printed the blue and orange door lock assembly which can be found at http://www.thingiverse.com/thing:465349

Step 2: Setting Up the RFID Reader to Your Arduino

1. Use your breadboard to connect your RFID reader to seven jumper cables that will connect the reader to the arduino.

2. Connect the following RFID reader connections to the arduino pins listed.

MISO to pin 12

SCK to pin 13

SS to pin 10

MOSI to pin 11

GND to GND

3.3V to 3.3V

RST to pin 5

Step 3: Setting Up the Severo to the Arduino

To hook up the servo to your arduino connect the signal cable to pin 9 of the arduino, the black wire to gnd and the red wire to 5V. (See schematic)

Step 4: Downloading the Arduino Coding Environment

To write up the code for the arduino you must first download the latest arduino coding environment from http://arduino.cc/en/Main/Software

Step 5: Setting Up the Arduino Sketch

I used the code that came with the RFID kit and manipulated it to control the servo.

Use the arduino compiler to upload the following code

Step 6: Optional 3D Printable Demonstration Lock

To demonstrate that the servo is actually doing its job you can 3D print this demonstration lock that can even be used as a lock. If youd like to incorporate that to your project go to http://www.thingiverse.com/thing:465349 and print it out. In my project I printed the locks stationary parts in see-through blue and all of its moving parts in bright orange. The servo is connected to the large orange gear. When the servo rotates, it spins the gear which slides in the door bolt and then back out again. The action of sliding the door bolt back and forth simulates the door being unlocked and then locked again.

Step 7: Conclusion

There are many other ways to accomplish the same task but this way has seemed to work out even when my hands are full of groceries. Thanks for reading and be sure to follow me as I will be doing more write ups in the near future.

how to initialize the card
<p>same question</p>
<p>Actually my card is not working so the servo motor is not working can you help me out please...................</p>
<p>Can u send me the codes please</p>
Can we use an Arduino pro mini or nano?
<p>Good</p>
<p>I am able to get this to work, but after the servo unlocks it creeps back locked.</p><p>is there a way to change to code so that the lock stays unlocked until you swip the RFID card again to lock?</p>
<p>Hai,I have a aruino mega but change the code than ?! So yes can you send my thad code</p>
<p>Maybe I'm missing something that should be obvious but how do you program the ATMega to know which cards to open for? I'm working on this project right now and am a bit stumped. Any help is appreciated. Thanks in advance!</p>
<p>i doing a final year project on asset tracking using rfid and arduino but i dont know what are the component that i will require to accomplish this project.help please</p>
<p>This is pretty sweet. I've actually saved that lock mechanism from thingiverse already in anticipation of trying it out. I'm curious as to how secure an actual 3D printed lock would be, as getting in a metal version would be significantly more expensive especially for a customized version.</p><p>I wonder if its possible to customize the bolt by screwing in a solid metal tip on the end, but leaving the gear section plastic. That way if anyone tried to force your door while it was locked it would be just as secure as a normal deadbolt.</p>
<p>If you mounted a metal plate like on the bolt for any door on the door and jam and made sure the metal of the bolt is long enough that it would reach an angle at which it binds up with both the plates before the door is open you could keep it locked without even anchoring the mechanism more than enough to force the bolt into place.</p>
<p>The PLA that the assembly was printed in is strong enough for other projects like the coffee table and locking compartments you mentioned but I wouldn't use it as the first line of defence for your house. Let me know what you discover!</p>
<p>There is a &quot;Protected Contest&quot; going on right now that you should enter this project in.</p>
<p>Thanks for the heads up. I just tried to enter and the instructable isn't eligible; it was published before the contest entry date</p>
@flagtrax A lot of public libraries now have 3d printers that anyone can use. Only charge is for the small amount of filament you use. Very inexpensive.
<p>Yes. Community colleges, universities and hackerspaces should also be helpful.</p>
<p>Thanks. This looks really cool. I may modify to let my cat in and out when I'm not home.</p>
<p>Awesome idea! I was thinking of repurposing it for my car but I kind of want to use a proximity sensor for that.</p>
<p>I might make this.</p>
<p>Just do it - Nike</p>
<p>I can see that I got my electrical (computer) engineering degree about 30 years too soon... I would have LOVED to have things like Arduinos around back then (instead of huge Intel 8080/8085 development boards). Very nice job. (And as you can tell by my userid: Go Bulls!!)</p>
<p>I'll 2nd this ... except my learning platform was the Motorola 6809 ... a bit more the 30 years ago.</p>
3DPrinting?? Really?? Sure we all can affotd one of those....Present something people can actually build.
<p>Alternatively you could use this for locking projects that have nothing to do with the security of doors on your home and are instead maybe coffee tables with locking compartments, or treasure chests that open with RFID tags etc.</p>
this is a cool use for an arduino. thanks for sharing
<p>Any time</p>
Man keep doing what you are doing, its awesome nice work man
<p>Glad you like it, bud. This was my first instructable and I'm hooked. More to come</p>
<p>Hi, I've tryed going to cooqrobot for the kit but it's just a website filled with ads and no info or branding whatsoever could you please check and see what I've done wrong. Thanks</p>
<p>Yeah thats strange, that website is written on the back of the reader. Google &quot;MF522-AN RFID kit&quot; and see what sites you'd trust to get it from. I found the reader at http://www.b2cqshop.com/products/203-rfid-module-kit-1356-mhz-with-tags-spi-w-and-r-for-arduino.aspx but I've never bought anything from them. And thanks for noticing I'll have to edit my instructable. </p>

About This Instructable

43,498views

646favorites

License:

Bio: USF EE Undergraduate
More by Swellsandstorms:RFID Controlled Door 
Add instructable to: