Summary of Arduino RFID Lock
The Arduino RFID lock project creates a secure access system using an Arduino microcontroller, an RFID reader, and a servo motor to control a mechanical lock. The system communicates with a MySQL database via PHP to manage registered card codes and user accounts. When a valid RFID card is scanned, the server verifies the code, and the Arduino activates the servo to unlock the door. An internal button also allows manual unlocking from inside.
Parts used in the Arduino RFID Lock:
- Arduino Uno
- Servo motor
- Breadboard
- RFID reader
- Mechanical cylindrical lock
- Button
- Pull down resistor
- Connection cables (5v, ground, signal)
- Drill and screws or duct-tape
The Arduino RFID lock
How does it work?
The Arduino RFID lock is a lock that can be opened easily, but is secure. The lock works with a server database that can register card codes. On the door there is a RFID reader connected to the lock. If the RFID reader reads a registered card the door will open. One of the pictures gives a schematic overview of the functionality of the Arduino RFID lock.
In this instructable there will be explained how to setup a database, how to connect the RFID reader and how to set up the Arduino controlled lock.
Step 1: The database
How to make?
Step 1: The database and PHP.
https://www.dropbox.com/s/i9jd5pv6qxrm6x2/Instructable.rar
This link has one file with all the codes in it. For the database use the PHP_final.rar.
Create a Mysql database that is named ‘doorsystem’ and exists of 4 columns:
– ‘id’,
– ‘rfid’,
– ‘name’,
– ‘password’.
In the upper image you can see the settings for the different columns. In the lower picture you see the different values for the columns. (Note the id is auto incremented so you don’t have to manually assign it, and works as the key for the database)
Make sure you add an account named ‘admin’, the php files will automatically assign admin privileges to this account.
When the database is online, open the connection.php file and enter the database connection data.
The rest of the files can be uploaded as is. Check the system by going to the index page and logging in with your admin account. Try adding some users.
Step 2: The Lock and Arduino
As you can see in the Fritzing file above, connecting the servo to the Arduino is as simple as connecting the 5v, ground and signal cables. To be able to use a button from the inside, this is also connected, with a pull down resistor, so when the button is pressed, it sends a signal to the Arduino.
For attaching the servo to the lock, you may need to drill some holes in the lock.
The red dots indicate where to drill the holes.
Put the screws through the holes of the servo, and then through the lock, to attach the servo firmly to the lock. Of course any other kind of binding material would work, e.g. we used duct-tape in the testing phase.
· Arduino (we used an Uno, but any kind is possible)
· Servo
· Breadboard
· RFID reader
· Mechanical cylindrical lock
For more detail: Arduino RFID Lock
- How does the Arduino RFID lock open the door?
The door opens when the RFID reader scans a card that has been registered in the server database. - What database is required for this project?
A MySQL database named doorsystem with columns for id, rfid, name, and password is required. - Can I use any type of Arduino board?
Yes, while an Uno was used, any kind of Arduino is possible for this project. - How is the servo attached to the lock?
Holes must be drilled in the lock to attach the servo firmly using screws or binding material like duct-tape. - Does the system support manual unlocking?
Yes, a button connected with a pull down resistor allows users to send a signal to the Arduino to open the door from the inside. - Which account automatically receives admin privileges?
An account named admin will automatically be assigned admin privileges by the php files. - What is the purpose of the connection.php file?
You must enter your database connection data into the connection.php file to establish the link between the system and the database. - Is the id column manually assigned?
No, the id column is auto incremented and works as the key for the database without manual assignment.


