Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Home Automation & Smart Devices

Smart Door Lock with RFID: Arduino Access Control System

Smart Door Lock with RFID: Arduino Access Control System

April 1, 2026 /Posted by / 0

A smart door lock with RFID is one of the most practical security projects you can build with Arduino. Instead of fumbling with keys, you simply tap your RFID card or keychain tag on the reader, and the door unlocks automatically. This guide shows you how to build a complete RFID-based access control system with Arduino, supporting multiple authorised cards, an audit log, and a solenoid or servo-based lock mechanism — all for under ₹1,500.

Whether you want to secure your bedroom door, office cabin, or workshop, this project is perfect for Indian homes and small businesses.

Table of Contents

  • How RFID Access Control Works
  • Components Required
  • Wiring Diagram
  • Arduino Code with Multiple Card Support
  • Adding an LCD Display
  • Solenoid Lock vs Servo Lock
  • Adding Security Features
  • Frequently Asked Questions
  • Conclusion

How RFID Access Control Works

RFID (Radio Frequency Identification) uses electromagnetic fields to identify objects carrying RFID tags. In our door lock system:

  1. The RFID reader (RC522) continuously emits a low-power radio signal
  2. When an RFID card or keychain tag comes within 3–5 cm, the tag’s antenna picks up energy from the reader’s signal
  3. The tag transmits its unique ID number back to the reader
  4. The Arduino compares this ID against a list of authorised IDs
  5. If the ID matches, the Arduino activates the solenoid lock for a few seconds, allowing the door to be opened

The entire process takes less than half a second — faster than pulling out a key from your pocket.

Components Required

🛒 Recommended: RC522 RFID Card Reader Module (13.56MHz) — The most popular RFID reader for Arduino projects. Comes with one card and one keychain tag. SPI interface for fast communication.
🛒 Recommended: 12V DC Solenoid Door Lock — Electric solenoid lock that releases when powered. Mount on any door frame for reliable locking and unlocking.
Component Qty Price (₹)
Arduino Uno / Nano 1 250–400
RC522 RFID Module + cards 1 120–180
12V Solenoid Lock 1 200–350
1-Channel 5V Relay 1 35–60
12V Power Supply 1 100–200
Buzzer + LED 1 each 20–30
Wires, breadboard – 50–80
Total – ₹775–₹1,300
🛒 Recommended: 13.56MHz RFID IC Key Tags (2 Pcs) — Additional RFID key tags for family members. Compatible with the RC522 reader module.

Wiring Diagram

RC522 RFID Module to Arduino

RC522 SDA   → Arduino Pin 10
RC522 SCK   → Arduino Pin 13
RC522 MOSI  → Arduino Pin 11
RC522 MISO  → Arduino Pin 12
RC522 IRQ   → Not connected
RC522 GND   → Arduino GND
RC522 RST   → Arduino Pin 9
RC522 3.3V  → Arduino 3.3V (NOT 5V!)

Solenoid Lock Circuit

Arduino Pin 7  → Relay IN
Arduino 5V     → Relay VCC
Arduino GND    → Relay GND
12V Supply (+) → Relay COM
Relay NO       → Solenoid (+)
Solenoid (-)   → 12V Supply (-)

Indicators

Arduino Pin 6 → Green LED (via 220Ω resistor) → GND   [Access Granted]
Arduino Pin 5 → Red LED (via 220Ω resistor) → GND     [Access Denied]
Arduino Pin 4 → Buzzer (+), Buzzer (-) → GND
⚠️ Important: The RC522 module operates at 3.3V. Connecting it to 5V will damage the module. Always use the Arduino’s 3.3V pin for powering the RC522.

Arduino Code with Multiple Card Support

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

#define SS_PIN 10
#define RST_PIN 9
#define RELAY_PIN 7
#define GREEN_LED 6
#define RED_LED 5
#define BUZZER 4
#define LOCK_TIME 5000  // Door stays unlocked for 5 seconds

MFRC522 rfid(SS_PIN, RST_PIN);

// Authorised card UIDs (add your card UIDs here)
// To find your card UID, upload this code first with an empty array,
// open Serial Monitor, and scan your card
byte authorisedCards[][4] = {
  {0xA1, 0xB2, 0xC3, 0xD4},  // Card 1 - Jayesh
  {0xE5, 0xF6, 0x07, 0x18},  // Card 2 - Family Member
  {0x29, 0x3A, 0x4B, 0x5C},  // Card 3 - Guest
};
int numCards = sizeof(authorisedCards) / sizeof(authorisedCards[0]);

void setup() {
  Serial.begin(9600);
  SPI.begin();
  rfid.PCD_Init();
  
  pinMode(RELAY_PIN, OUTPUT);
  pinMode(GREEN_LED, OUTPUT);
  pinMode(RED_LED, OUTPUT);
  pinMode(BUZZER, OUTPUT);
  
  digitalWrite(RELAY_PIN, HIGH);  // Lock engaged
  digitalWrite(RED_LED, HIGH);    // Red LED on = locked
  
  Serial.println("=== RFID Door Lock System ===");
  Serial.println("Scan your card...");
}

void loop() {
  // Check for new card
  if (!rfid.PICC_IsNewCardPresent() || !rfid.PICC_ReadCardSerial()) {
    return;
  }
  
  // Print card UID
  Serial.print("Card UID: ");
  for (byte i = 0; i < rfid.uid.size; i++) {
    Serial.print(rfid.uid.uidByte[i] < 0x10 ? " 0" : " ");
    Serial.print(rfid.uid.uidByte[i], HEX);
  }
  Serial.println();
  
  // Check if card is authorised
  if (isAuthorised(rfid.uid.uidByte, rfid.uid.size)) {
    grantAccess();
  } else {
    denyAccess();
  }
  
  rfid.PICC_HaltA();
  rfid.PCD_StopCrypto1();
}

bool isAuthorised(byte *uid, byte uidSize) {
  for (int i = 0; i < numCards; i++) {
    bool match = true;
    for (byte j = 0; j < uidSize && j < 4; j++) {
      if (uid[j] != authorisedCards[i][j]) {
        match = false;
        break;
      }
    }
    if (match) return true;
  }
  return false;
}

void grantAccess() {
  Serial.println("ACCESS GRANTED");
  
  digitalWrite(GREEN_LED, HIGH);
  digitalWrite(RED_LED, LOW);
  
  // Two short beeps for access granted
  tone(BUZZER, 2000, 100);
  delay(150);
  tone(BUZZER, 2500, 100);
  
  // Unlock door
  digitalWrite(RELAY_PIN, LOW);
  delay(LOCK_TIME);
  
  // Re-lock door
  digitalWrite(RELAY_PIN, HIGH);
  digitalWrite(GREEN_LED, LOW);
  digitalWrite(RED_LED, HIGH);
  
  Serial.println("Door locked again");
}

void denyAccess() {
  Serial.println("ACCESS DENIED");
  
  // Three long beeps for access denied
  for (int i = 0; i < 3; i++) {
    tone(BUZZER, 500, 300);
    digitalWrite(RED_LED, LOW);
    delay(200);
    digitalWrite(RED_LED, HIGH);
    delay(200);
  }
}

Adding an LCD Display

Adding a 16×2 LCD display makes the system more user-friendly by showing messages like “Scan Card”, “Access Granted”, or “Access Denied” along with the card holder’s name.

🛒 Recommended: 0.96 Inch I2C OLED Display Module — Compact OLED display that shows card status, names, and access logs. Uses only 2 pins (I2C), leaving more pins free for other features.

LCD Code Addition

#include <Wire.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// Add names for each card
String cardNames[] = {"Jayesh", "Priya", "Guest"};

void showMessage(String line1, String line2) {
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 10);
  display.println(line1);
  display.setTextSize(1);
  display.setCursor(0, 40);
  display.println(line2);
  display.display();
}

// In grantAccess(), add:
// showMessage("Welcome!", cardNames[cardIndex]);

// In denyAccess(), add:
// showMessage("DENIED!", "Unknown card");

Solenoid Lock vs Servo Lock

You have two options for the physical locking mechanism:

Solenoid Lock (Recommended for Doors)

  • Pros: Strong holding force, fail-secure (locks when power is off), professional look
  • Cons: Requires 12V power supply, draws 0.5–1.7A when activated
  • Best for: Main doors, office doors, cabinets
  • Price: ₹200–₹500

Servo Motor Lock (Good for Cabinets)

  • Pros: Runs on 5V (no extra power supply), quiet operation, low cost
  • Cons: Lower holding force, requires mechanical adaptation
  • Best for: Drawers, small cabinets, letter boxes
  • Price: ₹80–₹150 for SG90 servo
🛒 Recommended: 125KHz RFID Cards (Pack of 5) — Extra RFID cards for distributing to family members, tenants, or office staff. Works with RDM6300 readers.

Adding Security Features

A basic RFID lock is functional, but adding these security features makes it robust enough for real-world use:

1. Brute-Force Protection

After 5 consecutive failed attempts, lock the system for 5 minutes:

int failedAttempts = 0;
unsigned long lockoutUntil = 0;

// In loop():
if (millis() = 5) {
  lockoutUntil = millis() + 300000; // 5 minutes
  failedAttempts = 0;
  // Sound alarm
}

2. Access Logging

Log every access attempt (successful and failed) with timestamps to an SD card or EEPROM for audit purposes.

3. Master Card

Designate one card as the “master card” that can add or remove other cards from the authorised list without reprogramming the Arduino.

4. Emergency Override

Add a hidden push button inside the room for emergency exit even if the system malfunctions.

Frequently Asked Questions

Can someone clone my RFID card?

Basic 13.56MHz MIFARE Classic cards (used with RC522) can be cloned with specialised equipment. For higher security, use MIFARE DESFire or NFC-based cards that have encryption. For home use, the basic MIFARE cards are generally sufficient.

What happens during a power cut?

With a solenoid lock, the door remains locked during power cuts (fail-secure). Add a backup battery (12V lead-acid or lithium) with a charging circuit for uninterrupted operation. Alternatively, install a manual key lock as backup.

Can I use this with a wooden door?

Yes. Mount the solenoid lock on the door frame, and the latch mechanism on the door. Most 12V solenoid locks come with mounting screws suitable for both wooden and metal frames.

How far away can the card be read?

The RC522 module reads cards at 3–5 cm distance. This is intentional for security — it prevents accidental or unauthorised reads from a distance.

Can I add a keypad as backup?

Yes. Add a 4×4 matrix keypad and implement a PIN code alongside RFID. This gives dual authentication or a fallback when you forget your card.

Conclusion

An RFID-based smart door lock is a practical, affordable security upgrade for any Indian home or office. At under ₹1,500 in total component cost, it offers keyless convenience with features that rival commercial smart locks costing ₹5,000–₹15,000. The Arduino platform makes it endlessly customisable — add WiFi logging, fingerprint sensors, or integrate it with your smart home system as your needs grow.

Start building your RFID access control system today with components from Zbotic.in. Browse our RFID modules, Arduino boards, and solenoid locks — all with fast delivery across India.

Tags: Arduino, Door Lock, rfid, security, smart home
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Racing vs Freestyle vs Photogr...
blog racing vs freestyle vs photography drone which to build 612503
blog lorawan gateway build the things network india coverage 612506
LoRaWAN Gateway Build: The Thi...

Related posts

Svg%3E
Read more

MQTT for Home Automation: ESP32 + Mosquitto + Home Assistant

April 1, 2026 0
MQTT is the backbone protocol of professional home automation systems. If you are building a smart home with multiple ESP32... Continue reading
Svg%3E
Read more

Curtain and Blind Automation: Stepper Motor Controller

April 1, 2026 0
Curtain automation is one of the most satisfying smart home upgrades you can build. Imagine your curtains opening automatically at... Continue reading
Svg%3E
Read more

Smart Doorbell with Camera: ESP32-CAM Video Intercom

April 1, 2026 0
A smart doorbell with a camera lets you see who is at your door from your phone, even when you... Continue reading
Svg%3E
Read more

Blynk IoT Platform: Control Arduino and ESP32 from Mobile

April 1, 2026 0
The Blynk IoT platform is the fastest way to control your Arduino and ESP32 projects from your mobile phone. Instead... Continue reading
Svg%3E
Read more

PIR Sensor Automatic Light: Save Electricity with Motion Detection

April 1, 2026 0
PIR sensor automatic lights are the simplest and most effective way to save electricity in Indian homes. By automatically turning... Continue reading

Add comment Cancel reply

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

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now