You are on page 1of 33

A Project Report on

Password Based Door Lock System


Submitted by

Ananya Rana (1704331014)

Under the guidance of

Dr. Mahendra Kumar

In partial fulfillment of the


requirements for the award of the
degree of

BACHELOR OF TECHNOLOGY

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING
BUNDELKHAND INSTITUTE OF ENGINEERING AND
TECHNOLOGY, JHANSI, INDIA
2021-2022

1
Declaration
We hereby proclaim that the work that is being presented in this report entitled “Password
Based Door Lock System” is our own original work and has not been re- ported by
anyone else or submitted in any form for another degree or diploma to any other
institution. Information derived from the other sources has been accredited in thetext and
a list of references has been given.

Ananya Rana
Roll no.1704331014

Certificate
This is to certify that the project report entitled “Password Based Door Lock
System” submitted by Ananya Rana for the award of the degree of B. Tech., is
carried out by them under my guidance.

Dr. Mahendra Kumar


Department of ECE, BIET Jhansi

Verification
This is to verify that the project entitled “Password Based Door Lock System”
submitted in department of Electronics and communication engineering department of
Bundelkhand Institute of Engineering and Technology, Jhansi.

Dr. Atul Kumar Dwivedi Prof. Deepak Nagaria


Officer in Charge, B. Tech. Projects Head of Department

ii
DEDICATION

To my beloved Parents and almighty

iii
Project Outcomes (Ps)

S. N. Project outcomes Bloom’s


After completing this project students will be able to knowledge
level

P1 Understand the working of Arduino AT mega 328P KL3


P2 Apply the knowledge of electronics in order to find the most efficient KL3
sensors and suitable microcontroller.
P3 Analyse the inputs and outputs for reaching the most accurate results. KL4
P4 Evaluate developed system for number of users by testing it several KL5
times.
P5 Design connections diagram of the system and creating a path of com- KL6
munication

KL: Bloom’s knowledge level, KL1: remember, KL2: Understand, KL3: Apply,
KL4: Analyze, KL5: Evaluate, KL6: Create/Design

iv
Acknowledgment
It is my great pleasure to acknowledge the support and encouragements I have received
from the people along the way of the research work. First and foremost, I would like
to express my heartiest Above all, with all humility; I offer my deepest feelings of grat-
itude to the blessings and mercy of the Supreme Person for providing me everything I
need. We would like to express our sincere thanks and deep sense of gratitude towards
Dr. Mahendra Kumar, Department of Electronics and communication engineering,
who has not only helped us in enhancement of my technical knowledge regarding sub-
ject topic but also taken us to zenith where we could reset our views and exhibit our
talent in front of others. The enthusiastic crystal-clear view on the format and layout
and presentation helped us immensely.

Ananya Rana
Roll no.1704331014

v
ABSTRACT

KEYWORDS: Arduino Uno, Keypad Lock, Security, Servomotor.

As technology advances and expands on a daily basis, safety becomes increasingly essential in all
disciplines. Everyone desires a private place where no one can enter without their permission, thus
we need to secure our room, office, locker, etc. that preserve our valuable accessories, documents,
data, and jewelry, and for that purpose, the proposed work has developed a "Password based door
lock system by using Arduino.". This device is a digital door lock with a password or pin code,
which prevents the user from opening the door unless they input the correct password or pin code.

In this day and age, security has become of an utmost importance, be it one’s house, car or their
digital accounts. The solutions currently available in the market are satisfactory but high security
solutions come at an expensive price. Hence, an economically feasible security system has become
the need of the hour.
In this paper, we present an electronically controlled door locking system that employs Arduino,
an open source microcontroller board that can sense, monitor, store and control applications. This
system also employs an IoT based log that monitors the entry and exit of the users.

vi
TABLE OF CONTENTS

Page

ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Vi

LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iX

ABBREVIATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Xi

CHAPTER 1: Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1.1 BACKGROUND AND MOTIVATION . . . . . . . . . . . . . . . . 14


1.2 Project Outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.3 A brief outline of the project. . . . . . . . . . . . . . . . . . . . . . . . 15
1.4 problem statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.5 Aim and objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.6 Scope of project . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

CHAPTER 2: Literature Review. . . . . . . . . . . . . . . . . . . . . . . 17

2.1 Literature Survey. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17


2.2 Justification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.3 Objectives of the project. . . . . . . . . . . . . . . . . . . . . . . . . . 19

CHAPTER 3: Methodology and modeling. . . . . . . . . . . . . . . . . . 20

3.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2 Working Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.1 Process of work. . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3 Important components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.4 Implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

vii
Table of Contents (continued) Page
3.5 Test experimental setup. . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3.6 Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

CHAPTER 4: Results and Discussion . . . . . . . . . . . . . . . . . . . . 31

4.1 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

CHAPTER 5: Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . 33

CHAPTER 6: Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34

viii
List of Figures

S.No. Title Page No.

3.1 Arduino UNO 21

3.2 Keypad (4*4 matrix) 21

3.3 PWM Powered Servo Motor 22

3.4 16*2 LCD Display 22

3.5 PCB 23

3.6 LCD 23

3.7 Resistor 24

3.8 Jumper Wire 24

3.9 ULN2003A 25

3.10 Relay 5V 25

3.11 Phone keypad connected with Arduino Board 26

3.12 16*2 Alphanumerical Display connected with Arduino Board 26

3.13 Complete Circuit Diagram In Proteus 27

4.1 After Simulation run successfully 31

4.2 Giving passwords by keypad 31

4.3 On giving Correct Password 31

4.4 Timeout After Entering 32

4.5 On giving Wrong Password 32

viii
Major contributions
The main objective of this project is to provide a:-
 This simple circuit can be used at residential places to ensure better safety.
 It can be used at organizations to ensure authorized access to highly secured places.
 With a slight modification this Project can be used to control the switching of loads through
password.

ix
ABBREVIATIONS

LCD Liquid crystal Display


LED Light Emission Diode

ix
ix
CHAPTER 1

INTRODUCTION

1.1 BACKGROUND AND MOTIVATION

Security has become a major concern in the twenty first century; everybody wants to feel safe
at his or her own home, workplace and a safe environment as a whole. Smart door security
system using Arduino and Bluetooth application is a project aimed at increasing and
advancing the safety and security of lives and property of the people. The project deals
primarily with the protection of doors and making it more secured within our houses, office
or public related buildings. With the help of smart door, when indoors or while you are away
from your home and workplace, the doors are protected primarily to grant access to only
authorized persons using their smartphone and Bluetooth application. With the advancement
of technology smartphone has become a household requirement. As of 2007 smartphones
were not more than two percent of phone industries, but in 2009 the smartphone world has
taken more than fifty percent of phone market. With this it is quite logical to say that there is
at least a Smartphone owner in every house. With this smartphone we can simply interface it
with an arduino (microcontroller) to keep our houses and offices safer and more secure with a
single click to lock or unlock the resulting door.

The term "door lock" refers to a device that prohibits a door from being opened and that can
only be opened with a key, fingerprint, retina scanner, smartcard, or other similar device.
Door locks have played a vital role in human life for a long time. As the rate of theft rises,
security has become a top priority in recent years. Door locks are intended to keep us and our
belongings safe and secure from thieves. People used to lock home doors with physical keys,
and they required the key to unlock doors. If they lost the key, it was unlikely to repair, and it
was expensive. Now, those door lock systems may be replaced with new locking
technologies. The Arduino Uno, Servo motor, 4*4 keypad module, and jumper wires
comprise the password-based door lock system. In this project, we will use the keypad to
enter a password and then use the servo motor to open the door lock. The Arduino is the
program's brain, controlling the entire system. The password or pin code is entered using the
4*4 keypad module. The servo motor pushes (locks) or pulls (unlocks) the door's latch.

Password Based Door Lock System is designed using ARDUINO UNO where in once the
correct code or password is entered, the door is opened and the concerned person is allowed
access to the secured area. The idea came to bring some security after the incident of loot
came in vast number.
In normal locks it is easy to make the keys (duplicate keys) with which a person can easily
enter into someone’s house.

14
1.2 Project Outcomes

The PO of this project is to research and analyze a suitable collection of components for
developing a smart lock using Arduino that provides excellent security and quick access. The
following are the specific project goals:
 Familiarity with a smart door locking system based on a microcontroller.
 Using Arduino to create a simple and smart door locking system.

1.3 A brief outline of the report

This project is divided into 5 chapters:


 Chapter 1 presents the background of study and motivation of this project. Chapter
one also presents objectives and a brief outlines.
 Chapter 2 provides the literature review of this project.
 Chapter 3 introduces the project methodology and modeling like working principle,
process of work, component and implantation, testing and cost analysis.
 Chapter 4 presents the results and discussions of this project, also the simulation and
experimental results.
 Chapter 5 concludes the project.

1.4 Problem Statement


In order to make sure that every door is safe people now look for counter measures to protect
their doors. With the vast and different forms of keeping doors locked from unauthorized
persons many people tend to use low means of protection. Meanwhile the deployment is of
more advanced technology like the use of smart door security is a step forward. This project
aims to keep doors safe and also ease access.

1.5 Aim and Objectives


The aim of this project is to design and implement a smart door security system using arduino
and keypad application that could help advance the protection of doors at home and public
buildings
• Designing of a smartphone application to control the movement of doors.
• Interfacing of arduino Uno with the smartphone via Bluetooth module to establish a
connection between the arduino the smartphone.
• Controlling the position of a servo motor to open or close a door which I controlled and
processed due to the response of the microcontroller.

15
1.6 Scope of the project
The project is about interacting with component and devices with the help of AT Mega
(Arduino Uno). The project is limited to performing the task of opening and closing of 3
doors precisely main entrance doors of a building. It is not designed for the purpose of
surveillance in a home or any building nor is it a burglar alarm that alarms you in any case of
perimeter bridging it’s only limited to performing the task of opening and closing.

16
Chapter 02

Literature Review

2.1 Literature Survey

There are just a few digital approaches for door security locks in the current system. This
contemporary smart locking system takes the place of the classic lock and key locking
method. Modern living is largely reliant on technological advancements, such as opening
doors, managing the air conditioning, and regulating the curtains. People want to feel safe in
their own homes, offices, and stores. The primary motivation for the development of smart
locks is to meet the needs of people. Some of these systems will be discussed in this section.

Fingerprint Locking System


A fingerprint locking system is a locking system that uses a fingerprint sensor module to
secure the user's fingerprint. The fingerprint sensor module uses an Arduino or a Raspberry
Pi to operate. In the proposed system, there is three-level security. Any two levels of security
users have to face to unlock the system. This is the ideal option for avoiding the hassles of a
stolen or lost key or illegal access. The authorized user must register his or her fingerprint in
the system. The registered person's mobile number is then added to GSM, and a permanent
image password is assigned to this user. As a first step, the unauthorized individual must
choose unauthorized as the user type. The admin receives a random picture. The person must
properly choose the random image. Otherwise, the system will go back to the first page.

Internet of Things
The internet of things, or IoT, is a wireless links that works in a door lock. With the help of
IoT-enabled applications, the user may unlock the door with his smartphone. The servo
library is introduced after the application is developed by creating a string variable that
contains the unique device ID for the lock. The essential concept underlying the door lock's
operation is the ID supplied by the Android phone via the created app.

Knock-Pattern Using Arduino and GSM Communication


This system, which consists of Arduino, GSM Module, Servo Motor, and other components,
employs a ‘Secret Knocking Pattern' that is only known by the owner of the safe, luggage, or
other property or item on which the device is mounted. For the lock to open, the knocking
pattern must be used only at a certain location, which is only known by the owner. The secret
pattern can only be changed after the secret knock has been unlocked. Because there is no key
to be copied, this approach fully eliminates the worry of duplication.

Keyless Entry System Based on Arduino Board with Wi-Fi Technology


A keyless entry system that focuses on the use of an Arduino circuit board, a Wi-Fi module,
and the PHP programming language to provide access to a closed door. The suggested
solution, which uses an Arduino Uno board and a Wi-Fi shield to unlock the door without a
key, is described. The internet connection allows the system to unlock the door from any
place, unlike traditional systems, which have a limited range.

17
RFID Based Access Control System
A magnetic door lock is administered through an RFID reader in the suggested system, which
begins the authentication and validation of the user or regulates access in short. In addition,
the systems keep track of each user's access and exit records in the form of a log report for
each access. To avoid unforeseen circumstances, the administrator of the central subsystem
can terminate the validity of any user at any moment.

Passwords aren't a novel concept when it comes to locking doors. However, as technology
advances, these systems have become more sophisticated.
 Akshaya Krishnadas Bhat: - This article illustrates how a password-protected door
lock can be used in a variety of settings, including the home, office, and desk. The
system will check the user's entered password for validity before unlocking it for the
authorized user. This method could be a less expensive alternative to expensive door
lock systems that use retina scans, iris scans, or fingerprints, among several other
technologies.
 Prof.A.Y. Prabhakar: - This article shows how an ARDUINO UNO-based password-
based door lock system is created, where the door is unlocked and the user who input
the right code is authorized to enter the zone. And the common individual can bid on
such a locking system for a low price in order to ensure the protection of their
valuables.
 Dr. Manish Kumar: - This study states how we may use an Android-based smart door
lock system to address the issues of unwanted access, trespassing, and instruction.
Also included in this concept is a bluetooth module that serves as a communication
channel between the Arduino Uno and a mobile phone. This application is simple to
set up and maintain.
 Shruti Jalpur: - This paper depicts a secure and protected door lock system, with
network security supplied by the use of cryptographic algorithms such as SHA-128
and SHA-512. The technology also allows the authorized user to access the
information remotely. The user input is encrypted and hashed using the algorithms
AES-128 and SHA-512. If the sensor detects unauthorized access, it will send a
notification to the smart phone application placed on the authorized user's
smartphone.
 Aleksander IBRO: - This article depicts a door lock system that allows users to unlock
the door using face recognition and data stored on the cloud via a camera installed on
the door. This work will be quite costly, and it will necessitate the installation and
employment of qualified experts.
 Shuhad Natashab Bint Mohd Zainot: - "The door entry system utilizing Arduino is
created to overcome cannot be replaced," according to this research. It also saves time
and provides a high level of security.

2.2 Justification
In general terms my project is a more user friendly project with easy access to users. People that have
problems physically like cripples or half paralysis can have access to doors without the help of
anybody not even an assistant, as long as they are in position of smartphone. The physically
challenged persons can open or lock any door they have permission to, or even lock or unlock a door
while sitting on their wheel chairs, resting sofas or sleeping bed.

18
2.3 Objective of the project

The objective of this project is to provide such a security system which is highly secure for
Commercial, Residential, Industrial areas, etc. By using an input device an individual user
enters a Password if the entered Password is matched with the predetermined Password
stored in the data memory of the micro-controller, then the microcontroller sends the input
signal for actuating the dc motor drive in a specific direction required for opening of the door.
If the entered Password doesn’t matched with the predetermined Password then no input
signal generates from the micro-controller to activate the dc motor drive. Hence the door
remains unlock.

19
CHAPTER 3

Methodology and Modeling

3.1 Introduction
In this project, we implemented a Password-Based Security System Using Arduino &
Keypad. As thefts are increasing day by day security is becoming a major concern nowadays.
So a digital code lock can secure our home or locker easily. It will open your door only when
the right password is entered. Only authorized people are allowed access to the restricted
sections due to a password-based door lock mechanism. The Arduino is responsible for the
entire project's operation. The desired password can be entered using a 4×3 keypad.

3.2 Working Principle

3.2.1 Process of Work:


The purpose of this experiment is to implement a door-locking mechanism that opens or
closes the lock on the door automatically with a key code. There are two work processes for
this experiment which are:
Case 1: The lock will open: A Keypad will input values allowing us to compare the values
with the string of integer values that are set in the code. When inputting a code comprising of
integer values with the help of the Keypad, if the string of integer values matches the string of
integer values already fixed in the code, the keypad will send a signal to the display and the
“Code Accepted” message will be shown. If the code is accepted, the Arduino will send a
signal to Servo Motor. The Motor will then rotate 90° and open the lock, allowing the door to
be unlocked.
Case 2: The lock will not open: If the code inserted in the Keypad does not match the fixed
string in the code, the Keypad will send a signal to the Display to show the “Wrong Code”
message. Pressing the wrong values in the Keypad will automatically instruct the user to start
again from the beginning. If the “Wrong Code” message is shown, the Servo Motor will not
rotate and the lock will not open allowing the door to remain locked.

3.3 Important Components

Hardware:
1. Arduino UNO
2. 4×3 Matrix Keypad
3. PWM Powered Servo Motor
4. 16×2 LCD Display
5. PCB
6. LED
7. Resister
8. Jumper wire
9. ULN2003
10. Relay 5V

20
Software:
1. Proteus
2. Arduino IDE

Arduino UNO:
Arduino is an open-source platform used for building electronics projects. Arduino consists
of both a physical programmable circuit board (often referred to as a microcontroller) and a
piece of software, or IDE (Integrated Development Environment) that runs on your computer,
used to write and upload computer code to the physical board. The Arduino platform has
become quite popular with people just starting with electronics, and for good reason. Unlike
most previous programmable circuit boards, the Arduino does not need a separate piece of
hardware (called a programmer) to load new code onto the board -- you can simply use a
USB cable. Additionally, the Arduino IDE uses a simplified version of C++, making it easier
to learn to program. Finally, Arduino provides a standard form factor that breaks out the
functions of the micro-controller into a more accessible package.

Figure 3.1 Arduino Uno

4×3 Matrix Keypad:


This 4x3 matrix keypad has 12 built-in push button contacts connected to row and column
lines. A microcontroller can scan these lines for a button-pressed state. In the keypad library,
the Propeller sets all the column lines to input and all the row lines to input. Then, it picks a
row and sets it high. After that, it checks the column lines one at a time. If the column
connection stays low, the button on the row has not been pressed. If it goes high, the
microcontroller knows which row (the one it set high), and which column, (the one that was
detected high when checked).

Figure 3.2 Keypad (4*4 matrix)

21
PWM Powered Servo Motor:
This servo motor is a rotational or translational motor that receives power from a servo
amplifier and is used to impart torque or force to a mechanical device like an actuator or a
brake. Servo motors provide exact angular position, acceleration, and velocity control. A
closed-loop control system is used with this type of motor. A closed-loop control system
takes the current output into account and adjusts it to the desired state. The output of the
motor drives the control action in these systems. The velocity and final position of the shaft is
controlled by a positive feedback mechanism.In these motors, there are two forms of current
flow: AC and DC. AC servo motors are more typically found in heavy industrial machines
because they can sustain higher current surges. DC Servo Motors from ISL are best suited for
compact applications and provide great control and feedback. The frequency of the applied
voltage and the number of magnetic poles affect the speed of a servo motor.

Figure 3.3 Servo motor

16×2 Alphanumeric Display:


An LCD (Liquid Crystal Display) screen is an electronic display module and has a wide
range of applications. A 16x2LCD is a very basic module and is very commonly used in
various devices and circuits. A 16x2 LCD means it can display 16 characters per line and
there are 2 such lines. In this LCD each character is displayed in a 5x7 pixel matrix. The 16 x
2 intelligent alphanumeric dot matrix display is capable of displaying 224 different characters
and symbols. This LCD has two registers, namely, Command and Data.

Figure 3.4 16*2 LCD Display

22
PCB:
A printed circuit board (PCB) is a laminated sandwich structure of conductive and insulating
layers. PCBs have two complementary functions. The first is to affix electronic
components in designated locations on the outer layers by means of soldering. The second is
to provide reliable electrical connections (and also reliable open circuits) between the
component's terminals in a controlled manner often referred to as PCB design. Each of the
conductive layers is designed with an artwork pattern of conductors (similar to wires on a flat
surface) that provides electrical connections on that conductive layer. Another manufacturing
process adds vies, plated-through holes that allow interconnections between layers.

Figure 3.5 PCB

LED:
A light-emitting diode (LED) is a semiconductor light source that emits light when current
flows through it. Electrons in the semiconductor recombine with electron holes, releasing
energy in the form of photons. The color of the light (corresponding to the energy of the
photons) is determined by the energy required for electrons to cross the band gap of the
semiconductor. White light is obtained by using multiple semiconductors or a layer of light-
emitting phosphor on the semiconductor device.

Figure 3.6 LED

23
Resistor:
A resistor is a passive two-terminal electrical component that implements electrical resistance
as a circuit element. In electronic circuits, resistors are used to reduce current flow, adjust
signal levels, to divide voltages, bias active elements, and terminate transmission lines,
among other uses. High-power resistors that can dissipate many watts of electrical power as
heat may be used as part of motor controls, in power distribution systems, or as test loads for
generators. Fixed resistors have resistances that only change slightly with temperature, time
or operating voltage. Variable resistors can be used to adjust circuit elements (such as a
volume control or a lamp dimmer), or as sensing devices for heat, light, humidity, force, or
chemical activity.

Figure 3.7 Resistor

Jumper wire:
A jump wire (also known as jumper, jumper wire, DuPont wire) is an electrical wire, or
group of them in a cable, with a connector or pin at each end (or sometimes without them –
simply "tinned"), which is normally used to interconnect the components of a breadboard or
other prototype or test circuit, internally or with other equipment or components, without
soldering. Individual jump wires are fitted by inserting their "end connectors" into the slots
provided in a breadboard, the header connector of a circuit board, or a piece of test
equipment.

Figure 3.8 Jumper Wire

24
ULN2003A:
The ULN2003A is an array of seven NPN Darlington transistors capable of 500 mA, 50 V
output. It features common-cathode fly back diodes for switching inductive loads. It can
come in PDIP, SOIC, SOP or TSSOP packaging.[1][2] In the same family are ULN2002A,
ULN2004A, as well as ULQ2003A and ULQ2004A, designed for different logic input levels.
The ULN2003A is also similar to the ULN2001A (4 inputs) and the ULN2801A,
ULN2802A, ULN2803A, ULN2804A and ULN2805A, only differing in logic input levels
(TTL, CMOS, PMOS) and number of in/outputs (4/7/8).

Figure 3.9 ULN2003A

Relay 5V:
Relay is one kind of electro-mechanical component that functions as a switch. The relay coil
is energized by DC so that contact switches can be opened or closed. A single channel 5V
relay module generally includes a coil, and two contacts like normally open (NO) and
normally closed (NC). This article discusses an overview of the 5V relay module & its
working but before going to discuss what is relay module is, first we have to know what is
relay and its pin configuration.

Figure 3.10 Relay 5V

3.4 Implementation

At first, the Keypad-Phone component was connected with the Arduino UNO R3. We
connected all the necessary pins of the Keypad to the Arduino board. All 7 pins were
connected using connecting wires.

25
Figure 3.11 Phone-Keypad connected with Arduino Board

Then we connected the 16x2 Alphanumerical Display to the Arduino Board. This allowed us
to view the inserted values and messages. All the pins were connected using connecting
wires.

Figure 3.12 16x2 Alphanumerical Display connected with Arduino board

Finally, we connected the PWM Powered Servo Motor with the Arduino Board. The motor is
used to open and close the locking mechanism of the door. If the Motor rotates 90°, then the
lock will open. If it stays in the same position, the lock will stay closed. LED Bulbs were also
to further differentiate if the locking mechanism is open or closed.

Figure 3.13 PWM Powered Servo Motor connected with Arduino Boards along with
LED

26
3.5 Test Experimental Setup

We implement our Test Experimental Setup on Proteus Design Suite; A virtual electronic
design automation software. For generating the source code for Arduino UNO official IDE of
Arduino is used. We export .hex file from the IDE after successful code compilation and
import it in proteus to start the simulation.

Figure 3.14 Complete Circuit Diagram in Proteus

27
3.7 Source code:
#include <LiquidCrystal.h>
#include <Servo.h>
#include <Keypad.h>
Servo myservo;
int pos = 0;
LiquidCrystal lcd(A4, A5, A3, A2, A1, A0);
const byte rows = 4;
const byte cols = 3;
char key[rows][cols] = {
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}};
byte rowPins[rows] = {0, 1, 2, 3};
byte colPins[cols] = {4, 5, 6};

Keypad keypad = Keypad(makeKeymap(key), rowPins, colPins, rows, cols);


char *password = "1234";
int currentposition = 0;

void setup()
{
lcd.begin(16, 2);
myservo.attach(9);
}
void loop()
{
if (currentposition == 0)
{
displayscreen();
}
int l;
char code = keypad.getKey();
if (code != NO_KEY)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("PASSWORD:");
lcd.setCursor(7, 1);
for (l = 0; l <= currentposition; ++l)
{
lcd.print("*");
}
if (code == password[currentposition])
{
++currentposition;
if (currentposition == 4)
{
unlockdoor();
currentposition = 0;
}
}
Else
{
incorrect();
currentposition = 0;

28
}
}
}
void unlockdoor()
{
delay(900);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Access Granted");
lcd.setCursor(4, 1);
lcd.println("WELCOME!!");

for (pos = 180; pos >= 0; pos -= 5) // open the


door
{
myservo.write(pos);
delay(5);
}

delay(500);
ClosingCountDown();
delay(1000);
for (pos = 0; pos <= 180; pos += 5)
{
myservo.write(pos);
delay(15);
currentposition = 0;
lcd.clear();
}
lcd.clear();
lcd.setCursor(4, 0);
lcd.print("LOCKED!");
delay(1000);
displayscreen();
}
void incorrect()
{
delay(500);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("CODE INCORRECT!!");
delay(500);
lcd.setCursor(3, 1);
lcd.println("GET AWAY!!!");
delay(2000);
lcd.clear();
displayscreen();
}
void displayscreen()
{
lcd.setCursor(0, 0);
lcd.println(" # ENTER CODE #");
lcd.setCursor(1, 1);
lcd.println("TO OPEN DOOR!!");
}
void ClosingCountDown()
{

29
lcd.clear();
lcd.setCursor(0, 0);
lcd.println("GET IN WITHIN:");
lcd.setCursor(6, 1);lcd.print("5");
delay(1000);
lcd.setCursor(6, 1);
lcd.print("4");
delay(1000);
lcd.setCursor(6, 1);
lcd.print("3");
delay(1000);
lcd.setCursor(6, 1);
lcd.print("2");
delay(1000);
lcd.setCursor(6, 1);
lcd.print("1");
delay(1000);
lcd.clear();
lcd.setCursor(2, 0);
lcd.print("RE-LOCKING");
delay(500);

30
Chapter 4

Result and Discussion

4.1 Simulation

Figure 4.1 After simulation run successfully

Figure 4.2 Giving passwords by keypad

Figure 4.3 On giving the correct password

31
Figure 4.4 Timeout after entering

Figure 4.5 On giving wrong password

32
Chapter 5

Conclusion

Thus “Smart Door Locking System using Arduino” is a modern successor of the conventional
door locking system. The conclusion of the discussion of smart Lock using Arduino is the
innovation created from the lock system with no more direct contact between the user and the
lock. This system is very cost-effective and easy to install. In conclusion, it was discovered
that the project performed according to specification and can be implemented. The use of the
Arduino UNO microcontroller in this project allows for design simplicity, hence, the project
can be achieved in lesser time compared to other techniques previously employed. This work
proposes a secure locking/unlocking system based on a keypad and Arduino. Adding
password to the Arduino side increase the system security. The system also has a feature for
locking itself after some delayed time. This system could be used to prevent houses,
companies, institutions from steal ingot losing the ordinary key.

33
Chapter 6

Reference

1. “(PDF) Password Based Door Lock System Using Arduino,” Research Gate.


https://www.researchgate.net/publication/330998913_Password_Based_Door_Lock_S
ystem_Using_Arduino (accessed Aug. 08, 2021).
2. Meenakshi, N, M Monish, K J Dikshit, and S Bharath. “Arduino Based Smart
Fingerprint Authentication System.” In 2019 1st International Conference on
Innovations in Information and Communication Technology (ICIICT), 1–7.
CHENNAI, India: IEEE, 2019.
3. Patil, Karthik A, Niteen Vittalkar, Pavan Hiremath, and Manoj AMurthy. “Smart
Door Locking System Using IoT” 07, no. 05 (2020): 5.
4. Reddy, R Sai Charan, P Vamsi Krishna, M Krishna Chaitanya, M Neeharika, and K
Prabhakara Rao. “Security System Based on Knock-Pattern Using Arduino and GSM
Communication” 4, no. 1 (2018): 5.
5. Areed, Marwa F. “A Keyless Entry System Based on Arduino Boardwith Wi-Fi
Technology.” Measurement 139 (June 2019): 34–
39.https://doi.org/10.1016/j.measurement.2019.02.028.
6. Kishwar Shafin, Md., Kazi Lutful Kabir, Nazmul Hasan, Israt Jahan Mouri, Samina
Tasnia Islam, Lazima Ansari, Md. Mahboob Karim, andMd. Afzal Hossain.
“Development of an RFID Based Access Control System in the Context of
Bangladesh.” In 2015 International Conference on Innovations in Information,
Embedded and Communication Systems (ICIIECS), 1–5. Coimbatore, India: IEEE,
2015.
7. "What is an Arduino? - learn.sparkfun.com", Learn.sparkfun.com,2021. [Online].
Available: https://learn.sparkfun.com/tutorials/what-is-an-arduino/all. [Accessed: 08-
Aug- 2021].
8. “Read a 4x4 Matrix Keypad,” Parallax.com. [Online].
Available:https://learn.parallax.com/tutorials/language/propeller-c/propeller-c-simple-
devices/read-4x4-matrix-keypad. [Accessed: 10-Aug-2021].
9. “Read a 4x4 Matrix Keypad,” Parallax.com. [Online].
Available:https://learn.parallax.com/tutorials/language/propeller-c/propeller-c-simple-
devices/read-4x4-matrix-keypad. [Accessed: 10-Aug-2021].
10. Servo Motor Fundamentals", ISL Products International, 2021.[Online]. Available:
https://islproducts.com/design-note/servo-motor-fundamentals/. [Accessed: 10- Aug-
2021.

34

You might also like