Introduction: RFID Auto Door Lock

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

read over all of instructable before starting (especially the recommendations step 7)

This RFID Lock is a drop in substitution for the back handle of a deadbolt lock. no drilling into door needed.
keys can still be used with it or manually

It opens when you walk up to it from the inside and auto locks after you, after 10 seconds.
unlock it from the outside with a RFID tag/card using a RFID reader.

It can be used for left of right handed door. A right hand side door (from the inside view) will require easy code tweaks and assemble adjustments.

There are two videos linked above one is a demo and one gives more detailed information on the project.
Below are some solidworks files for the assembly (not needed)

Step 1: 1 Materials

1. Access to a 3D printer to print out 3 parts

2. Arduino uno or larger

3. 9g micro servo plastic gears 'sg90' or metal 'mg90'(screws and attachment horns needed, typically come with the servo)

4. RFID reader RC522 and at least two RFID cards or tags

5. Black box - for hiding mechanism and electronics. "DC-47P DC Series Heavy Duty Electronics Enclosures"

6. Door or wood compatible with deadbolt.

8. wires - arduino style jumper wires or regular electrical if you want to solder it.

9. Drill & drill bits.

10. USB type B to USB A (or to wall plug directly).

11. USB A to wall plug (for power also can use 9- 12V DC connector on arduino).

12. 1 Small screw approximately #4 1/2

13.Deadbolt door lock.

14. SR04 Proximity Sensor.

15. 1 switch.

16. 1 momentary button.

17. a second box for containing RFID reader.

18. command strips or double sided tape.

19. hot glue gun and glue or tape or other type of adhesive.

20. buzzer

21. measuring device recommended digital caliper

Step 2: 2 3D Print Parts .stl Files

3D Print:

Servo mount (fits the specific box)

Adapter part- D shape or flat bar hole type (depends on your type of lock) kwikset is what i used and uses D type

External handle

sand down parts and remove supports

Step 3: 3 Drill & Cut Holes

place servo mount in lower left corner (top right if you use a right hand,inside view, door) and attach servo (servo can be positions either direction.) *the servo mounts on the other side of the part from what is shown.(the height was changed of the part so the wires would not cause fitment issues*

mark center drill hole in line with axis of servo.
drill 3/8 in hole
verify parts assemble and adapter is lined up and goes through hole

measure distance between two bolts of deadbolt (should be 1 in)
mark 2 drill holes to the side of the adapter hole
drill holes for deadbolt bolts (varies on model of deadbolt)

mark and drill 5/8 in holes for proximity sensor (position sensor away from mechanism on other side of box for clearance)

drill 3/8 in hole in lid of box for top of adapter part

place arduino on other side of box away from mechanism. position against edge drill holes for arduino power/serial port.

cut slot for 7 RFID reader wires from top edge of box down.

cut slot and hole for wipe button and switch. again

Step 4: 4 Wiring of Components

See the fritzing diagram attached

The green rectangle represents the 8 pins of the RFID Reader (only 7 are used)

You can solder or used a breadboard. If you use a breadboard it may be difficult to fit a full size one.

notice common grounds/power among wires

black device in top left is the buzzer

IMPORTANT the RFID reader uses 3.3V not 5V you will fry it if you apply 5V.

Step 5: 5 Arduino Code

My code was based off of a user on
he released updated to his code since I made my alteration so mine does not have some of the updates
His is designed to be used with LEDs and a relay.I chose to use a buzzer so you can hear when it auto locks and

The arduino code is below a text file containing the code is there too.

libraries will need some you may already have built in. others are below or can be found online

the degrees may need to be adjusted based on servo and installation

many of the variables can be adjusted at the top of the code.

*right hand door switch the degree settings of the servo's lock position and unlock.

ex: lockdeg 45 -> lockdeg 135
unlockdeg 135 -> unlockdeg 45

Step 6: 6 Final Assemble

assemble all the parts like how they are in the other pictures above. Recommended have a friend help hold things in place.

*note parts have been modified slightly for better fits. The servo mounts on the other side from what is shown in pictures.

open door and place deadbolt in locked position.
unscrew bolts holding back latch on, front of lock may fall out. Use tape to secure it or a friend to hold it.

put bolts through box housing mount holes. thread into front of lock tighten until box is sits lightly against door.
adjust position so that is is as little resistance to rotate adapter part/servo. you can check this by moving it by hand
once you find the least resistance spot tighten the bolts down more and double check the resistance.

now put the servo in the servo mount. you will likely have to change the horn orientations.(plug power in to make the servo move to its two positions). Place adapter piece in horn of servo. slide assemble onto lock shaft and hole stump for mount.

use a screwdriver and a #4 1/2 in long wood screw to secure servo mount.

use hot glue to secure arduino and other parts and wires.

Step 7: 7 Recommendations for Improvements & Tips

CAD measurements of box are off because the box slightly tapers. heights and depth measurements are good though

watch how and where you drill your holes

use a reed sensor to detect when door is shut

LCD display to show outside temperature/ humidity

a smaller box

a hinge to make installation easier hanging lid stresses wires

stronger RFID reader range is only 1 or 2 cm

thin wires or ribbon cable for reader to fit around door good

use zip ties, heat shrink wrap, and hot glue to tidy up wires

LEDs if you want can be used they are all set to an unused pin # 2.