Automated Door Lock System

Automated Door Lock System Using Arduino

This automated door lock system is designed to enhance security by using an Arduino microcontroller, a servo motor, and an RFID or keypad module to control access.

Key Components & Their Roles

  1. Arduino Uno/Nano – Microcontroller that processes input and controls the locking mechanism.
  2. Servo Motor – Moves the lock mechanism based on authentication.
  3. RFID Module or Keypad – Allows users to unlock the door using an RFID card or password.
  4. LCD Display (Optional) – Shows status messages like “Access Granted” or “Access Denied.”
  5. Buzzer – Provides an audible alert when access is granted or denied.
  6. Relay Module (Optional) – Can control an electromagnetic lock for enhanced security.
  7. Power Supply (9V or 12V) – Provides power to the system.

Working Principle

  • The RFID module or keypad receives user input.
  • The Arduino processes the input and compares it with stored credentials.
  • If the input matches, the servo motor rotates to unlock the door.
  • If the input does not match, the buzzer sounds and access is denied.
  • The LCD display (if included) shows relevant messages.

Wiring Connections

ComponentArduino Pin
RFID Module SDAD10
RFID Module SCKD13
RFID Module MOSID11
RFID Module MISOD12
Servo Motor SignalD9
Buzzer PositiveD8
Buzzer GroundGND
LCD Display (I2C)A4 (SDA), A5 (SCL)

Arduino Code Example

#include <Servo.h>

Servo myServo;            // Create a servo object
int irSensorPin = 2;      // IR sensor output pin
int ledPin = 8;           // LED pin
int buzzerPin = 9;        // Buzzer pin
int servoPin = 3;         // Servo motor control pin
int personDetected = 0;   // Variable to store IR sensor value

void setup() {
  pinMode(irSensorPin, INPUT);
  pinMode(ledPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  myServo.attach(servoPin);
  myServo.write(0);       // Initial position (Locked)
  Serial.begin(9600);
}

void loop() {
  personDetected = digitalRead(irSensorPin);

  if (personDetected == HIGH) {       // If person detected
    digitalWrite(ledPin, HIGH);       // Turn on LED
    myServo.write(90);                // Unlock position (90 degrees)
    Serial.println("Door Unlocked!");
    delay(5000);                      // Keeps the door unlocked for 5 seconds
    myServo.write(0);                 // Lock the door again
    digitalWrite(ledPin, LOW);        // Turn off LED
    Serial.println("Door Locked!");
  } else {
    digitalWrite(buzzerPin, HIGH);    // Activate buzzer if access attempt fails
    delay(1000);
    digitalWrite(buzzerPin, LOW);
    Serial.println("Unauthorized Access Attempt!");
  }

  delay(1000);                        // Small delay for sensor stabilization
}
Automated-Door-Lock-System_watermark

Advantages of This System

Enhanced Security – Prevents unauthorized access.
Customizable Access Methods – Supports RFID, keypad, or fingerprint modules.
Low Power Consumption – Operates efficiently with minimal energy.
Easy to Build – Uses basic electronic components.

Leave a Reply

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

More Articles & Posts