Capstone
Capstone
JONDHALE POLYTECHNIC
DOMBIVLI (W)
A Microproject Report on
“Prepare a door lock system using
Arduino.”
Under Guidance: -
Ms. Shraddha Tayade
1
MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION
CERTIFICATE
2
ACKNOWLEDGEMENT
3
Index
4
ABSTRACT
This project presents the design and implementation of an
Arduino-based door lock system aimed at enhancing security
through customizable, electronic access control. The system
utilizes an Arduino microcontroller, a 4x4 matrix keypad, a
servo motor for locking/unlocking, and optionally, an RFID or
Bluetooth module for additional authentication methods. The
core objective of this project is to replace traditional
mechanical locks with a more flexible, secure, and easily
customizable electronic solution that is suitable for residential,
office, or personal use. The door lock system is designed to
authenticate users through a passcode, which is entered via
the keypad. When the correct code is entered, the Arduino
microcontroller triggers the servo motor to unlock the door,
providing access to the user. The system also allows for remote
control and monitoring through Bluetooth or RFID, giving users
additional flexibility in managing access. This setup can be
enhanced with features like automatic door locking, logging of
access events, or integration with a mobile app for real-time
notifications and remote control.The Arduino-based design
offers advantages in terms of cost, customization, and
expandability, as users can easily modify the software and
hardware to meet specific security needs. However, it also
faces challenges such as security vulnerabilities, reliability
concerns, and limited scalability in larger installations.
Nevertheless, with careful design and appropriate
precautions, this system offers a robust and accessible solution
for modern access control needs.
5
I. INTRODUCTION
6
Circuit Diagram
7
How this door lock system works ?
When powering this door lock, the servo motor activates and
pushes the door lock forward. Also displayed as “Welcome, put
your card” on the LCD. When the RFID tag is moved closer to
the RFID reader, it is scanned. In that case, it is displayed as
“scanning” on the LCD. Then, if the RFID tag is correct, the
servo motor is activated and the door lock is pulled back. The
LCD shows “Door is Open”. When the RFID tag is moved closer
to the RFID reader again, if it gets the correct tag, the servo
motor will push the lock forward. Displays “Door is locked” on
LCD. If a wrong RFID tag is used according to the program, it
will be displayed as “Wrong card” on the LCD.
The Arduino door lock system operates based on a simple
user authentication process where the user enters a passcode
through a keypad. The Arduino verifies the entered passcode,
and if it matches the predefined correct passcode, it activates
a servo motor (or solenoid lock) to unlock the door. If the
passcode is incorrect, the system provides feedback through
a buzzer or an LED indicator.
8
Step-by-Step Working Process
1. Initialization:
o The system starts when power is supplied to the
Arduino board.
o The system is in a locked state, and the door is
secured by the servo motor or electric lock.
2. User Input:
o Keypad Input: The user is prompted to enter a
passcode using the 4x4 matrix keypad. The
passcode is typically hard-coded in the Arduino
program or stored in EEPROM.
o RFID Input: If an RFID system is used, the user
scans an RFID tag (card or fob), and the system
reads the unique ID of the tag.
o Bluetooth Input: If Bluetooth is integrated, the user
can use their smartphone to send an unlock signal
via an app or Bluetooth interface.
3. Authentication:
o The Arduino processes the input from the keypad,
RFID, or Bluetooth.
o The system compares the entered passcode or
scanned RFID ID with the stored passcode or RFID
credentials.
9
o Correct Passcode: If the input matches the stored
credentials, the system proceeds to unlock the
door.
o Incorrect Passcode: If the input does not match,
the system may activate a buzzer to alert the user
of an invalid entry, and the door remains locked.
4. Unlocking the Door:
o Upon successful authentication, the Arduino sends
a signal to the servo motor or electronic lock to
unlock the door.
o If using a servo motor, it physically rotates to move
the locking mechanism, thus allowing the door to
open.
o If using an electric lock, the system sends a signal to
disengage the lock (often by energizing or de-
energizing the lock mechanism).
5. Feedback to User:
o LCD Display (if included): It can display messages
such as "Access Granted" or "Incorrect Code."
o Buzzer or LED: The system may emit a short beep
or flash a green LED to indicate that access has
been granted, or a red LED with a long beep for an
incorrect passcode.
6. Re-locking the Door:
o After a certain time, the system can automatically
re-lock the door. This could be based on a timer or
10
when the door is closed. For added security, the
system could be programmed to lock after a certain
delay, ensuring that the door is not left open
unintentionally.
7. Security and Logging:
o In some systems, the Arduino can maintain a log of
successful or failed attempts. For example, every
time the door is unlocked, the system could store
the time and date, or the RFID tag used, in the
Arduino’s memory or an external storage medium
(like an SD card).
o Mobile App (if integrated): With Bluetooth or Wi-Fi
integration, users can check the status of the door
(locked/unlocked) and control the door remotely
via a smartphone application.
11
METHODOLOGY
13
Example Circuit
Here’s an example of how to wire a 4x4 keypad to an
Arduino:
Keypad Pin Arduino Pin
R1 Pin 9
R2 Pin 8
R3 Pin 7
R4 Pin 6
C1 Pin 5
C2 Pin 4
C3 Pin 3
C4 Pin 2
14
3. SERVO MOTOR
A servo motor is a simple electric motor which is controlled
by servomechanism. When a DC motor is used as a controlled
device in conjunction with a servo mechanism, it is referred
to as a DC Servo Motor. AC Servo-Motor refers to a controlled
motor that is powered by AC
16
4. Jumper Wires
Simple terms, jumper wires are wires with connection pins on
both ends. A jumper wire is sometimes referred to as a jumper,
a jumper cable, a DuPont, or a cable. Without soldering,
jumper wires are used to connect electronic components or a
test circuit. Jumper wires come in a variety of colours, and the
fact that they all work the same colors doesn't mean anything.
The end points of male jumper wires have a pin that is used to
connect to other components, whereas female jumper wires
do not. Female jumper wires do not have pins on their ends
and are used to plug into items. The most common type of
jumper wire used to connect components is male-to-male
jumper wires.
17
FLOW CHART
18
Programming code for working of door lock
system
#include <Servo.h>
#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
#include <Password.h>
#define buzzer 11
Servo servo;
LiquidCrystal_I2C lcd(0x27, 16, 2);
byte maxPasswordLength = 6;
19
byte currentPasswordLength = 0;
const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns
char keys[ROWS][COLS] = {
{'D', 'C', 'B', 'A'},
{'#', '9', '6', '3'},
{'0', '8', '5', '2'},
{'*', '7', '4', '1'},
};
void setup() {
Serial.begin(9600);
pinMode(buzzer, OUTPUT);
20
servo.attach(10);
servo.write(50);
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() {
lcd.setCursor(1, 0);
lcd.print("ENTER PASSWORD");
}
}
void dooropen() {
if (password.evaluate()) {
digitalWrite(buzzer, HIGH);
delay(300);
digitalWrite(buzzer, LOW);
servo.write(50);
delay(100);
lcd.setCursor(0, 0);
lcd.print("CORRECT PASSWORD");
lcd.setCursor(0, 1);
lcd.print("DOOR OPENED");
delay(2000);
lcd.clear();
a = 5;
23
} else {
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(200);
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(200);
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(200);
lcd.setCursor(0, 0);
lcd.print("WRONG PASSWORD!");
lcd.setCursor(0, 1);
lcd.print("PLEASE TRY AGAIN");
delay(2000);
lcd.clear();
a = 5;
}
resetPassword();
24
}
void resetPassword() {
password.reset();
currentPasswordLength = 0;
lcd.clear();
a = 5;
}
void doorlocked() {
if (password.evaluate()) {
digitalWrite(buzzer, HIGH);
delay(300);
digitalWrite(buzzer, LOW);
servo.write(110);
delay(100);
lcd.setCursor(0, 0);
lcd.print("CORRECT PASSWORD");
lcd.setCursor(2, 1);
lcd.print("DOOR LOCKED");
delay(2000);
lcd.clear();
25
a = 5;
} else {
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(200);
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(200);
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(200);
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(200);
lcd.setCursor(0, 0);
lcd.print("WRONG PASSWORD!");
lcd.setCursor(0, 1);
lcd.print("PLEASE TRY AGAIN");
26
delay(2000);
lcd.clear();
a = 5;
}
resetPassword();
}
27
Advantages of Using an Arduino-Based Door
Lock System
1. Cost-Effective
Affordable Hardware: Arduino boards, keypads, motors (like
servos), and other components are relatively inexpensive
compared to proprietary electronic or biometric lock systems.
2. Customizable and Flexible
Easily Adjustable: The software is open-source, which allows
you to modify it according to your needs.
3. Enhanced Security
Passcode Protection: The most basic Arduino door lock system
can be secured with a passcode.
4 .Remote Access (IoT Capabilities)
Mobile App Integration: You can create a mobile application
that interfaces with the Arduino lock system, allowing you to
control the lock from anywhere with an internet connection.
5. Control via Multiple Inputs
Fingerprint Scanners: Adding a fingerprint scanner makes the
system even more secure and personal, ensuring that only
authorized users can unlock the door.
6. Easy to Maintain and Repair
Replaceable Parts: Since Arduino-based systems use
commonly available components (keypad, servo, sensors,
etc.), any faulty parts are easy to replace and inexpensive.
28
Disadvantages of Using an Arduino-Based
Door Lock System
1. Security Vulnerabilities
Susceptibility to Hacking: If the Arduino-based system is
connected to the internet (e.g., via Wi-Fi or Bluetooth), it could
be vulnerable to cyberattacks.
2. Reliability Concerns
Power Loss : If the power is cut off (e.g., due to a power failure,
battery depletion, or wiring issue), the system may stop
functioning.
3. Limited User Support
Technical Support: Unlike commercial systems, Arduino-based
door lock systems do not come with professional customer
support. If something goes wrong, you’ll need to rely on your
own troubleshooting skills or community support.
4. Complexity for Non-Technical Users
Requires Technical Knowledge: While Arduino is great for
hobbyists and developers, it may not be the best solution for
someone without technical skills.
5. Limited Power Options and Backup
Power Dependency: Arduino-based systems typically require
an external power source. If you're using a battery, you'll need
to ensure it is adequately charged and that the system has low
power consumption.
29
Future Scope of Door Lock Systems Using
Arduino
30
Applications of Arduino :
Arduino-based door lock systems have a wide range of
applications across various fields due to their flexibility,
affordability, and ease of customization. Below are several
key applications of door lock systems using Arduino:
1. Home Security System : Smart Home Integration, Keypad
Entry
2. Industrial/Commercial Access Control : Employee Access
Control, Time-Based Locking
3. Student Dormitories or Hostels : Remote Access
Management, RFID or Card-Based System
4. Office Buildings : Multi-User Access, Logging and Audit
Trail:
5. Hotel Room Access : Electronic Room Keys, Personalized
Access Control
6. Smart Lock Systems : Bluetooth and Smartphone
Integration, Geofencing
7. Emergency or Safety Doors : Fail-Safe Mechanisms,
Manual Override
8. Garage Doors and Gates : Automatic Garage Door
Systems, Automated Gate Systems
9. Access Control for Vehicles : Car Security
10. Hospital or Healthcare Settings : Sensitive Area Access,
Patient Privacy
31
Conclusion
32