. RFID Based Door Lock System using Arduino UNO ~ SmartElectronicsDIY

RFID Based Door Lock System using Arduino UNO


 In today’s digital era, security is a major concern for homes, offices, and institutions. The RFID Based Door Lock System using Arduino UNO is a smart and efficient solution that replaces traditional keys with contactless RFID cards or tags. This system provides enhanced security, ease of use, and reliability at a low cost.

The core of the project is the Arduino UNO microcontroller, which controls the entire system. An RFID reader (such as MFRC522) scans the RFID card and reads its unique identification number (UID). When a user brings an authorized RFID card near the reader, the Arduino compares the scanned UID with the stored authorized UID. If the card is valid, the Arduino activates a servo motor or electronic lock to open the door. If the card is unauthorized, access is denied and a buzzer or alert can be triggered.

This system is widely used in modern access control applications because it is fast, secure, and does not require physical contact. It also reduces the risk of key duplication. The RFID door lock system can be further enhanced by adding features such as LCD displays, IoT connectivity, GSM alerts, or fingerprint verification. Overall, this project is an excellent example of how embedded systems can be used to create smart security solutions.


Components Required

ComponentQuantity
Arduino UNO1
RFID Reader (MFRC522)1
RFID Card / Tag1–2
Servo Motor (SG90)1
Buzzer (optional)1
LED (Green/Red – optional)2
Jumper WiresAs needed
Breadboard1

🔌 Pin Connections

RFID (MFRC522 → Arduino)

RFID PinArduino Pin
SDAD10
SCKD13
MOSID11
MISOD12
RSTD9
VCC3.3V
GNDGND

Servo Motor

Servo WireArduino
Red5V
BrownGND
YellowD3

Buzzer (Optional)

BuzzerArduino
+D4
GND

⚙️ Working Principle

  1. RFID reader scans the card.

  2. Arduino checks the card UID.

  3. ✅ If UID matches → door opens (servo rotates).

  4. ⛔ If UID doesn’t match → buzzer sounds.

  5. Door closes automatically after a delay.


💻 Arduino Code

#include <SPI.h> #include <MFRC522.h> #include <Servo.h> #define SS_PIN 10 #define RST_PIN 9 #define BUZZER 4 MFRC522 rfid(SS_PIN, RST_PIN); Servo door; byte authorizedUID[4] = {0xDE, 0xAD, 0xBE, 0xEF}; // Change to your card UID void setup() { Serial.begin(9600); SPI.begin(); rfid.PCD_Init(); door.attach(3); door.write(0); // Door closed pinMode(BUZZER, OUTPUT); Serial.println("RFID Door Lock Ready..."); } 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"); door.write(90); // Open door delay(3000); door.write(0); // Close door } else { Serial.println("Access Denied"); digitalWrite(BUZZER, HIGH); delay(1000); digitalWrite(BUZZER, LOW); } rfid.PICC_HaltA(); }

📐 Block Diagram (Text)

RFID Card ↓ RFID Reader (MFRC522) ↓ Arduino UNO ↓ ↓ Servo Buzzer (Door) (Alert)

🚪 Applications

  • Home security systems

  • Office access control

  • School/college labs

  • Hotel room locking

  • Smart door systems


0 comments:

Post a Comment