Introduction: RFID Controlled Door

Picture of RFID Controlled Door

This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (

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

Picture of 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

Step 2: Setting Up the RFID Reader to Your Arduino

Picture of 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

Picture of 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

Picture of Downloading the Arduino Coding Environment

To write up the code for the arduino you must first download the latest arduino coding environment from

Step 5: Setting Up the Arduino Sketch

Picture of 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

Picture of 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 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

Picture of 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.


Shayan Das (author)2016-09-05

how to initialize the card

NailaG (author)Shayan Das2017-01-23

same question

Akshat Kumar (author)2016-06-20

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

Akshat Kumar (author)2016-06-19

Can u send me the codes please

Tanmaysrivastava (author)2016-05-03

Can we use an Arduino pro mini or nano?

taifur (author)2015-09-18


DavidB22 (author)2015-03-19

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?

1Dann (author)2015-01-29

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

Tayl90mm (author)2015-01-25

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!

MayengaM (author)2015-01-16

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 please

gravityisweak (author)2014-12-05

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.

AlexD12 (author)gravityisweak2014-12-19

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!

mbelew (author)2014-12-10

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

Swellsandstorms (author)mbelew2014-12-10

Thanks for the heads up. I just tried to enter and the instructable isn't eligible; it was published before the contest entry date

steamMelody (author)2014-12-07

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

Yes. Community colleges, universities and hackerspaces should also be helpful.

billy_kolb (author)2014-12-06

Thanks. This looks really cool. I may modify to let my cat in and out when I'm not home.

Awesome idea! I was thinking of repurposing it for my car but I kind of want to use a proximity sensor for that.

JohnW12 (author)2014-12-05

I might make this.

Swellsandstorms (author)JohnW122014-12-08

Just do it - Nike

TampaGeek (author)2014-12-07

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

digimonatx (author)TampaGeek2014-12-07

I'll 2nd this ... except my learning platform was the Motorola 6809 ... a bit more the 30 years ago.

flagtrax (author)2014-12-07

3DPrinting?? Really?? Sure we all can affotd one of those....Present something people can actually build.

gravityisweak (author)2014-12-05

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.

Wolfbane221 (author)2014-12-03

this is a cool use for an arduino. thanks for sharing

Any time

andyrambo (author)2014-12-03

Man keep doing what you are doing, its awesome nice work man

Glad you like it, bud. This was my first instructable and I'm hooked. More to come

Ethan_Lundy (author)2014-12-03

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

Yeah thats strange, that website is written on the back of the reader. Google "MF522-AN RFID kit" and see what sites you'd trust to get it from. I found the reader at but I've never bought anything from them. And thanks for noticing I'll have to edit my instructable.

About This Instructable




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