Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Smart Door Lock System with RFID and Keypad

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Smart Door Lock System with RFID and Keypad

Circuit Documentation

Summary

This circuit is a comprehensive door lock system that integrates various components such as LEDs, a fan, a piezo buzzer, a servo motor, an LCD screen, an RFID reader, and a membrane keypad. The system is controlled by an Arduino UNO microcontroller. The circuit is designed to detect motion, read RFID tags, accept password input via a keypad, and control a servo motor to lock or unlock a door. It also provides visual and auditory feedback using LEDs and a buzzer.

Component List

  1. LED: Two Pin (red)

    • Pins: cathode, anode
    • Description: Red LED for visual indication.
  2. LED: Two Pin (green)

    • Pins: cathode, anode
    • Description: Green LED for visual indication.
  3. LED: Two Pin (white)

    • Pins: cathode, anode
    • Description: White LED for visual indication.
  4. Fan

    • Pins: GND, 5V
    • Description: Fan for air circulation.
  5. Arduino UNO

    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
    • Description: Microcontroller for controlling the circuit.
  6. Piezo Buzzer

    • Pins: pin 1, pin 2
    • Description: Buzzer for auditory feedback.
  7. LCD screen 16x2 I2C

    • Pins: SCL, SDA, VCC, GND
    • Description: LCD screen for displaying messages.
  8. RFID-RC522

    • Pins: VCC (3.3V), RST, GND, IRQ, MISO, MOSI, SCK, SDA
    • Description: RFID reader for reading RFID tags.
  9. Servo

    • Pins: GND, VCC, PWM
    • Description: Servo motor for controlling the door lock.
  10. 4X4 Membrane Matrix Keypad

    • Pins: R1, R2, R3, R4, C1, C2, C3, C4
    • Description: Keypad for password input.

Wiring Details

LED: Two Pin (red)

LED: Two Pin (green)

LED: Two Pin (white)

Fan

Arduino UNO

Piezo Buzzer

LCD screen 16x2 I2C

RFID-RC522

Servo

4X4 Membrane Matrix Keypad

Code Documentation

#include <Servo.h> 
#include <LiquidCrystal_I2C.h> 
#include <Keypad.h> 
#include <Password.h> 
#include <SPI.h> 
#include <MFRC522.h>  

#define buzzer A3 
#define ledr A2 
#define ledg A1 
#define SS_PIN 10  
#define RST_PIN 9  
#define PIR_PIN 1  
#define HOME_LED 0 

String UID2 = "B3 06 14 32"; 
String UID1 = "43 D1 16 BE"; 
String UID0 = "76 C4 52 00"; 

Servo servo; 

LiquidCrystal_I2C lcd(0x27, 16, 2); 
MFRC522 rfid(SS_PIN, RST_PIN); 

String newPasswordString; 
char newPassword[6];  

byte a = 5; 
byte lock = 0; 
bool value = true; 
int state; 

Password password = Password("0657"); 
byte maxPasswordLength = 6; 
byte currentPasswordLength = 0; 

const byte ROWS = 4;  
const byte COLS = 4; 

char keys[ROWS][COLS] = { 
  {'1', '2', '3'}, 
  {'4', '5', '6'}, 
  {'7', '8', '9'}, 
  {'*', '0', '#'}, 
}; 

byte rowPins[ROWS] = {8, 7, 6, 5}; 
byte colPins[COLS] = {4, 3, 2}; 
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS); 

void setup() { 
  Serial.begin(9600); 
  pinMode(ledr, OUTPUT); 
  pinMode(ledg, OUTPUT); 
  pinMode(buzzer, OUTPUT); 
  pinMode(PIR_PIN, INPUT); 
  pinMode(HOME_LED, OUTPUT); 
  SPI.begin(); 
  rfid.PCD_Init(); 
  servo.attach(A0); 
  digitalWrite(9, HIGH); 
  servo.write(0); 
  lcd.init(); 
  lcd.backlight(); 
  lcd.setCursor(3, 0); 
  lcd.print("WELCOME TO"); 
  lcd.setCursor(0, 1); 
  lcd.print("DOOR LOCK SYSTEM"); 
  delay(3000); 
  lcd.clear(); 
} 

void loop() { 
  if (digitalRead(PIR_PIN) == HIGH) {
    digitalWrite(HOME_LED,