RFID Controlled Door




About: USF EE Undergraduate

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.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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


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.

Formlabs Contest

Participated in the
Formlabs Contest

3D Design Contest

Participated in the
3D Design Contest

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    31 Discussions

    Akshat Kumar

    3 years ago

    Actually my card is not working so the servo motor is not working can you help me out please...................

    Akshat Kumar

    3 years ago

    Can u send me the codes please


    4 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?


    4 years ago on Introduction

    Hai,I have a aruino mega but change the code than ?! So yes can you send my thad code


    4 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!


    4 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

    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.

    2 replies

    Reply 4 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.

    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!


    4 years ago on Introduction

    There is a "Protected Contest" going on right now that you should enter this project in.

    1 reply

    Reply 4 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


    4 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.

    1 reply