Smart Door Locking System Based On OTPFinal Doc
Smart Door Locking System Based On OTPFinal Doc
ON
SMART DOOR LOCKING SYSTEM BASED ON OTP
Submitted in Partial Fulfillment of the Requirements for
The Award of
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE & ENGINEERING
BY
K.SAIKRISHNA (19C31A0520)
S.NAVYASHRI (19C31A0554)
N.PREETHI (19C31A0538)
MD.AKTHARALI (19C31A0535)
i
BALAJI INSTITUTE OF TECHNOLOGY & SCIENCE
Accredited by NBA (UG-CE,ECE,ME,CSE Programs) & NAAC A+ Grade
(Affliated by JNTU Hyderabad and Approved by the AICTE, New Delhi)
NARSAMPET, WARANGAL – 506331.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CERTIFICATE
This is to certify that K. SAI KRISHNA (19C31A0520),
S. NAVYASHRI (19C31A0554), N. PREETHI (19C31A0538) and
MD. AKTHAR ALI (19C31A0535) of B. Tech IV–II Sem has satisfactorily
completed the Major Project entitled “SMART DOOR LOCKING SYSTEM
BASED ON OTP”, as part of curriculum in Computer Science Engineering during
academic year 2022-2023.
External Examiner
ii
ACKNOWLEDGEMENT
We would like to express our sincere gratitude to our guide, Mr. J. Chaitanya
whose knowledge and guidance have motivated us to achieve goals. We never thought
possible. He has consistently been a source of motivation, encouragement and
inspiration. The time we have spent working under his supervision has truly been a
pleasure.
We thank our HoD, Mr. Fasi Ahmed Parvez of his effort and guidance and all
senior faculty members for their help during our course. Thanks to programmers
and non-teaching staff of CSE Department of our college.
We heartily thank to our Principal Dr. V. S. HARIHARAN for giving this great
opportunity and his support to complete our project.
Finally Special thanks to our parents for their support and encouragement
throughout our life and this course. Thanks to all my friends and well-wishers for their
constant support.
iii
ABSTRACT
Today’s world is a smart world we live in and Smart Phones have a major
contribution in it. A smart phone is now a very common device that everyone carries
with them all the time. Smart phones have enabled us to perform various tasks while
using a single device. Considering this phenomenon we can exploit the idea of remote-
controlling a door with the help of a smart phone. Physical keys and a lock are the basic
requirements for a door. However managing these keys has become cumbersome. To
overcome this, we present a solution which is a smart and a secure way of remote-
controlling the door using a smart phone. This project consist of a door locking system
which provides a great solution to improve the home safety management of doors.
Arduino IDE software and a wi-fi were used to connect between the smartphone, the
microcontroller and the door lock to give an easy access to authorized persons. The
person with the authority to open the door can have access within their fingertips by
installing the required application which has open/close button
iv
TABLE OF CONTENTS
1. Introduction 1
1.1 Introduction 1
1.2 Purpose 2
2. System Analysis 3
2.1 Introduction 3
3. Feasibility Study 8
v
5. System Design 19
5.1 Introduction 19
6. Technology Description 22
7. Screenshots 31
8. Testing 37
8.1 Introduction 37
9. Future Enhancements 42
10. Conclusion 43
11. BIBILIOGRAPHY 44
vi
ABBREVIATIONS
vii
SMART DOOR LOCKING SYSTEM BASED ON OTP
1.INTRODUCTION
1.1 Introduction
Smart door locking system based on OTP is designed using NodeMCU where
in once the correct code or password is entered, the lock is unlocked, and the concerned
person is allowed access to the secured area. Smart door locking system based on OTP
using NodeMCU is a simple project where a secure password will act as a door
unlocking system. Old fashioned lock systems use mechanical locking and these can be
replaced by new advanced techniques of locking systems. These methods are a
combination of mechanical and electronic devices and are highly intelligent. One of the
distinct features of these intelligent lock systems is their simplicity and high efficiency.
Such an automated lock system consists of electronic control assembly, which controls
the output load through a password.
The example of this output load can be a motor or a lamp or any other
mechanical/electrical load. Here, we made an electronic code lock system using
NodeMCU, which provides control to the actuating the load. It is a simple embedded
system which takes input from the application and the output being actuated
accordingly. This system demonstrates Smart door locking system based on OTP using
NodeMCU, wherein once the correct code or password is entered, the door is opened
and the concerned person is allowed access to the secured area. If another person
arrives, it will ask to enter the password again. If the password is wrong, then door
would remain locked, denying access to the person.
Smart door locking system based on OTP using NodeMCU. It can generate a
new password every time you try to unlock it, which gives you extra security.
1
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
1.2 Purpose
A key-based locking system has now become outdated because if your key is
lost or stolen, it creates a huge problem. Also, the electronic wireless locking system is
not that safe because you might forget your password, or it might get stolen by others
while entering the password on your device. So, we can make a DIY smart lock that
has the capability to remove all these security threats and problems.
Instead of a key, this type of lock system requires a numerical code to grant
entry to a facility or property. The code is punched in by users via a numerical pad,
similar to those on a basic calculator. If the correct code is entered, the door lock or
deadbolt should release. The biggest advantage is convenience. It eliminates the
necessity of keys. There’s no need to carry them around, keep track of copies and spares,
or change locks when a key is stolen or misplaced. Children, guests and service
providers can be given their own code or a temporary code, rather than a key.
Keypad locks have a different hardware design than other types of locks. They
don’t have cylinder mechanisms, so they essentially cannot be picked or bumped like
conventional locks. This keeps the building more secure. Instead of risking losing keys
and having to rekey or change out the lock. With a keypad system, it’s easy to change
the security pin code whenever necessary. Traditional keys and locks wear down over
time; it becomes more difficult to get it to turn and function properly. Keypads are much
more durable than conventional locks. A high-quality lock and keypad device should
last longer with standard hardware. Many property owners think that if they want to
install a keypad lock, they’ll have to make major adjustments to door or frames. That’s
not true. In most cases, keypad locks can be easily, installed on standard doors, just like
any standard lock. Mechanical and battery-powered keypad locks are available which
don’t require connection to a power source.
2
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
2. SYSTEM ANALYSIS
2.1 Introduction
After analysing the requirements of the task to be performed, the next step is to
analyse the problem and understand its context. The first activity in the phase is
studying the existing system and other is to understand the requirements and domain of
the new system. Both the activities are equally important, but the first activity serves as
a basis of giving the functional specifications and then successful design of the
proposed system. Understanding the properties and requirements of a new system is
more difficult and requires creative thinking and understanding of existing running
system is also difficult.
➢ Requirement Analysis
➢ Project Planning
➢ System design
➢ Coding
➢ Unit testing
➢ System integration & testing
Here the linear ordering of these activities is critical. End of the phase and the
output of the one phase is the input of another phase. Some of the qualities of spiral
model are also incorporated like after the people concerned with the project review
completion of each of the phase the work done. WATERFALL MODEL was being
3
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
chosen because all requirements were known beforehand and the objective of our
software development is the online house rental system.
• Administration
• User
Admin Module
4
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
User Module
The user module allows users to use the functionality of the system. The
administrator will give the password details to the user and the user can make the use
of it. By using the password the user can access the door.
Disadvantages
5
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
The password-based door lock system allows only authorized persons to access
the restricted areas. This smart lock can generate a new password every time you unlock
it, which further enhances your security level. This new device is much safer than the
traditional key-based system and electronic wireless lock system. If you are still using
the key-based system, you are likely to land in a big problem if your key gets lost or
stolen. The electronic wireless lock system is not safe either. You might forget the
password and there is also a high risk being hacked.
This is a one-time password (OTP) based smart locking system using Arduino
and Bluetooth. It can generate a new password every time you try to unlock it, which
gives you extra security. A key-based locking system has now become outdated because
if your key is lost or stolen, it creates a huge problem. Also, the electronic wireless
locking system is not that safe because you might forget your password, or it might get
stolen by others while entering the password on your device.
Advantages
6
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Unique designs
One can choose from a while range of electronic locks to suit their individual
requirements, taste and everyday lifestyle. You can find a wide array of lock designs,
ranging from the traditional to the futuristic and minimalistic ones. Moreover, the high
tech designs of these locks make it much harder to copy than traditional options. A
machine for duplicating this kind of locks has not yet been invented.
Durability
The keypad locks come with a superior level of durability. Unlike traditional
locks, they never get worn out or malfunction. The fact that these locks don’t need to
sustain the constant friction of turning and inserting keys makes it a much more durable
option. When it comes to security, convenience and ease of use, nothing can beat the
advantages that a keypad lock has to offer.
7
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
3. FEASIBILITY STUDY
1. Technical Feasibility
2. Operational Feasibility
3. Economical Feasibility
Technical feasibility is one of the first studies that must be conducted after the
project has been identified. In large engineering projects consulting agencies that have
large staffs of engineers and technicians conduct technical studies dealing with the
projects. For example, In individual agricultural projects financed by local agricultural
credit corporations, the technical staff composed of specialized agricultural engineers,
irrigation and construction engineers, and other technicians are responsible for
conducting such feasibility studies.
8
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
• A brief description of the business to assess more possible factors which could
affect the study.
• All necessary technology exists to develop the system.
• This system is too flexible and it can be expanded further.
• This system can give guarantees of accuracy, ease of use, reliability and the data
security.
• This system can give instant response to inquire.
• The human and economic factor.
• The possible solutions to the problem.
9
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
In this step, we verify different operational factors of the proposed system like
man-power, time etc, whichever solution uses less operational resources, is the best
operationally feasible solution. The solution should also be operationally possible to
implement. Operational Feasibility determines if the proposed system user objectives
could be fitted into the current system operation.
10
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
The new system is economically feasible only when the financial benefits are
more than the investments and expenditure. Economic feasibility determines whether
the project goal can be within the resource limit allocated to it or not. It must determine
whether it is worthwhile to process with the entire project or whether the benefits
obtained from the new system are not worth the costs. Financial benefits must be equal
or exceed the costs.
11
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
We should react to particular inputs, and how the system should behave in
particular situations, it specifies the application functionality that the developers must
build into the product to enable users to accomplish their tasks. switch on your Smart
door locking system based on OTP system and follow the steps given below:
1. Open the installed OTP_Smartlock app and connect it with the system
2. Touch on the send OTP button
3. On successful connection, you will receive an OTP to the registered mobile.
4. On successful entry of OTP, you will be able to lock and unlock the door.
5. And you will also be able to setup IR Lock and also the Buzzer.
Access Security
The extent to which the system is safeguarded against deliberate and intrusive faults
from internal and external sources.
Accessibility
The extent to which the software system can be used by people with the widest range
of capabilities to achieve a specified goal in a specified context of use.
12
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Availability
The degree to which users can depend on the system to be up (able to function) during
“normal operating times”.
Confidentiality
The degree to which the software system protects sensitive data and allows only
authorized access to the data.
Efficiency
The extent to which the software system handles capacity, throughput, and response
time.
Integrity
The degree to which the data maintained by the software system are accurate, authentic,
and without corruption.
Reliability
The extent to which the software system consistently performs the specified functions
without failure.
Safety
The degree to which a software system prevents harm to people or damage to the
environment in the intended context of use.
Survivability
The extent to which the software system continues to function and recovers in the
presence of a system failure.
Usability
The ease with which the user is able to learn, operate, prepare inputs, and interpret
outputs through interaction with a system.
13
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Flexibility
The ease with which the software can be modified to adapt to different environments,
configurations, and user expectations.
Maintainability
The ease with which faults in a software system can be found and fixed.
Modifiability
The degree to which changes to a software system can be developed and deployed
efficiently and cost effectively.
Performance requirements are the requirements that are not directly concerned
with the specific services delivered by the system to its users. They may define
constraints on the system implementation such as the capabilities of input devices or
the data representation used in interfaces with other system.
Security
The system should provide a high level of security and integrity of the data and
only authorized persons can gain access to the system; and only users with valid
password can open the lock. The person will fail to unlock the door if the person
provides the wrong password. So this project will enhance the security concerns to
higher level. In traditional door lock system, we will be using a physical key to unlock
a door. But there is a probability where the key may be missed or a thief can theft it.
Hence, usage of digital door lock will avoid all these issues and will provide more
security.
Access Permission
The Arduino will contain the predefined secured password. The person who
enters the correct password which matches with the password stored in Arduino will be
given the access to open the door. The password entered by a person if not matches with
the password stored in the Arduino will not be given the access to unlock the door.
14
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Maintainability
The system shall provide the capability to work efficiently and the time must be
required less for processing the request. The maintenance of this project is pretty easy
and cost effective which can be affordable by most of the people.
Reliability
Performance
The system should have high performance rate when executing user’s input and
should be able to provide process the request on time. The door must be lock or unlock
on time by taking limited period of time. The performance of this project will be at
higher levels.
List of components
➢ NodeMCU
➢ IR Sensor
➢ Servo Motor
➢ Buzzer
15
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Node MCU:
The NodeMCU (Node MicroController Unit) is an open source software and hardware
development environment that is built around a very inexpensive System-on-a-Chip
(SoC) called the ESP8266.
IR Sensor:
IR sensor is an electronic device, that emits the light in order to sense some object of
the surroundings.
Servo Motor:
A servo motor is a type of motor that can rotate with great precision. Normally
this type of motor consists of a control circuit that provides feedback on the current
position of the motor shaft, this feedback allows the servo motors to rotate with great
precision.
16
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Buzzer:
The buzzer is a sounding device that can convert audio signals into sound
signals. It is usually powered by DC voltage.
Arduino IDE The open-source Arduino software (IDE) makes it easy to write
code and upload it to the board. This software can be used with any Arduino. The
Arduino Integrated Development Environment - or Arduino Software (IDE) - contains
a text editor for writing code, a message area, a text console, a toolbar with buttons for
common functions and a series of menus. It connects to the Arduino and Genuine
hardware to upload programs and communicate with them. Programs written using
Arduino Software (IDE) are called sketches. These sketches are written in the text editor
and are saved with the file extension.ino. The editor has features for cutting/pasting and
for searching/replacing text.
17
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
The open-source Arduino software (IDE) makes it easy to write code and upload
it to the board. This software can be used with any Arduino. The Arduino Integrated
Development Environment - or Arduino Software (IDE) - contains a text editor for
writing code, a message area, a text console, a toolbar with buttons for common
functions and a series of menus. It connects to the Arduino and Genuine hardware to
upload programs and communicate with them. Programs written using Arduino
Software (IDE) are called sketches. These sketches are written in the text editor and are
saved with the file extension.ino. The editor has features for cutting/pasting and for
searching/replacing text.
Android application
This application is useful for generating the different one-time passwords every
time. The installed OTP Smart lock app when opened. On successful tapping of send
OTP button, it will show a OTP message on the app. Then an OTP will be received in
the app next to the key icon. Touch the lock icon and enter OTP in the text bar. If
everything is fine, the servo motor will move to unlock the lock.
18
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
5. SYSTEM DESIGN
5.1 Introduction
Software design sits at the technical kernel of the software engineering process
and is applied regardless of the development paradigm and area of application. Design
is the first step in the development phase for any engineered product or system. The
designer’s goal is to produce a model or representation of an entity that will later be
built. Beginning, once system requirement have been specified and analysed, system
design is the first of the three technical activities design, code and test that is required
to build and verify software.
19
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Use Case
Class
20
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Activity
21
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
6.TECHNOLOGY DESCRIPTION
Arduino IDE
• Arduino IDE is an open source software that is mainly used for writing and
compiling the code into the Arduino Module.
• It is an official Arduino software, making code compilation too easy that
even a common person with no prior technical knowledge can get their feet
wet with the learning process.
• It is easily available for operating systems like MAC, Windows, Linux and
runs on the Java Platform that comes with inbuilt functions and commands
that play a vital role for debugging, editing and compiling the code in the
environment.
• A range of Arduino modules available including Arduino Uno, Arduino
Mega, Arduino Leonardo, Arduino Micro and many more.
• Each of them contains a microcontroller on the board that is actually
programmed and accepts the information in the form of code.
• The main code, also known as a sketch, created on the IDE platform will
ultimately generate a Hex File which is then transferred and uploaded in the
controller on the board.
• The IDE environment mainly contains two basic parts: Editor and Compiler
where former is used for writing the required code and later is used for
compiling and uploading the code into the given Arduino Module.
First, download the IDE and install it. The IDE is available for most common
operating systems, including Windows, Mac OS X, and Linux, so be sure to download
the correct version for your OS. Once the installer has downloaded, go ahead and install
the IDE.
22
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Projects made using the Arduino are called sketches, and such sketches are
usually written in a cut-down version of C++ (a number of C++ features are not
included). Because programming a microcontroller is somewhat different from
programming a computer, there are a number of device-specific libraries (e.g., changing
pin modes, output data on pins, reading analog values, and timers). This sometimes
confuses users who think Arduino is programmed in an “Arduino language.” However,
the Arduino is, in fact, programmed in C++. It just uses unique libraries for the device.
23
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Writing Sketches
Programs written using Arduino Software (IDE) are called sketches. These
sketches are written in the text editor and are saved with the file extension .ino. The
editor has features for cutting/pasting and for searching/replacing text. The message
area gives feedback while saving and exporting and also displays errors. The console
displays text output by the Arduino Software (IDE), including complete error messages
and other information. The bottom right hand corner of the window displays the
configured board and serial port. The toolbar buttons allow you to verify and upload
programs, create, open, and save sketches, and open the serial monitor.
• The main code, also known as a sketch, created on the IDE platform will
ultimately generate a Hex File which is then transferred and uploaded in
the controller on the board.
• The IDE environment mainly contains two basic parts: Editor and
Compiler where former is used for writing the required code and later is
used for compiling and uploading the code into the given Arduino
Module.
• This environment supports both C and C++ languages.
It includes following:
24
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Additional commands are found within the five menus: File, Edit, Sketch, Tools, Help.
The menus are context sensitive, which means only those items relevant to the work
currently being carried out are available.
File
• New
Creates a new instance of the editor, with the bare minimum structure of a sketch
already in place.
• Open
Allows to load a sketch file browsing through the computer drives and folders.
• Open Recent
Provides a short list of the most recent sketches, ready to be opened.
• Sketchbook
Shows the current sketches within the sketchbook folder structure; clicking on
any name opens the corresponding sketch in a new editor instance.
• Examples
Any example provided by the Arduino Software (IDE) or library shows up in
this menu item. All the examples are structured in a tree that allows easy access
by topic or library.
• Close
Closes the instance of the Arduino Software from which it is clicked.
• Save
Saves the sketch with the current name. If the file hasn't been named before, a
name will be provided in a "Save as.." window.
• Save as
Allows to save the current sketch with a different name.
• Page Setup
It shows the Page Setup window for printing.
• Print
Sends the current sketch to the printer according to the settings defined in Page
Setup.
25
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
• Preferences
Opens the Preferences window where some settings of the IDE may be
customized, as the language of the IDE interface.
• Quit
Closes all IDE windows. The same sketches open when Quit was chosen will
be automatically reopened the next time you start the IDE.
• Find
Opens the Find and Replace window where you can specify text to search inside
the current sketch according to several options.
• Find Next
Highlights the next occurrence - if any - of the string specified as the search
item in the Find window, relative to the cursor position.
• Find Previous
Highlights the previous occurrence - if any - of the string specified as the search
item in the Find window relative to the cursor position.
Sketch
• Verify/Compile
Checks your sketch for errors compiling it; it will report memory usage for code
and variables in the console area.
• Upload
Compiles and loads the binary file onto the configured board through the
configured Port.
• Upload Using Programmer
This will overwrite the bootloader on the board; you will need to use Tools >
Burn Bootloader to restore it and be able to Upload to USB serial port again.
However, it allows you to use the full capacity of the Flash memory for your
sketch.
• Export Compiled Binary
Saves a .hex file that may be kept as archive or sent to the board using other
tools.
26
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Tools
• Auto Format
This formats your code nicely: i.e. indents it so that opening and closing curly
braces line up, and that the statements inside curly braces are indented more.
• Archive Sketch
Archives a copy of the current sketch in .zip format. The archive is placed in the
same directory as the sketch.
• Fix Encoding & Reload
Fixes possible discrepancies between the editor char map encoding and other
operating systems char maps.
• SerialMonitor
Opens the serial monitor window and initiates the exchange of data with any
connected board on the currently selected Port. This usually resets the board, if
the board supports Reset over serial port opening.
• Board
Select the board that you're using. See below for descriptions of the various
boards.
• Port
This menu contains all the serial devices (real or virtual) on your machine. It
should automatically refresh every time you open the top-level tools menu.
27
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
• Programmer
For selecting a hardware programmer when programming a board or chip and
not using the onboard USB-serial connection. Normally you won't need this, but
if you're burning a bootloader to a new microcontroller, you will use this.
• BurnBootloader
The items in this menu allow you to burn a bootloader onto the microcontroller
on an Arduino board. This is not required for normal use of an Arduino or
Genuino board but is useful if you purchase a new ATmega microcontroller
(which normally come without a bootloader). Ensure that you've selected the
correct board from the Boards menu before burning the bootloader on the target
board. This command also set the right fuses.
Help
Here you find easy access to a number of documents that come with the Arduino
Software (IDE). You have access to Getting Started, Reference, this guide to the IDE
and other documents locally, without an internet connection.
Find in Reference
This is the only interactive function of the Help menu: it directly selects the
relevant page in the local copy of the Reference for the function or command under the
cursor.
Sketchbook
The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to store
your programs (or sketches). The sketches in your sketchbook can be opened from the
File > Sketchbook menu or from the Open button on the toolbar. The first time you run
the Arduino software, it will automatically create a directory for your sketchbook. You
can view or change the location of the sketchbook location from with the Preferences
dialog.
Beginning with version 1.0, files are saved with a .ino file extension. Previous
versions use the .pde extension. You may still open .pde named files in version 1.0 and
later, the software will automatically rename the extension to .ino.
Allows you to manage sketches with more than one file (each of which appears
in its own tab). These can be normal Arduino code files (no visible extension), C files
(.c extension), C++ files (.cpp), or header files (.h).
Uploading
Before uploading sketch, select the correct items from the Tools > Board and
Tools > Port menus. The boards are described below. On the Mac, the serial port is
probably something like /dev/tty.usbmodem241 for an Uno or Mega2560 or Leonardo
or /dev/tty.usbserial-1B1 for a Duemilanove or earlier USB board, or
/dev/tty.USA19QW1b1P1.1 for a serial board connected with a Keyspan USB-toSerial
adapter. On Windows, it's probably COM1 or COM2 (for a serial board) or COM4,
COM5, COM7, or higher for a USB board - to find out, you look for USB serial device
in the ports section of the Windows Device Manager. On Linux, it should be
/dev/ttyACMx , /dev/ttyUSBx or similar. Once you've selected the correct serial port
and board, press the upload button in the toolbar or select the Upload item from the
Sketch menu. Current Arduino boards will reset automatically and begin the upload.
With older boards (pre-Diecimila) that lack auto-reset, you'll need to press the reset
button on the board just before starting the upload. On most boards, you'll see the RX
and TX LEDs blink as the sketch is uploaded. The Arduino Software (IDE) will display
a message when the upload is complete, or show an error.
When you upload a sketch, you're using the Arduino bootloader, a small
program that has been loaded on to the microcontroller on your board. It allows you to
upload code without using any additional hardware. The bootloader is active for a few
seconds when the board resets; then it starts whichever sketch was most recently
uploaded to the microcontroller. The bootloader will blink the on-board (pin 13) LED
when it starts (i.e. when the board resets).
Libraries
Libraries provide extra functionality for use in sketches, e.g. working with
hardware or manipulating data. To use a library in a sketch, select it from the Sketch >
Import Library menu. This will insert one or more #include statements at the top of the
sketch and compile the library with your sketch. Because libraries are uploaded to the
29
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
board with sketch, they increase the amount of space it takes up. If a sketch no longer
needs a library, simply delete its #include statements from the top of your code.
C language
There are many languages in the market, which are using to develop
applications; still C programming language is much popular due to following reasons:
C language has less number of keywords, as we know that in a standard version
30
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
7.SCREENSHOTS
Fig: After tapping on send otp, the otp is sent to registered mobile number
31
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Fig: If the otp entered is correct,the it allows the user to lock or unlock the door by
displaying lock or unlock door buttons
32
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Initially door will be in closed state, when user taps on door open then the
door will be unlocked and door status will be updated in the application, it is
displayed as opened.
When the user tries to open the door using mobile application to latch the
servo motor will be opened as shown below
When user taps on door close, the door gets closed and it displays as closed in the
application.
33
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
34
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
35
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
36
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
8.TESTING
8.1 Introduction
A Strategy for software testing may also be viewed in the context of the spiral.
Unit testing begins at the vertex of the spiral and concentrates on each unit of the
software as implemented in source code. Testing progress by moving outward along the
spiral to integration testing, where the focus is on the design and the construction of the
software architecture talking another turn on outward on the spiral we encounter
validation testing where requirements established as part of software requirements
analysis are validated against the software that has been constructed. Finally we arrive
at system testing, where the software and other system elements are tested as a whole.
37
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
The software units in the system are modules and routines that are assembled
and integrated to perform a specific function. As a part of unit testing, we executed the
program for individual modules independently. This enables, to detect errors in coding
and logic that are contained within each of the three modules. This testing includes
entering data that is filling forms and ascertaining if the value matches to the type and
entered into the database. The various controls are tested to ensure that each performs
its action as required.
38
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
39
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
Serial.println(WiFi.localIP());
digitalWrite(relay,LOW);
}
void loop()
{
if(Firebase.failed())
{
Serial.print("Firebase error");
Serial.println(Firebase.error());
}
Serial.print("IR:");
Serial.println(digitalRead(ir));
if(Firebase("DOORLOCK/DOOR") == "\"OPEN\"")
{
Serial.println("OPEN");
digitalWrite(relay,HIGH);
}
if(Firebase("DOORLOCK/DOOR") == "\"CLOSE\"")
{
lc_v=0;
Serial.println("CLOSE");
digitalWrite(relay,LOW);
}
if(Firebase("DOORLOCK/DOOR") == "\"LOCK\"")
{
Serial.println("LOCK");
lc_v=1;
l_v=1;
digitalWrite(relay,LOW);
40
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
}
if(Firebase("DOORLOCK/DOOR") == "\"UNLOCK\"")
{
Serial.println("UNLOCK");
l_v=0;
lc_v=0;
digitalWrite(buz,LOW);
}
if(Firebase("DOORLOCK/DOOR") == "\"ALERTON\"")
{
Serial.println("ALKERTON");
digitalWrite(buz,HIGH);
}
if(Firebase("DOORLOCK/DOOR") == "\"ALERTOFF\"")
{
Serial.println("ALKERTOFF");
digitalWrite(buz,LOW);
}
if((!digitalRead(ir)) && (lc_v==1))
{
digitalWrite(buz,HIGH);
Serial.println("ALERT");
Serial.write('A');
if(r_v==0)
{
}
r_v++;
delay(500);
}
41
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
9.FUTURE ENHANCEMEMNTS
A rechargeable battery can be provided which can give power backup of 3-4hrs
in case of power failure. It can also be implemented using cloud computing where user
can control the lock irrespective of his location. Use of camera can also be done for
surveillance. For further security, finger scanner, face recognizes or etc can be used. To
avoid opening of door every time, voice conversation can also be done with the person
on the other side of the door. This system can also be installed with a fire alarm. Usually
at home we don't have fire alarms, so this system can work as both - lock and fire alarm.
This system can be used in hotels, banks, motels, or any other place as an alternative
lock for additional security.
42
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
10.CONCLUSION
“Smart Door Locking System Based On OTP” is a modern successor of the
conventional door locking system. This system is very cost effective and easy to install
and is designed under different modes which makes it useful. This system allows single-
person residents to relieve the anxiety caused by the password leakage and unforeseen
visitors, making solve the growing social problems occurring in single person
households. It is expected that this system not only contributes to relieving the anxiety
about the social safety for single-person households, but also be applied to various
sharing economy platforms such as lodging facilities and personal lockers.
43
CSE Department,BITS
SMART DOOR LOCKING SYSTEM BASED ON OTP
11.BIBILIOGRAPHY
1. https://create.arduino.cc/projecthub/chummer1010/electronic-safe-with
arduino25d039?ref=tag&ref_id=lock&offset=1
2. https://create.arduino.cc/projecthub/rampi/rampiot-cool-smart
locka6d816?ref=tag&ref_id=lock&offset=9
3. https://create.arduino.cc/projecthub/arun8/smart-bt-door-lock-simple-
arduino69e6d7?ref=tag&ref_id=lock&offset=20
4. https://create.arduino.cc/projecthub/jegatheesan/smart-bt-lock-with-custom-
numberc15c7b?ref=tag&ref_id=lock&offset=18
5. Ushie James Ogri, Donatus Enang Bassey Okwong, Akaiso Etim, “DESIGN
AND CONSTRUCTION OF DOOR LOCKING SECURITY SYSTEM
USING GSM”, International Journal Of Engineering And Computer Science
ISSN:2319-7242 Volume 2 Issue 7 (July 2013), Page No. 2235-2257
6. Oleka C.V, Nduanya U.I. and Orji E.Z, “Microcontroller Based Digital Door
Lock Security System Using Keypad”, International Journal of Latest
Technology in Engineering, Management & Applied Science (IJLTEMAS)
Volume VIII, Issue I, January 2019 | ISSN 2278-2540
7. Halliru, Umar Muhammad, “Design and Construction of Smartdoor Security
System Using Arduino and Bluetooth Application”
8. Arpita Mishra , Siddharth Sharma , Sachin Dubey , S.K.Dubey, “Password
Based Security Lock System”, International Journal of Advanced Technology
in Engineering and Science www.ijates.com Volume No.02, Issue No. 05, May
2014 ISSN (online): 2348 – 7550
9. Aqib, “RFID and Keypad Door lock and Alert System Using Arduino”
10. "NodeMCU - A Perfect Board for IoT". circuito.io blog. 2018-11-21. Retrieved
2021-05-27.
11. https://www.theengineeringprojects.com/2018/10/introduction-to-nodemcu-
v3.html
12. https://www.androiderode.com/relay-module-and-working-details/
13. https://www.flyrobo.in/12v-piezo-electric-buzzer-alarm
14. https://robu.in/ir-sensor-working/
15. https://quartzcomponents.com/products/12v-solenoid-lock-0-6a-electric-door-
lock
44
CSE Department,BITS