Capstone Design Project Feb2020 Dig Sec Door Access System Using Arduino
Capstone Design Project Feb2020 Dig Sec Door Access System Using Arduino
JCDP3203
Final Report
SUBMITTED BY
Project Supervisor
February 2020
DECLARATION
We declare that the work in this capstone project report has been carried out in accordance
with the rules and regulations of Al-Madinah International University. It is authentic and the
result of our own work in the capstone project,with the help of the project supervisor, team
members and other cited references. This capstrone project report has not been submitted to
any other academic or non-academic institutions for any other qualification.
1
ACKNOWLEDEMENT
Alhamdulillah we have completed our capstone project by the grace of Almighty and
Omniscient Allah. We would like to express our gratitude to our supervisor Mr. Fayez Said
Hamdan for the useful comments, remarks and engagement through the learning process of
this project. He introduced us to the topic and supported us on the long way of the project. His
guidance, patience, and motivation helped us to develop a deep understanding of the project.
We would also like to thank our other lecturers who have supported us throughout the entire
process, both by keeping us harmonious and helping us putting pieces together. We will be
grateful forever for their valuable suggestions. We are lucky to get their guidance, knowledge,
encouragement throughout this project. It is a precious experience in our life. Last but not
least, thanks to all my friends for their ideas and help that they have given to us during project
period. Their valuable suggestions and support meant a lot to us and are very much
appreciated.
2
ABSTRACT
The Basic requirement of security can be achieved by designing electrical or mechanical locks
that are designed with one or a few keys, but for locking a big area many locks are required.
Basically traditional locks are heavy and are not protective as they can be broken down easily
by using some tools. Electronic locking systems are preferable over mechanical locks, to
resolve the security problems that are associated with the mechanical locks. Nowadays every
device’s operation is based on digital technology. For instance, token-based digital identity
devices, Fort-token mobile and digital-based door lock systems for auto door opening or
closing are all based on digital technology. These locking systems are used to control the
movement of door and are functional without requiring a key to lock or unlock the door. This
report describes the design and implementation of an automatic door access control system,
where a correct access code must be entered, followed by the associated fingerprints of the
authorized users are enrolled and verified to provide access to a facility that is used by
multiple users. The brain of the system is an Arduino UNO microcontroller board which gives
the control signal to a solenoid door lock to open the door once the person’s identity is verified
through the correct access code and finger print. An LCD is used to communicate with the
user to give feedback of the correctness of the entered access code and fingerprint or ask the
user to try again. Entering the wrong code or using the wrong finger print results in an error
message displayed and an error tone sounded by the buzzer. The system was implemented
successfully and proved to be a cost effective, automatic, all-time convenient and secure door
access system.
3
TABLE OF CONTENTS
CHAPTER 1........................................................................................................................................6
INTRODUCTION...............................................................................................................................6
1.1 Project Background......................................................................................................................6
1.2 Problem Statement........................................................................................................................6
1.3 Objectives.......................................................................................................................................6
1.4 Scope .............................................................................................................................................6
1.5 Limitations.....................................................................................................................................7
1.6 ADVANTAGES System Significance:.........................................................................................7
CHAPTER 2........................................................................................................................................8
LITERATURE REVIEW...................................................................................................................8
CHAPTER 3......................................................................................................................................12
DESIGN METHODOLOGY............................................................................................................12
3.1 Overall system description:........................................................................................................12
3.2. System operation .......................................................................................................................13
3.3 Hardware description:................................................................................................................14
3.3.1 ARDUINO.................................................................................................................................14
3.3.2. Arduino Hardware:.................................................................................................................15
3.3.3. ARDUINO POWER:..............................................................................................................16
3.4 Software description....................................................................................................................18
3.4.1 Introduction..............................................................................................................................18
3.4.2 Overview....................................................................................................................................18
3.4.3 Why Arduino IDE....................................................................................................................19
3.4.4Working with Arduino..............................................................................................................19
3.4.5 Writing Sketches......................................................................................................................19
3.5. Construct circuit for testing......................................................................................................21
3.4.1 Keypad:.....................................................................................................................................21
3.4.2 Fingerprint scanner:................................................................................................................23
3.4.3 LCD display:.............................................................................................................................23
3.4.5 Interface:..................................................................................................................................25
3.5 Create coding of each feature.....................................................................................................26
3.6 Component Requirements:.........................................................................................................27
CHAPTER 4......................................................................................................................................30
RESULTS & DISCUSSION.............................................................................................................30
4.1 Introduction :...............................................................................................................................30
4.1.1 Testing keypad :.......................................................................................................................30
4.1.2 Password :.................................................................................................................................30
4.1.3 Testing Fingerprint scanner:...................................................................................................32
4
4.1.4 Enrolling:..................................................................................................................................32
4.1.5 Fingerprint test and matching:...............................................................................................32
CHAPTER 5......................................................................................................................................34
CONCLUSION..................................................................................................................................34
5.1 CONCLUSION:...........................................................................................................................34
5.2 FUTURE SCOPE:.......................................................................................................................35
REFERENCES..................................................................................................................................35
APPENDICES...................................................................................................................................37
5
CHAPTER 1
INTRODUCTION
1.3 Objectives
The main objectives of the project are given as follows
3. Granting permission to enter for only authorized people with verified identity.
1.4 Scope
6
It is used for home security.
1.5 Limitations
We installed a keypad and fingerprint in office door, and we built a simple pulley system to
operate the locking mechanism. When we search in google about our project there are only
programme available about normal LCD but we use our project I2C LCD. In this MCO period
we couldn’t meet with our supervisor by physically that is the big problem for us.
Also Time limitation, since capstone project must be carried out in one semester period of 4 months.
That time was not enough.
CHAPTER 2
LITERATURE REVIEW
7
Door access system has been widely used around the world. It is a type of security system
that is created to help in securing people and assets in a building from unwanted cases such
as burglaries and kidnapping. To develop a door access system, features or hardware such
as keypad, smart card, RFID card and biometric are implemented. Besides hardware,
software is also included in developing the door access system as it helps in interfacing the
hardware and to have the desired system flow. Types of software or programming language
being used in this system are PIC language programming, Matlab, Microsoft Visual C++,
ARDUINO and many more.
In this project, keypad and fingerprint scanner are implemented in developing the
Door Access System – ARDUINO Based. These two features were chosen because of its
user-friendly, smart and high security system compared to other features such as face-
verification, smart card, RFID card and many more.
Fingerprint scanner is a type of biometric sensors whereby it senses the human
fingerprint for identification. Biometric consist of many types such as voice- recognition,
face-recognition, fingerprint-recognition and other identification that consist of human
body parts.
8
background noise.
Cui et. al. (2009) agrees the fact of voice-recognition system being difficult. The
reason being is because it needs to build up a speech model whereby the users have to
pronounce the text according to the stated ones. Despite of its lacking in efficiency, this
project done by Bo Cui and Tongze Xue has its advantages compared to other projects with
similar feature by using a technology to filter low frequency disturbing
Compared to the fingerprint scanner used in this project, during experimental work,
the elements needs to be considered are the illumination and humans sweat that may
appear on an individual’s finger. Implementing the fingerprint scanner produce a less time-
consuming system as it can easily sense human fingerprint with a much higher percentage
of accuracy which is 70% for the left thumbprint The reason being is because fingerprint
scanner accuracy is only influenced less factor than face-verification which are by human’s
sweat and scratch surface of the scanner. Besides that the fingerprint scanner used in this
project can make decision in less than 1 second.
The benefit of using fingerprint scanner was also said by Zhu et. al. (2011) in their
journal that fingerprint-verification overcome the issue of losing ID card where in their
project is car keys. Another advantage is that the ownership can never be passed to other
people. An optical fingerprint scanner is implemented in this project compared to other
biometric features is because it has more advantages as stated in.
9
Table 1: Literature Review Summary
. Limitations
1 Wheeler, G. V., Performance Identify intra 1- An individual needs to have more than 1 image to
Courtney, P., assessment of a and inter separate id and non-id images.
Cootes, T. F., & face-verification dependencies 2- Very sensitive
Taylor, based access control
3- Less speed because it takes 6 seconds to make
C. J (2000) System
decision while the aim is
within 2 seconds.
2 Ibrahim, R., & Study of Automated Able to improve 1- Difficult because had to consider many other
Zin, Z. M (2011) Face Recognition the human elements such as illumination, distance and an
System for Office identification by individual’s head orientation for capturing image.
Door Access Control distinguish a 2- Sensitive to aging and facial expression.
person’s 3- Subject needs to be very cooperative during image
particular face capturing to have accurate results.
from other 4- Troublesome during experimental work because a
person’s face lot of face positions needs to be stored.
images 5- Results are influenced by illumination and pose.
.
10
3 Rashid, R. A., Security System Provides 1- Very sensitive. It will reject the match if there are
Mahalin, Using Biometric adjustable background noise
N. H., Sarijari, Technology: Design security level 2- Less speed because it uses parallel port for
M. A., & Abdul and Implementation setting account for communication interface.
Aziz, A. A. (2008) of Voice variations
Recognition
System (VRS)-
4 Cui, B., & Xue, Design and Realization Implements fore- Difficult because it needs to build up a speech model
T. of an Intelligent Access aggravation whereby the users have to pronounce the text
(2009) Control System Based technology to according to the stated
on Voice Recognition filter low ones.
frequency
disturbing
5 G Zhu, Z., & Fingerprint Overcome the Designed specifically for automobiles
Chen, F (2011) Recognition- issue of car
Based Access robbery if the
Controlling owners lose his
System for car keys or his
Automobiles car keys been
stolen
11
CHAPTER 3
DESIGN METHODOLOGY
The project process flow is illustrated as flow chart. Firstly the user will insert the
password that has already been set by the system. If the entered password is correct, the
user may proceed by entering their ID. Otherwise the user will be given three attempts to
enter password. If wrong password is entered at the third attempt, alarm will be activated.
Next, each authorized user have a template of their own fingerprint saved in the
memory. In order to enter the building, the users need to scan their fingers by placing their
finger onto the fingerprint scanner.
During storing process for fingerprint scanner, the storing starts by enrolling the
users ID. Once the users place their finger, the fingerprint scanner will capture the
fingerprint. It will then extract the minutiae and store the output in memory.
Next the process continues by finding the match. For fingerprint, it uses the stored
minutiae with the ones that was recently capture.
12
3.2. System operation
Start
Enter Password
NO
YES
(3rd attempt)
Scan fingerprint
Match NO
fingerprint
?
NO
Go back to start
(3rd attempt
again
13
3.3 Hardware description:
3.3.1 ARDUINO
The Arduino microcontroller is an easy to use yet powerful single board computer that has
gained considerable traction in the hobby and professional market. The Arduino is open-
source, which means hardware is reasonably priced and development software is free. This
guide is for students in ME 2011, or students anywhere who are confronting the Arduino for
the first time. For advanced Arduino users, prowl the web; there are lots of resources. This is
what the Arduino board looks like.
14
3.3.2. Arduino Hardware:
The power of the Arduino is not its ability to crunch code, but rather its ability to interact with
the outside world through its input-output (I/O) pins. The Arduino has 14 digital I/O pins
labelled 0 to 13 that can be used to turn motors and lights on and off and read the state of
switches. Each digital pin can sink or source about 40 mA of current. This is more than
adequate for interfacing to most devices, but does mean that interface circuits are needed to
control devices other than simple LED's. In other words, you cannot run a motor directly
using the current available from an Arduino pin, but rather must have the pin drive an
interface circuit that in turn drives the motor. A later section of this document shows how to
interface to a small motor. To interact with the outside world, the program sets digital pins to
a high or low value using C code instructions, which corresponds to +5 V or 0 V at the pin.
The pin is connected to external interface electronics and then to the device being switched on
and off. The sequence of events is shown in this figure.
To determine the state of switches and other sensors, the Arduino is able to read the voltage
value applied to its pins as a binary number. The interface circuitry translates the sensor
signal into a 0 or +5 V signal applied to the digital I/O pin. Through a program command, the
Arduino interrogates the state of the pin. If the pin is at 0 V, the program will read it as a 0 or
LOW. If it is at +5 V, the program will read it as a 1 or HIGH. If more than +5 V is applied,
you may blow out board, so be careful. The sequence of events to read a pin is shown in this
figure. Interacting with the world has two sides. First, the designer must create electronic
interface circuits that allow motors and other devices to be controlled by a low (1-10 mA)
15
current signal that switches between 0 and 5 V, and other circuits that convert sensor readings
into a switched 0 or 5 V signal.
The Arduino Uno can be powered via the USB connection or with an external power supply.
The power source is selected automatically. External (non-USB) power can come either from
an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a
2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted
in the Gnd and Vin pin headers of the POWER connector. The board can operate on an
external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply
less than five volts and the board may be unstable. If using more than 12V, the voltage
regulator may overheat and damage the board. The recommended range is 7 to 12 volts. The
power pins are as follows:
VIN. The input voltage to the Arduino board when it's using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source). You can
supply voltage through this pin, or, if supplying voltage via the power jack, access it through
this pin.
5V.This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the
VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage your board. We don't advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is
50 mA.
Memory:
16
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM
and 1 KB of EEPROM (which can be read and written with the EEPROM library).
Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode(),
digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or
receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of
20-50 kOhms. In addition, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial
chip.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog Write function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though
17
is it possible to change the upper end of their range using the AREF pin and the analog
Reference function. Additionally, some pins have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library. There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analog Reference.
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.
See also the mapping between Arduino pins and ATmega328 ports. The mapping for the
Atmega8, 168, and 328 is identical.
3.4.1 Introduction
Arduino IDE is an open-source electronic platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs like light on a sensor, a finger placed on a
button, or a Twitter message; and turn it into an output to activating a motor, turn on an
LED, publishing something online. One can tell the board what to do by sending a set of
commands/instructions to the micro-controller on the board. To do this, the Arduino
programming language (based on wiring) and the Arduino software processing based are
used.
3.4.2 Overview
Over the years, Arduino has been the brain of thousands of projects, from everyday
objects to complex scientific instruments. A worldwide community of makers, students, artists,
programmers and professionals have gathered around this opensource platform to make their
contributions which added up to make an incredible amount of knowledge that is of great help
to novices and experts alike [23]-[24]. Arduino was born at Ivrea Interaction Design
Institution as an easy tool for fast prototyping aimed at students without background in
electronics and programming. As soon as it reached a wider community, the Arduino boards
18
started changing to adapt to new needs and challenges; differentiating its offers from simple 8-
bit boards to produce for IoT applications, 3D printings and embedded design environments.
All Arduino boards are completely open-source, empowering users to build them
independently and eventually adapt to their particular needs. The software is also open-source
and it is growing by the day through the contributions of users worldwide.
19
how to correct the errors. The bottom right hand corner of the window displays the
configured boards and serial port. The toolbar buttons allows you to verify and upload
programs, create, open and save sketches. It also allows you to open the serial monitor or
serial plotter for value and graphical displays respectively.
Open: Presents a menu of all the sketches in your sketchbook. Clicking open will open it
within the current window overwriting its contents.
Verify: Checks for errors in the sketch while compiling. Fingerprint based Security System
Department of ECE, SVCET (Autonomous), Chittoor 45
Upload: Compiles the present code and uploads it to the configured board.
Serial Monitor and Plotter: Opens the serial monitor or plotter depending which is clicked
for analyzing of data. Additional commands are found within the five menus: File, Edit,
Sketch and Help. The menus are context sensitive, which means only those items relevant to
the work currently being carried out will be available.
20
3.5. Construct circuit for testing
3.6 Keypad:
The keypad used in this project is 4x4 keypad which have eight I/O pins. It is divided as rows
and columns.
21
Figure 3.6.1: 4x4 Keypad
22
3.7 Fingerprint scanner:
The fingerprint scanner has 4 wires that can be connected to Arduino. Shows the circuit
connection below of it. The connections of fingerprints scanner to Arduino I/O pins can be
referred to this.
Fingerprint processing includes two parts: fingerprint enrollment and fingerprint match- ing
(the matching can be 1:1 or 1:N). When enrolling, user needs to enter the finger two times.
The system will process the two time finger images, generate a template of the finger based on
processing results and store the template. When matching, user enters the finger through
optical sensor and system will generate a template of the finger and compare it with templates
of the finger library. For matching, system will compare the live finger with specific template
designated in theModule;for 1:N match- ing, or searching, system will search the whole finger
library for the matching finger.
23
display 16 characters per line and there are 2 such lines. In this LCD each character is
displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data. The
command register stores the command instructions given to the LCD. A command is an
instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting
the cursor position, controlling display etc. The data register stores the data to be displayed on
the LCD. The data is the ASCII value of the character to be displayed on the LCD. Click to
learn more about internal structure of a LCD.
24
3.9 Relay module:
The relay module is a separate hardware device used for remote device switching. With it
you can remotely control devices over a network or the Internet. Devices can be remotely powered
on or off with commands coming from Clock Watch Enterprise delivered over a local or wide area
network. You can control computers, peripherals or other powered devices from across the office or
across the world.
The Relay module can be used to sense external On/Off conditions and to control a variety of
external devices. The PC interface connection is made through the serial port.
The Relay module houses two SPDT relays and one wide voltage range, optically isolated input.
These are brought out to screw-type terminal blocks for easy field wiring. Individual LED’s on the
front panel monitor the input and two relay lines. The module is powered with an AC adapter.
3.10 Interface:
After testing the keypad circuit and fingerprint scanner circuit by interfacing with Arduino
separately, both of the circuit are then combined together with LCD display and Arduino to
be interfaced. Shows the interfacing circuit between keypad and fingerprint scanner with
Arduino.
First of all, connect the fingerprint sensor to the Arduino UNO. Make sure you get a
fingerprint sensor that works with the Arduino through the serial communication.
25
The default pins for serial communication on the Arduino UNO are pin 0 (RXD) and pin 1
(TXD) of the board, but we are going to use other pins for serial communication. For this
project, we will use the SoftwareSerial library in the code.
Here are the required connections between the fingerprint sensor and the UNO:
Then connect the I2C LCD module to the UNO. The connections are as follows:
26
3.11 Create coding of each feature
Since keypad and fingerprint scanner is the feature used in this project, therefore coding for
these two features are created in the beginning. For fingerprint scanner it includes coding for
enrolling and finger test. The output of the keypad and fingerprint scanner will be displayed
using the serial monitor before it is displayed though LCD display. After each feature has its
own programming, it is then been interface among the features itself. Below is the list of
coding developed for this project.
27
Figure 3.12.3: Fingerprint scanner
28
Table 1: Functions of each hardware
Hardware Function
USB cable Connects the Arduino board to computer for
uploading purposes
Arduino Testing purposes and interface Arduino with
the features
Fingerprint scanner Scan the users thumbprint
Keypad To enter ID / password
LCD Display Display the output
Table 1: Functions of each hardware
CHAPTER 4
4.1 Introduction :
According to project activities flow chart above, after constructing the circuit, testing was
done. Figures 3.13 shows the results obtained from each feature and the interfacing all feature
with Arduino. During testing, the outputs obtained were displayed through serial monitor.
The LCD display is added afterwards to replace the serial monitor.
4.1.2 Password :
Keypad is used to enter character and integer that is required to access the door. In this
project, keypad is implemented for password feature and use to insert ID. The first stage to
access the door is to enter password. . Figure 3.13 shows a display for the user to enter the
password. In this program the password is set as ‘123456’. If the users entered the same
password the door will open. Now the next users may scan their fingerprint immediately for
the next stage of door access system.
CONCLUSION
5.1 CONCLUSION:
In today’s technologically advanced world, autonomous systems are gaining rapid popularity
so the advancement in latest technology is continuously and rapidly made on different latest
automatic door lock security systems. The need for an advanced door access security systems
using new technologies is increases day by day as security become a very important or serious
issue for everybody. Due to the recent trends in various methods of security for home,
buildings, companies, vehicles etc, there is no need to worry about this security any longer, as
automatic security systems are here to deal with it. This paper tries to focus all recent door
lock security systems in a comprehensive way.
Our implemented door access security system system overcomes all the security problems in
existing system and provides high security and efficiency. This is a perfect/optimal solution for
saving/protecting one from the hassle of stolen/lost key or an unauthorized entry. Fingerprint
is a boon solution for these problems which provides high level of recognition accuracy. The
skin on our palms and soles exhibits a flow like pattern of ridges called friction ridges. The
pattern of friction ridges on each finger is unique and immutable
[1]LinHong.”AutomaticPersonalIdentificationUsingFingerprints”,Ph.D.Thesis, 1998.
[2]D.Maio and D. Maltoni. Direct gray-scale minutiae detection in fingerprints IEEE Trans.
Pattern Anal. And Machine Intel., 19(1):27-40, 1997.
[4]N. Ratha, S. Chen and A.K. Jain, ”Adaptive Flow Orientation Based Feature Extraction in
Fingerprint Images”, Pattern Recognition, Vol. 28, pp. 1657-1672, November 1995.
[5]Jain, A.K., Hong, L., and Bolle, R.(1997), On-Line Fingerprint Verification, IEEE Trans.
On Pattern Anal and Machine Intell, 19(4), pp. 302-314.
[6].A. Aditya Shankar, “Finger Print Based Door Locking System”, IJECS Volume 4 Issue 3
March, 2015 ISSN:2319-7242.
[12] Sagar S.Palsodkar, “Bank Lockers Security System using Biometric and GSM
Technology”, SSRG International Journal of Electronics and Communication Engineering
(SSRG-IJECE) – Volume 2 Issue 4–April 2015.
[13]Anil k. Jain, Ling Hong, Sharath Pankanti, Ruud Bolle “An Identity-Authentication
System using Fingerprints” .IEEE Vol.85 No.9 September1997.
[14] A. O. Oke, A. A. Adigun, A. S. Falohun, and F. O. Alamu, “Development of a
programmable electronic digital code lock system,” International Journal of Computer and
Information Technology, vol.2, issue 1, pp. 127-131, January 2013.
[16]. Anil K. Jain, Arun Ross, Salil Prabhakar, "An Introduction to Biometric Recognition",
IEEE Transactions on Circuits and Systems for Video Technology Special Issue on Image and
Video Based Biometrics, vol. 14, no. 1, 2004
[17]. Yu-Chih Huang, "Secure Access Control Scheme of RFID System Application", Fifth
International Conference on Information Assurance and Security, 2009.
[21]. A. Antonelli, R. Cappelli, D. Maio, D. Maltoni, "Fake Finger Detection by Skin Distortion
Analysis", IEEE Trans. Information Forensics and Security, vol. 1, no. 3, pp. 360-373, Sept.
2006.
[22]. A. Antonelli, R. Cappelli, D. Maio, D. Maltoni, "Fake Finger Detection by Skin Distortion
Analysis", IEEE Trans. Information Forensics and Security, vol. 1, no. 3, pp. 360-373, Sept.
2006.
APPENDICES
#include <Adafruit_Fingerprint.h>
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
//Created instances
LiquidCrystal_I2C lcd(0x27, 16, 2);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
int relayPin = 9;
void setup()
{
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, LOW);
Serial.begin(9600);
while (!Serial); // For Yun/Leo/Micro/Zero/...
delay(100);
lcd.begin();
lcd.setCursor(0, 0);
lcd.print("Fingerprint Door");
lcd.setCursor(0, 1);
lcd.print("lock by MakerPro");
delay(3000);
lcd.clear();
if (finger.verifyPassword()) {
lcd.setCursor(0, 0);
lcd.print(" FingerPrint ");
lcd.setCursor(0, 1);
lcd.print("Sensor Connected");
}
else {
lcd.setCursor(0, 0);
lcd.print("Unable to found");
lcd.setCursor(0, 1);
lcd.print("Sensor");
delay(3000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Check Connections");
while (1) {
delay(1);
}
}
lcd.clear();
}
p = finger.image2Tz();
if (p != FINGERPRINT_OK) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" Messy Image");
lcd.setCursor(0, 1);
lcd.print(" Try Again");
delay(3000);
lcd.clear();
return -1;
}
p = finger.fingerFastSearch();
if (p != FINGERPRINT_OK) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Not Valid Finger");
delay(3000);
lcd.clear();
return -1;
}
// found a match!
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" Door Unlocked");
lcd.setCursor(0, 1);
lcd.print(" Welcome");
digitalWrite(relayPin, HIGH);
delay(3000);
digitalWrite(relayPin, LOW);
lcd.clear();
return finger.fingerID;}
#include <Keypad.h>
#include <LiquidCrystal.h>
#include <Servo.h>
Servo myservo;
#define Password_Lenght 7 // Give enough room for six chars + NULL char
byte rowPins[ROWS] = {1, 2, 3, 4}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {5, 6, 7}; //connect to the column pinouts of the keypad
Keypad customKeypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS); //initialize an
instance of class NewKeypad
void setup()
{
myservo.attach(9);
ServoClose();
lcd.begin(16, 2);
lcd.print(" Arduino Door");
lcd.setCursor(0, 1);
lcd.print("--Look project--");
delay(3000);
lcd.clear();
}
void loop()
{
if (door == 0)
{
customKey = customKeypad.getKey();
if (customKey == '#')
{
lcd.clear();
ServoClose();
lcd.print(" Door is close");
delay(3000);
door = 1;
}
}
else Open();
}
void clearData()
{
while (data_count != 0)
{ // This can be used for any array size,
Data[data_count--] = 0; //clear array for new data
}
return;
}
void ServoOpen()
{
for (pos = 180; pos >= 0; pos -= 5) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
void ServoClose()
{
for (pos = 0; pos <= 180; pos += 5) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
void Open()
{
lcd.setCursor(0, 0);
lcd.print(" Enter Password");
customKey = customKeypad.getKey();
if (customKey) // makes sure a key is actually pressed, equal to (customKey != NO_KEY)
{
Data[data_count] = customKey; // store char into data array
lcd.setCursor(data_count, 1); // move cursor to show each new char
lcd.print(Data[data_count]); // print char at said cursor
data_count++; // increment data array by 1 to store new char, also keep track of the number
of chars entered
}