Sei sulla pagina 1di 54

Advanced automobile security system using biometric authentication

CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION
Recently vehicle tracking system is getting vast popularity because of the rising
number of the stolen vehicles. Vehicle theft is happening on parking and sometimes
driving in unsecured places. This project explores how to avoid this kind of stealing and
provides more security to the vehicles. The implemented system contains single-board
embedded system which is equipped with Global System for Mobile Communication
(GSM) and Global Positioning System (GPS) along with a microcontroller installed in
the vehicle.
The use of GSM and GPS technologies allows the system to track the vehicle and
provides the most up-to-date information about on-going trips. The Fingerprint sensor
captures the fingerprint images, matches the uniqueness of each print read by the sensor
and compares it to the one stored in its module or local system database. The
implemented system is very simple with greater security for vehicle anti-theft protection
and low cost technique compared to others. This technique helps in taking fast steps
towards an attempt to steal the vehicle .The design is robust and simple.

1.2 EXISTING SYSTEM


In the existing system, user has to enter his password to start the vehicle. The
vehicle user must carry an RF receiver device with him. If a thief tries to break the key
lock he still cannot start engine ignition without entering the right password. If he enters
the wrong password the system sends signals through RF transmitter. These signals are
then received by RF receiver device with the user and he is alerted.
DISADVANTAGES
1. Not efficient
2. Short distance communication
3. Not reliable
4. Low performance

Department of ECE, VBIT 1


Advanced automobile security system using biometric authentication

1.3 PROPOSED SYSTEM


In this proposed system, a module has been developed based on
microcontroller that consists of a GPS and GSM. A two way communication process is
achieved using a GSM modem. This system comprises of a keypad protection system
and it is used protect the vehicle from anti-theft. The Fingerprint sensor captures the
fingerprint images, matches the uniqueness of each print read by the sensor and
compares it to the one stored in its module or local system database. When driver gives
his password before starting the vehicle, the system will be considered as fair condition.
This system makes use of an embedded chip that has an inductive proximity
sensor, which senses the key during insertion and sends a text message to the owner‟s
mobile stating that the car is being accessed. If the user still fails to enter the correct
password, in three trials, the system will be taken as an abnormal condition. Then the
system will send an SMS to owner of the vehicle the coordinates of the current location
of the vehicle. SMS will be then sent to the owner having updated location’s
coordinate every interval of 10 seconds until doing the proper password verification.
The proposed system is used for positioning and navigating the vehicle with an
accuracy of 10 m. The Exact location is indicated in the form of latitude and longitude
along with the exact Navigated track on Google map. The system tracks the location of
particular vehicle and sends to users mobile in form of data and also to microcontroller.
The arrived data, in the form of latitude and longitude is used to locate the Vehicle on
the Google

1.4 LITERATURE REVIEW


Car security system has been very popular in recent times and widely used in
most cars and automobiles owned by companies, business organization and even by some
private individuals who can afford the cost. The most common automobile security
system has been the mannually operated demobilizer. Few of the many automobile theft-
prevention system allow a vehicle to start and temporarily run before disabling a critical
component, such as the fuel or ignition system. This type of shut down sequence is not
very confusing and the system could possibly be overcome by the thief . Also has
developed a security system titled: “Design and Construction of a home automation via

Department of ECE, VBIT 2


Advanced automobile security system using biometric authentication

domestic power line and GSM network which can be used to monitor home appliances in
an automated form via the GSM network. have developed embedded system design to
control automobile peripherals automatically through voice recognition system. The
profile of the authorize user was configured and saved in the system which operates
specific settings for the user. Whenever the user wishes to drive the car, system will
initiate the personal settings by identifying the users voice which includes the side and
rear mirrors setting and seat adjustments. The use of DM642 media processor allows the
real time snapshot of the driver to be taken and displayed on the LCD screen with
available profile report. The remotely operation of the smart car locked or unlocked was
also performed using GSM modem. Some another features such as navigation and
tracking of car using GPS module was also incorporated into the system. The latitude and
longitude positions were also taken by the system from GPS and sends to the PC using
GSM modem. The car real time location was also displayed on the map on PC. Also
have presented Short Message System (SMS) .
An auto security anti-theft system with an Immobilizer system through the radio
frequency identification (RFID) has been presented by which characterizes low hacking
rate while ensuring the safety supports of the passengers when the vehicle is hijacked.
The active RFID technology has been used for the operation of the immobilizer system
whereby three control circuits from the receiving unit which are in the vehicle, namely,
ignition circuit, power control unit, and automatic gear changing system, enabling the
vehicle speed is brought down to zero in a gradual safe manner. The proposed anti-theft
auto security system has been tested under various climate conditions and possible signal
instability situations were used to test its reliability. This paper proposes a smart anti-theft
car security system, which not only identifies thief but also controls the car.

Department of ECE, VBIT 3


Advanced automobile security system using biometric authentication

CHAPTER 2
BLOCK DIAGRAM

LCD

POWER SUPPLY
GPS

GSM AURDINO
BUZZER
UNO

FINGER PRINT DRIVER


READER CIRCUIT

DC.MOTOR

Fig 2.1 Block Diagram

Department of ECE, VBIT 4


Advanced automobile security system using biometric authentication

CHAPTER 3
SYSTEM REQUIREMENT SPECIFICATION

3.1 HARDWARE REQUIREMENTS


3.1.1 LCD Display

One of the most common devices attached to an Arduino is an LCD display.


Some of the most common LCDs connected to the Atmega328 are 16x2 and 20x2
displays. This means 16 characters per line by 2 lines and 20 characters per line by 2
lines, respectively. In recent years the LCD is finding widespread use replacing LED‟s.
This is due to the following reasons:

1. Declining prices.
2. Ability to display numbers, characters and graphics.
3. Incorporation of a refreshing controller into the LCD.
4. Ease of programming.

Figure 3.1: LCD display

Fortunately, a very popular standard exists which allows us to communicate with


the vast majority of LCDs regardless of their manufacturer. The standard is referred to as
HD44780U, which refers to the controller chip which receives data from an external
source (in this case, the Atmega328) and communicates directly with the LCD. The
44780 standard requires 3 control lines as well as either 4 or 8 I/O lines for the data bus.
The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data

Department of ECE, VBIT 5


Advanced automobile security system using biometric authentication

bus. If a 4-bit data bus is used the LCD will require a total of 7 data lines (3 control lines
plus the 4 lines for the data bus). If an 8-bit data bus is used the LCD will require a total
of 11 data lines (3 control lines plus the 8 lines for the data bus).

3.1.2 Pin Symbol I/O Description

PIN SYMBOL FUNCTION


NO
1 VSS GND
2 VDD +5V
3 V0 Contrast Adjustment
4 RS H/L REGISTER SELECT SIGNAL
5 R/W H/L READ/ WRITE SIGNAL
6 E H/L ENABLE SIGNAL
7 DB0 H/L DATA BUS LINE
8 DB1 H/L DATA BUS LINE
9 DB2 H/L DATA BUS LINE
10 DB3 H/L DATA BUS LINE
11 DB4 H/L DATA BUS LINE
12 DB5 H/L DATA BUS LINE
13 DB6 H/L DATA BUS LINE
14 DB7 H/L DATA BUS LINE
15 A +4.2 FOR LED
16 K POWER SUPPLY FOR BKL(0)

Table 3.1: LCD pin symbol I/O description

Department of ECE, VBIT 6


Advanced automobile security system using biometric authentication

3.1.3 Important Signals

The following pins are important to LCD‟s while programming

3.1.3.1 Enable (EN)

The EN line is called "Enable." This control line is used to tell the LCD that you
are sending it data. To send data to the LCD, your program should make sure this line is
low (0) and then set the other two control lines and/or put data on the data bus. When the
other lines are completely ready, bring EN high (1) and wait for the minimum amount of
time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing
it low (0) again.

3.1.3.2 Register Select (RS)

The RS line is the "Register Select" line. When RS is low (0), the data is to be
treated as a command or special instruction (such as clear screen, position cursor, etc.).
When RS is high (1), the data being sent is text data which should be displayed on the
screen. For example, to display the letter "T" on the screen you would set RS high.

3.1.3.3 Read/Write (R/W)

The RW line is the "Read/Write" control line. When RW is low (0), the
information on the data bus is being written to the LCD. When RW is high (1), the
program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD
status") is a read command. All others are write commands--so RW will almost always be
low. Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation
selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0,
DB1, DB2, DB3, DB4, DB5, DB6, and DB7.

The LCD panel's Enable and Register Select is connected to the Control Port. The
Control Port is an open collector / open drain output. While most Parallel Ports have
internal pull-up resistors, there is a few which don't. Therefore by incorporating the two

Department of ECE, VBIT 7


Advanced automobile security system using biometric authentication

10K external pull up resistors, the circuit is more 18 portable for a wider range of
computers, some of which may have no internal pull up resistors.
We make no effort to place the Data bus into reverse direction. Therefore we hard
wire the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on
the data lines. As a result we cannot read back the LCD Internal busy flag is noticed if
the LCD has accepted and finished processing the last instruction. This problem is
Overcome by inserting known delays into our program.
The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy
here. As with all the examples, I've left the power supply out. You can use a bench power
supply set to 5V or use a onboard +5 regulator. Remember a few de-coupling capacitors,
especially if you have trouble with the circuit working properly.

CODE COMMAND TO LCD INSTRUCTION REGISTER


(HEX)
1 CLEAR DISPLAY SCREEN
2 RETURN HOME
4 DECREMENT CURSOR(SHIFT CURSOR TO LEFT)
6 INCREMENT CURSOR(SHIFT CURSOR TO RIGHT)
5 SHIFT DISPLAY RIGHT
7 SHIFT DISPLAY LEFT
8 DISPLAY OFF ,CURSOR OFF
A DISPLAY ON ,CURSOR OFF
C DISPLAY ON ,CURSOR OFF
E DISPLAY ON ,CURSOR BLINKING
F DISPLAY ON ,CURSOR BLINKING
10 SHIFT CURSOR POSITON TO LEFT
14 SHIFT CURSOR POSITION TO RIGHT
18 SHIFT THE ENTIRE DISPLAY TO LEFT
1C SHIFT THE ENTIRE DISPLAY TO RIGHT
80 FORCE CURSOR TO BEGINNING OF1* LINE
0C0 FORCE CURSOR TO BEGINNING OF 2*4 LINE
38 2 LINES AND 5×7 MATRIX

Table 3.2: LCD command set.

Department of ECE, VBIT 8


Advanced automobile security system using biometric authentication

3.2 ARDUINO UNO


ARDUINO can be described as a computer embedded on a rather small circuit
board. To describe the function of a Arduino more precisely it is a single chip that can
perform various calculations and task and send/receive signals/data from other devices
via the available pins.
However, the microcontroller by itself, cannot accomplish much, it needs
several external inputs, power, for one, a steady clock signal, for another. Also, the job of
programming it has to be accomplished by an external circuit. So typically, a
microcontroller is used along with a circuit which provides these things to it; this
combination is called a microcontroller board. The Arduino Uno that you have received
is one such microcontroller board. The actual microcontroller at its heart is the chip
called Atmega328. The advantages that Arduino offers over other microcontroller boards
are largely in terms of reliability of the circuit hardware as well as the ease of
programming and using it.

Fig 3.2: Arduino UNO board

The Atmel 8-bit AVR RISC-based microcontroller combines 32 KB ISP flash


memory with read-while-write capabilities, 1 KB EEPROM, 2 KB SRAM, 23 general
purpose I/O lines, 32 general purpose working registers, three flexible timer/counters
with compare modes, internal and external interrupts, serial programmable USART, a
byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter (8-
channels in TQFP and QFN/MLF packages), programmable watchdog timer with

Department of ECE, VBIT 9


Advanced automobile security system using biometric authentication

internal oscillator, and five software selectable power saving modes. The device operates
between 1.8-5.5 volts. The device achieves throughputs approaching 1 MIPS.

3.2.1 Applications

Today the ATmega328 is commonly used in many projects and autonomous


systems where a simple, low-powered, low-cost micro-controller is needed. Perhaps the
most common implementation of this chip is on the popular Arduino development
platform, namely the Arduino Uno and Arduino Nano models.

3.2.2 Features

 28-pin AVR Microcontroller


 Flash Program Memory: 32 kbytes
 EEPROM Data Memory: 1 kbytes
 SRAM Data Memory: 2 kbytes
 I/O Pins: 23
 Timers: Two 8-bit / One 16-bit
 A/D Converter: 10-bit Six Channel
 PWM: Six Channels
 RTC: Yes with Separate Oscillator
 MSSP: SPI and I²C Master and Slave Support
 USART: Yes
 External Oscillator: up to 20MHz

3.3 MICROCONTROLLER ATMEGA 328

The Atmega328 is a very popular microcontroller chip produced by Atmel. It is an 8-


bit microcontroller that has 32K of flash memory, 1K of EEPROM, and 2K of internal
SRAM.

The Atmega328 is one of the microcontroller chips that are used with the popular
Arduino Duemilanove boards. The Arduino Duemilanove board comes with either 1 of 2

Department of ECE, VBIT 10


Advanced automobile security system using biometric authentication

microcontroller chips, the Atmega168 or the Atmega328. Of these 2, the Atmega328 is


the upgraded, more advanced chip. Unlike the Atmega168 which has 16K of flash
program memory and 512 bytes of internal SRAM, the Atmega328 has 32K of flash
program memory and 2K of Internal SRAM.

The Atmega328 has 28 pins, It has 14 digital I/O pins, of which 6 can be used as
PWM outputs and 6 analog input pins. These I/O pins account for 20 of the pins

3.3.1 Pin diagram of ATMEGA328

Fig 3.3: Pin diagram of Atmega328

Department of ECE, VBIT 11


Advanced automobile security system using biometric authentication

PIN DESCRIPTION FUNCTION


NO
1 PC6 RESET
2 PD0 DIGITAL PIN(RX)
3 PD1 DIGITAL PIN(TX)
4 PD2 DIGITAL PIN
5 PD3 DIGITAL PIN(PWM)
6 PD4 DIGITAL PIN
7 VCC POSITIVE VOLTAGE(POWER)
8 GND GROUND
9 XTAL1 CRYSTAL OSCILLATOR
10 XTAL2 CRYSTAL OSCILLATOR
11 PD5 DIGITAL PIN(PWM)
12 PD6 DIGITAL PIN(PWM)
13 PD7 DIGITAL PIN
14 PB0 DIGITAL PIN
15 PB1 DIGITAL PIN(PWM)
16 PB2 DIGITAL PIN(PWM)
17 PB3 DIGITAL PIN(PWM)
18 PB4 DIGITAL PIN
19 PB5 DIGITAL PIN
20 AVCC POSITIVE VOLTAGE FOR ADC(POWER)
21 AREF REFERENCE VOLTAGE
22 GND GROUND
23 PC0 ANALOG I/P
24 PC1 ANALOG I/P
25 PC2 ANALOG I/P
26 PC3 ANALOG I/P
27 PC4 ANALOG I/P
28 PC5 ANALOG I/P

Table 3.3: Description of each pins of ATmega328

As stated before, 20 of the pins function as I/O ports. This means they can
function as an input to the circuit or as output. Whether they are input or output is set in
the software. 14 of the pins are digital pins, of which 6 can function to give PWM output.
6 of the pins are for analog input/output. Two of the pins are for the crystal oscillator,
this is to provide a clock pulse for the Atmega chip. A clock pulse is needed for
synchronization so that communication can occur in synchrony between the Atmega chip
and a device that it is connected to.

Department of ECE, VBIT 12


Advanced automobile security system using biometric authentication

The Atmega328 chip has an analog-to-digital converter (ADC) inside of it. This
must be or else the Atmega328 wouldn't be capable of interpreting analog signals.
Because there is an ADC, the chip can interpret analog input, which is why the chip has 6
pins for analog input. Thus, a portrait of an analog signal is shown by this digital value;
thus, it is its digital correspondent value. The last pin is the RESET pin. This allows a
program to be rerun and start over. And this sums up the pin out of an Atmega328 chip.

3.4 ARCHITECTURE

Fig 3.4: Architecture of AVR

3.5 FEATURES OF AVR.

• High-performance, Low-power AVR® 8-bit Microcontroller


• Advanced RISC Architecture
 131 Powerful Instructions – Most Single-clock Cycle Execution
 32 x 8 General Purpose Working Registers
 Fully Static Operation
 Up to 16 MIPS Throughput at 16 MHz
 On-chip 2-cycle Multiplier

• Nonvolatile Program and Data Memories

Department of ECE, VBIT 13


Advanced automobile security system using biometric authentication

• Endurance: 10,000 Write/Erase Cycles


 Optional Boot Code Section with Independent Lock Bits
• In-System Programming by On-chip Boot Program
• True Read-While-Write Operation
 1024 Bytes EEPROM
• Endurance: 100,000 Write/Erase Cycles
 2K Byte Internal SRAM
 Programming Lock for Software Security
• JTAG (IEEE std. 1149.1 Compliant) Interface
 Boundary-scan Capabilities According to the JTAG Standard
 Extensive On-chip Debug Support
 Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG
Interface
• Peripheral Features
 Two 8-bit Timer/Counters with Separate Pre scalers and Compare Modes
 One 16-bit Timer/Counter with Separate Pre scaler, Compare Mode, and Capture
 Mode
 Real Time Counter with Separate Oscillator
 Four PWM Channels
 8-channel, 10-bit ADC
• 8 Single-ended Channels
• 7 Differential Channels in TQFP Package Only
• 2 Differential Channels with Programmable Gain at 1x, 10x, or 200x
 Byte-oriented Two-wire Serial Interface
 Programmable Serial USART
 Master/Slave SPI Serial Interface
 Programmable Watchdog Timer with Separate On-chip Oscillator
 On-chip Analog Comparator
• Special Microcontroller Features
 Power-on Reset and Programmable Brown-out Detection
 Internal Calibrated RC Oscillator

Department of ECE, VBIT 14


Advanced automobile security system using biometric authentication

 External and Internal Interrupt Sources


 Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby
 and Extended Standby
• I/O and Packages
 32 Programmable I/O Lines
 40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF
• Operating Voltages
 2.7 - 5.5V for ATmega32L
 4.5 - 5.5V for ATmega32
• Speed Grades
 0 - 8 MHz for ATmega32L
 0 - 16 MHz for ATmega32
• Power Consumption at 1 MHz, 3V, 25°C for ATmega32L
 Active: 1.1 mA
 Idle Mode: 0.35 mA
 Power-down Mode: < 1 μA

3.6 BASIC TERMINOLOGIES IN ARDUINO

3.6.1 Analog to Digital Converter (ADC)

 The process of Analog to digital conversion is shown in figure.


 The Arduino has 10 bits of Resolution when reading analog signals.
 210=1024 increments.
 Influence also by how fast you sample.

3.6.2 Pulse Width Modulation (PWM)

 The Arduino has 8bit of resolution, when outputting a signal using PWM.
 The range of output voltage is from 0 to 5 Volts.
 28=255 Increments

Department of ECE, VBIT 15


Advanced automobile security system using biometric authentication

 Average of on/off(digital signals to make an average voltage),Duty cycle in 100%


of 5Volts.
3. 7 LANGUAGE REFERENCES:

The Microcontroller on the board is programmed using the Arduino programming


language (based on wiring) and the arduino development environment (based on
processing).

3.7.1 Arduino programming language (APL) (based on wiring)

The Arduino programming language is an implementation of wiring, a similar


physical computing platform, which is based on the Processing multimedia programming
environment.

3.8 ARDUINO DEVELOPMENT ENVIRONMENT

3.8.1 Processing

Processing is an open source programming language and environment for people


who want to create images, animations, and interactions. Initially developed to serve as a
software sketchbook and to teach fundamentals of computer programming within a
visual context, Processing also has evolved into a tool for generating finished
professional work. Today, there are tens of thousands of students, artists, designers,
researchers, and hobbyists who use Processing for learning, prototyping, and production.

3.9 FINGER PRINT READER

This is a finger print sensor module with TTL UART interface for direct
connections to microcontroller UART or to PC through MAX232 / USB-Serial adapter.
The user can store the finger print data in the module and can configure it in 1:1 or 1: N
mode for identifying the person.The FP module can directly interface with 3v3 or 5v
Microcontroller. A level converter (like MAX232) is required for interfacing with PC
serial port.Optical biometric fingerprint reader with great features and can be embedded

Department of ECE, VBIT 16


Advanced automobile security system using biometric authentication

into a variety of end products, such as: access control, attendance, safety deposit box, car
door locks

3.9.1 Features

 Integrated image collecting and algorithm chip together, ALL-in-One


 Fingerprint reader can conduct secondary development, can be embedded into a
variety of end products
 Low power consumption, low cost, small size, excellent performance
 Professional optical technology, precise module manufacturing techniques
 Good image processing capabilities, can successfully capture image up to
resolution 500 dpi

3.9.2 Specifications

 Fingerprint sensor type: Optical


 Sensor Life: 100 million times
 Static indicators: 15KVBacklight: bright green
 Interface: USB1.1/UART(TTL logical level)
 RS232 communication baud rate: 4800BPS~115200BPS changeable
 Dimension: 55*32*21.5mm
 Image Capture Surface 15—18(mm)
 Verification Speed: 0.3 sec
 Scanning Speed: 0.5 sec
 Character file size: 256 bytes
 Template size: 512 bytes
 Storage capacity: 250
 Security level: 5 (1,2,3,4,5(highest))
 False Acceptance Rate (FAR) :0.0001%
 False Rejection Rate (FRR): 0.1%
 Resolution 500 DPI
 Voltage :3.6-6.0 VDC
 Working current: Typical 90 mA, Peak 150mA

Department of ECE, VBIT 17


Advanced automobile security system using biometric authentication

 Matching Method: 1: N
 Operating Environment Temperature: -20 to 45° centigrades.
 Connection of fingerprint to Microcontrollers.
 The corner pin is +5V as shown below in red line, then is Ground(GND), Then
TXD which goes to MCU's RX-IN, and last pin is RXD which goes to MCU's
TX-OUT pin.

Fig 3.5 : Fingerprint Reader

3.10 GSM

GSM is a mobile communication modem; it is stands for global system for mobile
communication (GSM). . 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 operates at the 850MHz, 900MHz, 1800MHz and 1900MHz frequency
bands.

Fig 3.6: GSM Modem 800

Department of ECE, VBIT 18


Advanced automobile security system using biometric authentication

GSM system was developed as a digital system using time division multiple
access (TDMA) technique for communication purpose. A GSM digitizes and reduces the
data, then sends it down through a channel with two different streams of client data, each
in its own particular time slot. The digital system has an ability to carry 64 kbps to 120
Mbps of data rates.

There are various cell sizes in a GSM system such as macro, micro, pico and
umbrella cells. Each cell varies as per the implementation domain. There are five
different cell sizes in a GSM network macro, micro, pico and umbrella cells. The
coverage area of each cell varies according to the implementation environment.

Time Division Multiple Access

TDMA technique relies on assigning different time slots to each user on the same
frequency. It can easily adapt to data transmission and voice communication and can
carry 64kbps to 120Mbps of data rate.

GSM Architecture

A GSM network consists of the following components:

 Mobile Station:
It is the 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
Station Controller which controls the Base Transceiver station and acts as a interface
between the mobile station and mobile switching centre.
 Network Subsystem:
It provides the basic network connection to the mobile stations. The basic part of
the Network Subsystem is the Mobile Service Switching Centre which provides
access to different networks like ISDN, PSTN etc. It also consists of the Home

Department of ECE, VBIT 19


Advanced automobile security system using biometric authentication

Location Register and the Visitor Location Register which provides the call routing
and roaming capabilities of GSM. It also contains the Equipment Identity Register
which maintains an account of all the mobile equipments wherein each mobile is
identified by its own IMEI number. IMEI stands for International Mobile Equipment
Identity.

3.10.1 Features of GSM Module:

 Improved spectrum efficiency


 International roaming
 Compatibility with integrated services digital network (ISDN)
 Support for new services.
 SIM phonebook management
 Fixed dialing number (FDN)
 Real time clock with alarm management
 High-quality speech
 Uses encryption to make phone calls more secure
 Short message service (SMS)
The security strategies standardized for the GSM system make it the most secure
telecommunications standard currently accessible. Although the confidentiality of a call
and secrecy of the GSM subscriber is just ensured on the radio channel, this is a major
step in achieving end-to- end security.

3.10.2 Working of GSM Module:

A GSM modem duly interfaced to the MC through the level shifter IC Max232.
The SIM card mounted GSM modem upon receiving digit command by SMS from any
cell phone send that data to the MC through serial communication. While the program is
executed, the GSM modem receives command ‘STOP’ to develop an output at the MC,
the contact point of which are used to disable the ignition switch. The command so sent
by the user is based on an intimation received by him through the GSM modem ‘ALERT’
a programmed message only if the input is driven low. The complete operation is
displayed over 16×2 LCD display.

Department of ECE, VBIT 20


Advanced automobile security system using biometric authentication

3.11 GPS
GPS or Global Positioning System is a satellite navigation system that furnishes
location and time information in all climate conditions to the user. GPS is used for
navigation in planes, ships, cars and trucks also. The system gives critical abilities to
military and civilian users around the globe. GPS provides continuous real time, 3-
dimensional positioning, navigation and timing worldwide.

Fig 3.7: GPS receiver

 How does GPS System Work


The GPS system consists of three segments:

1.The space segment: the GPS satellites

2. The control system, operated by the U.S. military

3. The user segment, which includes both military and civilian users and their GPS
equipment.

 Space Segment:

The space segment is the number of satellites in the constellation. It comprises


of 29 satellites circling the earth every 12 hours at 12,000 miles in altitude. The
function of the space segment is utilized to route/navigation signals and to store and
retransmit the route/navigation message sent by the control segment. These
transmissions are controlled by highly stable atomic clocks on the satellites. The GPS
Space Segment is formed by a satellite constellation with enough satellites to ensure

Department of ECE, VBIT 21


Advanced automobile security system using biometric authentication

that the users will have, at least, 4 simultaneous satellites in view from any point at the
Earth surface at any time.

 Control Segment:

The control segment comprises of a master control station and five monitor
stations outfitted with atomic clocks that are spread around the globe. The five monitor
stations monitor the GPS satellite signals and then send that qualified information to
the master control station where abnormalities are revised and sent back to the GPS
satellites through ground antennas. Control segment also referred as monitor station.

 User Segment:

The user segment comprises of the GPS receiver, which receives the signals from
the GPS satellites and determine how far away it is from each satellite. Mainly this
segment is used for the U.S military, missile guidance systems, civilian applications
for GPS in almost every field. Most of the civilian uses this from survey to
transportation to natural resources and from there to agriculture purpose and mapping
too.

3.11.1 How GPS Determines a Position:

The working/operation of Global positioning system is based on the ‘trilateration’


mathematical principle. The position is determined from the distance measurements to
satellites. From the figure, the four satellites are used to determine the position of the
receiver on the earth. The target location is confirmed by the 4th satellite. And three
satellites are used to trace the location place. A fourth satellite is used to confirm the
target location of each of those space vehicles. Global positioning system consists of
satellite, control station and monitor station and receiver. The GPS receiver takes the
information from the satellite and uses the method of triangulation to determine a user’s
exact position.

Department of ECE, VBIT 22


Advanced automobile security system using biometric authentication

 GPS is used on some incidents in several ways, such as:

To determine position locations; for example, you need to radio a helicopter pilot
the coordinates of your position location so the pilot can pick you up.
1. To navigate from one location to another; for example, you need to travel from a
lookout to the fire perimeter.
2. To create digitized maps; for example, you are assigned to plot the fire perimeter
and hot spots.
3. To determine distance between two different points.
 Advantages of GPS:

1. GPS satellite based navigation system is an important tool for military, civil and
commercial users
2. Vehicle tracking systems GPS-based navigation systems can provide us with turn
by turn directions
3. Very high speed
 Disadvantages of GPS:

1. GPS satellite signals are too weak when compared to phone signals, so it doesn’t
work as well indoors, underwater, under trees, etc.
2. The highest accuracy requires line-of-sight from the receiver to the satellite, this is
why GPS doesn’t work very well in an urban environment.
3. There are many sources of possible errors that will degrade the accuracy of
positions computed by a GPS receiver. The travel time taken by the GPS satellite

Department of ECE, VBIT 23


Advanced automobile security system using biometric authentication

signals can be changed by atmospheric effects; when a GPS signal passes through
the ionosphere and troposphere it is refracted, causing the speed of the signal to be
different from the speed of a GPS signal in space. Another source of error is noise,
or distortion of the signal which causes electrical interference or errors inherent in
the GPS receiver itself.

The information about satellite orbits will also cause errors in determining the
positions, because the satellites are not really where the GPS receiver “thought” based on
the information it received when it determine the positions. Small variations in the
atomic clocks on board the satellites can translate to large position errors; a clock error of
1 nanosecond translates to 1 foot or .3 meters user error on the ground. A multipath effect
occurs when signals transmitted from the satellites bounce off a reflective surface before
getting to the receiver antenna. During this process, the receiver gets the signal in
straight line path as well as delayed path (multiple paths). The effect is similar to a ghost
or double image on a TV set.

3.11.2 Specifications :

1. 5Hz position update rate

2. Operating temperature range: -40 TO 85°CUART TTL socket

3. EEPROM to save configuration settings

4. Rechargeable battery for Backup

5. The cold start time of 38 s and Hot start time of 1 s

6. Supply voltage: 3.3 V

7. Configurable from 4800 Baud to 115200 Baud rates. (default 9600)

8. SuperSense ® Indoor GPS: -162 dBm tracking sensitivity

9. Separated 18X18mm GPS antenna

Department of ECE, VBIT 24


Advanced automobile security system using biometric authentication

3.12 MOTOR DRIVING CIRCUIT

This motor driving circuit section acts as a relay which switches on the
motor/pump based on the switching operation.Here in this project we are using transistor
for the switching operation.Transistors have three pins. For Bipolar Junction
Transistors (BJT), like the one used used in this example, the pins are called base,
collector, and emitter. A small amount of current on the base pin closes a circuit
between the collector and emitter pins. BJT’s come in two different types, NPN
and PNP. The TIP120 is a NPN-type transistor, which means the collector will
connect to the motor , and the emitter will connect to ground.

Fig 3.8: Motor driving circuit

3.13 DC MOTOR
DC motors like this are great for battery-powered toys (things like model trains,
radio-controlled cars, or electric shavers), but you don't find them in many household
appliances. Small appliances (things like coffee grinders or electric food blenders) tend to
use what are called universal motors, which can be powered by either AC or DC. Unlike
a simple DC motor, a universal motor has an electromagnet, instead of a permanent
magnet, and it takes its power from the DC or AC power you feed in:
 When you feed in DC, the electromagnet works like a conventional permanent
magnet and produces a magnetic field that's always pointing in the same direction.

Department of ECE, VBIT 25


Advanced automobile security system using biometric authentication

The commutator reverses the coil current every time the coil flips over, just like in
a simple DC motor, so the coil always spins in the same direction.
 When you feed in AC, however, the current flowing through the electromagnet
and the current flowing through the coil both reverse, exactly in step, so the force
on the coil is always in the same direction and the motor always spins either
clockwise or counter-clockwise. What about the commutator? The frequency of
the current changes much faster than the motor rotates and, because the field and
the current are always in step, it doesn't actually matter what position the
commutator is in at any given moment.

Fig 3.9: DC Motor

3.14. BUZZER

A buzzer or beeper is an audio signaling device, which may be mechanical,


electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm
devices, timers and confirmation of user input such as a mouse click or keystroke. Buzzer
is an integrated structure of electronic transducers, DC power supply, widely used in
computers, printers, copiers, alarms, electronic toys, automotive electronic equipment,
telephones, timers and other electronic products for sound devices. Active buzzer 5V
Rated power can be directly connected to a continuous sound, this section dedicated
sensor expansion module and the board in combination, can complete a simple circuit
design, to "plug and play."

Department of ECE, VBIT 26


Advanced automobile security system using biometric authentication

Specifications:
 On-board passive buzzer

 On-board 8550 triode drive

 Can control with single-chip microcontroller IO directly

 Working voltage: 5V

 Board size: 22 (mm) x12 (mm)

Pin Configuration:
1. VCC
2. Input
3.Ground

Fig 3.10: Buzzer

3.15 SOFTWARE REQUIREMENTS

3.15.1 Embedded C

Embedded C is a set of language extensions for the C Programming language by


the C Standards committee to address commonality issues that exist between C
extensions for different embedded systems.
Historically, embedded C programming requires nonstandard extensions to the C
language in order to support exotic features such as fixed-point arithmetic, multiple
distinct memory banks, and basic I/O operations.

Department of ECE, VBIT 27


Advanced automobile security system using biometric authentication

3.15.2 Difference between C and Embedded C

Though C and embedded C appear different and are used in different contexts,

they have more similarities than the differences. Most of the constructs are same; the

difference lies in their applications

Though C and embedded C appear different and are used in different contexts, they have

more similarities than the differences. Most of the constructs are same; the difference lies

in their applications.

C is used for desktop computers, while embedded C is for microcontroller based


applications. C takes more resources of a desktop PC like memory, OS, etc. while
programming on desktop systems what embedded C cannot. Embedded C has to use the
limited resources (RAM, ROM, I/O’s) on an embedded processor. Thus, program code
must fit into the available program memory. If code exceeds the limit, the system is likely
to crash.

Compilers for C (ANSI C) typically generate OS dependent executable files.


Embedded C requires compilers to create files to be downloaded to the
microcontrollers/microprocessors where it needs to run. Embedded compilers give access
to all resources which is not provided in compilers for desktop computer applications.

Embedded systems often have the real-time constraints, which is usually not
there with desktop computer applications.

Embedded systems often do not have a console, which is available in case of


desktop applications.

The C programming language is perhaps the most popular programming


language for programming embedded systems. C continues to be a very popular language
for micro-controller developers/programmers due to the code efficiency and reduced
overhead and development time. C offers low-level control and is considered more
readable than assembly language which is a little difficult to understand. Assembly

Department of ECE, VBIT 28


Advanced automobile security system using biometric authentication

language requires more code writing, whereas C is easy to understand and requires less
coding. Plus, using C increases portability, since C code can be compiled for different
types of processors. We can program microcontrollers using Atmel Atmega328, AVR or
PIC.
Here by developing the programs as per the electronic hardware using Atmel
Atmega328 micro controller. For the operations like: blink led, increment decrement
counters, token displays etc.

Most C programmers are spoiled because they program in environments where


not only there is a standard library implementation, but there are frequently a number of
other libraries available for use. The cold fact is, that in embedded systems, there rarely
are many of the libraries that programmers have grown used to, but occasionally an
embedded system might not have a complete standard library, if there is a standard
library at all. Few embedded systems have capability for dynamic linking, so if standard
library functions are to be available at all, they often need to be directly linked into the
executable. Oftentimes, because of space concerns, it is not possible to link in an entire
library file, and programmers are often forced to "brew their own" standard c library
implementations if they want to use them at all. While some libraries are bulky and not
well suited for use on microcontrollers, many development systems still include the
standard libraries which are the most common for C programmers.
C remains a very popular language for micro-controller developers due to
the code efficiency and reduced overhead and development time. C offers low-level
control and is considered more readable than assembly. Many free C compilers are
available for a wide variety of development platforms. The compilers are part of an IDEs
with ICD support, breakpoints, single-stepping and an assembly window. The
performance of C compilers has improved considerably in recent years, and they are
claimed to be more or less as good as assembly, depending on who you ask. Most tools
now offer options for customizing the compiler optimization. Additionally, using C
increases portability, since C code can be compiled for different types of processors.

Department of ECE, VBIT 29


Advanced automobile security system using biometric authentication

3.15.3 Software

The software used by the arduino is Arduino IDE. The Arduino IDE is a cross-
platform application written in Java, and is derived from the IDE for the Processing
programming language and the Wiring project. It is designed to introduce programming
to artists and other newcomers unfamiliar with software development. It includes a code
editor with features such as syntax highlighting, brace matching, and automatic
indentation, and is also capable of compiling and uploading programs to the board with a
single click. There is typically no need to edit make files or run programs on a command-
line interface. Although building on command-line is possible if required with some
third-party tools such as Ino.

The Arduino IDE comes with a C/C++ library called "Wiring" (from the project
of the same name), which makes many common input/output operations much easier.
Arduino programs are written in C/C++, although users only need define two functions to
make a runnable program:

 setup() – a function run once at the start of a program that can initialize settings
 loop() – a function called repeatedly until the board powers off

A typical first program for a microcontroller simply blinks a LED on and off. In
the Arduino environment, the user might write a program like this:
 #define LED_PIN 13
 void setup (){
 pinMode(LED_PIN, OUTPUT);// enable pin 13 for digital output
 }
 void loop (){
 digitalWrite(LED_PIN, HIGH);// turn on the LED
 delay(1000);// wait one second (1000 milliseconds)

Department of ECE, VBIT 30


Advanced automobile security system using biometric authentication

Fig 3.11: A Screenshot of Arduino IDE

For the above code to work correctly, the positive side of the LED must be
connected to pin 13 and the negative side of the LED must be connected to ground. The
above code would not be seen by a standard C++ compiler as a valid program, so when
the user clicks the "Upload to I/O board" button in the IDE, a copy of the code is written
to a temporary file with an extra include header at the top and a very simple main()
function at the bottom, to make it a valid C++ program.

The Arduino IDE uses the GNU tool chain and AVR Libc to compile programs,
and uses AVR dude to upload programs to the board.

For educational purposes there is third party graphical development environment


called Mini blog available under a different open source license.

Department of ECE, VBIT 31


Advanced automobile security system using biometric authentication

PROGRAM COMPILING

Figure 3.12: Program compiling using arduino IDE.

SELECTING BOARD

Figure 3.13: Selecting the board from Tools menu

Department of ECE, VBIT 32


Advanced automobile security system using biometric authentication

SELECTING PORT

Figure 3.14: Selecting the port

UPLOADING PROGRAM

Figure 3.15: Uploading program to the arduino.

Department of ECE, VBIT 33


Advanced automobile security system using biometric authentication

CHAPTER 4
DESIGN AND IMPLEMENTATION

4.1 SCEAMATIC DIAGRAM

LCD1
LM016L

GSM
10

1.995949,W
RX
54.071125,N
TX

VDD
VSS

VEE

RW
VGPS

RS

D0
D1
D2
D3
D4
D5
D6
D7
E
1
2
3

4
5
6

7
8
9
10
11
12
13
14
U1
30 12
PD0/RXD/PCINT16 PB0/ICP1/CLKO/PCINT0
31 13
PD1/TXD/PCINT17 PB1/OC1A/PCINT1
32 14
PD2/INT0/PCINT18 PB2/SS/OC1B/PCINT2
1 15
PD3/INT1/OC2B/PCINT19 PB3/MOSI/OC2A/PCINT3
2 16
PD4/T0/XCK/PCINT20 PB4/MISO/PCINT4
9 17
PD5/T1/OC0B/PCINT21 PB5/SCK/PCINT5
10 7
PD6/AIN0/OC0A/PCINT22 PB6/TOSC1/XTAL1/PCINT6
11 8
PD7/AIN1/PCINT23 PB7/TOSC2/XTAL2/PCINT7
20 23
AREF PC0/ADC0/PCINT8
18 24
AVCC PC1/ADC1/PCINT9
25
GPS1 PC2/ADC2/PCINT10
19 26
ADC6 PC3/ADC3/PCINT11
22 27
TX 54.071125,N ADC7 PC4/ADC4/SDA/PCINT12
28
RX 1.995949,W PC5/ADC5/SCL/PCINT13
29
PC6/RESET/PCINT14
10
ATMEGA328P
VGPS

FINGERPRINT SENSOR RELAY


RLY-SPCO
10 D1
1N4001
1.995949,W
RX
54.071125,N
TX
VGPS

Fig 4.1 Schematic Diagram

Department of ECE, VBIT 34


Advanced automobile security system using biometric authentication

4.2 Operating procedure:


Initially, the power supply is given to the Arduino uno board and GSM
module.The four manual switches are used to start the system and to enroll and delete the
fingerprint.Using the switches the fingerprint of user can be enrolled manually .
Press enroll button to enroll the fingerprint.As per instructions displayed on lcd
place the finger to enroll.Then start the system using up/down switches.Now the
fingerprint reader stores the optical image of finger. And whenever the user places his/her
finger it searches the location in which it is stored.
If the fingerprint matches with the stored fingerprint the engine/motor will be
on.If not the Arduino will send the control signal to initiate the gps receiver and an sms is
sent to the concerned person mobile number using gsm showing the location i.e latitude
and longitude coordinates. And simulatenously buzzer will on .Thus the system is
operated and used for security of automobiles.

Department of ECE, VBIT 35


Advanced automobile security system using biometric authentication

CHAPTER 5
ADVANTAGES AND APPLICATIONS

5.1 ADVANTAGES
1.Fingerprint based security system is most secured system as compared to other
systems. Reason is that RFID card or Keys of lock can be stolen, password may be
leaked
2. No need to carry the keys to open the lock. Or even there is no need to remember
the password or any Pin number

5.2 DIS-ADVANTAGES
1.Biometric systems may be costly to implement ,which might exclude many
companies or organizations from implementing it.

5.3 APLLICATIONS
1. This project is used at parking places.
2. It is implemented for vehicle security systems.

Department of ECE, VBIT 36


Advanced automobile security system using biometric authentication

CHAPTER 6
OVERVIEW

6.1 RESULT

Snapshots of the Proposed System

1. Welcome Note

Fig 6.1: Snapshots of the System

Department of ECE, VBIT 37


Advanced automobile security system using biometric authentication

CHAPTER 7
CONCLUSION AND FUTURE SCOPE

7.1 CONCLUSION
Security is the pivotal for any system. Thus fingerprint identification
enhances the security of the vehicle and makes it possible for only authenticated users.
The proposed system is cheap and easy to use. This system brings innovation to the
existing technology in the vehicles and also improves the safety features, hence proving
to be an effective development in the automobile industry.
A project or system has to be tested under various conditions to ensure its correctness.
The testing conditions for this project include several authorized and unauthorized
attempts to access the system. These include:
• Authorized access i.e., registered fingerprint to access the system.
• Unauthorized access i.e. unregistered fingerprint.
• Vehicle being dragged for a specific duration.
• Notification from the user to activate and deactivate the system.

7.2 FUTURE SCOPE


video camera can be assembled to this project to capture the picture of the
burglar.and these can be sent to the web browser and stored .

Department of ECE, VBIT 38


REFERENCES

[1] Sukeerti Singh and Ayushi Mhalan, Vehicle Theft Alert System using GSM,
Int. Journal of Engineering Science and Technology (IJEST), May 2013.

[2] Mohammed Yousuf baba moinuddin, Kalpana Gogoi and K.Muralidhar, Real
time biometric based vehicle security system with gps and gsm technology, Int.
Journal of Engineering Science and computing (IJESC), 2017.

[3] Z. M. Win and M. M. Sein, Fingerprint recognition system for low quality
images, presented at the SICE Annual Conference,Waseda University, Tokyo,
Japan, Sep. 13-18, 2011.

[4] S.Malathi and C. Meena,”An efficient method for partial finger print
recoginition based on Local Binary Pattern”, in proc.Communication Control and
Computing Technologies IEEE 2010.

[5] Vikram Kulkarani and G.Narsimhulu,” A Low cost Extended Embedded Smart
Car Security System on Face Detection and Continous Video Monitoring
System”Int.Journal of Engineering Science and Technology,May (IJESAT)2012.
APPENDIX - A
#include<LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8);
#include <SoftwareSerial.h>
SoftwareSerial fingerPrint(2, 3);
#include <SoftwareSerial.h>
SoftwareSerial gps(4,5);
#include<Servo.h>

Servo myServo;

#include <Adafruit_Fingerprint.h>
uint8_t id;
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&fingerPrint);

#define enroll A0
#define del A1
#define up A2
#define down A3
#define openLight 7
#define closeLight A5
#define servoPin A6
int motor = 6;
char str[70];
String gpsString="";
char *test="$GPGGA";
String latitude="No Range ";
String longitude="No Range ";
int temp=0,i;
boolean gps_status=0;
void setup()
{
finger.begin(57600);
Serial.begin(9600);
myServo.attach(servoPin);
myServo.write(180);
pinMode(enroll, INPUT_PULLUP);
pinMode(up, INPUT_PULLUP);
pinMode(down, INPUT_PULLUP);
pinMode(del, INPUT_PULLUP);
pinMode(openLight, OUTPUT);
pinMode(closeLight, OUTPUT);
pinMode(motor, OUTPUT);
lcd.begin(16,2);
lcd.print("Security System");
lcd.setCursor(0,1);
lcd.print("by Finger Print");
delay(2000);
gsm_init();
lcd.clear();
//Serial.println("AT+CNMI=2,2,0,0,0");
//lcd.print("GPS Initializing");
//lcd.setCursor(0,1);
//lcd.print(" No GPS Range ");
//get_gps();
//delay(2000);
//lcd.clear();
lcd.print("GPS Range Found");
lcd.setCursor(0,1);
lcd.print("GPS is Ready");
delay(2000);
lcd.clear();
lcd.print("System Ready");
temp=0;
lcd.clear();
// lcd.print("Circuit Digest");
// lcd.setCursor(0,1);
// lcd.print("Saddam Khan");
// delay(2000);
// finger.begin(57600);
// Serial.begin(9600);
// lcd.clear();
lcd.print("Finding Module");
lcd.setCursor(0,1);
delay(1000);
if (finger.verifyPassword())
{
Serial.println("Found fingerprint sensor!");
lcd.clear();
lcd.print("Found Module ");
delay(1000);
}
else
{
Serial.println("Did not find fingerprint sensor :(");
lcd.clear();
lcd.print("module not Found");
lcd.setCursor(0,1);
lcd.print("Check Connections");
while (1);
}
}

void loop()
{
lcd.setCursor(0,0);
lcd.print("Press UP/Down ");
lcd.setCursor(0,1);
lcd.print("to start System");
digitalWrite(closeLight, HIGH);
if(digitalRead(up)==0 || digitalRead(down)==0)
{
for(int i=0;i<5;i++)
{
lcd.clear();
lcd.print("Place Finger");
delay(2000);
int result=getFingerprintIDez();
if(result>=0)
{
digitalWrite(openLight, HIGH);
digitalWrite(closeLight, LOW);
lcd.clear();
lcd.print("Allowed");
lcd.setCursor(0,1);
lcd.print("ignition start");
digitalWrite(motor, HIGH);
//myServo.write(0);
delay(2000);
digitalWrite(motor, LOW);
//myServo.write(180);
// digitalWrite(closeLight, HIGH);
// digitalWrite(motor, LOW);
//lcd.setCursor(0,1);
//lcd.print("Gate Closed ");
return;
}
}
}
checkKeys();
delay(1000);
}

void checkKeys()
{
if(digitalRead(enroll) == 0)
{
lcd.clear();
lcd.print("Please Wait");
delay(1000);
while(digitalRead(enroll) == 0);
Enroll();
}

else if(digitalRead(del) == 0)
{
lcd.clear();
lcd.print("Please Wait");
delay(1000);
delet();
}
}

void Enroll()
{
int count=0;
lcd.clear();
lcd.print("Enroll Finger ");
lcd.setCursor(0,1);
lcd.print("Location:");
while(1)
{
lcd.setCursor(9,1);
lcd.print(count);
if(digitalRead(up) == 0)
{
count++;
if(count>25)
count=0;
delay(500);
}

else if(digitalRead(down) == 0)
{
count--;
if(count<0)
count=25;
delay(500);
}
else if(digitalRead(del) == 0)
{
id=count;
getFingerprintEnroll();
return;
}

else if(digitalRead(enroll) == 0)
{
return;
}
}
}

void delet()
{
int count=0;
lcd.clear();
lcd.print("Delete Finger ");
lcd.setCursor(0,1);
lcd.print("Location:");
while(1)
{
lcd.setCursor(9,1);
lcd.print(count);
if(digitalRead(up) == 0)
{
count++;
if(count>25)
count=0;
delay(500);
}

else if(digitalRead(down) == 0)
{
count--;
if(count<0)
count=25;
delay(500);
}
else if(digitalRead(del) == 0)
{
id=count;
deleteFingerprint(id);
return;
}

else if(digitalRead(enroll) == 0)
{
return;
}
}
}

uint8_t getFingerprintEnroll()
{
int p = -1;
lcd.clear();
lcd.print("finger ID:");
lcd.print(id);
lcd.setCursor(0,1);
lcd.print("Place Finger");
delay(2000);
while (p != FINGERPRINT_OK)
{
p = finger.getImage();
switch (p)
{
case FINGERPRINT_OK:
Serial.println("Image taken");
lcd.clear();
lcd.print("Image taken");
break;
case FINGERPRINT_NOFINGER:
Serial.println("No Finger");
lcd.clear();
lcd.print("No Finger");
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
lcd.clear();
lcd.print("Comm Error");
break;
case FINGERPRINT_IMAGEFAIL:
Serial.println("Imaging error");
lcd.clear();
lcd.print("Imaging Error");
break;
default:
Serial.println("Unknown error");
lcd.clear();
lcd.print("Unknown Error");
break;
}
}
// OK success!

p = finger.image2Tz(1);
switch (p) {
case FINGERPRINT_OK:
Serial.println("Image converted");
lcd.clear();
lcd.print("Image converted");
break;
case FINGERPRINT_IMAGEMESS:
Serial.println("Image too messy");
lcd.clear();
lcd.print("Image too messy");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
lcd.clear();
lcd.print("Comm Error");
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println("Could not find fingerprint features");
lcd.clear();
lcd.print("Feature Not Found");
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println("Could not find fingerprint features");
lcd.clear();
lcd.print("Feature Not Found");
return p;
default:
Serial.println("Unknown error");
lcd.clear();
lcd.print("Unknown Error");
return p;
}

Serial.println("Remove finger");
lcd.clear();
lcd.print("Remove Finger");
delay(2000);
p = 0;
while (p != FINGERPRINT_NOFINGER) {
p = finger.getImage();
}
Serial.print("ID "); Serial.println(id);
p = -1;
Serial.println("Place same finger again");
lcd.clear();
lcd.print("Place Finger");
lcd.setCursor(0,1);
lcd.print(" Again");
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
Serial.println("Image taken");
break;
case FINGERPRINT_NOFINGER:
Serial.print(".");
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
break;
case FINGERPRINT_IMAGEFAIL:
Serial.println("Imaging error");
break;
default:
Serial.println("Unknown error");
return p;
}
}

// OK success!

p = finger.image2Tz(2);
switch (p) {
case FINGERPRINT_OK:
Serial.println("Image converted");
break;
case FINGERPRINT_IMAGEMESS:
Serial.println("Image too messy");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println("Could not find fingerprint features");
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println("Could not find fingerprint features");
return p;
default:
Serial.println("Unknown error");
return p;
}

// OK converted!
Serial.print("Creating model for #"); Serial.println(id);

p = finger.createModel();
if (p == FINGERPRINT_OK) {
Serial.println("Prints matched!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println("Communication error");
return p;
} else if (p == FINGERPRINT_ENROLLMISMATCH) {
Serial.println("Fingerprints did not match");
return p;
} else {
Serial.println("Unknown error");
return p;
}

Serial.print("ID "); Serial.println(id);


p = finger.storeModel(id);
if (p == FINGERPRINT_OK) {
Serial.println("Stored!");
lcd.clear();
lcd.print("Stored!");
delay(2000);
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println("Communication error");
return p;
} else if (p == FINGERPRINT_BADLOCATION) {
Serial.println("Could not store in that location");
return p;
} else if (p == FINGERPRINT_FLASHERR) {
Serial.println("Error writing to flash");
return p;
}
else {
Serial.println("Unknown error");
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();
lcd.print("Finger Not Found");
lcd.setCursor(0,1);
lcd.print("Try Later");
tracking();
delay(2000);
return -1;
}
// found a match!
Serial.print("Found ID #");
Serial.print(finger.fingerID);
return finger.fingerID;
}

uint8_t deleteFingerprint(uint8_t id)


{
uint8_t p = -1;
lcd.clear();
lcd.print("Please wait");
p = finger.deleteModel(id);
if (p == FINGERPRINT_OK)
{
Serial.println("Deleted!");
lcd.clear();
lcd.print("Figer Deleted");
lcd.setCursor(0,1);
lcd.print("Successfully");
delay(1000);
}

else
{
Serial.print("Something Wrong");
lcd.clear();
lcd.print("Something Wrong");
lcd.setCursor(0,1);
lcd.print("Try Again Later");
tracking();
delay(2000);
return p;
}
}
void serialEvent()
{
while(Serial.available())
{
if(Serial.find("1"))
{
temp=1;
break;
}
else
temp=0;
}
}
void gpsEvent()
{
gpsString="";
while(1)
{
while (gps.available()>0) //checking serial data from GPS
{
char inChar = (char)gps.read();
gpsString+= inChar; //store data from GPS into gpsString;
i++;
if (i < 7)
{
if(gpsString[i-1] != test[i-1]) //checking for $GPGGA sentence
{
i=0;
gpsString="";
}
}
if(inChar=='\r')
{
if(i>65)
{
gps_status=1;
break;
}
else
{
i=0;
}
}
}
if(gps_status)
break;
}
}

void gsm_init()
{
lcd.clear();
lcd.print("Finding Module..");
boolean at_flag=1;
while(at_flag)
{
Serial.println("AT");
while(Serial.available()>0)
{
if(Serial.find("OK"))
at_flag=0;
}

delay(1000);
}

lcd.clear();
lcd.print("Module Connected..");
delay(1000);
lcd.clear();
lcd.print("Disabling ECHO");
boolean echo_flag=1;
while(echo_flag)
{
Serial.println("ATE0");
while(Serial.available()>0)
{
if(Serial.find("OK"))
echo_flag=0;
}
delay(1000);
}
lcd.clear();
lcd.print("Echo OFF");
delay(1000);
lcd.clear();
lcd.print("Finding Network..");
boolean net_flag=1;
while(net_flag)
{
Serial.println("AT+CPIN?");
while(Serial.available()>0)
{
if(Serial.find("+CPIN: READY"))
net_flag=0;
}
delay(1000);
}
lcd.clear();
lcd.print("Network Found..");
delay(1000);
lcd.clear();
}

void get_gps()
{
gps_status=0;
int x=0;
while(gps_status==0)
{
gpsEvent();
int str_lenth=i;
latitude="17° 11' 46.374";
longitude="78° 35' 50.467";
int comma=0;
while(x<str_lenth)
{
if(gpsString[x]==',')
comma++;
if(comma==2) //extract latitude from string
latitude+=gpsString[x+1];
else if(comma==4) //extract longitude from string
longitude+=gpsString[x+1];
x++;
}
int l1=latitude.length();
latitude[l1-1]=' ';
l1=longitude.length();
longitude[l1-1]=' ';
lcd.clear();
lcd.print("Lat:");
lcd.print(latitude);
lcd.setCursor(0,1);
lcd.print("Long:");
lcd.print(longitude);
i=0;x=0;
str_lenth=0;
delay(2000);
}
}

void init_sms()
{
Serial.println("AT+CMGF=1");
delay(400);
Serial.println("AT+CMGS=\"+918096663028\""); // use your 10 digit cell no. here
delay(400);
// Serial.println("AT+CMGS=\"+919705327805\""); // use your 10 digit cell no. here
// delay(400);
}

void send_data(String message)


{
Serial.println(message);
delay(200);
}

void send_sms()
{
Serial.write(26);
}

void lcd_status()
{
lcd.clear();
lcd.print("Message Sent");
delay(2000);
lcd.clear();
lcd.print("System Ready");
return;
}

void tracking()
{
init_sms();
send_data("alert:");
send_data("You ");
Serial.print("Latitude:");
send_data("1728.0420,N");
Serial.print("Longitude:");
send_data("07843.0057,E");
send_data("Please take some action soon..\nThankyou");
send_sms();
delay(2000);
lcd_status();
}

Potrebbero piacerti anche