Professional Documents
Culture Documents
Session (2018-2022)
Program
Bachelor of Studies in Software Engineering
Submitted By:
Supervised By:
Dr Hammad Sherazi
Assistant Professor
Department of CS & IT
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
COMMITTEE
Supervisor ___________________
Chairman ___________________
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
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
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.
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.
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.
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.
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.
• Arduino UNO
• GSM
• Android application
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 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]
i. Arduino UNO
ii. Breadboard
iii. GSM module
iv. Battery Cells
v. Bell Push button
vi. Jumper wires
vii. Relay
viii. 12v solenoid lock
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
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.
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.
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.
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.
• 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.
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.
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.
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.
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.
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
TX stands for transmit, and RX for receive. These are indicator LEDs which blink
whenever the UNO board is transmitting or receiving data.
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
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.
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.
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.
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]
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.
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.
i. Android studio
ii. IDE for Arduino
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]
This login activity is just to secure our application. Their password is not that which
password or code is required to open the door.
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)
I. User login
II. User name
III. User password
IV. User registered
Admin User
3.7.1.1 Admin
Username Password
Step 1: start
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 8: End
1. Android studio
2. IDE for Arduino
3.9.1 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.
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.
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.
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.
re
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.
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.
[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.