
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
- Arduino Uno/Nano – Microcontroller that processes input and controls the locking mechanism.
- Servo Motor – Moves the lock mechanism based on authentication.
- RFID Module or Keypad – Allows users to unlock the door using an RFID card or password.
- LCD Display (Optional) – Shows status messages like “Access Granted” or “Access Denied.”
- Buzzer – Provides an audible alert when access is granted or denied.
- Relay Module (Optional) – Can control an electromagnetic lock for enhanced security.
- 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
Component | Arduino Pin |
---|---|
RFID Module SDA | D10 |
RFID Module SCK | D13 |
RFID Module MOSI | D11 |
RFID Module MISO | D12 |
Servo Motor Signal | D9 |
Buzzer Positive | D8 |
Buzzer Ground | GND |
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
}
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