Introduction: RFID Controlled Door
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
Attachments
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)
Attachments
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
Attachments
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.
Attachments

Participated in the
Formlabs Contest

Participated in the
3D Design Contest
32 Comments
Question 3 years ago
I'm new to c++ programming please help me with coding i got above component please provide me a code
7 years ago
how to initialize the card
Reply 6 years ago
same question
7 years ago
Actually my card is not working so the servo motor is not working can you help me out please...................
7 years ago
Can u send me the codes please
7 years ago
Can we use an Arduino pro mini or nano?
8 years ago on Introduction
Good
8 years ago on Introduction
I am able to get this to work, but after the servo unlocks it creeps back locked.
is there a way to change to code so that the lock stays unlocked until you swip the RFID card again to lock?
8 years ago on Introduction
Hai,I have a aruino mega but change the code than ?! So yes can you send my thad code
8 years ago on Introduction
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!
8 years ago on Introduction
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
8 years ago on Introduction
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.
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.
Reply 8 years ago on Introduction
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.
Reply 8 years ago on Introduction
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!
8 years ago on Introduction
There is a "Protected Contest" going on right now that you should enter this project in.
Reply 8 years ago on Introduction
Thanks for the heads up. I just tried to enter and the instructable isn't eligible; it was published before the contest entry date
8 years ago
@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.
Reply 8 years ago on Introduction
Yes. Community colleges, universities and hackerspaces should also be helpful.
8 years ago on Introduction
Thanks. This looks really cool. I may modify to let my cat in and out when I'm not home.
Reply 8 years ago on Introduction
Awesome idea! I was thinking of repurposing it for my car but I kind of want to use a proximity sensor for that.