In an era where security is paramount, the integration of technology into everyday life has become essential. One such innovation is the RFID-based door locking system, a project designed and developed in 2016 by Nooruddin Mohammed. This blog will walk you through the intricacies of creating a door locking system using RFID technology, powered by Arduino.
Introduction to RFID Technology
Radio Frequency Identification (RFID) is a technology that uses electromagnetic fields to automatically identify and track tags attached to objects. In our project, RFID is employed to grant or deny access to a door, enhancing security by ensuring that only authorized individuals can enter.
Project Overview
The RFID-based door locking system is designed to be user-friendly and efficient. It includes an RFID reader that scans the access card and checks if the card is authorized. If the card matches the pre-stored values in the system, access is granted; otherwise, access is denied, and an alarm is triggered.
Hardware Components
To build this system, the following hardware components are required:
Arduino Uno: The microcontroller that controls the entire system.
RFID Reader Module: Used to read the RFID tags.
Liquid Crystal Display (LCD): Displays messages to the user.
Relay Module: Controls the locking mechanism.
Buzzer/Alarm: Sounds when unauthorized access is attempted.
LEDs: Indicate the status of access (granted or denied).
Power Supply: Powers the system.
Software Requirements
The system is coded using Arduino IDE, a platform that allows for easy development and testing of the code. The code utilizes libraries like SPI.h for communication with the RFID module and LiquidCrystal.h for controlling the LCD display.
Arduino Code Walkthrough
Below is a brief explanation of the key parts of the Arduino code for the RFID-based door locking system:
Library Inclusions and Pin Definitions:
#include <LiquidCrystal.h>
#include <SPI.h>
#include <RFID.h>
#define SS_PIN 10
#define RST_PIN 9
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
RFID rfid(SS_PIN,RST_PIN);
These lines include necessary libraries and define the pins used for the RFID module and LCD.
Initialization:
void setup(){
Serial.begin(9600);
SPI.begin();
rfid.init();
...
The setup() function initializes serial communication, SPI communication, and the RFID module. It also sets the pin modes for the relay, LEDs, and alarm.
Card Authentication:
if(rfid.readCardSerial()){
// Code to check if the card is authorized
}
Here, the code reads the serial number of the RFID card and compares it with the pre-stored card numbers. If a match is found, access is granted; otherwise, access is denied.
Granting Access:
if(access){
Serial.println("Authorised!");
digitalWrite(relay, HIGH); // Unlock the door
digitalWrite(LED, HIGH); // Indicate access granted
...
}
When a card is authorized, the relay is activated, unlocking the door, and an LED lights up to indicate successful access.
Denying Access and Triggering Alarm:
if(!access){
Serial.println("Un Authorised!");
digitalWrite(relay, LOW); // Keep the door locked
digitalWrite(alarm, HIGH); // Trigger the alarm
digitalWrite(LED2, HIGH); // Indicate access denied
...
}
If the card is not recognized, the system keeps the door locked, triggers an alarm, and lights up a different LED to indicate access denial.
Final Messages:
lcd.setCursor(0, 1);
lcd.print("Nooruddin Mohammed");
...
The LCD displays messages throughout the process, including personalized messages when access is granted.
Conclusion
This RFID-based door locking system is a robust and reliable security solution that leverages the power of Arduino and RFID technology. By following the steps and understanding the code provided, you can build a similar system tailored to your needs.
This project not only reinforces the importance of security in modern systems but also demonstrates the versatility of Arduino in implementing practical solutions. Whether for a personal project or a commercial application, the RFID-based door locking system is a valuable addition to any security setup.
For those interested in diving deeper into the code or customizing the system further, the possibilities are endless. Happy building!
.