Smart Door Lock with RFID Using Arduino | DIY RFID Security System

Looking for a smart home security project? In this tutorial, you will learn how to build a Smart Door Lock with RFID using Arduino Uno. This DIY RFID security system allows access using RFID cards or key tags instead of traditional keys.

This project is perfect for beginners interested in Arduino projects, smart home automation, and RFID-based security systems. We will use an MFRC522 RFID module, SG90 servo motor, and Arduino Uno to create a simple but powerful electronic door lock.

smart door lock with RFID using Arduino

What is an RFID Smart Door Lock?

An RFID smart door lock is an electronic locking system that uses Radio Frequency Identification (RFID) technology to unlock doors. When an authorized RFID card or tag is scanned near the RFID reader, the system verifies the UID and unlocks the door automatically.

Unlike traditional locks, RFID door locks provide better security, fast access, and smart automation features.

Features of This RFID Door Lock Project

  • RFID-based smart access control
  • Automatic door locking and unlocking
  • Arduino-controlled servo mechanism
  • Easy wiring and beginner-friendly setup
  • Expandable for IoT and WiFi control
  • Low-cost DIY smart security project

Components Required

ComponentQuantity
Arduino Uno1
MFRC522 RFID Reader Module1
RFID Card / RFID Tag1 or More
SG90 Servo Motor1
Breadboard1
Jumper WiresSeveral
LED Indicator1
Buzzer (Optional)1
USB Cable1
RFID door lock project components

RFID Door Lock Circuit Diagram

Connect the MFRC522 RFID module and SG90 servo motor to Arduino Uno using the SPI interface. Follow the wiring table below carefully.

RFID door lock circuit diagram using Arduino
RFID Module PinArduino Uno Pin
SDAD10
SCKD13
MOSID11
MISOD12
RSTD9
3.3V3.3V
GNDGND

Servo Motor Connections:

  • Signal → D6
  • VCC → 5V
  • GND → GND

How RFID Smart Door Lock Works

The MFRC522 RFID reader continuously scans nearby RFID cards or tags. When a valid RFID card is detected, the Arduino compares the card UID with the stored authorized UID.

If the UID matches, Arduino rotates the SG90 servo motor to unlock the door. After a few seconds, the servo returns to the locked position automatically.

RFID smart door lock working process

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 lockServo;

String authorizedUID = "13B64FA2";

void setup() {

  Serial.begin(9600);

  SPI.begin();

  rfid.PCD_Init();

  lockServo.attach(6);

  lockServo.write(0);

  Serial.println("RFID Door Lock Ready");

}

void loop() {

  if (!rfid.PICC_IsNewCardPresent())
    return;

  if (!rfid.PICC_ReadCardSerial())
    return;

  String tag = "";

  for (byte i = 0; i < rfid.uid.size; i++) {

    tag += String(rfid.uid.uidByte[i], HEX);

  }

  Serial.println(tag);

  if (tag == authorizedUID) {

    Serial.println("Access Granted");

    lockServo.write(90);

    delay(5000);

    lockServo.write(0);

  } else {

    Serial.println("Access Denied");

  }

  rfid.PICC_HaltA();

}

Arduino IDE Programming Setup

Install the MFRC522 library from the Arduino Library Manager before uploading the code. Select the correct COM port and Arduino board from the Tools menu.

Arduino RFID door lock code setup

How to Find RFID Card UID

Open the Serial Monitor after uploading the code. Scan the RFID card near the reader. The UID number will appear on the screen. Copy this UID and replace it in the Arduino code.

RFID card UID detection using Arduino

Applications of RFID Smart Lock

  • Smart home security systems
  • Office access control
  • School and college laboratories
  • Locker and cabinet protection
  • Hotel room security systems
applications of RFID smart locks

Advanced Upgrade Ideas

  • Add WiFi monitoring using ESP8266
  • Control door lock using smartphone app
  • Add fingerprint authentication
  • Use LCD display for access messages
  • Store multiple user RFID cards
  • Add cloud logging system
advanced RFID smart door lock system

Troubleshooting Common Problems

ProblemSolution
RFID reader not detecting cardCheck SPI wiring connections
Servo motor not rotatingVerify power supply and signal pin
Wrong UID readingUse correct baud rate in Serial Monitor
Arduino upload failedSelect correct COM port and board
RFID smart lock troubleshooting guide

Final RFID Smart Door Lock Output

After successful setup and programming, your Arduino-powered RFID smart door lock system will unlock automatically when an authorized RFID card is scanned near the MFRC522 module.

final RFID smart door lock project output

SEO FAQs

What is RFID in Arduino?

RFID stands for Radio Frequency Identification. It allows wireless identification using RFID cards or tags in Arduino projects.

Which RFID module is best for Arduino?

The MFRC522 RFID module is one of the most popular and affordable RFID readers for Arduino-based projects.

Can I use RFID for home security?

Yes, RFID systems are widely used in smart home security, office access control, and electronic door locks.

Can I add multiple RFID users?

Yes, you can store multiple RFID card UIDs in the Arduino code for multi-user access control.

Conclusion

The Smart Door Lock with RFID using Arduino is a fantastic DIY smart home project for beginners and electronics enthusiasts. It combines RFID technology, automation, and Arduino programming to create a practical security system.

You can further upgrade this project using WiFi, fingerprint sensors, mobile apps, and cloud-based monitoring systems for advanced IoT home automation.

Leave a Reply

Your email address will not be published. Required fields are marked *