RFID Based Door Lock Security System using Arduino
RFID Based Door Lock Security System using Arduino Code & RC522 RFID Module to lock/unlock Solenoid Relay with matched RFID Tag
- Suitable forB.Tech/Diploma Arduino students
- Build time1-2 weeks
- LevelIntermediate
- Available atAjvika Labs, Kakinada
About this project
Overview:
In this project, we will design an
RFID Based Door Lock Security System
utilizing the
RC5222 Module
and
Arduino
. As the world advances towards more sophisticated security measures,
RFID (Radio Frequency Identification)
technology has emerged as a preferred choice for many
security applications
. Unlike conventional lock and key systems,
RFID security systems
employ electromagnetic fields to identify and
track tags
attached to objects, making them more efficient and less susceptible to duplication.
By coupling the versatile
Arduino microcontroller
with the
RC5222 RFID module
, we can develop a robust and responsive
door lock system
. When an RFID tag comes in proximity to the reader, the Arduino evaluates the
tag’s information
against the stored data to ascertain if access should be permitted or restricted. This project provides a practical insight into the workings of
RFID technology
, demonstrating the synergy between
Arduino
and the RC5222 module in crafting security solutions.
Earlier, we build Security system projects like
Password Based Security System
and also
Fingerprint Biometric Security System
using Arduino. You may check that as well.
Bill of Materials
Following are the components required for building this RFID Based Door Lock Security System Project using Arduino. You can purchase all these components from the given links.
S.N.
Components Name
Quantity
Purchase Links
Arduino Nano Board
Amazon
AliExpress
SunFounder
RFID Module RC522
Amazon
AliExpress
SunFounder
16x2 I2C LCD Display
Amazon
AliExpress
SunFounder
12V Solenoid Lock
Amazon
AliExpress
LED 5mm Any Color
Amazon
AliExpress
SunFounder
Buzzer 5V
Amazon
AliExpress
SunFounder
1 Channel Relay Module
Amazon
AliExpress
SunFounder
Resistor 1K
Amazon
AliExpress
SunFounder
7805 Voltage Regulator IC
Amazon
AliExpress
Capacitor 100uF/35V
Amazon
AliExpress
SunFounder
12V Power Supply
Amazon
AliExpress
SunFounder
Connecting Wires
Amazon
AliExpress
SunFounder
Breadboard
Amazon
AliExpress
SunFounder
Block Diagram & System Operations
Here’s the block diagram of the RFID Based Door Lock Security System using Arduino:
Components Used
The system employs an Arduino Microcontroller, an RFID Reader, and several other components which are detailed below:
Arduino
: This acts as the brain of the system. It receives signals from the RFID reader, processes them, and subsequently sends commands to either grant or deny access.
LCD Display
: This display module offers feedback to the user. It can showcase messages such as “Access Granted”, “Access Denied”, or “Scan your RFID card”.
RFID Reader
: This component reads the RFID card or tag presented by the user. If the RFID data aligns with the stored information, it sends a signal to the Arduino for further action. The RC522 SPI Module is the most popular module in the market which has been used in this project.
LED Indicator
: This provides visual feedback about the system’s status. For instance, a green LED might indicate successful access, while a red LED could signify denied access.
Buzzer
: An auditory component that can sound alerts or notifications based on the system’s status or user interactions.
Relay
: This electrically operated switch is activated when the Arduino sends a command to grant access.
Solenoid Lock
: An electronic lock mechanism that can be locked or unlocked when powered. The relay, when activated, supplies power to this lock, causing it to unlock.
System Operation
The
RFID Based Door Lock Security System
is engineered to offer
secure access control
through RFID card verification. Central to the system are an
RFID reader
, an Arduino microcontroller, a relay, a
solenoid lock
, an LCD display, an LED indicator, and a buzzer. Users mainly interact with the system by presenting their RFID cards to the reader and receiving feedback via the
LCD display
and
LED indicator
When a user
scans
their
RFID card
, the reader captures the card’s data and forwards it to the Arduino for
validation
. The Arduino then
compares
this data with the stored
RFID information
. If there’s a match, the Arduino triggers the
relay
, which subsequently powers the
solenoid lock
, unlocking it. Throughout this procedure, the LCD display and LED indicator provide
real-time feedback
to the user, indicating actions required or the outcome of the
verification
, such as “
Access Granted
” or “
Access Denied
”.
Circuit Diagram of RFID Door Lock Security System using Arduino
Here’s the circuit diagram of the RFID Based Door Lock Security System:
Let us take a closer look at the connection between various components in this project.
Arduino – LCD Connection
:
SDA (Serial Data)
: Connected to the
A4
pin of the Arduino.
SCL (Serial Clock)
: Connected to the
A5
pin of the Arduino.
VCC
: Connected to the
5V
pin of the Arduino, providing power to the LCD.
GND (Ground)
: This is connected to the
GND
pin of the Arduino
LED Indicators
:
Led1
: Indicates the Lock Status and is connected to the
D2
pin of the Arduino.
Led2
: Another indicator for the Unlock status is connected to the
D3
pin of the Arduino.
RFID MFRC522 Module
SDA
: Connected to
D10
of Arduino
SCK
: Connected to
D13
of Arduino
MOSI
: Connected to the
D11
pin of Arduino
MISO
: Connected to the
D12
pin of Arduino
GND
: Connected to
GND
of Arduino
RST
: Connected to the
D9
pin of Arduino
3.3V
: Connected to the
3.3V
pin of Arduino
Relay Module
VCC
: Connected to
5V
of Arduino
GND
: Connected to
GND
Pin
IN
: Connected to
D6
of Arduino
COM
: Connected to Solenoid Lock
NC
: Connected to
12V
For the
Power Supply unit
, the entire device is powered using a
12V DC Power
Adapter. The
7805 Voltage regulator IC
power the Relay and relay using the 5V output of the 7805 regulator. The 12V Supply is also connected to the
Vin
Pin of Arduino Nano. The
100uF/35V Electrolytic Capacitor
is used for Voltage Stability at Power Supply Pins.
All the connection can be done in breadboard as per circuit diagram.
Source Code/Program
Let us move to the programming part of “
RFID Based Door Lock Security System
” using Arduino IDE. The code requires few libraries for compilation. You need to install the libraries first.
Download the following libraries and add it to the Arduino Library folder.
RFID Library:
Download
I2C LCD Library:
Download
Apart from above two librarries, we need a header file
“
pitches.h
“
. This header file has a definitions for musical note frequencies in Hertz, which can be used to play melodies using a piezo buzzer or other sound-producing device.
Copy the code from the following link:
pitches.h
and save it to the sketch folder with the name pitches.h.
Here is the completed code for the RFID RFID Based Door Lock Security System using Arduino. Copy the code and paste it to the Arduino IDE.
// Include necessary libraries for RFID, SPI, pitches, and LCD
#include <RFID.h>
#include <SPI.h>
#include "pitches.h"
#include <LiquidCrystal_I2C.h>
// Define pins for RFID, Relay, LEDs, and Buzzer
#define SS_PIN 10
#define RST_PIN 9
#define RELAY_PIN 6
#define Red_LED 2
#define Green_LED 3
#define Buzzer 4
// Initialize LCD with I2C address
LiquidCrystal_I2C
lcd
(
0x27
)
;
// Initialize RFID with SS and RST pins
In this project, we will design an
RFID Based Door Lock Security System
utilizing the
RC5222 Module
and
Arduino
. As the world advances towards more sophisticated security measures,
RFID (Radio Frequency Identification)
technology has emerged as a preferred choice for many
security applications
. Unlike conventional lock and key systems,
RFID security systems
employ electromagnetic fields to identify and
track tags
attached to objects, making them more efficient and less susceptible to duplication.
By coupling the versatile
Arduino microcontroller
with the
RC5222 RFID module
, we can develop a robust and responsive
door lock system
. When an RFID tag comes in proximity to the reader, the Arduino evaluates the
tag’s information
against the stored data to ascertain if access should be permitted or restricted. This project provides a practical insight into the workings of
RFID technology
, demonstrating the synergy between
Arduino
and the RC5222 module in crafting security solutions.
Earlier, we build Security system projects like
Password Based Security System
and also
Fingerprint Biometric Security System
using Arduino. You may check that as well.
Bill of Materials
Following are the components required for building this RFID Based Door Lock Security System Project using Arduino. You can purchase all these components from the given links.
S.N.
Components Name
Quantity
Purchase Links
Arduino Nano Board
Amazon
AliExpress
SunFounder
RFID Module RC522
Amazon
AliExpress
SunFounder
16x2 I2C LCD Display
Amazon
AliExpress
SunFounder
12V Solenoid Lock
Amazon
AliExpress
LED 5mm Any Color
Amazon
AliExpress
SunFounder
Buzzer 5V
Amazon
AliExpress
SunFounder
1 Channel Relay Module
Amazon
AliExpress
SunFounder
Resistor 1K
Amazon
AliExpress
SunFounder
7805 Voltage Regulator IC
Amazon
AliExpress
Capacitor 100uF/35V
Amazon
AliExpress
SunFounder
12V Power Supply
Amazon
AliExpress
SunFounder
Connecting Wires
Amazon
AliExpress
SunFounder
Breadboard
Amazon
AliExpress
SunFounder
Block Diagram & System Operations
Here’s the block diagram of the RFID Based Door Lock Security System using Arduino:
Components Used
The system employs an Arduino Microcontroller, an RFID Reader, and several other components which are detailed below:
Arduino
: This acts as the brain of the system. It receives signals from the RFID reader, processes them, and subsequently sends commands to either grant or deny access.
LCD Display
: This display module offers feedback to the user. It can showcase messages such as “Access Granted”, “Access Denied”, or “Scan your RFID card”.
RFID Reader
: This component reads the RFID card or tag presented by the user. If the RFID data aligns with the stored information, it sends a signal to the Arduino for further action. The RC522 SPI Module is the most popular module in the market which has been used in this project.
LED Indicator
: This provides visual feedback about the system’s status. For instance, a green LED might indicate successful access, while a red LED could signify denied access.
Buzzer
: An auditory component that can sound alerts or notifications based on the system’s status or user interactions.
Relay
: This electrically operated switch is activated when the Arduino sends a command to grant access.
Solenoid Lock
: An electronic lock mechanism that can be locked or unlocked when powered. The relay, when activated, supplies power to this lock, causing it to unlock.
System Operation
The
RFID Based Door Lock Security System
is engineered to offer
secure access control
through RFID card verification. Central to the system are an
RFID reader
, an Arduino microcontroller, a relay, a
solenoid lock
, an LCD display, an LED indicator, and a buzzer. Users mainly interact with the system by presenting their RFID cards to the reader and receiving feedback via the
LCD display
and
LED indicator
When a user
scans
their
RFID card
, the reader captures the card’s data and forwards it to the Arduino for
validation
. The Arduino then
compares
this data with the stored
RFID information
. If there’s a match, the Arduino triggers the
relay
, which subsequently powers the
solenoid lock
, unlocking it. Throughout this procedure, the LCD display and LED indicator provide
real-time feedback
to the user, indicating actions required or the outcome of the
verification
, such as “
Access Granted
” or “
Access Denied
”.
Circuit Diagram of RFID Door Lock Security System using Arduino
Here’s the circuit diagram of the RFID Based Door Lock Security System:
Let us take a closer look at the connection between various components in this project.
Arduino – LCD Connection
:
SDA (Serial Data)
: Connected to the
A4
pin of the Arduino.
SCL (Serial Clock)
: Connected to the
A5
pin of the Arduino.
VCC
: Connected to the
5V
pin of the Arduino, providing power to the LCD.
GND (Ground)
: This is connected to the
GND
pin of the Arduino
LED Indicators
:
Led1
: Indicates the Lock Status and is connected to the
D2
pin of the Arduino.
Led2
: Another indicator for the Unlock status is connected to the
D3
pin of the Arduino.
RFID MFRC522 Module
SDA
: Connected to
D10
of Arduino
SCK
: Connected to
D13
of Arduino
MOSI
: Connected to the
D11
pin of Arduino
MISO
: Connected to the
D12
pin of Arduino
GND
: Connected to
GND
of Arduino
RST
: Connected to the
D9
pin of Arduino
3.3V
: Connected to the
3.3V
pin of Arduino
Relay Module
VCC
: Connected to
5V
of Arduino
GND
: Connected to
GND
Pin
IN
: Connected to
D6
of Arduino
COM
: Connected to Solenoid Lock
NC
: Connected to
12V
For the
Power Supply unit
, the entire device is powered using a
12V DC Power
Adapter. The
7805 Voltage regulator IC
power the Relay and relay using the 5V output of the 7805 regulator. The 12V Supply is also connected to the
Vin
Pin of Arduino Nano. The
100uF/35V Electrolytic Capacitor
is used for Voltage Stability at Power Supply Pins.
All the connection can be done in breadboard as per circuit diagram.
Source Code/Program
Let us move to the programming part of “
RFID Based Door Lock Security System
” using Arduino IDE. The code requires few libraries for compilation. You need to install the libraries first.
Download the following libraries and add it to the Arduino Library folder.
RFID Library:
Download
I2C LCD Library:
Download
Apart from above two librarries, we need a header file
“
pitches.h
“
. This header file has a definitions for musical note frequencies in Hertz, which can be used to play melodies using a piezo buzzer or other sound-producing device.
Copy the code from the following link:
pitches.h
and save it to the sketch folder with the name pitches.h.
Here is the completed code for the RFID RFID Based Door Lock Security System using Arduino. Copy the code and paste it to the Arduino IDE.
// Include necessary libraries for RFID, SPI, pitches, and LCD
#include <RFID.h>
#include <SPI.h>
#include "pitches.h"
#include <LiquidCrystal_I2C.h>
// Define pins for RFID, Relay, LEDs, and Buzzer
#define SS_PIN 10
#define RST_PIN 9
#define RELAY_PIN 6
#define Red_LED 2
#define Green_LED 3
#define Buzzer 4
// Initialize LCD with I2C address
LiquidCrystal_I2C
lcd
(
0x27
)
;
// Initialize RFID with SS and RST pins
Technologies used
Hardware components
- Arduino
- RFID
- RC522
- Relay
Software & tools
- Arduino IDE
What you get
- Working project / hardware kit, tested before delivery
- Complete source code with explanation
- Project demo and guidance for your viva
- Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed.
Payment is in two parts:
• 50% advance to start the project
• Remaining 50% before delivery
Note:
• Documentation and PPT are not included by default
• If you need documentation/PPT, it can be arranged for extra time and cost
We'll confirm the exact timeline and cost with you after reviewing your requirements.