Introduction: Electronic RFID Door Lock
Today I'm going to teach you how I design and built the "ULTIMATE ELECTRONIC DOOR LOCK" follow me on this step by step tutorial, I'll explain every detail and trouble I had during the construction.
I hope you enjoy it!
As you can see in the picture above the case its made by 3 different pieces, the cover with a simple circular design, behind a 3mm acrilic sheet and at the end the box that contains everithing in it.
Oh, almost forgot it, I will put this device INSIDE a door, not on either side, so... it will sit flush with the door face.
Step 1: Why?
I'm planning to make this door lock for a hotel so I need to be able to have a unique code for every room and also a master key to open every door even when it's locked.
The mechanism works with a servo motor and I added a inner knob. It has a backup battery in case that the power is cutted off.
It works mainly with RFID.
Step 2: What You Need
The brain of this project is an Arduino UNO, working with an RFID reader and a servo as the actuator so you will need the nexts parts.
-Arduino RFID Module
-MG995 Servo Motor
-2 x 2200uf Capacitos
-3 x 330ohm Resistors
-Several RFID Cards
-RGB LED Strip
-BMS (Battery Manage System)
I'm using a supposedly 1500mA battery with 65mm of leght and 18mm of diameter
Step 3: Schematic
Imagine that the RFID module is the black square on the top and the touch sensor is the one on the right, you just need a little bit of imagination...
The pinout is correct, if you look the modules with the pins pinting down like in the second image.
The Battery and the power source will be different steps, at the end I will put a complete schematic with all the components and wiring.
Step 4: 3D Pieces
I'm using a 3D printer to make the case because it has some difficult parts like the windows for the actuator and the arduino ports, and the cover for this last ones.
I´ll leave all the .stl files I made in SolidWorks
Step 5: Coding
The code will be in the same Google Drive folder explained line by line.
Step 6: Power Supply
As I tell you earlier, this unit will be always connected to the AC and to the circuit with an AC-DC converter but also to a UPS with a Lithium battery in case that something fails with the AC
In this case (With AC failure) the circuit will enter into a "Safe mode" so all the leds will be off and the current consumming will be at the minimun level but still be able to read cards and open the door every 8 seconds.
For the battery I'm using a BMS to control the charge and discharge.
The UPS BMS will be between the main power supply and the arduino so if the AC turn off automaticly the battery will power the circuit
I had troubles with the BMS The servo motor consumes too much current for my cheap BMS so I'll change it soon, so this is something you need to consider, the curren consumption when the servo is working and because it has a Spring atached to the actuator, the servo strugles a bit by moving it
I needed to use a small relay, is always on with the AC connected but when this fails send the ACFail pin to ground so I dont have any noise in this signal.
Step 7: Mechanism
So this is one of the parts I'm most proud, I designed every little pice of it from scratch, using the servo and trying to make it really slim, it has 40mm of deepness so it can fit inside a regular door.
Like a regular door lock you can open it from the inside by rotating the knob and lock it with a capacitive touch sensor and also, if the lock was on, when you turn the knob the lock is automaticly off, for this I used a micro switch to send HIGH signal to the arduino anytime the button is pressed.
I salvaged a spring from an old stapler but you can use pretty much any spring that your servo can move.
Also as a regular door you don't need to turn the knob to close de door, the latch bolt can move freely without mooving the servo and go back with the spring, this is also usefull to open with the knob.
Step 8: Put All Together
In this step you should have everything to make the dream come true, if you are not able to get some of this materials you can always change it for some similar piece.
The USB guard is in place with a screw and a nut, both where contemplated in the 3D model so they fit perfect in place.
For now the front part is just in place by the act of a prayer but in the real product this will be held by screws on the inside.
I'm still thinking of how and where to place the touch sensor to lock the door.
As I told you earlyer I still have some trouble with the capacity of the UPS system, I'm looking foward to improve it and update this instructable.
I place the RFID module over the servo and I don't have any issue, the small PCB is for the Relay and for some capacytors to reduce noice in the Vcc.
And is pretty much done!
If you make it so far, congratulations! Also if you have any questions or constructive comments feel free to let me know.
Step 9: Demo
Here you can see how it works perfect while the Vcc is connected, it can read any card and the ones with access will open the door.
But as soon as I disconnect the power, it goes into the safe mode, goes to sleep for 8 seconds and then read again, but you can see that the servo cant move the bolt anymore...
I'll fix this soon.