RFID Door Lock System

Introduction

An RFID Door Lock System is an electronic security system that allows access using RFID cards or tags. Instead of traditional keys, authorized users can unlock the door by simply tapping an RFID card near the reader.

This system is widely used in offices, hotels, laboratories, and smart homes due to its high security and convenience.


Objective of the Project

  • To design a secure door locking system using RFID.
  • To allow access only to authorized users.
  • To understand RFID communication.
  • To interface RFID module with a microcontroller.

Working Principle

The system works on Radio Frequency Identification (RFID) technology.

Operation Steps

  1. RFID reader continuously scans for RFID tags.
  2. When a tag is brought near the reader, it reads the unique ID.
  3. Arduino compares the ID with stored authorized IDs.
  4. If the ID matches, the door lock opens.
  5. If the ID does not match, access is denied.

Components Required

  • Arduino Uno
  • RFID Module (MFRC522)
  • RFID Card / Tag
  • Servo Motor / Solenoid Lock
  • Buzzer
  • Jumper Wires
  • Breadboard
  • 5V Power Supply

Circuit Diagram

RFID Module Connections (MFRC522)

SDA  -> D10
SCK  -> D13
MOSI -> D11
MISO -> D12
RST  -> D9
3.3V -> 3.3V
GND  -> GND

Servo Motor

Signal -> D3
VCC    -> 5V
GND    -> GND

Arduino Code for RFID Door Lock

#include <SPI.h>
#include <MFRC522.h>
#include <Servo.h>

#define SS_PIN 10
#define RST_PIN 9

MFRC522 rfid(SS_PIN, RST_PIN);
Servo doorLock;

byte authorizedUID[4] = {0xDE, 0xAD, 0xBE, 0xEF};

void setup() {
  Serial.begin(9600);
  SPI.begin();
  rfid.PCD_Init();
  doorLock.attach(3);
  doorLock.write(0); // Locked position
}

void loop() {
  if (!rfid.PICC_IsNewCardPresent()) return;
  if (!rfid.PICC_ReadCardSerial()) return;

  bool accessGranted = true;
  for (byte i = 0; i < 4; i++) {
    if (rfid.uid.uidByte[i] != authorizedUID[i]) {
      accessGranted = false;
      break;
    }
  }

  if (accessGranted) {
    Serial.println("Access Granted");
    doorLock.write(90);
    delay(3000);
    doorLock.write(0);
  } else {
    Serial.println("Access Denied");
  }

  rfid.PICC_HaltA();
}

Code Explanation

  • RFID reader detects card UID.
  • UID is compared with stored authorized UID.
  • Servo unlocks door if access is granted.
  • Door locks automatically after delay.

Advantages

  • High security
  • No physical keys required
  • Fast response
  • Easy user management

Applications

  • Office security systems
  • Hotel room access
  • Smart homes
  • Laboratories
  • Restricted areas

Future Enhancements

  • LCD display for status
  • Mobile app integration
  • Cloud-based access logging
  • Biometric + RFID system

Conclusion

The RFID Door Lock System is a reliable and modern security solution that replaces traditional lock systems. It demonstrates practical use of RFID technology in real-life access control applications.

Leave a Reply

Shopping cart

0
image/svg+xml

No products in the cart.

Continue Shopping