0% found this document useful (0 votes)
6 views

Home security system

The document outlines a final thesis submitted by students at Dire Dawa University on the design and implementation of a home security system that integrates password, fingerprint recognition, GSM communication, and infrared sensors. The system aims to enhance residential security by preventing unauthorized access and providing real-time alerts to homeowners. The thesis includes detailed methodologies, objectives, and the significance of the project in addressing modern security challenges.

Uploaded by

kelbesashibo429
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Home security system

The document outlines a final thesis submitted by students at Dire Dawa University on the design and implementation of a home security system that integrates password, fingerprint recognition, GSM communication, and infrared sensors. The system aims to enhance residential security by preventing unauthorized access and providing real-time alerts to homeowners. The thesis includes detailed methodologies, objectives, and the significance of the project in addressing modern security challenges.

Uploaded by

kelbesashibo429
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

DIRE DAWA UNIVERSITY

INSTITUTE OF TECHNOLOGY
SCHOOL OF ELECTRICAL AND COMPUTER ENGINEERING
INDUSTRIAL CONTROL ENGINEERING
FINAL THESIS ON:
DESIGN AND IMPLEMENTATION HOME SECURITY
SYSTEM(PASSWORD+FINGERPRINT+GSM)

A FINAL THESIS IS SUBMITTED IN PARTIAL FULFILLMENT OF THE


REQUIREMENTS FOR AWARD OF THE DEGREE OF BACHELOR OF SCIENCE IN
ELECTRICAL AND COMPUTER ENGINEERING (INDUSTRIAL CONTROL STREAM)
FROM DIRE DAWA UNIVERSITY
PREPARED BY:
NAME OF STUDENT ID NUMBER
KALBESA SHIBO 1200668
TADALA NOTE 1201342
GAMECHU WARE 1200436
KALID KADIR 1204162
MOHAMMED BIDRU 1200938
OUSMAN SEID 1201122

ADVISO R: NURYE HASSEN (M. SC)

MAY,2024
DIRE DAWA,ETHIOPIA
APPROVAL OF EXAMINER(S)

I/we, the undersigned, an examiner of the final open defense by have read and evaluated their
thesis entitled “Design and Implementation of Home security system” (password+fingerprint
GSM) and examined the candidate. This is, therefore, to certify that the thesis has been
accepted in the fulfillment of the requirements of the BSC Degree of Electrical and Computer
Engineering.

Advisor name Signature Date


……………… …………… …………..
Examiner
………………... ……………... ……………

…………………. ………………. ……………..

I
DECLARATION

We are students of Dire Dawa University, School of Electrical and Computer Engineering
(Stream of industrial control Engineering ).The following thesis done for Final project.
Moreover, all sources of materials that will be used for the project work will be fully
acknowledged.

Name of Student Signature Date


Kalbesa Shibo ………………….. …………….
Tadala Note ………………….. ……………..
Gamechu Ware …………………… ……………..
Kalid Kadir …………………… ……………..
Mohammed Bidru …………………… ……………..
Ousman Seid …………………… ……………..

II
ACKNOWLEDGEMENT

First of all, we are grateful to the Almighty God for enabling us to complete this Final project
work. We would like to take this opportunity to express our heartfelt gratitude to our advisor
Nurye Hassen (M.Sc) for his expert, sincere and valuable guidance and encouragement. We
are thankful for his aspiring guidance, invaluably constructive criticism and friendly advice
during the project work. We have been able to learn the skills from him, which have benefited
us immensely and will continue to help us throughout our future endeavors, both academically
and professionally. Finally, we would like to express our gratitude to Dire Dawa University,
school of Electrical and Computer Engineering (stream of industrial control Engineering) staff
members for their valuable advice and good communicate help to complete the project
successfully.

III
Table of contents
APPROVAL OF EXAMINER(S) ............................................................................................. I

DECLARATION ...................................................................................................................... II

ACKNOWLEDGEMENT ....................................................................................................... III

LIST OF FIGURES .................................................................................................................VI

LIST OF TABELS ................................................................................................................. VII

LIST OF ACRONYMS ........................................................................................................ VIII

ABSTRACT .............................................................................................................................IX

CHAPTER ONE ........................................................................................................................ 1

INTRODUCTION ..................................................................................................................... 1

1.1 Background ...................................................................................................................... 1

1.2 Problem Statement ........................................................................................................... 2

1.3 Objectives The Project .................................................................................................... 3

1.3.1 General Objective ..................................................................................................... 3

1.3.2 Specific Objectives .................................................................................................. 3

1.4 Scope of The Project ....................................................................................................... 4

1.5 Significance Of The Project ............................................................................................. 5

1.6 Limitations ...................................................................................................................... 5

CHAPTER TWO ....................................................................................................................... 6

LITERATURE REVIEW .......................................................................................................... 6

CHAPTER THREE ................................................................................................................... 8

METHODOLOGY AND MATERIALS ................................................................................... 8

3.1 Design, Implementation and Operation Phase of The System ........................................ 8

3.1.1 Design Phase ............................................................................................................ 8

3.1.2 Implementation Phase ............................................................................................... 8

3.2 Project Activities .............................................................................................................. 9

3.3 Designing of Proposed System Block Diagram............................................................. 10

3.4 Project Process Flow ...................................................................................................... 11


IV
3.5 Selection Of Hardware Components ............................................................................ 13

3.5.1 Arduino Uno ........................................................................................................... 13

3.5.2 Keypad ................................................................................................................... 15

3.5.2 Fingerprint scanner ................................................................................................ 16

3.5.3 LCD display ............................................................................................................ 20

3.5.3 GSM Module .......................................................................................................... 21

3.5.4 Relay ....................................................................................................................... 23

3.5.5 Infrared Sensor ........................................................................................................ 25

3.5.6 solenoid Lock .......................................................................................................... 27

3.5.7 Jumper Wires .......................................................................................................... 29

3.6 Software Requirements .................................................................................................. 30

3.6.1 Arduino programming ............................................................................................ 30

CHAPTER FOUR .................................................................................................................... 31

RESULT ANALYSIS AND DISCUSSION ........................................................................... 31

4.1 Fingerprint Enrolling ..................................................................................................... 32

4.2 Finger test and matching ................................................................................................ 33

4.3 Circuit Diagram ............................................................................................................. 34

4.4 Interfacing ...................................................................................................................... 36

CHAPTER FIVE ..................................................................................................................... 37

CONCLUSION AND RECOMMENDATION ....................................................................... 37

5.1 Conclusion ..................................................................................................................... 37

5.2 Recommendation ........................................................................................................... 38

REFERENCES ........................................................................................................................ 39

APPENDIX .............................................................................................................................. 41

ARDUINO SOURCE CODE .................................................................................................. 41

V
LIST OF FIGURES

Figure 1: Flow chart of the project activities ............................................................................. 9


Figure 2: Block diagram of the system interfaced by Arduino ................................................ 10
Figure 3: Flow Chart Of Project Process ................................................................................. 12
Figure 4: Arduino Uno ATmega328P Microcontroller Board [2] ........................................... 13
Figure 5: Rows and columns of a keypad [.............................................................................. 15
Figure 7: An 8-bit image of minutiae ...................................................................................... 16
Figure 9: Fingerprint scanner process flow ............................................................................. 19
Figure 10: 16x2 LCD display[7] .............................................................................................. 20
Figure 11: GSM modem and pin configuration[12] ................................................................ 22
Figure 12: 5v four-channel Relay module[8]........................................................................... 24
Figure 13: Infrared (IR) Sensor Module[13] ........................................................................... 26
Figure 14:12v Solenoid Door Lock ......................................................................................... 28
Figure 15: Jumper Wire (Male-Male, Male-Female, Female-Female).................................... 29
Figure 16: Arduino IDE Development Cycle[15] ................................................................... 30
Figure 17: Fingerprint enrolling output at serial monitor ........................................................ 32
Figure 18: Finger test output at serial monitor......................................................................... 33
Figure 19: Circuit diagram of home security system ............................................................... 34
Figure 20: Circuit diagram showing when password working ................................................ 35
Figure 21: Final product........................................................................................................... 36

VI
LIST OF TABELS

Table 1: Arduino Uno Parameters Descriptions………………………………………14


Table 2: Adafruit Fingerprint Sensor Specifications………………………………….19
Table 3: LCD display pin description…………………………………………………22

VII
LIST OF ACRONYMS

GSM Global System for Mobile


LCD Liquid Crystal Display
NO Normally Open
NC Normally Closed
SMS Short Message Service
USB Universal Serial Bus
ADC Analog To Digital Converter
LED Light Emitting Diode
TX Transmitter
ESD Electrostatic Discharge
COM Common
SSR Solid State Relay
EMR Electromagnetic Relay
IR Infrared
DC Direct Current
RX Receiver
V Voltage
IDE Integrated Development Environment
VCC Voltage Common Collector
GND Ground
RFID Radio Frequency Identification

VIII
ABSTRACT

This paper presents the design and implementation of a home security system for door lock
system that incorporates multiple security mechanisms, including password, fingerprint, GSM,
infrared sensor, and solenoid door lock. The system is designed to enhance the security of
homes and prevent unauthorized access.The system incorporates a password and fingerprint
recognition module to allow users to open the door using their unique credentials. For added
security, the system includes a GSM module that sends an alert message to the registered
mobile phone number if someone enters the wrong password or fingerprint more than
twice.Furthermore, the system utilizes an infrared sensor to detect the presence of objects
around windows. If any object is detected, the system sends a message to the registered mobile
phone number, alerting the user of potential suspicious activity.The solenoid door lock is
controlled by a relay and is used to open or close the door. The relay receives commands from
the arduino microcontroller, which evaluates the user's input and decides whether to open or
close the door.The hardware components of the system are interfaced with an Arduino
microcontroller, which serves as the central processing unit. The system is programmed using
the Arduino IDE, and the source code is provided for ease of implementation and customization.
Keywords: Arduino, password, fingerprint scanner, GSM module, infrared sensor, solenoid
door lock.

IX
CHAPTER ONE

INTRODUCTION

1.1 Background

Home security is a major concern for homeowners, especially in urban areas. Traditional door
locks can be easily bypassed by burglars, making it essential to implement more sophisticated
security measures. Electronic door lock systems offer a more secure alternative, as they require
users to enter a password, fingerprint, or other unique credential to gain access.n an era where
security concerns are paramount, the integration of advanced technologies intoI home security
systems becomes imperative. In this context, the Arduino microcontroller platform emerges as
a versatile and reliable tool for designing innovative solutions. This introduction delves into
the design and implementation of a cutting-edge Home Security System centered around a door
lock mechanism, incorporating a blend of password, fingerprint, GSM (Global System for
Mobile Communications), infrared sensor, and solenoid door lock functionalities.The
incorporation of password authentication serves as the primary line of defense in the Arduino-
based home security system. By implementing a secure password mechanism, homeowners
can restrict access to designated individuals and prevent unauthorized entry. The Arduino
platform facilitates the seamless integration of keypad or touchscreen interfaces, allowing users
to input and verify passwords with ease.Leveraging biometric authentication through
fingerprint recognition enhances the security posture of the system. By enrolling authorized
fingerprints into the database, the Arduino-based system can accurately identify individuals
and grant access privileges accordingly. This biometric feature not only offers enhanced
security but also eliminates the need for cumbersome password memorization, providing a
streamlined and user-friendly experience.The integration of GSM technology enables real-time
communication and remote monitoring capabilities within the home security system. By
leveraging GSM modules or shields, the Arduino device can transmit alerts, notifications, and
status updates to homeowners' mobile devices or designated recipients. This seamless
connectivity empowers users to remotely arm/disarm the system, receive intrusion alerts, and
access live surveillance feeds from anywhere, thereby enhancing situational awareness and
responsiveness.

1
The utilization of infrared (IR) sensors augments the detection and surveillance capabilities of
the Arduino-based security system. IR sensors can detect motion and presence within
designated areas, triggering immediate responses such as alarm activation or alert notifications.
By strategically deploying IR sensors across key entry points and vulnerable areas,
homeowners can effectively monitor and deter potential intrusions, bolstering the overall
security posture of their premises.

1.2 Problem Statement

In the contemporary landscape of residential security, traditional door lock mechanisms are
often insufficient to mitigate the evolving threats posed by intruders. The need for more robust
and intelligent home security systems has become increasingly imperative. This problem
statement seeks to explore the challenges inherent in designing and implementing an Arduino-
based Home Security System for door locks, integrating password, fingerprint, GSM, infrared
sensor, and solenoid door lock functionalities, while delving deeply into the complexities
associated with each component., conventional door locks, reliant solely on mechanical keys,
are susceptible to vulnerabilities such as lock picking and key duplication. This antiquated
approach to security fails to provide adequate protection against modern intrusion techniques.
Therefore, there is a critical need to develop door lock systems that leverage advanced
authentication methods, such as passwords and fingerprint recognition, to fortify residential
security against unauthorized access attempts.the integration of multiple authentication
modalities, including password and fingerprint recognition, presents intricate design challenges.
Ensuring seamless interoperability between these diverse authentication mechanisms while
maintaining a high level of security and user-friendliness demands meticulous system
architecture and software development expertise. Additionally, optimizing the speed and
accuracy of biometric identification processes in varying environmental conditions further
complicates the design and implementation process.incorporating GSM communication
capabilities introduces a new set of challenges related to network connectivity, data
transmission, and security protocols. Reliable communication between the Home Security
System and the homeowner's mobile device is essential for real-time monitoring and alerting.
However, mitigating issues such as network coverage limitations, signal interference, and data
privacy concerns necessitates careful consideration during system design and
implementation.the utilization of infrared sensors for window surveillance presents challenges
associated with environmental factors and false alarms. Infrared sensors are sensitive to

2
changes in ambient conditions such as temperature fluctuations and the presence of nearby
objects. Distinguishing between genuine security threats and false positives requires the
development of sophisticated algorithms for signal processing and sensor calibration to ensure
accurate detection and minimize false alarms.

1.3 Objectives The Project

1.3.1 General Objective

The general objective of our project is to design and implementation of home security system
( for door access and window) by integration of password and fingerprint with GSM

1.3.2 Specific Objectives

The specific objectives of the project are to:


 Design and implement a password and fingerprint recognition module
 Design and implement a GSM module to send alert messages to a registered mobile phone
number
 Design and implement an infrared sensor to detect objects around windows
 Design and implement a solenoid door lock controlled by a relay
 Integrate all of these components into a single, cohesive system
 Test and evaluate the system to ensure that it meets the requirements

3
1.4 Scope of The Project

This project aims to develop an Arduino-based Home Security System tailored for door lock
control, integrating a robust combination of security measures including password, fingerprint
recognition, GSM communication, infrared sensing, and solenoid door lock activation. The
system's core functionality revolves around providing secure access control to a residential
property, enabling users to conveniently manage door entry while ensuring the utmost security
against unauthorized access attempts. Leveraging the Arduino platform, the system will be
designed to seamlessly integrate multiple sensors and modules, orchestrating their interactions
to create a comprehensive security solution. The solenoid door lock, controlled via relay, serves
as the primary mechanism for granting or denying access, responding to authenticated user
inputs and sensor feedback.The implementation phase will involve meticulous hardware
configuration and software development to orchestrate the interaction between the various
components. Each security feature will be carefully integrated into the system's architecture,
with particular attention to seamless user experience and robust security protocols. Password
authentication will be implemented through a keypad interface, while fingerprint recognition
will utilize dedicated sensor modules to enhance security. The GSM module will enable remote
monitoring and control of the system, facilitating real-time alerts and access management via
SMS communication. Additionally, the infrared sensor will provide motion detection
capabilities, further fortifying the system against unauthorized entry attempts. Through
systematic testing and validation procedures, the project will ensure the reliability, efficiency,
and security of the Arduino-based Home Security System, offering homeowners peace of mind
and enhanced control over their property's access points.

4
1.5 Significance Of The Project

The significance of implementing an Arduino-based Home Security System with a


multifaceted approach to door lock control cannot be overstated in today's context of increasing
concerns about personal safety and property security. By integrating password, fingerprint,
GSM, infrared sensor, and solenoid door lock functionalities, this system offers a
comprehensive defense against unauthorized access attempts. The inclusion of password and
fingerprint recognition adds layers of authentication, ensuring that only authorized individuals
can gain entry. Moreover, the integration of GSM communication enables remote monitoring
and control, empowering homeowners to manage access to their property from anywhere,
thereby enhancing convenience and security. The infrared sensor further enhances the system's
effectiveness by detecting motion near the door, alerting homeowners to potential security
breaches in real-time. Ultimately, the Arduino-based design offers a flexible and cost-effective
solution, allowing for easy customization and expansion to meet evolving security needs,
making it an invaluable asset for modern homeowners seeking to safeguard their homes and
loved ones.

1.6 Limitations

Our project has certain limitations and list of such is mentioned below:
 During simulation Fingerprint sensor is not found on proteus
 GSM module is not working properly ,sometimes it disconnected
 There is mechanism to reset forgotten password

5
CHAPTER TWO

LITERATURE REVIEW

Arduino-based home security systems have gained significant traction in recent years due to
their flexibility, affordability, and ease of implementation. These systems typically integrate
various sensors, communication modules, and actuators to provide comprehensive protection
against unauthorized access. In the context of door lock systems, several studies have explored
the integration of multiple security features, including password, fingerprint recognition, GSM
communication, infrared sensors, and solenoid door locks.
Password-based door lock systems have been extensively researched and implemented in
various contexts. Researchers such as Wang et al. (2017) explored the design and
implementation of Arduino-based password-protected door lock systems, emphasizing the
importance of robust authentication mechanisms to prevent unauthorized access. Similarly,
Gupta et al. (2018) proposed a novel password-based door lock system using Arduino,
highlighting the system's effectiveness in enhancing security while maintaining user
convenience.
Fingerprint recognition technology has also been widely studied for its applications in home
security systems. Studies such as Li et al. (2019) have investigated the design and
implementation of fingerprint-based authentication systems using Arduino platforms. These
systems leverage fingerprint sensor modules to accurately identify authorized users, offering a
higher level of security compared to traditional password-based methods.
The integration of GSM communication modules in home security systems enables remote
monitoring and control, enhancing the system's accessibility and effectiveness. Research by
Sharma et al. (2020) focused on the development of Arduino-based GSM-controlled door lock
systems, demonstrating the feasibility of remote access management via SMS communication.
Similarly, studies by Kumar et al. (2018) highlighted the importance of GSM-enabled security
systems in providing real-time alerts and notifications to homeowners.
Infrared sensors play a crucial role in detecting motion and proximity in home security
applications. Research by Zhang et al. (2016) explored the use of Arduino-based infrared
sensor modules for intruder detection and alarm systems, emphasizing the sensor's
effectiveness in detecting unauthorized entry attempts. Integrating infrared sensors into door
lock systems enhances security by providing an additional layer of detection against potential
threats.

6
Solenoid door locks controlled by relays are commonly used in Arduino-based door lock
systems to provide physical access control. Research by Han et al. (2019) investigated the
design and implementation of solenoid door lock systems using Arduino microcontrollers,
highlighting the reliability and efficiency of relay-controlled mechanisms for door access
control
Based on a journal written by Wheeler et.al. (2000) on face-verification system, this system is
time-consuming to build because the users need to have more than one images to separate ID
and non-ID images for identification data storage purposes. Despite of its advantages of
identifying intra and interdependencies, it is proven that this system is inefficient because it
took 6 seconds to make decision while the aim is within 2 seconds [11].
The fact of time-consuming system has also been said in a journal written by Ibrahim et. al.
(2011) on face-recognition system. Face-recognition is difficult to build as there are alot of
factor needs to be considered during image capturing which are illumination, distance and an
individuals head orientation. This system is also sensitive to aging and facial expression. It is
also troublesome during experimental work as many faces need to be taken at nine different
angles [9].12
Another access control system project by using voice-recognition system done by Rashid et.
al. (2008) is also a sensitive system as it will reject the voice input if there are background
noise [10].

7
CHAPTER THREE

METHODOLOGY AND MATERIALS

3.1 Design, Implementation and Operation Phase of The System

3.1.1 Design Phase

 Define requirements: Identify the specific needs and objectives of the home security
system.
 Research and select components: Choose the appropriate hardware and software
components for the system, based on the requirements.
 Design the system architecture: Create a block diagram or other visual representation of
the system, showing how the components will interact with each other.
 Develop the software: Write the code for the system, using the Arduino programming
language.
 Test the system: Test the system thoroughly to ensure that it meets the requirements.

3.1.2 Implementation Phase

 Assemble the hardware: Connect the hardware components according to the system design.
 Install the software: Upload the software to the Arduino board.
 Test the system: Test the system again to ensure that it is working properly.
 Install the system: Install the system in the desired location.

8
3.2 Project Activities

The project activities are done according to flow chart in Figure 1. The
procedure shows the activity from the beginning of the project until it is
completed

Figure 1: Flow chart of the project activities

9
3.3 Designing of Proposed System Block Diagram

POWER

Keypad LCD Display

ATMEGA328P

Fingerprint Scanner Relay

Infrared Sensor GSM Solenoid Lock

Figure 2: Block diagram of the system interfaced by Arduino

10
3.4 Project Process Flow

 Initialization:Power up the Arduino-based home security system.Initialize all hardware


components, including the solenoid door lock, relay, fingerprint sensor, GSM module, and
infrared sensor.
 User Authentication:Prompt the user to enter a password using the keypad interface.Verify
the entered password against the stored password in the system.If the password is correct,
proceed to fingerprint authentication.If the password is incorrect, increment the incorrect
password attempt counter.
 Fingerprint Authentication:Prompt the user to place their fingerprint on the fingerprint
sensor.Compare the scanned fingerprint with the authorized fingerprints stored in the
system.If the fingerprint is recognized, grant access to the user.If the fingerprint is not
recognized, increment the incorrect fingerprint attempt counter.
 Error Handling:Check the incorrect password and fingerprint attempt counters.If either
counter exceeds the predefined threshold (e.g., two attempts), trigger an alert. Send a
message to the predefined mobile phone numbers via the GSM module indicating a
potential security breach.
 Infrared Sensor Monitoring:Continuously monitor the infrared sensor to detect motion or
objects around windows.If the infrared sensor detects an object within the specified range,
trigger an alert.Send a message to the predefined mobile phone numbers via the GSM
module indicating the presence of an object near the window.
 Door Lock Control:Upon successful authentication (either through password or
fingerprint), activate the solenoid door lock via the relay.If access is granted, open the door
by activating the solenoid door lock.If access is denied due to incorrect authentication or
security breach, keep the door locked.
 Continuous Monitoring:Continuously monitor the system for any unauthorized access
attempts.

11
START

Energize Components

Enter password/fingerprint

Insert fingerprint Insert keypad

If IR=high

NO Is valid YES YES Is correct NO

finger? password
YES
1st& 2nd attemts 1st& 2nd attemts

Display message Display message


access denied Display message access denied

access granted
rd
(3 attemts) (3rd attemts)

Send message Send message


Door open
to phone to phone

Door not open END Door not open

Figure 3: Flow Chart Of Project Process

12
3.5 Selection Of Hardware Components

3.5.1 Arduino Uno

A micro-controller is a small computer on a single integrated circuit containing a processor


core, memory, and programmable input/output peripherals The important part for us is that a
micro-controller contains the processor (which all computers have) and memory, and some
input/output pins that you can control. (Often called GPIO - General Purpose Input Output
Pins). Arduino Uno is a microcontroller board based on the ATmega328P. It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz
crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains
everything needed to support the micro controller; simply connect it to a computer with a USB
cable or power it with an AC-to-DC adapter or battery to get started. You can tinker with your
UNO without worrying too much about doing something wrong, worst case scenario you can
replace the chip for a few dollars and start over again. “Uno" means one in Italian and was
chosen to mark the release of Arduino Software (IDE) 1.0. The Uno board and version 1.0 of
Arduino Software (IDE) were the reference versions of Arduino, now evolved to newer
releases. The Uno board is the first in a series of USB Arduino boards.

Figure 4: Arduino Uno ATmega328P Microcontroller Board [2]

13
Specifications Details
Microcontroller ATmega328P
Operating Voltage 5V
Input Voltage (recommended) 7V-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 20 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32KB(ATmega328P)
SRAM 2KB(ATmega328P)
EEPROM 1 KB (ATmega328P)
Clock Speed 16MHz

Table 1: Arduino Uno Parameters Descriptions [1]

14
3.5.2 Keypad

A keypad is a device used to enter the desired output. In this project a keypad matrix
with 16 push buttons is used as shown in Figure 6. This type of keypad has four rows
and four columns whereby the overlapping rows and columns are the keys as shown
in Figure 5

Figure 5: Rows and columns of a keypad [4] Figure 6: 4x4 keypad matrix [3]

A 4x4 matrix keypad is a type of input device consisting of a grid of 16 buttons arranged in
four rows and four columns. Each button represents a specific input, typically a digit from 0 to
9 or special characters such as *, #, or letters.The structure of a 4x4 matrix keypad is organized
into rows and columns, forming a grid-like pattern:
Rows: There are four rows labeled R1 through R4. Each row consists of four buttons placed
horizontally.
Columns: There are also four columns labeled C1 through C4. Each column consists of four
buttons placed vertically.
How it works
Scanning: The microcontroller scans the rows and columns of the keypad to detect button
presses.
Row scanning: Initially, all rows are set to a high-impedance state (often referred to as
"floating"), while columns are configured as inputs with internal or external pull-up resistors
enabled. This configuration allows the microcontroller to detect changes in the columns.
Column scanning: The microcontroller sequentially sets each row to a low state (ground), one
at a time, while simultaneously reading the state of the columns. When a button is pressed, it

15
creates a connection between a specific row and column, causing the corresponding column to
detect a low state (indicating a button press).
Button identification: By identifying which row and column have a low state, the
microcontroller can determine which button was pressed based on its position in the grid.
Debouncing: To ensure accurate detection, debounce logic is often implemented to filter out
any noise or bouncing that may occur when a button is pressed or released.

3.5.2 Fingerprint scanner

A fingerprint scanner is a type of biometric scanner which scans the human fingerprint. Its
function is to capture the human fingerprint as in Figure 7. There are two types of fingerprint
scanner which are optical and capacitive fingerprint scanner. The differences between these
two types of fingerprint is that the optical fingerprint and capacitive fingerprint scanner
captures minutiae by light and current respectively. In this project, the optical scanner is used
because it is less accessible to electrostatic discharge (ESD) compared to capacitive fingerprint
scanner. The fingerprint scanner is frequently implemented in control access system. The
reason being is because every human have different fingerprint minutiae which helps in
identifying the true data of a person accurately. In the case of door access system, the person
who wishes to enter the building needs to scan their fingerprint to be Based on Figure 8, in this
project the Adafruit fingerprint scanner used can cater up to 162 fingerprints. The fingerprint
scanner process flow is shown in Figure 9

Figure 7: An 8-bit image of minutiae [5] Figure 8:Adafruit fingerprint sensor[6]

16
The Adafruit fingerprint sensor is a biometric identification device manufactured by Adafruit
Industries. It allows users to easily add fingerprint recognition to their projects, enabling secure
access control, authentication, and other biometric applications. One popular model is the
Adafruit Fingerprint Sensor (GT-521F32/GT-521F52), which is based on the GT-521F32/GT-
521F52 chipset.
Pin Description (for GT-521F32/GT-521F52):
The Adafruit Fingerprint Sensor typically features several pins for interfacing with
microcontrollers or other devices. Here's a common pin configuration:
TX (Transmit): This pin is used to transmit data from the sensor to the microcontroller.
RX (Receive): This pin is used to receive data from the microcontroller to the sensor.
VCC: Power supply pin. Connect to a regulated 3.3V or 5V power source.
GND: Ground pin. Connect to the ground of the power source.
RESET: Reset pin. Pulses on this pin reset the sensor.
LED: This pin controls the onboard LED indicator, which may be used for status indication.
ADC: Analog-to-Digital Converter pin, used for fingerprint image acquisition.
GPIO: General Purpose Input/Output pin. Can be used for additional functionality such as
interrupt handling or controlling external devices.

The color of the wires on an Adafruit fingerprint sensor can vary depending on the specific
model and manufacturer. However, here's a general guideline based on common practices:
Red: Typically, the red wire indicates the positive power supply connection. It should be
connected to the VCC (Voltage Common Collector) or a 5V power source on your
microcontroller or power supply.
Black or Brown: The black or brown wire usually represents the ground connection (GND).
It should be connected to the ground (GND) pin on your microcontroller or power supply.
Green or Blue: The green or blue wire might be used for communication purposes, such as
transmitting data (TX) or receiving data (RX). These wires are often used for serial
communication between the fingerprint sensor and your microcontroller. Sometimes, TX is
blue, and RX is green, or vice versa.
Yellow or White: The yellow or white wire could be used for additional functionality, such as
reset (RESET) or general-purpose input/output (GPIO) pins. These wires might have different
functions depending on the specific requirements of your project.

17
Orange or Gray: Occasionally, there might be additional wires in different colors, serving
various purposes such as enabling an LED indicator, providing analog signals, or acting as
auxiliary communication channels.
Adafruit Fingerprint Sensor Specifications
Descriptions Details
Supply voltage 3.6 - 6.0VDC
Operating current: 120mA max
Peak current 150mA max
Fingerprint imaging time <1.0 seconds
Window area 14mm x 18mm
Signature file 256 bytes
Template file 512 bytes
Storage capacity 162 templates
Safety ratings (1-5 low to high safety
False Acceptance Rate <0.001% (Security level 3)
False Reject Rate <1.0% (Security level 3)
Interface TTL Serial
Baud rate: 9600, 19200, 28800, 38400, 57600
(default is 57600)
Working temperature rating -20C to +50C
Working humidy 40%-85% RH
Full Dimensions 56 x 20 x 21.5mm
Exposed Dimensions (when placed in box): 21mm x 21mm x
21mm triangular
Weight: 20 grams

Table 2: Adafruit Fingerprint Sensor Specifications

18
Figure 9: Fingerprint scanner process flow

19
3.5.3 LCD display

A 16x2 LCD display which has 2 horizontal lines comprising a space of 16


displaying character is used in this project as shown in Figure 9. It has two types of
registry inbuilt which are:-
a) Command register that is use to insert command
b) Data register that is use to insert data
In this project ,the function of the LCD display is to displays the desired output
according to the program. Based on Table 1 ,each LCD pins has its own and it is
connected to Arduino I/O digital pins.

Figure 10: 16x2 LCD display[7]

Table 3: LCD display pin description [7]

20
3.5.3 GSM Module

A GSM is a mobile communication modem it is standards for global system for mobile
communication (GSM). The idea of GSM was developed at Bell laboratories in 1970. It is
widely used mobile communication system in the world. GSM is an open and digital cellular
technology used for transmitting mobile voice and data services operate. GSM is modem is a
specialized type of modem which accepts a SIM card, and operates over a subscription to a
mobile operator, just like a mobile phone. From the mobile operator perspective, a GSM
modem looks just like a mobile phone. When a GSM modem is connected to a computer, this
allows the computer to use the GSM modem to communicate over the mobile network. While
these GSM modems are most frequently used to provide mobile internet connectivity, many of
them can also be used for sending and receiving SMS and MMS messages. GSM modems can
be a quick and efficient way to get started with SMS, because a special Subscription to an SMS
service provider is not required. In most parts of the world, GSM Modems are a cost-effective
solution for receiving SMS messages, because the sender is paying for the message delivery.
A GSM modem exposes an interface that allows applications such as Now SMS to send and
receive messages over the modem interface. The mobile operator charges for this message
sending and receiving as if it was performed directly on a mobile phone. To perform these tasks,
a GSM modem must support an “extended AT command set” for sending/receiving SMS
messages. GSM modules are manufactured by different companies.
They all have different input power supply specs. We need to double check our GSM modules
power requirements. The GSM module requires a 12 volts input, so we feed it using a 12V, 1A
DC power supply. It can be noticed that GSM modules which require 15 volts and some other
which needs only 5 volts. They differ with manufacturers. If we are having a 5V module, we
can power it directly from Arduino 5V out.
GSM Architecture
A GSM network consists of the following components, these are:
A mobile station: It is mobile phone which consists of the transceiver, the display and the
processor and is controlled by a SIM card operating over the network.
Base station subsystem: It acts as an interface between the mobile station and the network
subsystem. It consists of the base Transceiver station which contains the radio transceivers and
handles the protocols for communication with mobiles. It also consists of the base transceiver
station and acts as an interface between the mobile station and mobile switching center.

21
Network subsystem: It provides the basic network connection to the mobile stations. The basic
22part of the network subsystem is the mobile service switching center which provides access
to different networks like ISDN, PSTN etc. It also consists of the home location register and
the visitor location register which provides the call routing and roaming capabilities of the
GSM. It also contains the equipment‟s identity register which maintains an account of all the
mobile equipment where in each mobile is identified by IMEI number. IMEI stands for
international mobile equipment identity.

Figure 11: GSM modem and pin configuration[12]

22
3.5.4 Relay

A relay is an electromechanical device commonly used in electrical circuits to control a high-


power or high-voltage circuit with a low-power signal. It essentially acts as a switch that is
controlled by an electrical signal. Relays are crucial components in various applications, from
simple home automation systems to complex industrial machinery.
The working principle of a relay is based on electromagnetic induction. A typical relay consists
of an electromagnet, a set of contacts (usually two or more), and a spring-loaded mechanism.
When an electric current flows through the coil of the electromagnet, it generates a magnetic
field around it. This magnetic field attracts an armature connected to one or more movable
contacts. As a result, these contacts are pulled towards the electromagnet, closing the circuit
they are part of.
When the current through the coil is switched off, the magnetic field collapses, releasing the
armature and allowing the spring-loaded mechanism to return the contacts to their original
position, thereby opening the circuit.
Relays are commonly classified into two main types based on their operating principles:
Electromechanical Relays (EMRs): These relays use an electromagnet to mechanically
operate the switch contacts. They are widely used due to their reliability and versatility.
Solid-State Relays (SSRs): Unlike EMRs, SSRs use semiconductor devices such as thyristors
or transistors to perform switching operations. They offer advantages like faster switching
speeds, longer lifespan, and silent operation, but they may not be as suitable for high-power
applications as EMRs.

23
Figure 12: 5v four-channel Relay module[8]

Pin Configuration:
Relays typically have several pins for connecting them to the circuit. The number and
configuration of these pins can vary depending on the specific type and model of the relay.
However, the most common types of relays have pins arranged in a standard configuration.
Here's a brief overview:
Coil Pins (Control Pins): These pins are used to connect the relay coil to the control circuit.
When a voltage is applied across these pins, it energizes the coil, generating the magnetic field
that actuates the relay.
Normally Open (NO) Contact Pins: These pins are connected to one end of the switch
contacts. When the relay is not energized, these contacts are open, meaning there is no electrical
connection between them. When the relay is energized, these contacts close, allowing current
to flow between them.
Normally Closed (NC) Contact Pins: These pins are connected to the other end of the switch
contacts. When the relay is not energized, these contacts are closed, providing a continuous
electrical connection between them. When the relay is energized, these contacts open,
interrupting the flow of current.

24
Common (COM) Pins: These pins are typically used to connect the common terminal of the
switch contacts. In a single-pole, double-throw (SPDT) relay, there is one common pin shared
between the NO and NC contacts. In multi-pole relays, there may be multiple common pins.

3.5.5 Infrared Sensor

An infrared (IR) sensor is a device that detects infrared radiation emitted or reflected by objects.
It's commonly used in various applications such as motion detection, temperature sensing,
proximity sensing, and remote controls. IR sensors operate based on the principle of detecting
changes in infrared radiation levels within their detection range.
Working Principle:
The working principle of an infrared sensor depends on the type of sensor and its specific
application. However, the basic principle involves the interaction between infrared radiation
and the sensor's components. Here's a simplified overview:
Emitter: In some IR sensor configurations, there's an infrared emitter (usually an IR LED) that
emits infrared radiation.
Detector: The IR detector, often a photodiode or a phototransistor, receives the infrared
radiation. When infrared radiation falls on the detector, it generates a voltage or current
proportional to the intensity of the received radiation.
Filter and Signal Processing: Some IR sensors include a filter to block unwanted radiation
and focus on the desired wavelength range. Additionally, signal processing circuitry may be
employed to amplify and interpret the output signal from the detector.
Detection: When an object enters the sensor's field of view and emits or reflects infrared
radiation, it alters the intensity of the radiation reaching the detector. This change in radiation
level triggers a response from the sensor, indicating the presence or absence of the object.
Depending on the specific application, IR sensors can be designed to detect various aspects
such as motion, temperature, distance, or the presence of obstacles.
Pin Configuration:
The pin configuration of an infrared sensor can vary based on the sensor model and
manufacturer. However, here's a general outline of the typical pin configuration for an IR
sensor module:
VCC (or +V): This pin is connected to the positive terminal of the power supply, providing
the operating voltage for the sensor. It's usually labeled as VCC or +V.

25
GND (or -V): This pin is connected to the ground or negative terminal of the power supply,
completing the circuit. It's labeled as GND or -V.
OUT (or Signal): This pin outputs the signal from the sensor indicating the detection status or
any measured parameters. The signal may be digital (e.g., high or low voltage) or analog (e.g.,
voltage proportional to detected intensity).

Figure 13: Infrared (IR) Sensor Module[13]

26
3.5.6 solenoid Lock

A 12V solenoid lock is a type of electromechanical lock that operates using a solenoid
mechanism and requires a 12-volt power supply to function. Solenoid locks are commonly used
in various applications where secure access control is needed, such as doors, cabinets, drawers,
and safes.
Here's how a typical 12V solenoid lock works:
Solenoid Mechanism: At the heart of the solenoid lock is a solenoid, which is essentially an
electromagnet. It consists of a coil of wire wound around a metal core. When an electric current
passes through the coil, it generates a magnetic field that magnetizes the core.
Locking Mechanism: The solenoid lock is designed to engage or disengage a locking
mechanism when activated. This locking mechanism can be a bolt, latch, or other type of
locking device depending on the specific application.
Control Circuit: The solenoid lock is connected to a control circuit, typically powered by a
12-volt DC power source. The control circuit includes components such as switches, relays,
and possibly a microcontroller for electronic control.
Activation: When a valid input signal is received by the control circuit, it triggers the solenoid
to energize. The energized solenoid generates a magnetic field, which pulls the locking
mechanism into the locked or unlocked position, depending on the design.
Locking/Unlocking: When the solenoid is energized, the locking mechanism is either engaged
or disengaged, allowing the door, cabinet, or drawer to be securely locked or unlocked.
Power Requirement: A 12-volt power supply is required to operate the solenoid lock. This
can be provided by batteries, a dedicated power adapter, or a centralized power supply
depending on the installation.

27
Security Features: Some solenoid locks may include additional security features such as
keypads, RFID readers, or biometric scanners for authentication before allowing access.
Durability and Reliability: Solenoid locks are known for their durability and reliability,
making them suitable for both residential and commercial applications where security is
paramount.

Figure 14:12v Solenoid Door Lock

28
3.5.7 Jumper Wires

Jumper wires are essential components in electronics and electrical projects, serving as
connectors to establish electrical connections between various components on a breadboard,
circuit board, or prototype. They are flexible wires with connectors or pins at both ends,
allowing them to be easily inserted into breadboard holes or connected to electronic
components. Jumper wires play a crucial role in electronics prototyping, testing, and circuit
building:
Uses:
Jumper wires play a crucial role in electronics prototyping, testing, and circuit building:
Bread boarding: When prototyping circuits on a breadboard, jumper wires are used to create
electrical connections between components, such as integrated circuits (ICs), resistors,
capacitors, and LEDs. They allow for quick and temporary connections without the need for
soldering.
Testing and Troubleshooting: Jumper wires are used to test circuits and troubleshoot issues
by manually creating or modifying connections to identify faulty components or wiring errors.
Component Interfacing: Jumper wires facilitate connections between various electronic
components and modules, such as microcontrollers, sensors, motors, and displays, enabling the
integration of different parts into a cohesive circuit.
Education and Learning: Jumper wires are commonly used in educational settings, such as
classrooms and workshops, to teach electronics concepts, circuit design, and experimentation
due to their simplicity and versatility.

Figure 15: Jumper Wire (Male-Male, Male-Female, Female-Female)

29
3.6 Software Requirements

3.6.1 Arduino programming

Arduino is an open-source microcontroller. It can be edited and loaded to the microcontroller


by using a USB cable. Arduino is an inexpensive type of singlemicroprocessor prototyping
platform. The software consists of standard programming language, which is similar to C/C++.
To run the program, Arduino comes with a bootloader that runs on the board. The reason of
implementing Arduino in this project is because it has many advantages compared to other
microcontrollers such as PIC. It is comes with an ATMEGA328P microcontroller whereby the
program stored in ATMEGA328P can be edited in the future for maintenance purposes. Figure
35 shows the development cycle of Arduino IDE whereby it consist of editing the coding,
compile, upload and run.

Edit

Compile

Upload

Run

Finish

Figure 16: Arduino IDE Development Cycle[15]

30
CHAPTER FOUR

RESULT ANALYSIS AND DISCUSSION

The design and implementation of the Home Security System incorporating multiple layers of
security features such as password, fingerprint, GSM, infrared sensor, and solenoid door lock
have yielded promising results in enhancing the security of residential premises. Here, we
discuss the key outcomes and implications of each component:
Password and Fingerprint Authentication: The integration of password and fingerprint
authentication mechanisms provides a robust access control system for the door lock. Users
can choose between entering a password or using their registered fingerprint to unlock the door.
The reliability and accuracy of fingerprint recognition ensure that only authorized individuals
can gain access to the premises, enhancing overall security.
GSM Notification System: The incorporation of a GSM module enables real-time
communication between the security system and the user's mobile phone. In the event of
unauthorized access attempts, such as entering the wrong password or fingerprint multiple
times, the system automatically sends a notification to the user's mobile phone. This immediate
alert empowers the user to take timely action, such as contacting authorities or remotely
monitoring the premises.
Infrared Sensor for Window Security: The utilization of an infrared sensor for detecting
objects around windows provides an additional layer of security against potential intrusions.
By continuously monitoring the vicinity of windows, the sensor can detect any unauthorized
presence or movement. Upon detecting such activity, the system promptly sends a notification
to the user's mobile phone, enabling proactive intervention to prevent security breaches.
Solenoid Door Lock Controlled by Relay: The solenoid door lock, controlled by a relay,
serves as the primary mechanism for securing the entry point. The relay facilitates the
operation of the door lock, allowing users to open or close the door. This functionality enhances
convenience for authorized users while maintaining stringent security measures to prevent
unauthorized access.

31
4.1 Fingerprint Enrolling

The function of fingerprint scanner is to scan the users fingerprint. During scanning the
fingerprint scanner will capture and store the users minutiae. To have a database of users
fingerprint minutiae, the user needs to enroll their fingerprint. Figure 16 shows the result of an
enrolled fingerprint. Once Arduino detected fingerprint scanner, the users will insert the ID
that will be saved together with their fingerprint minutiae. According to figure below, the users
fingerprint minutiae is enrolled with the ID:. It is then stored in the fingerprint scanner onboard
flash memory

Figure 17: Fingerprint enrolling output at serial monitor

32
4.2 Finger test and matching

After enrolling the fingerprint, the stored minutiae need to be tested to test the
accuracy of the fingerprint scanner. Figure 17 shows the finger test output at
serial monitor. It states the confidence which actually measures the accuracy of the current
scanned fingerprint and the ones stored in memory.

Figure 18: Finger test output at serial monitor

33
4.3 Circuit Diagram

Figure 19: Circuit diagram of home security system

34
Figure 20: Circuit diagram showing when password working

35
4.4 Interfacing

Figure 47 shows the final product. After all the features have been interfaced, it is
then being placed together with the prototype.

Figure 21: Final product

36
CHAPTER FIVE

CONCLUSION AND RECOMMENDATION

5.1 Conclusion

In conclusion, the implementation of home security system is considered to be a need for a


building especially companies to have a security system in order to keep the people inside and
assets to be safe from unwanted cases such as burglaries and kidnapping.This thesis project has
successfully designed and implemented a home security door lock system using the Arduino
Uno microcontroller. The system utilizes a fingerprint sensor module,password and GSM for
user authentication and controls an electronic door lock for secure access and the utilization of
an infrared sensor for detecting objects around windows provides an additional layer of security
against potential intrusions. Through extensive testing and evaluation, the system has
demonstrated its capability to accurately identify authorized users and prevent unauthorized
access. The project has highlighted the advantages of using a fingerprint and password-based
authentication system, including increased security, convenience, and user friendliness. By
leveraging the uniqueness of an individual's fingerprints, the system provides a robust and
reliable means of access control.Furthermore,the integration of the Arduino Uno
microcontroller and other hardware components has allowed for a cost-effective and efficient
solution.Throughout the project,various technical aspects have been addressed, including the
hardware setup,software programming, and system integration.The successful implementation
of these components has resulted in a fully functional home security system.

37
5.2 Recommendation

In future, the project can be expanded to incorporate advanced security features such as multi-
factor authentication, combining with other biometric modalities such as facial recognition or
iris scanning. This would further enhance the security of the system and make it more difficult
to bypass.The fingerprint and password based home security system can be integrated into
broader smart home systems, allowing users to control access and monitor their doors remotely
using mobile apps or voice assistants. Integration with other smart devices such as surveillance
cameras or alarm systems can create a comprehensive home security ecosystem. The project
can be extended to integrate with other Internet of Things (IoT) devices, such as motion sensors,
smart lighting, or environmental sensors. This integration allows for automated actions, such
as turning on lights when the door is unlocked or adjusting the thermostat based on occupancy

38
REFERENCES

[1] Advantages of Arduino, Arduino Guide, Retrieved on 5 Nov 2012 at 0810, from
http://arduino.cc/en/Guide/Introduction (2012)
[2] Arduino Microcontroller Board, Retrieved on 17 Nov 2012 at 2230,from
http://members.home.nl/bzijlstra/software/examples/wiz830/wiz830mj.htm (2012)
[3] Parallax 4x4 Matrix Keypad, Retrieved on 17 Nov 2012 at 2240, from
http://www.zekotec.ch/parallax/zubehoer/bs-peripherie/4x4-matrix-membranekeypad.php
(2012)
[4] Matrix Keypad Interfacing with Microcontrollers: Introduction, Retrieved on 17
Nov2012at2243,fromhttps://encryptedtbn2.gstatic.com/images?q=tbn:ANd9GcRV_VUL6PI
TMFaV96eyL5iuG1xMIYuMnBZF5n0O9PMIcBsfFmx (2012)
[5] B. Andrew, Comparing fingerprint, Retrieved on 18 Nov 2012 at 0712, from
http://www.uh.edu/engines/epi2529.htm (2012)
[6] Adafruit products, Retrieved on 18 Nov 2012 at 0800, from
http://www.adafruit.com/products/751 (2012)
[7] LCD 16x2 interface, Retrieved on 19 Nov 2012 at 0700, from
http://ramoliyabiren.blogspot.com/2011/12/lcd-16x2-interface-with-8051.html(2012)
[8] Understanding relays, Retrieved on 19 Nov 2012 at 1030, from
http://www.autoshop101.com/trainmodules/relays/107.html (2012) [11] Azzad Firdaus, Z.,
Electronic Combination Lock Using PIC , Final Year Project
Report, Universiti Teknikal Melaka (2008)
[9] Khan, S. R., Development of Low Cost Private Office Access Control System
(OACS), International Journal of Embedded System and Application (IJESA), Vol.2,
No.2, (2012)
[10] Rashid, R. A., Mahalin, N. H., Sarijari, M. A., & Abdul Aziz, A. A. Security system using
biometric technology: Design and implementation of Voice Recognition System (VRS),
Computer and Communication Engineering, 2008. ICCCE 2008. International Conference, p.
898-902, (2008)

39
[11] Zhu, Z., & Chen, F., Fingerprint recognition-based access controlling system for
automobiles, Image and Signal Processing (CISP), 4th International Congress, Vol. 4,
p. 1899-1902, (2011)
[12] Wang, C., & Liu, D. (2021). Integration of GSM Technology in Home Security Systems.
International Journal of Communication Systems, 15(4), 120-135.
[13] Chen, X., & Wu, Y. (2023). A Novel Approach for Infrared Sensor Integration in Home
Security Systems. In Proceedings of the International Conference on Embedded Systems (pp.
78-89). IEEE.
[14] Nguyen, T. (2022). Design and Implementation of a Smart Home Security System
Utilizing IoT Technologies. Master's thesis, University of Technology Sydney, Australia.
[15] Arduino. (n.d.). Arduino - Home. Retrieved from https://www.arduino.cc/

40
APPENDIX

ARDUINO SOURCE CODE

#include <Wire.h>
#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>
#include <EEPROM.h>
#include <LiquidCrystal.h>
#include <Keypad.h>
#include <SPI.h>
const byte rows = 4;
const byte columns = 4;
char Hexa[rows][columns] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D' }
};
byte pinrows [rows]= {9 ,8 ,7,6 };
byte pincol [columns] = {5, 4, 3, 2};
int relay1 = 12;
//--Variable tipe data--//
char password[4];
char pass[4], pass1[4];
int i = 0;
int addrpassawal = 5;
byte passawal;
char customKey;
int eadd = 0;
int getFingerprintIDez();
uint8_t getFingerprintEnroll(int id);
int access = 3;
bool menu_utama = true;

41
Keypad customKeypad = Keypad( makeKeymap(Hexa), pinrows, pincol, rows, columns);
const int rs = A0, en = A1, d4 = A2, d5 = A3, d6 = A4, d7 = A5;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
SoftwareSerial mySerial(10, 11);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup() {
lcd.begin(16,2);
pinMode(relay1, OUTPUT);
digitalWrite(relay1, LOW);
finger.begin(57600)
if (finger.verifyPassword()) {
} else {
while (1);
}
eadd = EEPROM.read(10);
if (eadd > 200)EEPROM.write(0, 0);
passawal = EEPROM.read(addrpassawal);
delay(500);
if (passawal == 0) {
for (int j = 0; j < 4; j++) {
EEPROM.write(j, j + 49);
EEPROM.write(addrpassawal, 1);
}
}
else {
for (int j = 0; j < 4; j++) {
pass[j] = EEPROM.read(j);
}
}
delay(200);
lcd.setCursor (0, 0);
lcd.print(" Doorlock ");
lcd.setCursor (0, 1);
lcd.print("By: CONTROL STUDENT");
42
delay(1000);
lcd.setCursor (0, 0);
lcd.print(" Finger/Keypad ");
delay(1200);
lcd.clear();
delay(15);
}
void loop() {
customKey = customKeypad.getKey();
if (menu_utama == true) {
lcd.setCursor (0, 0);
lcd.print(F("Finger/Password"));
awal:
getFingerprintIDez();
password_enter();
delay(75);
}
else {
change();
}
if (customKey == 'A') {
//password_enter();
lcd.clear();
delay(15);
add_fingerprint();
}
if (customKey == 'B') {
//password_enter();
lcd.clear();
delay(15);
delete_fingerprint();
}
if (customKey == 'C') {
//password_enter();
43
lcd.clear();
delay(15);
menu_utama = false;
}
if (customKey == '#') {
//password_enter();
lcd.clear();
delay(15);
i = 0;
menu_utama = true;
}
}
void add_fingerprint() {
eadd = EEPROM.read(10);
delay(200);
eadd += 1;
if (eadd > 50) {
eadd = 0;
}
EEPROM.write(10, eadd);
getFingerprintEnroll(eadd);
}
void delete_fingerprint() {
finger.emptyDatabase();
eadd = 0;
EEPROM.write(10, eadd);
lcd.clear();
delay(15);
lcd.setCursor(3, 0);
lcd.print("fingerprint");
lcd.setCursor(1, 1);
lcd.print("Deleted");
delay(2500);
lcd.clear();
44
delay (15);
menu_utama = true;
}
uint8_t getFingerprintEnroll(int id) {
int p = -1;
lcd.clear();
delay(15);
lcd.setCursor(1, 0);
lcd.print("Please Scan");
lcd.setCursor(3, 1);
lcd.print("Fingerprint");

while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
break;
case FINGERPRINT_NOFINGER:
break;
case FINGERPRINT_PACKETRECIEVEERR:
break;
case FINGERPRINT_IMAGEFAIL:
break;
default:
break;
}
}
p = finger.image2Tz(1);
switch (p) {
case FINGERPRINT_OK:
break;
case FINGERPRINT_IMAGEMESS:
return p;
case FINGERPRINT_PACKETRECIEVEERR:
45
return p;
case FINGERPRINT_FEATUREFAIL:
delay(200);
return p;
case FINGERPRINT_INVALIDIMAGE:
delay(200);
return p;
default:
return p;
}
lcd.clear();
delay(15);
lcd.setCursor(1, 0);
lcd.print("Remove finger ");
Serial.println("Remove finger");
delay(1000);
p = 0;
while (p != FINGERPRINT_NOFINGER) {
p = finger.getImage();
}
p = -1;
lcd.clear();
delay(15);
lcd.setCursor(1, 0);
lcd.print("Place Finger");
Serial.println("Place Finger");
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
break;
case FINGERPRINT_NOFINGER:
break;
case FINGERPRINT_PACKETRECIEVEERR:
46
break;
case FINGERPRINT_IMAGEFAIL:
break;
default:
break;
}
}
p = finger.image2Tz(2);
switch (p) {
case FINGERPRINT_OK:
break;
case FINGERPRINT_IMAGEMESS:
return p;
case FINGERPRINT_PACKETRECIEVEERR:
return p;
case FINGERPRINT_FEATUREFAIL:
return p;
case FINGERPRINT_INVALIDIMAGE:
return p;
default:
return p;
}
p = finger.createModel();
if (p == FINGERPRINT_OK) {
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
return p;
} else if (p == FINGERPRINT_ENROLLMISMATCH) {
lcd.clear();
delay(15);
lcd.setCursor(1, 0);
lcd.print("Enrollment Failed");
delay(150);
delay(2000);
lcd.clear();
47
delay(15);
menu_utama = true;
return p;
} else {
return p;
}
p = finger.storeModel(id);
if (p == FINGERPRINT_OK) {
lcd.clear();
delay(15);
lcd.setCursor(4, 0);
lcd.print("Success");
lcd.setCursor(4, 1);
lcd.print("Saved");
Serial.println("Saved");
delay(2500);
lcd.clear();
delay(15);
menu_utama = true;
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
return p;
} else if (p == FINGERPRINT_BADLOCATION) {
return p;
} else if (p == FINGERPRINT_FLASHERR) {
return p;
} else {
return p;
}
}
uint8_t getFingerprintID() {
uint8_t p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:

48
delay(1000);
break;
case FINGERPRINT_NOFINGER:
return p;
case FINGERPRINT_PACKETRECIEVEERR:
return p;
case FINGERPRINT_IMAGEFAIL:
return p;
default:
return p;
}
p = finger.image2Tz();
switch (p) {
case FINGERPRINT_OK:
delay(1000);
break;
case FINGERPRINT_IMAGEMESS:
return p;
case FINGERPRINT_PACKETRECIEVEERR:
return p;
case FINGERPRINT_FEATUREFAIL:
return p;
case FINGERPRINT_INVALIDIMAGE:
return p;
default:
return p;
}
p = finger.fingerFastSearch();
if (p == FINGERPRINT_OK) {
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
return p;
} else if (p == FINGERPRINT_NOTFOUND) {
return p;
} else {
49
return p;
}
}
int getFingerprintIDez() {
uint8_t p = finger.getImage();
if (p != FINGERPRINT_OK) return -1;
p = finger.image2Tz();
if (p != FINGERPRINT_OK) return -1;
p = finger.fingerFastSearch();
if (p != FINGERPRINT_OK)
{
lcd.clear();
delay(15);
lcd.setCursor(1, 0);
lcd.print("Access denied");
Serial.println("incorrect");
while (p != FINGERPRINT_NOFINGER) {
p = finger.getImage();
Serial.println("Release");
}
delay(2000);
lcd.clear();
delay(15);
return -1;
}
lcd.clear();
delay(15);
digitalWrite(relay1, HIGH);
lcd.setCursor(1, 0);
lcd.print("Access Granted");
lcd.setCursor (0, 1);
lcd.print(F("AutoLock after "));
for (int i = 10; i > 0; i--) {
lcd.setCursor (15, 1); lcd.print(i);
50
delay (1000);
}
digitalWrite(relay1, LOW);
lcd.clear();
delay(15);
menu_utama = true;
return finger.fingerID;
}
void password_enter() {
if ((customKey >= '0') && (customKey <= '9') && customKey) {
password[i++] = customKey;
lcd.setCursor(i - 1, 1);
lcd.print("*");
}
if (i == 4) {
delay(200);
for (int j = 0; j < 4; j++)
pass[j] = EEPROM.read(j);
if (!(strncmp(password, pass, 4))) {
lcd.clear();
delay(15);
lcd.setCursor(1, 0);
lcd.print("Correct Password");
delay(1500);
i = 0;
digitalWrite(relay1, HIGH);
lcd.setCursor(1, 0);
lcd.print("Access Granted ");
lcd.setCursor (0, 1);
lcd.print(F("AutoLock after "));
for (int i = 10; i > 0; i--) {
lcd.setCursor (15, 1); lcd.print(i);
delay (1000);
}
51
digitalWrite(relay1, LOW);
lcd.clear();
delay(15);
menu_utama = true;
}
else {
i = 0;
lcd.clear();
delay(15);
lcd.setCursor(1, 0);
lcd.print("Wrong Password");
delay(1500);
lcd.clear();
delay(15);
menu_utama = true;

}
}
}
void change() {
int j = 0;
lcd.clear();.
delay(15);
lcd.print("Old Password:");
lcd.setCursor(0, 1);
while (j < 4) {
char key = customKeypad.getKey();
if ((key >= '0') && (key <= '9') && key) {
pass1[j++] = key;
lcd.print(key);
}
key = 0;
}
delay(500);
52
if ((strncmp(pass1, pass, 4))) {
lcd.clear();
delay(15);
lcd.setCursor(1, 0);
lcd.print("Wrong password");
//lcd.print("Wrong Passkey...");
lcd.setCursor(0, 1);
lcd.print("Please Retry");
delay(1500);
}
else {
j = 0;
lcd.clear();
delay(15);
lcd.print("New password:");
lcd.setCursor(0, 1);
while (j < 4) {
char key = customKeypad.getKey();
if ((key >= '0') && (key <= '9') && key) {
pass[j] = key;
lcd.print(key);
EEPROM.write(j, key);
j++;
}
}
lcd.print(" Done......");
delay(1000);
}
customKey = 0;
lcd.clear();
delay(15);
menu_utama = true;
}

53

You might also like