You are on page 1of 53

Android & Arduino Base Automatic home door lock

Session (2018-2022)

Program
Bachelor of Studies in Software Engineering

Submitted By:

Kamran Ali 52322-F18

Supervised By:

Dr Hammad Sherazi

Assistant Professor

Department of CS & IT

Hazara University, Mansehra

i
Final Approval
Android & Arduino Base Automatic home door lock
The thesis of Kamran Ali is approved as partial fulfillment of the requirements for the
Degree of Bachelor's in Software Engineering

Name Roll no

Kamran Ali 52322-F18

COMMITTEE

External Examiner __________________

Supervisor ___________________

Chairman ___________________

DEPARTMENT OF INFORMATION TECHNOLOGY

HAZARA UNIVERSITY MANSEHRA

2018-2022

ii
DECLARATION

I declare that this thesis is an original report of my research, has been written by me and
has not been submitted for any previous degree. This experimental work is almost entirely
my own work; the collaborative contributions have been indicated clearly band
acknowledged.

iii
DEDICATED

To

My Beloved Parents, family, and also my best friends

Who remained there side by side with me

and make my little world complete

May Allah bless them with a very happy, successful and a healthy
life! (AAMEEN)

iv
ACKNOWLEDGEMENT

I have no words to express my deepest sense of gratitude to the Exalter, Lord of Majesty
"Almighty Allah." The most Bestowed and loving, whose innumerable blessings enabled
me to complete this laborious task. I also want to pay all the tributes to the Holy Prophet
Muhammad (S.A.W), the most Equitable and the Source of all Goodness ever born on
the surface of Earth, whose love enlightened my darkness of life.
I would first like to thank my project supervisor Dr. Hammad Sherazi. His support and
cooperation always motivated me and helped me throughout the project work and thesis
as well. He steered me in the right direction whenever he thought I needed it.
Finally, I must express my very profound gratitude to my parents and my best friends
for providing me with unfailing support and continuous encouragement throughout my
years of study and through the process of researching and writing this thesis. This
accomplishment would not have been possible without them. Thank you.
Kamran Ali

v
Preface
Everybody wants to feel safe in their own home, workplace, etc. A smart door security
system using Arduino is a solution aimed at increasing and advancing the safety and
security of lives and property of the people. The fundamental research of my thesis and
project deals primarily with protecting doors and making them more secure. With the help
of a 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
smartphones. The Microcontroller will be mounted on the door which will then
communicate with the device through a GSM module which will be connected to the
Microcontroller. I designed it to give a facility to the family to open and lock the door
using the android application. When someone rings the bell will receive a notification on
our android phone then we can open the door through SMS or the android app.

vi
Table of Contents
Chapter 1 .......................................................................................................................................... 1
Introduction ...................................................................................................................................... 1
1. Introduction .............................................................................................................................. 1
1.1 Introduction of the project and its background ...................................................................... 2
1.2 Introduction of the tools used in the project ........................................................................... 3
1.2.1 Hardware tools................................................................................................................ 3
1.2.2 Software tool ................................................................................................................... 3
1.3 Scope of the project:............................................................................................................... 3
1.4.1 Economically ................................................................................................................... 3
1.4.2 Technically ...................................................................................................................... 3
1.4.3 Recurrent cost analysis ................................................................................................... 4
1.5 Introduction of final report ..................................................................................................... 4
Chapter 2 .......................................................................................................................................... 5
Present System ................................................................................................................................. 5
2 Present System .............................................................................................................................. 6
2.1 Introduction of the present System......................................................................................... 6
2.1.1 Present system ..................................................................................................................... 6
2.2 DataFlow Diagram ................................................................................................................. 6
2.3 Flow Chart Present system ..................................................................................................... 7
2.4 Drawbacks of the present System .......................................................................................... 7
2.5 What are available solutions for the Present issue ................................................................. 8
2.6 Justification of the proposed System ...................................................................................... 8
Chapter 3 .......................................................................................................................................... 9
Design Of Proposed System............................................................................................................. 9
3 Design of the Proposed System................................................................................................... 10
3.1 Introduction of the proposed System ................................................................................... 10
3.2 Objective of the proposed System ........................................................................................ 10
3.3 Tool used to build the proposed system ............................................................................... 10
3.3.1 Hardware components .................................................................................................. 11
3.3.1.1 Arduino UNO ............................................................................................................. 11
3.3.1.1.1 USB connector......................................................................................................... 12

vii
3.3.1.1.2 Power Port .............................................................................................................. 13
3.3.1.1.3 Microcontroller ....................................................................................................... 14
3.3.1.1.4 Analog input pins .................................................................................................... 15
3.3.1.1.5 Digital pins .............................................................................................................. 16
3.3.1.1.6 Reset Switch ............................................................................................................ 17
3.3.1.1.7 Crystal Oscillator .................................................................................................... 17
3.3.1.1.8 USB Interface chip .................................................................................................. 18
3.3.1.1.9 TX RX LEDs ............................................................................................................ 18
3.3.1.2 Jumper wires .............................................................................................................. 19
3.3.1.3 Breadboard ................................................................................................................ 19
3.3.1.4 Bell push button.......................................................................................................... 20
3.3.1.4 Solenoid Lock ............................................................................................................. 21
3.3.1.5 Ch Relay ..................................................................................................................... 22
3.3.1.6 GSM Module .............................................................................................................. 22
3.3.1.7 Battery Cells ............................................................................................................... 23
3.3.2 Software component ...................................................................................................... 24
3.3.2.1 Android studio ............................................................................................................ 24
3.3.2.1 Home page ................................................................................................................. 24
3.3.2.3 Signup page ................................................................................................................ 25
3.3.3 IDE for Arduino ............................................................................................................ 25
3.4 Flowchart of Proposed system ............................................................................................. 26
3.5 Use case Diagram ................................................................................................................. 27
3.6 Data base Design .................................................................................................................. 27
3.7.1 What data base actually contain ................................................................................... 28
3.7.1.1 Admin ......................................................................................................................... 28
3.8 Algorithim of the system ...................................................................................................... 28
3.9 Tool used to build the proposed system ............................................................................... 29
3.9.1 Android studio ............................................................................................................... 29
3.9.2 IDE for Arduino ............................................................................................................ 30
3.10 Justification of the proposed system .................................................................................. 30
Chapter 4 ........................................................................................................................................ 31
Testing ............................................................................................................................................ 31

viii
4 Testing ......................................................................................................................................... 32
4.1 Computer program testing.................................................................................................... 32
4.2 Black Box Testing ................................................................................................................ 32
4.3 Module Testing .................................................................................................................... 33
4.4 Branch testing....................................................................................................................... 33
4.5 Boundary value testing ......................................................................................................... 33
4.6 Testing of my project ........................................................................................................... 33
4.7 Testing result Validation ...................................................................................................... 34
4.8 Conclusion............................................................................................................................ 34
Chapter 5 ........................................................................................................................................ 35
Results and Screenshots ................................................................................................................. 35
5 Results and Screenshots .............................................................................................................. 36
5.1 Login page............................................................................................................................ 36
5.2 Registration Page ................................................................................................................. 36
5.3 Home page ........................................................................................................................... 37
5.4 Hardware results................................................................................................................... 37
Chapter 6 ........................................................................................................................................ 38
References training or manual training .......................................................................................... 38
6 Reference manual ........................................................................................................................ 39
6.1 Input Form............................................................................................................................ 39
6.2 Hardware Output .................................................................................................................. 40
6.3 References ............................................................................................................................ 41

ix
LIST OF FIGURES
Fig 2.1: DFD of present system ............................................................................................ 6
Fig 2.2: Flow diagram of present System ............................................................................. 7
Fig 3.1: Arduino UNO........................................................................................................ 11
Fig 3.1.1: USB Connector .................................................................................................. 12
Fig 3.1.2: Power port .......................................................................................................... 13
Fig 3.1.2.1: Center-positive plug ........................................................................................ 13
Fig 3.1.3: Microcontroller .................................................................................................. 14
Fig 3.1.4: Analog input pins ............................................................................................... 15
Fig 3.1.5: Digital pins ......................................................................................................... 16
Fig 3.1.6: Reset switch ....................................................................................................... 17
Fig 3.1.7: Crystal oscillator ................................................................................................ 17
Fig 3.1.8: USB interface chip ............................................................................................. 18
Fig 3.1.9: TR RX LEDs...................................................................................................... 18
Fig 3.2: Jumper Wires ........................................................................................................ 19
Fig 3.3: Breadboard ............................................................................................................ 19
Fig 3.4: Bell push button .................................................................................................... 20
Fig 3.5: Solenoid Lock ...................................................................................................... 21
Fig 3.6: Ch Relay................................................................................................................ 22
Fig 3.7: GSM Module......................................................................................................... 22
Fig 3.8: Battery Cells.......................................................................................................... 23
Fig 3.9: Flowchart of proposed System .............................................................................. 26
Fig 3.10: Use case diagram of proposed System ................................................................ 27
Fig 3.11: Android studio..................................................................................................... 29
Fig 3.12: IDE for Arduino .................................................................................................. 30
Fig 4.1: Computer program testing..................................................................................... 32
Fig 4.2: Test validation ....................................................................................................... 34
Fig 5.1: Login page............................................................................................................. 36
Fig 5.2: Registration page................................................................................................... 36
Fig 5.3: Home page ............................................................................................................ 37
Fig 5.4: Hardware results ................................................................................................... 37
Fig 6.1: Input Form............................................................................................................. 39
Fig 6.2: Hardware output .................................................................................................... 40

x
Fig 2.1: DFD of present system ............................................................................................ 6
Fig 2.2: Flow diagram of present System ............................................................................. 7
Fig 3.1: Arduino UNO........................................................................................................ 11
Fig 3.1.1: USB Connector .................................................................................................. 12
Fig 3.1.2: Power port .......................................................................................................... 13
Fig 3.1.2.1: Center-positive plug ........................................................................................ 13
Fig 3.1.3: Microcontroller .................................................................................................. 14
Fig 3.1.4: Analog input pins ............................................................................................... 15
Fig 3.1.5: Digital pins ......................................................................................................... 16
Fig 3.1.6: Reset switch ....................................................................................................... 17
Fig 3.1.7: Crystal oscillator ................................................................................................ 17
Fig 3.1.8: USB interface chip ............................................................................................. 18
Fig 3.1.9: TR RX LEDs...................................................................................................... 18
Fig 3.2: Jumper Wires ........................................................................................................ 19
Fig 3.3: Breadboard ............................................................................................................ 19
Fig 3.4: Bell push button .................................................................................................... 20
Fig 3.5: Solenoid Lock ...................................................................................................... 21
Fig 3.6: Ch Relay................................................................................................................ 22
Fig 3.7: GSM Module......................................................................................................... 22
Fig 3.8: Battery Cells.......................................................................................................... 23
Fig 3.9: Flowchart of proposed System .............................................................................. 26
Fig 3.10: Use case diagram of proposed System ................................................................ 27
Fig 3.11: Android studio..................................................................................................... 29
Fig 3.12: IDE for Arduino .................................................................................................. 30
Fig 4.1: Computer program testing..................................................................................... 32
Fig 4.2: Test validation ....................................................................................................... 34
Fig 5.1: Login page............................................................................................................. 36
Fig 5.2: Registration page................................................................................................... 36
Fig 5.3: Home page ............................................................................................................ 37
Fig 5.4: Hardware results ................................................................................................... 37
Fig 6.1: Input Form............................................................................................................. 39
Fig 6.2: Hardware output .................................................................................................... 40
Chapter 1

Introduction

A & A Base Automatic home door lock 1


1. Introduction

1.1 Introduction of the project and its background


Security has become a major concern in the twenty-first century; everybody wants to feel
safe in their own home, workplace, and a safe environment as a whole. A smart door
security system using Arduino is a project aimed at increasing and advancing the safety
and security of lives and property of the people. The project deals primarily with
protecting doors and making them more secure within our houses, office, or related public
buildings. With the help of a 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 smartphones. With the advancement of technology, the smartphone
has become a household requirement.

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 door. The Microcontroller will be mounted on the door, which will then communicate
with the device through a GSM module connected to the Microcontroller.[1] This project
aims to improve security and secure people's lives and properties at home or their
workplaces.

The Android and Arduino base Automatic home door lock project is designed to give the
family a facility to open and lock the door using the android application. When someone
rings the bell will receive a notification on our android phone, and then we can open the
door through SMS or the android app.

When someone comes near the door and automatically rings the bell, we receive a
notification or message with the help of GSM.

Through the Android application, we click the button ‘Open Door’.

Android applications can be interfaced with three different systems, home security
systems, home automation systems and Door lock systems, respectively, using GSM.
This arrangement facilitates a user with multiple password-based security, increasing
daily life safety.

A & A Base Automatic home door lock 2


1.2 Introduction of the tools used in the project
1.2.1 Hardware tools
i. Arduino UNO
ii. GSM module
iii. Battery cells
iv. Door lock
v. Circuit relay
vi. Breadboard
vii. Jumper wires
viii. Bell press button

1.2.2 Software tool


i. Android studio
ii. Arduino IDE

1.3 Scope of the project:


Automatic or electronic home door locks have become an integral part of our lives. They
allow you to forget the problems associated with handing over keys to relatives or guests
from another city, restrict access to private premises or set up access control in an office
building. Sometimes we do not have to wait for someone to open our door. It is a bit time-
consuming because sometimes we are in a bit hurry. In this era of technology, it is better,
and everyone wants to access everything at their fingertips. For that, we will use the
android application to overcome this issue and be able to open or access our home doors
with amobile app.1.4 Feasibility of the Project

1.4.1 Economically
This project is economically affordable because everyone can easily buy from the market.
This project has a low price in the market.

1.4.2 Technically
This project is technically affordable because of its easy usage and easy interface.
Everyone can be used it easily and open the door easily.

A & A Base Automatic home door lock 3


1.4.3 Recurrent cost analysis
The cost of developing a project of this android and Arduino base automatic home door
lock, i.e., this project has too much hardware. This system is based on hardware. If some
material does not work, then this project will not work. I buy a lot of hardware from the
market and made this project.

Arduino + GSM + Relay + battery cells + lock = 50$ to 65$

1.5 Introduction of final report


In chapter 1, it will provide a brief introduction of the project, such as background, tools
of project, the project's scope, and feasibility.

In chapter 2, it will cover why we need a new system if the existing system occurs. What
are the current system's limitations due to which we need a new System? The available
solutions to design and develop a new System and justification of the proposed System.

In chapter 3, it will give a clear view of the proposed system. The aims and objectives of
the proposed system. Moreover, we define how sequences of activities and data flow in a
process and who is responsible for these activities. Moreover, the proposed system's main
modules and hardware and software requirements.

In chapter 4, in which we discuss about the methods used to test the application,
hardware, and integration. The testing mainly consists of black-box and white-box
testing. Also, here the performance of the software is also tested.

In chapter 5, in which the results are shown, which are given by the system. It mainly
consists of screen snips and figures.

The chapter 6 is composed of a training manual that is intended to assist users in using a
particular product, service, or application. It's usually written by a technician, or product
developer.

A & A Base Automatic home door lock 4


Chapter 2
Present System

A & A Base Automatic home door lock 5


2 Present System
2.1 Introduction of the present System
2.1.1 Present system
In present system there are many securities issues regarding lock. In our daily life we use
the door locker manually and we go the door and open the door for someone. When the
weather is so bad like heavy rain, thunderstorm, or some other environmental issues, we
will also go for the door opening. There should be a person in the room or home (or
anywhere you want to enter) who will open the door for you. Secondly if there is a room
and more than 3 people use that room then the availability of key to all the person is
impossible because every lock making company make 3 keys with a lock. The China locks
and no security and can be open with any key having similar edges or size to the original
key.[2]

2.2 DataFlow Diagram

Fig 2.1: DFD of present system

A & A Base Automatic home door lock 6


2.3 Flow Chart Present system

The design of manual door lock system is designed in such a way that one of the room
members has to be there in the room. If no one is in the room then the person outside
must have the key to open the door. The availability of key must be to all the users of the
room.

Fig 2.2: Flow diagram of present System

2.4 Drawbacks of the present System


• Manually
• Time-consuming
• Need more resources
• Lock keys available any time
• Someone must have to be inside to open the door

A & A Base Automatic home door lock 7


2.5 What are available solutions for the Present issue
Multiple solutions are available for this issue but we need something that is easy and
unique.

For this manual system use such as:

• Arduino UNO
• GSM
• Android application

2.6 Justification of the proposed System

I choose android studio and Java for android application because this tool and language is
best for making the android application. And I chose IDE for Arduino; this tool is best for
Arduino projects and GSM is used for communication between android application and
door lock.

A & A Base Automatic home door lock 8


Chapter 3
Design Of Proposed System

A & A Base Automatic home door lock 9


3 Design of the Proposed System

3.1 Introduction of the proposed System

A door access system is a control access system that controls the door's opening and
closing. It is a system implemented on a building to keep the people and assets in the
building safe from outsiders. The system is usually used during the activity of people
entering and exiting the building. The door access system helps to differentiate between
unauthorized and authorized people as the system only allows the authorized person to
enter the building.[3]
The system is developed to operate the home appliances through mobile phones using
GSM technology. This system consists of; a home server, modem and Java-enabled
mobile phone. This system is only limited to mobile phones having java capabilities.[4]
In this proposed system, we discuss the new technology. That is how we will open the
door easily. In this project, we need some technology tools to make the automatic home
door lock, and we open the door easily from anywhere in our country through GSM.[5]

3.2 Objective of the proposed System


The main objectives of this project are the following:

• To implement Arduino for door lock automation.


• To implement the android application for an easy interface.
• To use GSM for communication between hardware and android application.
• We control the door lock from anywhere in our country where that sim which we
use in GSM will work.

3.3 Tool used to build the proposed system


There are some components used for this project. Some are hardware, and some are
software, such as;

A & A Base Automatic home door lock 10


3.3.1 Hardware components
The hardware components of this project consist of;

i. Arduino UNO
ii. Breadboard
iii. GSM module
iv. Battery Cells
v. Bell Push button
vi. Jumper wires
vii. Relay
viii. 12v solenoid lock

3.3.1.1 Arduino UNO


It is a low-cost, flexible, and easy-to-use programmable open-source microcontroller
board that can be integrated into a variety of electronic projects.[6] This board can be
interfaced with other Arduino boards, Arduino UNO, bread boards and can control relays.
This board contains a USB interface i.e. USB cable is used to connect the board with the
computer and Arduino IDE (Integrated Development Environment) software is used to
program the board.
The operating voltage of the unit is 5V which projects the Microcontroller on the board
and its associated circuitry operates at 5V while the input voltage ranges between 6V to
20V and the recommended input voltage ranges from 7V to 12V.

Fig 3.1: Arduino UNO

A & A Base Automatic home door lock 11


The major components of Arduino uno board are as follows:

i. USB connecter
ii. Power port
iii. Microcontroller
iv. Analog inputs pins
v. Digital pins
vi. Reset switch
vii. Crystal oscillator
viii. USB interface chip
ix. TX RX LEDs

3.3.1.1.1 USB connector

Fig 3.1.1: USB Connector

This is a printer USB port used to load a program from the Arduino IDE into the Arduino
board. The board can also be powered through this port.

A & A Base Automatic home door lock 12


3.3.1.1.2 Power Port

Fig 3.1.2: Power port

The Arduino board can be powered through an AC-to-DC adapter or a battery. The power
source can be connected by plugging in a 2.1mm center-positive plug into the power jack
of the board.

Fig 3.1.2.1: Center-positive plug

The Arduino UNO board operates at a voltage of 5 volts, but it can withstand a maximum
voltage of 20 volts. If the board is supplied with a higher voltage, there is a voltage
regulator (it sits between the power port and USB connector) that protects the board from
burning out.

A & A Base Automatic home door lock 13


3.3.1.1.3 Microcontroller

Fig 3.1.3: Microcontroller

It is the most prominent black rectangular chip with 28 pins. Think of it as the brains of
your Arduino. The Microcontroller used on the UNO board is Atmega328P by Atmel (a
major microcontroller manufacturer). Atmega328P has the following components in it:

• Flash memory of 32KB. The program loaded from Arduino IDE is stored here.

• RAM of 2KB. This is a runtime memory.

• CPU: It controls everything that goes on within the device. It fetches the
program instructions from flash memory and runs them with the help of
RAM.
• Electrically Erasable Programmable Read Only Memory (EEPROM)
of 1KB. This is a type of nonvolatile memory, and it keeps the data
even after device restart and reset.
Atmega328P is pre-programmed with bootloader. This allows you to directly upload a
new Arduino program into the device, without using any external hardware programmer,
making the Arduino UNO board easy to us.

A & A Base Automatic home door lock 14


3.3.1.1.4 Analog input pins

Fig 3.1.4: Analog input pins

The Arduino UNO board has 6 analog input pins, labeled “Analog 0 to 5.” These pins can
read the signal from an analog sensor like a temperature sensor and convert it into a
digital value so that the system understands. These pins just measure voltage and not the
current because they have very high internal resistance. Hence, only a small number of
current flows through these pins. Although these pins are labeled analog and input by
default, these pins can also be used for digital input or output.

A & A Base Automatic home door lock 15


3.3.1.1.5 Digital pins

Fig 3.1.5: Digital pins

You can find these pins labeled “Digital 0 to 13.” These pins can be used as either input
or output pins. When used as output, these pins act as a power supply source for the
components connected to them. When used as input pins, they read the signals from the
component connected to them.
When digital pins are used as output pins, they supply 40 milliamps of current at 5 volts,
which is more than enough to light an LED.
Some of the digital pins are labeled with tilde (~) symbol next to the pin numbers (pin
numbers 3, 5, 6, 9, 10, and 11). These pins act as normal digital pins but can also be used
for Pulse-Width Modulation (PWM), which simulates analog output like fading an LED
in and out.

A & A Base Automatic home door lock 16


3.3.1.1.6 Reset Switch

Fig 3.1.6: Reset switch

When this switch is clicked, it sends a logical pulse to the reset pin of the Microcontroller,
and now runs the program again from the start. This can be very useful if your code
doesn’t repeat, but you want to test it multiple times.

3.3.1.1.7 Crystal Oscillator

Fig 3.1.7: Crystal oscillator

This is a quartz crystal oscillator which ticks 16 million times a second. On each tick, the
Microcontroller performs one operation, for example, addition, subtraction, etc.

A & A Base Automatic home door lock 17


3.3.1.1.8 USB Interface chip

Fig 3.1.8: USB interface chip

Think of this as a signal translator. It converts signals in the USB level to a level that an
Arduino UNO board understands.
3.3.1.1.9 TX RX LEDs

Fig 3.1.9: TR RX LEDs

TX stands for transmit, and RX for receive. These are indicator LEDs which blink
whenever the UNO board is transmitting or receiving data.

A & A Base Automatic home door lock 18


3.3.1.2 Jumper wires

Fig 3.2: Jumper Wires

A jump wire (also known as jumper, jumper wire, jumper cable, DuPont wire or cable) 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.
3.3.1.3 Breadboard

Fig 3.3: Breadboard

A thin plastic board is used to hold electronic components (transistors, resistors, chips,
etc.) that are wired together. Used to develop prototypes of electronic circuits,
breadboards can be reused for future jobs. They can be used to create one-of-a-kind
systems but rarely become commercial products.

A & A Base Automatic home door lock 19


The breadboard contains spring clip contacts typically arranged in matrices with certain
blocks of clips already wired together. The components and jump wires (assorted wire
lengths with pins at both ends) are plugged into the clips to create the circuit patterns. The
boards also typically include metal strips along the side that are used for common power
rails and signal buses.
3.3.1.4 Bell push button

Fig 3.4: Bell push button

Bell push light switches are traditionally used on a front door but can also be featured
elsewhere in a project. From elevator buttons to a modern alternative to light switches,
bell push light switches offer a simple and effective form of operation. When you press a
doorbell button, you complete an electrical circuit that allows household electricity to
flow through the doorbell's internal electromagnet. The magnetic field generated by the
electromagnet is then used to power a mechanism that creates the doorbell sound.

A & A Base Automatic home door lock 20


3.3.1.4 Solenoid Lock

Fig 3.5: Solenoid Lock

The solenoid lock denotes a latch for electrical locking and unlocking. It is available in
unlocking in the power-on mode type, and locking and keeping in the power-on mode
type, which can be used selectively for situations.[7] The power-on unlocking type
enables unlocking only while the solenoid is powered on. A door with this type is locked
and not opened in case of power failure or wire disconnection, ensuring excellent safety.
This type is used mainly for places requiring crime prevention. The power-on locking
type can lock a door while the solenoid is powered on. If the power is disconnected, the
door is unlocked. This type unlocks the door in case of wire disconnection due to a fire or
accident, and it is used for emergency exits through which fire-fighting activity or
evacuation should preferentially be made rather than safety for crime prevention. The
keeping type performs two operations, locking and unlocking by applying a positive or
negative pulse voltage to the solenoid, and keeps the no-power state in each position. This
type features energy saving because it is unnecessary to always power the solenoid on.
For the continuous rating and the intermittent rating, the continuous rating is designed to
be able to feed a rated voltage power continuously for hours without exceeding a
specified temperature rise limit, and the intermittent rating is designed to be able to feed a
specified voltage only for a specified time duration without exceeding a specified
temperature rise limit.

A & A Base Automatic home door lock 21


3.3.1.5 Ch Relay

Fig 3.6: Ch Relay

The Single Channel Relay Module is a convenient board which can be used to control
high voltage, high current load such as motor, solenoid valves, lamps and AC load. It is
designed to interface with Microcontroller such as Arduino, PIC and etc. The relays
terminal (COM, NO and NC) is being brought out with screw terminal. It also comes with
a LED to indicate the status of relay.[8]

3.3.1.6 GSM Module

Fig 3.7: GSM Module

It is an international standard for mobile, telephones etc. it is an acronym that stands for
global system for mobile communication. It is also sometimes referred to as 2G/3G/4G as
it is a second, third, fourth generation cellular networks.[9]

GSM supports outgoing and incoming voice calls, simple text message system and also
data communication.

A & A Base Automatic home door lock 22


3.3.1.7 Battery Cells

Fig 3.8: Battery Cells

It is use to provide the electrical energy for GSM, Arduino, and Solenoid lock. When the
battery gives the current to lock then lock will be open if the cells not working then door
will not be open.

A & A Base Automatic home door lock 23


3.3.2 Software component
Following software components are used;

i. Android studio
ii. IDE for Arduino

3.3.2.1 Android studio

Android studio is the official integrated development environment for android application
development. It is based on IntelliJ IDEA, a Java integrated development environment for
software, and incorporates its code editing and developer tools.[10]

There are three main activities which is create in android studio.

3.3.2.1 Home page


In this page use only one button for opening the door. Open door (when we click on this
button ten automatically message will send to GSM and GSM forward this message to
Arduino and If password is correct which we save by default in Arduino code, then the
door will be open and after 10 seconds door will automatically close. If the code is not
correct then the door will not be opened.)

A & A Base Automatic home door lock 24


3.3.2.2 Login page

This login activity is just to secure our application. Their password is not that which
password or code is required to open the door.

There are four activities on the login page.

1. Username (Alphabets/Numbers)
2. Password (Alphabets/Numbers)
3. Login (when we click on this button then we shift to another activity)
4. Signup (if you have no account then click on this button)

3.3.2.3 Signup page


This activity is use for when we have no account to login then first we create an account
then shift to login page.
There are five activities on the Signup page.
1. Username (Anything like Alphabets/ Numbers/Special Numbers)
2. Password (Anything like Alphabets/ Numbers/Special Numbers)
3. Confirm password (Anything like Alphabets/ Numbers/Special Numbers)
4. Signup (Create the account)
5. Login (when we create account then click on this button and then shift other
activity)

3.3.3 IDE for Arduino

An integrated development environment (IDE) is a software suite that consolidates basic


tools required to write and test software. Developers use numerous tools throughout
software code creation, building and testing. Development tools often include text editors,
code libraries, compilers and test platforms. Without an IDE, a developer must select,
deploy, integrate and manage all of these tools separately. An IDE brings many of those
development-related tools together as a single framework, application or service. The
integrated toolset is designed to simplify software development and can identify and
minimize coding mistakes and typos. Some IDEs are open source, while others are
commercial offerings. An IDE can be a standalone application or it can be part of a larger
package.[11]

A & A Base Automatic home door lock 25


3.4 Flowchart of Proposed system

Fig 3.9: Flowchart of proposed System

A & A Base Automatic home door lock 26


3.5 Use case Diagram

Fig 3.10: Use case diagram of proposed System

3.6 Data base Design


As mentioned earlier this system is developed using the most powerful content
management system that is android studio and Arduino IDE. The reason of using of this
tool is that which is easy to make this system. Now coming to the point that android
application uses MySQL as its database management system. MySQL is a software used
to create database, store and get data when requested. MySQL is also an opensource
software, just like WordPress and works best with other popular open-source software.
We make a Database for Login page. Each of these tables would have different columns
where data is stored.

A & A Base Automatic home door lock 27


Login page has columns:

I. User login
II. User name
III. User password
IV. User registered

3.7.1 What data base actually contain

Admin User

3.7.1.1 Admin

Username Password

3.8 Algorithim of the system

Step 1: start

Step 2: visitor press the bell button

Step 3: Sms send from GSM to mobile sim

Step 4: Through Sms we send correct code then Door will open

Step 5: If you open the application and if you have an account then login, otherwise you
will signup.

Step 6: click on the OPEN DOOR button through GSM Door will open.

Step 7: After 10 second Door will close

Step 8: End

A & A Base Automatic home door lock 28


3.9 Tool used to build the proposed system

1. Android studio
2. IDE for Arduino
3.9.1 Android studio

Fig 3.11: Android studio

Android studio is used for android applications. In this tool, we use computer languages
like Java, Flitter etc.
In my android application I used XML for frontend and Java is used for back end.

A & A Base Automatic home door lock 29


3.9.2 IDE for Arduino

Fig 3.12: IDE for Arduino

An integrated development environment (IDE) is a software suite that consolidates basic


tools required to write and test software. Developers use numerous tools throughout
software code creation, building and testing. Development tools often include text editors,
code libraries, compilers and test platforms and this tool is use for Arduino UNO.

3.10 Justification of the proposed system

I choose android studio and Java for android application because this tool and language is
best for making the android application. And I chose IDE for Arduino; this tool is best for
Arduino projects and GSM is used for communication between android application and
door lock.

A & A Base Automatic home door lock 30


Chapter 4
Testing

A & A Base Automatic home door lock 31


4 Testing
Testing is done in order to eliminate any bugs that could cause any malfunction in the
system. Therefore, it is key to building successful systems. Testing this is simple and
any authorized person can test this. While testing the project, errors were fixed on the
spot.[12]

4.1 Computer program testing

On completion of the whole program, each module was again run from the main menu
was again tested by applying data on it. For this purpose, heavy data was applied to it to
ensure that system is working still accurately. A large number data is given to this project
and it was tested with that data, which could not produce any errors in the project so the
new system is fully tested and debugged, thus it may be implemented.

Fig 4.1: Computer program testing

4.2 Black Box Testing


Black box testing is a broad category that includes a variety of techniques and
technologies that check software from the outside without scanning the code. Black box
testing refers to any type of software test that examines an application without knowledge
of the internal design, structure, or implementation of the software project.

A & A Base Automatic home door lock 32


4.3 Module Testing
Module testing is a level of software testing where individual units are combined and
tested as a group. The purpose of this level of testing is to expose faults in the interaction
between integrated units. Test drivers and test stubs are used to assist in Integration
Testing.

4.4 Branch testing


Branch Testing is defined as a testing method, which has the main goal to ensure that
each one of the possible branches from each decision point is executed at least once and
thereby ensuring that all reachable code is executed. Each outcome from a code module is
tested as if the outcomes are binary. All the True and False Outcomes are tested.

4.5 Boundary value testing


This testing is a level of software testing where a system is tested for acceptability. The
purpose of this test is to evaluate the system’s compliance with the business requirements
and assess whether it is acceptable for delivery.

4.6 Testing of my project


In this project, we have defined the default password “100” in the Arduino. It can be
changed via coding. When we send the password, it will match it with the password
stored in the Arduino. If it is correct, then the solenoid lock moves as the door are opened
and then after 10 seconds door will automatically lock.

If the password is wrong, then the door will not be unlocked.

A & A Base Automatic home door lock 33


4.7 Testing result Validation

Fig 4.2: Test validation


4.8 Conclusion

Android and Arduino base home automatic door lock system is design for automatic
opening and closing the door through android application. This system is used for every
door like home or offices doors etc. This approach provides the users with the
functionality of automatic opening and closing the door through GSM and android
application.

A & A Base Automatic home door lock 34


Chapter 5
Results and Screenshots

A & A Base Automatic home door lock 35


5 Results and Screenshots

5.1 Login page

Fig 5.1: Login page


5.2 Registration Page

Fig 5.2: Registration page

A & A Base Automatic home door lock 36


5.3 Home page

Fig 5.3: Home page


5.4 Hardware results

re

Fig 5.4: Hardware results

A & A Base Automatic home door lock 37


Chapter 6
References training or manual training

A & A Base Automatic home door lock 38


6 Reference manual

6.1 Input Form

Fig 6.1: Input Form

In Fig 6.1 there is an android application which have following activities like Login,
Signup, home page activity. If we have no account then first we will go to signup page
and make an account then login and shift to home page. In home page we have only one
button which perform the function of sending the message to GSM module when we click
on this button.

A & A Base Automatic home door lock 39


6.2 Hardware Output

Fig 6.2: Hardware output

Fig 6.2 is the hardware system of the Android and Arduino base home automatic door
lock. In this hardware a lot of modules like GSM, breadboard, Arduino UNO, Ch Relay,
Solenoid Lock etc. Every module performs different works.

• GSM module perform the sending and receiving the massegse.


• When we give the command the Arduino UNO works according to our command.
Like we give the command for the Automatic door lock through GSM module.
• Relay is an electromechanical device that uses an electric current to open or close
the contacts of a switch. The single-channel relay module is much more than just a
plain relay, it comprises of components that make switching and connection easier
and act as indicators to show if the module is powered and if the relay is active or
not.
• A breadboard allows for easy and quick creation of temporary electronic
circuits or to carry out experiments with circuit design.
• The solenoid lock denotes a latch for electrical locking and unlocking. It is
available in unlocking in the power-on mode type, and locking and keeping in the
power-on mode type, which can be used selectively for situations. The power-on
unlocking type enables unlocking only while the solenoid is powered on.

A & A Base Automatic home door lock 40


6.3 References

[1] A. Jain, A. Shukla, and R. Rajan, "Password protected home automation system
with automatic door lock," MIT International Journal of Electrical and
Instrumentation Engineering, vol. 6, pp. 28-31, 2016.
[2] C. Gangadhar, R. Bhargude, A. Prabhu, A. Raut, and M. D. Bhosle, "BLE Based
Lock using Atmega 328."
[3] A. Mishra, S. Sharma, S. Dubey, and S. Dubey, "Password based security lock
system," International Journal of Advanced Technology in Engineering and
Science, vol. 2, no. 5, pp. 100-103, 2014.
[4] M. Van Der Werff, X. Gui, and W. Xu, "A mobile-based home automation
system," 2005.
[5] D. G. Seo, H. S. Ko, and Y. D. Noh, "Design and implementation of digital door
lock by iot," KIISE Transactions on Computing Practices, vol. 21, no. 3, pp. 215-
222, 2015.
[6] Y. A. Badamasi, "The working principle of an Arduino," in 2014 11th
international conference on electronics, computer and computation (ICECCO),
2014: IEEE, pp. 1-4.
[7] T. Adiono, S. Fuada, S. F. Anindya, I. G. Purwanda, and M. Y. Fathany, "IoT-
enabled door lock system," International Journal of Advanced Computer Science
and Applications, vol. 10, no. 5, 2019.
[8] H. Ahn and D. Lee, "The RELAY Module Design of Multi SNS Channel Auto
Streaming Server," Journal of Korea Society of Digital Industry and Information
Management, vol. 13, no. 4, pp. 213-219, 2017.
[9] M. Yuchun, H. Yinghong, Z. Kun, and L. Zhuang, "General application research
on GSM module," in 2011 International Conference on Internet Computing and
Information Services, 2011: IEEE, pp. 525-528.
[10] H. R. Esmaeel, "Apply android studio (SDK) tools," International Journal of
Advanced Research in Computer Science and Software Engineering, vol. 5, no. 5,
2015.
[11] M. Fezari and A. Al Dahoud, "Integrated development environment “IDE” for
Arduino," WSN applications, pp. 1-12, 2018.

A & A Base Automatic home door lock 41


[12] J. Voas, R. Kuhn, and P. Laplante, "Testing IoT Systems," in 2018 IEEE
Symposium on Service-Oriented System Engineering (SOSE), 2018: IEEE
Computer Society, pp. 48-52.

A & A Base Automatic home door lock 42

You might also like