CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated...

88
1 CHAPTER 1 INTRODUCTION The growth in electronic transactions has resulted in a greater demand for fast and accurate user identification and authentication. Access codes for buildings, banks accounts and computer systems often use personal identification numbers (PIN's) for identification and security clearances. Conventional method of identification based on possession of ID cards or exclusive knowledge like a social security number or a password are not all together reliable. An embedded fingerprint biometric authentication scheme for automated teller machine (ATM) banking systems is proposed in this paper. In this scheme, a fingerprint biometric technique is fused with the ATM for person authentication to ameliorate the security level. Biometric authentication technology using fingerprint identifier may solve this problem since a person’s biometric data is undeniably connected to its owner, is non-transferable and unique for every individual. Biometrics is not only a fascinating pattern recognition research problem but, if carefully used, could also be an enabling technology with the potential to make our society safer, reduce fraud and lead to user convenience.

Transcript of CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated...

Page 1: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

1

CHAPTER 1

INTRODUCTION

The growth in electronic transactions has resulted in a greater demand for

fast and accurate user identification and authentication. Access codes for buildings,

banks accounts and computer systems often use personal identification numbers

(PIN's) for identification and security clearances. Conventional method of

identification based on possession of ID cards or exclusive knowledge like a social

security number or a password are not all together reliable. An embedded

fingerprint biometric authentication scheme for automated teller machine (ATM)

banking systems is proposed in this paper. In this scheme, a fingerprint biometric

technique is fused with the ATM for person authentication to ameliorate the

security level. Biometric authentication technology using fingerprint identifier may

solve this problem since a person’s biometric data is undeniably connected to its

owner, is non-transferable and unique for every individual. Biometrics is not only a

fascinating pattern recognition research problem but, if carefully used, could also

be an enabling technology with the potential to make our society safer, reduce

fraud and lead to user convenience.

Page 2: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

2

CHAPTER 2

PROPOSED CONCEPT

2.1 BLOCK DIAGRAM

Fig.2.1 Block diagram of fingerprint based ATM security

Page 3: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

3

2.2.BLOCK DIAGRAM DESCRIPTION

Initially the RFID tag is read by the RFID reader and the the fingerprint of

the user is given. If the fingerprint data matches with the data stored in the RFID

tag for a particular user, then an OTP is generated via GSM and send to the users

handset. Now that OTP can be used to access the users account which is depicted

with the help of an LED. In this the input from the RFID tag is given to the PIN 26

of the PIC which is a USART receiver, also the input from the optical fingerprint

scanner is connected to pin 26 of PIC controller. Once the fingerprint data matches

with the data on RFID then the PIC controller generates an OTP. This OTP is sent

via GSM to the users mobile. The GSM is connected to pin 25 of PIC controller.

Since the output of PIC is a TTL , there is no necessary to connect max232

between controller and the GSM . When the user enters the OTP via keypad and if

it matches then the user is now allowd to access th ATM which is depictd with the

help of LED.

Page 4: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

4

CHAPTER 3

HARDWARE

3.1.CIRCUIT DESCRIPTION

3.1.1 FINGERPRINT MODULE

Fingerprint processing includes two parts: fingerprint enrollment and

fingerprint matching (the matching can be 1:1or 1:N). When enrolling, user needs

Page 5: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

5

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 1:1 matching, system will compare the live finger with specific

template designated in the module; for 1:N matching, or searching, system will

search the whole finger library for the matching finger. In both circumstances,

system will return the matching result, success or failure.

3.1.2 SERIAL COMMUNICATION

When the Fingerprint (FP) module communicates with user device, definition

of J1 is given in Table 1. 4.4.1 Hardware Connection The fingerprint module may

communicate via serial interface, with MCU of 3.3V or 5V power: TD (pin 2 of

P1) connects with RXD (receiving pin of MCU), RD (pin3 of P1) connects with

TXD (transferring pin of MCU). Should the upper computer (PC) be in RS-232

mode, please add level converting circuit, like MAX232, between the module and

PC.

3.1.3 SERIAL COMMUNICATION PROTOCOL

The mode is semi-duplex asynchronous serial communication. The default

baud rate is 57600 bps. The user may set the baud rate between 9600~115200bps.

Transferring frame format is 10 bit: the low-level starting bit, 8-bit data with the

LSB first, and an ending bit. There is no check bit. To address demands of

different customer, module system provides abundant resources at users use.

3.1.4 BUFFER

There is an image buffer and two 512-byte character-file buffer within the RAM

space of the module. Users can read and write any of the buffers by instructions.

Page 6: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

6

Image buffer serves for image storage and the image format is 256*288 pixels.

When transferring through UART, to quicken speed, only the upper 4 bits of the

pixel is transferred (that is 16 grey degrees). And the two adjacent pixels of the

same row will form a byte before the transferring. When uploaded to PC, the 16-

grey-degree image will be extended to 256-grey-degree format. i.e. 8-bit BMP

format. When transferring through USB, the image is 8-bit pixel, that’s 256 grey

degrees. Character file buffer, CharBuffer1, CharBuffer2 can be used to store both

character file and template file.

3.1.5 FINGERPRINT LIBRARY

System sets as idea certain space within flash for fingerprint template storage,

that’s the fingerprint library. The contents of the library remain at power off. The

capacity of the library changes with the capacity of flash, system will recognize the

latter automatically. Fingerprint template’s storage in flash is in sequential order.

Assume the fingerprint capacity N, then the serial number of template in library is

0,1,2,3…N. The user can only access library by template number.

3.1.6 LIQUID CRYSTAL DISPLAY

The LCD 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 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). The three control lines are referred to as Enable (EN), Register Select (RS),

and Read/Write (RW).

Page 7: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

7

CHAPTER 4

BASIC COMPONENTS

4.1 CRYSTAL OSCILLATOR

It is often required to produce a signal whose frequency or pulse rate is very

stable and exactly known. This is important in any application where anything to

do with time or exact measurement is crucial. It is relatively simple to make an

oscillator that produces some sort of a signal, but another matter to produce one of

relatively precise frequency and stability. An ordinary quartz watch must have an

oscillator accurate to better than a few parts per million. One part per million will

result in an error of slightly less than one half second a day, which would be about

3 minutes a year. This might not sound like much, but an error of 10

parts per million would result in an error of about a half an hour per year. A clock

such as this would need resetting about once a month, and more often if you are the

punctual type.

Fig.4.1. Crystal oscillator

A crystal oscillator is an electronic circuit that uses the mechanical resonance of a

vibrating crystal of piezoelectric material to create an electrical signal with a very

precise frequency. This frequency is commonly used to keep track of time (as in

quartz wristwatches), to provide a stable clock signal for digital integrated circuits,

and to stabilize frequencies for radio transmitters and receivers. The most common

Page 8: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

8

type of piezoelectric resonator used is the quartz crystal, so oscillator circuits

designed around them were called "crystal oscillators".

Quartz crystals are manufactured for frequencies from a few tens of kilohertz to

tens of megahertz. More than two billion (2×109) crystals are manufactured

annually. Most are small devices for consumer devices such as wristwatches,

clocks, radios, computers, and cellphones. Quartz crystals are also found inside test

and measurement equipment, such as counters, signal generators, and

oscilloscopes.

4.2 ZERO PCB PLATE

PCB is a platform where many of the embedded systems to be made. PCB

(Printed Circuit Board) is used for the assembly of various components on a single

plate. The connections on the PCB should be identical to the circuit diagram, but

while the circuit diagram is arranged to be readable, the PCB layout is arranged to

be functional, so there is rarely any visible correlation between the circuit diagram

and the layout.

PCB layout can be performed manually (using CAD) or in combination with

an Auto router. The best results are usually still achieved using atleast some

manual routing

Sometimes abbreviated PCB, a thin plate on which chips and other

electronic components are placed. Computers consist of one or more boards, often

called cards or adapters

Page 9: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

9

4.3 VOLTAGE REULATOR IC(78XX)

A voltage regulator is an electrical regulator designed to automatically

maintain a constant voltage level. It may use an electromechanical mechanism, or

passive or active electronic components. Depending on the design, it may be used

to regulate one or more AC or DC voltages.

Fig.4.2. Regulator ICs

Page 10: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

10

CHAPTER 5

PIC MICROCONTROLLER(16F877A)

5.1.INTRODUCTION

Circumstances that we find ourselves in today in the field of

microcontrollers had their beginnings in the development of technology of

integrated circuits. This development has made it possible to store hundreds of

thousands of transistors into one chip. That was a prerequisite for production of

microprocessors, and the first computers were made by adding external peripherals

such as memory, input-output lines, timers and other. Further increasing of the

volume of the package resulted in creation of integrated circuits. These integrated

circuits contained both processor and peripherals. That is how the first chip

containing a microcomputer, or what would later be known as a microcontroller

came about.

5.2 DEFINITION OF A MICROCONTROLLER

Microcontroller, as the name suggests, are small controllers. They are like

single chip computers that are often embedded into other systems to function as

processing/controlling unit. For example, the remote control you are using

probably has microcontrollers inside that do decoding and other controlling

functions. They are also used in automobiles, washing machines, microwave

ovens, toys ... etc, where automation is needed.

The key features of microcontrollers include:

High Integration of Functionality

Page 11: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

11

Microcontrollers sometimes are called single-chip computers because they

have on-chip memory and I/O circuitry and other circuitries that enable them

to function as small standalone computers without other supporting circuitry.

Field Programmability, Flexibility

Microcontrollers often use EEPROM or EPROM as their storage device to

allow field programmability so they are flexible to use. Once the program is

tested to be correct then large quantities of microcontrollers can be

programmed to be used in embedded systems.

Easy to Use

Assembly language is often used in microcontrollers and since they usually

follow RISC architecture, the instruction set is small. The development

package of microcontrollers often includes an assembler, a simulator, a

programmer to "burn" the chip and a demonstration board. Some packages

include a high level language compiler such as a C compiler and more

sophisticated libraries.

Most microcontrollers will also combine other devices such as:

A Timer module to allow the microcontroller to perform tasks for certain

time periods.

A serial I/O port to allow data to flow between the microcontroller and other

devices such as a PC or another microcontroller.

An ADC to allow the microcontroller to accept analogue input data for

processing.

Page 12: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

12

Figure 5.1: Showing a typical microcontroller device and its different subunits

The heart of the microcontroller is the CPU core. In the past this has traditionally

been based on an 8-bit microprocessor unit.

5.3 MICROCONTROLLERS VERSUS MICROPROCESSORS

Microcontroller differs from a microprocessor in many ways. First and the

most important is its functionality. In order for a microprocessor to be used, other

components such as memory, or components for receiving and sending data must

be added to it. In short that means that microprocessor is the very heart of the

computer. On the other hand, microcontroller is designed to be all of that in one.

No other external components are needed for its application because all necessary

peripherals are already built into it. Thus, we save the time and space needed to

construct devices

Page 13: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

13

5.4 MEMORY ORGANIZATION OF PIC16F877

The memory of a PIC 16F877 chip is divided into 3 sections. They are

1. Program memory

2. Data memory and

3. Data EEPROM

5.4.1 PROGRAM MEMORY

Program memory contains the programs that are written by the user. The

program counter (PC) executes these stored commands one by one. Usually

PIC16F877 devices have a 13 bit wide program counter that is capable of

addressing 8K×14 bit program memory space. This memory is primarily used for

storing the programs that are written (burned) to be used by the PIC. These devices

also have 8K*14 bits of flash memory that can be electrically erasable

/reprogrammed. Each time we write a new program to the controller, we must

delete the old one at that time. The figure below shows the program memory map

and stack.

Page 14: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

14

Program counters (PC) is used to keep the track of the program execution by

holding the address of the current instruction. The counter is automatically

incremented to the next instruction during the current instruction execution.

Page 15: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

15

The PIC16F87XA family has an 8-level deep x 13-bit wide hardware stack. The

stack space is not a part of either program or data space and the stack pointers are

not readable or writable. In the PIC microcontrollers, this is a special block of

RAM memory used only for this purpose.

Each time the main program execution starts at address 0000 – Reset Vector. The

address 0004 is “reserved” for the “interrupt service routine” (ISR).

5.4.2 PIC16F87XA DATA MEMORY ORGANIZATION

The data memory of PIC16F877 is separated into multiple banks which

contain the general purpose registers (GPR) and special function registers (SPR).

According to the type of the microcontroller, these banks may vary. The

PIC16F877 chip only has four banks (BANK 0, BANK 1, BANK 2, and BANK4).

Each bank holds 128 bytes of addressable memory.

The banked arrangement is necessary because there are only 7 bits are available in

the instruction word for the addressing of a register, which gives only 128

addresses. The selection of the banks are determined by control bits RP1, RP0 in

the STATUS registers Together the RP1, RP0 and the specified 7 bits effectively

form a 9 bit address. The first 32 locations of Banks 1 and 2, and the first 16

locations of Banks2 and 3 are reserved for the mapping of the Special Function

Registers (SFR’s).

Page 16: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

16

5.4.3 DATA EEPROM AND FLASH

The data EEPROM and Flash program memory is readable and writable

during normal operation (over the full VDD range). This memory is not directly

mapped in the register file space. Instead, it is indirectly addressed through the

Special Function Registers. There are six SFRs used to read and write this

memory:

Page 17: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

17

• EECON1

• EECON2

• EEDATA

• EEDATH

• EEADR

• EEADRH

The EEPROM data memory allows single-byte read and writes. The Flash program

memory allows single-word reads and four-word block writes. Program memory

write operations automatically perform an erase-before write on blocks of four

words. A byte write in data EEPROM memory automatically erases the location

and writes the new data (erase-before-write). The write time is controlled by an on-

chip timer. The write/erase voltages are generated by an on-chip charge pump,

rated to operate over the voltage range of the device for byte or word operations.

5.5 INPUT-OUTPUT UNIT

Those locations we've just added are called "ports". There are several types

of ports: input, output or bidirectional ports. When working with ports, first of all it

is necessary to choose which port we need to work with, and then to send data to,

or take it from the port.

Page 18: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

18

Figure.5.2.Simplified input-output unit communicating with external world

When working with it the port acts like a memory location. Something is simply

being written into or read from it, and it could be noticed on the pins of the

microcontroller.

5.6 SERIAL COMMUNICATION

Beside stated above we've added to the already existing unit the possibility

of communication with an outside world. However, this way of communicating has

its drawbacks. One of the basic drawbacks is the number of lines which need to be

used in order to transfer data. What if it is being transferred to a distance of several

kilometers? The number of lines times’ number of kilometers doesn't promise the

economy of the project. It leaves us having to reduce the number of lines in such a

way that we don't lessen its functionality. Suppose we are working with three lines

only, and that one line is used for sending data, other for receiving, and the third

one is used as a reference line for both the input and the output side. In order for

this to work, we need to set the rules of exchange of data. These rules are called

protocol. Protocol is therefore defined in advance so there wouldn't be any

misunderstanding between the sides that are communicating with each other. For

example, if one man is speaking in French, and the other in English, it is highly

Page 19: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

19

unlikely that they will quickly and effectively understand each other. Let's suppose

we have the following protocol. The logical unit "1" is set up on the transmitting

line until transfer begins. Once the transfer starts, we lower the transmission line to

logical "0" for a period of time (which we will designate as T), so the receiving

side will know that it is receiving data, and so it will activate its mechanism for

reception. Let's go back now to the transmission side and start putting logic zeros

and ones onto the transmitter line in the order from a bit of the lowest value to a bit

of the highest value. Let each bit stay on line for a time period which is equal to T,

and in the end, or after the 8th bit, let us bring the logical unit "1" back on the line

which will mark the end of the transmission of one data. The protocol we've just

described is called in professional literature NRZ (Non-Return to Zero).

Figure.5.3.Serial unit sending data through three lines only

As we have separate lines for receiving and sending, it is possible to receive and

send data (info.) at the same time. So called full-duplex mode block which enables

this way of communication is called a serial communication block. Unlike the

parallel transmission, data moves here bit by bit, or in a series of bits what defines

the term serial communication comes from. After the reception of data we need to

read it from the receiving location and store it in memory as opposed to sending

Page 20: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

20

where the process is reversed. Data goes from memory through the bus to the

sending location, and then to the receiving unit according to the protocol.

5.7 TIMER UNIT

Since we have the serial communication explained, we can receive, send and

process data.

Figure.5.4.Timer unit generating signals in regular time intervals

However, in order to utilize it in industry we need a few additionally blocks. One

of those is the timer block which is significant to us because it can give us

information about time, duration, protocol etc. The basic unit of the timer is a free-

run counter which is in fact a register whose numeric value increments by one in

even intervals, so that by taking its value during periods T1 and T2 and on the

basis of their difference we can determine how much time has elapsed. This is a

very important part of the microcontroller whose understanding requires most of

our time.

5.8 WATCHDOG

One more thing is requiring our attention is a flawless functioning of the

microcontroller during its run-time. Suppose that as a result of some interference

(which often does occur in industry) our microcontroller stops executing the

program, or worse, it starts working incorrectly.

Page 21: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

21

Figure.5.5. Watchdog

Of course, when this happens with a computer, we simply reset it and it will keep

working. However, there is no reset button we can push on the microcontroller and

thus solve our problem. To overcome this obstacle, we need to introduce one more

block called watchdog. This block is in fact another free-run counter where our

program needs to write a zero in every time it executes correctly. In case that

program gets "stuck", zero will not be written in, and counter alone will reset the

microcontroller upon achieving its maximum value. This will result in executing

the program again, and correctly this time around. That is an important element of

every program to be reliable without man's supervision.

5.9 ANALOG TO DIGITAL CONVERTER

As the peripheral signals usually are substantially different from the ones

that microcontroller can understand (zero and one), they have to be converted into

a pattern which can be comprehended by a microcontroller. This task is performed

by a block for analog to digital conversion or by an ADC. This block is responsible

for converting an information about some analog value to a binary number and for

follow it through to a CPU block so that CPU block can further process it.

Figure.5.6. Block for converting an analog input to digital output

Page 22: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

22

Finally, the microcontroller is now completed, and all we need to do now is to

assemble it into an electronic component where it will access inner blocks through

the outside pins. The picture below shows what a microcontroller looks like inside.

Figure.5.7. Physical configuration of the interior of a microcontroller

Thin lines which lead from the center towards the sides of the microcontroller

represent wires connecting inner blocks with the pins on the housing of the

microcontroller so called bonding lines. Chart on the following page represents the

center section of a microcontroller.

Page 23: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

23

Figure.5.8. Microcontroller outline with basic elements and internal

connections

For a real application, a microcontroller alone is not enough. Beside a

microcontroller, we need a program that would be executed, and a few more

elements which make up interface logic towards the elements of regulation (which

will be discussed in later chapters).

Page 24: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

24

5.10 PIN CONFIGURATION

Figure.5.9. Pin configuration of Microcontroller

5.11 Pin Description

As seen in Fig.5.9. above, the most pins are multi-functional. For example,

designator RA3/AN3/Vref+/C1IN+ for the fifth pin specifies the following

functions:

RA3 Port A third digital input/output

AN3 Third analog input

Vref+ Positive voltage reference

C1IN+ Comparator C1positive input

This small trick is often used because it makes the microcontroller package more

compact without affecting its functionality.

The following tables, refer to the PDIP 40 microcontroller:

Page 25: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

25

Page 26: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

26

Page 27: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

27

Table 1-1 I/O Ports

Page 28: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

28

5.12 RAM MEMORY

This is the third and the most complex part of microcontroller memory. In

this case, it consists of two parts: general-purpose registers and special-function

registers (SFR).

Even though both groups of registers are cleared when power goes off and even

though they are manufactured in the same way and act in the similar way, their

functions do not have many things in common.

5.12.1 GENERAL-PURPOSE REGISTERS

General-Purpose registers are used for storing temporary data and results

created during operation. For example, if the program performs a counting (for

example, counting products on the assembly line), it is necessary to have a register

which stands for what we in everyday life call “sum”. Since the microcontroller is

not creative at all, it is necessary to specify the address of some general purpose

register and assign it a new function. A simple program to increment the value of

this register by 1, after each product passes through a sensor, should be created.

Therefore, the microcontroller can execute that program because it now knows

what and where the sum which must be incremented is. Similarly to this simple

example, each program variable must be preassigned some of general-purpose

register.

Page 29: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

29

5.12.2 SFR REGISTERS

Special-Function registers are also RAM memory locations, but unlike

general-purpose registers, their purpose is predetermined during manufacturing

process and cannot be changed. Since their bits are physically connected to

particular circuits on the chip (A/D converter, serial communication module, etc.),

any change of their contents directly affects the operation of the microcontroller or

some of its circuits. For example, by changing the TRISA register, the function of

each port A pin can be changed in a way it acts as input or output. Another feature

of these memory locations is that they have their names (registers and their bits),

which considerably facilitates program writing. Since high-level programming

language can use the list of all registers with their exact addresses, it is enough to

specify the register’s name in order to read or change its contents.

5.12.3 RAM MEMORY BANKS

The data memory is partitioned into four banks. Prior to accessing some

register during program writing (in order to read or change its contents), it is

necessary to select the bank which contains that register. Two bits of the STATUS

register are used for bank selecting, which will be discussed later. In order to

facilitate operation, the most commonly used SFRs have the same address in all

banks which enables them to be easily accessed.

Page 30: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

30

Table 1-2 Address Banks

Page 31: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

31

Table 1-3 SFR Bank 0

Page 32: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

32

Table 1-4 SFR Bank 1

Page 33: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

33

Table 1-5 SFR Bank 2

5.13 STACK

A part of the RAM used for the stack consists of eight 13-bit registers.

Before the microcontroller starts to execute a subroutine (CALLinstruction) or

when an interrupt occurs, the address of first next instruction being currently

executed is pushed onto the stack, i.e. onto one of its registers. In that way, upon

subroutine or interrupt execution, the microcontroller knows from where to

continue regular program execution. This address is cleared upon return to the

main program because there is no need to save it any longer, and one location of

the stack is automatically available for further use.

Page 34: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

34

5.14 INTERRUPT SYSTEM

The first thing that the microcontroller does when an interrupt request

arrives is to execute the current instruction and then stop regular program

execution. Immediately after that, the current program memory address is

automatically pushed onto the stack and the default address (predefined by the

manufacturer) is written to the program counter. That location from where the

program continues execution is called the interrupt vector. For the PIC16F887

microcontroller, this address is 0004h. As seen in Fig. 1-7 below, the location

containing interrupt vector is passed over during regular program execution.

Part of the program being activated when an interrupt request arrives is called the

interrupt routine. Its first instruction is located at the interrupt vector. How long

this subroutine will be and what it will be like depends on the skills of the

programmer as well as the interrupt source itself. Some microcontrollers have

more interrupt vectors (every interrupt request has its vector), but in this case there

is only one. Consequently, the first part of the interrupt routine consists in interrupt

source recognition.

Finally, when the interrupt source is recognized and interrupt routine is executed,

the microcontroller reaches the RETFIE instruction, pops the address from the

stack and continues program execution from where it left off.

Page 35: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

35

5.15 EMBEDDED C

Two salient features of Embedded Programming are code speed and code

size. Code speed is governed by the processing power, timing constraints, whereas

code size is governed by available program memory and use of programming

language. Goal of embedded system programming is to get maximum features in

minimum space and minimum time.

Embedded systems are programmed using different type of languages:

· Machine Code

· Low level language, i.e., assembly

· High level language like C, C++, Java, Ada, etc.

· Application level language like Visual Basic, scripts, Access, etc.

Assembly language maps mnemonic words with the binary machine codes that the

processor uses to code the instructions. Assembly language seems to be an obvious

choice for programming embedded devices. However, use of assembly language is

restricted to developing efficient codes in terms of size and speed. Also, assembly

codes lead to higher software development costs and code portability is not there.

Developing small codes are not much of a problem, but large programs/projects

become increasingly difficult to manage in assembly language. Finding good

assembly programmers has also become difficult nowadays. Hence high level

languages are preferred for embedded systems programming.

Use of C in embedded systems is driven by following advantages

· It is small and reasonably simpler to learn, understand, program and debug.

· C Compilers are available for almost all embedded devices in use today, and

there is a large pool of experienced C programmers.

Page 36: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

36

· Unlike assembly, C has advantage of processor-independence and is not specific

to any particular microprocessor/ microcontroller or any system. This makes it

convenient for a user to develop programs that can run on most of the systems.

· As C combines functionality of assembly language and features of high level

languages, C is treated as a ‘middle-level computer language’ or ‘high level

assembly language’

· It is fairly efficient

· It supports access to I/O and provides ease of management of large embedded

projects.

Many of these advantages are offered by other languages also, but what sets C

apart from others like Pascal, FORTRAN, etc. is the fact that it is a middle level

language; it provides direct hardware control without sacrificing benefits of high

level languages.

Compared to other high level languages, C offers more flexibility because C is

relatively small, structured language; it supports low-level bit-wise data

manipulation.

Compared to assembly language, C Code written is more reliable and scalable,

more portable between different platforms (with some changes). Moreover,

programs developed in C are much easier to understand, maintain and debug. Also,

as they can be developed more quickly, codes written in C offers better

productivity. C is based on the philosophy ‘programmers know what they are

doing’; only the intentions are to be stated explicitly. It is easier to write good code

in C & convert it to an efficient assembly code (using high quality compilers)

rather than writing an efficient code in assembly itself. Benefits of assembly

Page 37: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

37

language programming over C are negligible when we compare the ease with

which C programs are developed by programmers.

CODE

#include<pic.h>

#include<string.h>

#include<string.h>

#include <stdlib.h>

__CONFIG(0X3F32);

#define _XTAL_FREQ 4000000

int ln =10;

char ps[]={"0123456089"};

#define RS RE0 //LCD PINS

#define RW RE1

#define E RE2

#define DATA PORTD

#define RELAY1 RC0

#define RELAY2 RC1

#define B1 RC2

#define RELAY3 RC3

#define RELAY4 RC4

#define R1 RB0 //ROW-output

#define R2 RB1

Page 38: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

38

#define R3 RB2

#define R4 RB3

#define C1 RB4 //COL inputs

#define C2 RB5

#define C3 RB6

#define C4 RB7

char *s;

int k,o,t,h,th;

char in[4];

char password[4];

char password1[4]={'1','2','3','4'};

char password2[4]="4321";

unsigned long int i1=0251;

int flag=0,CARD_FLAG = 0;

unsigned char card_id[12];

char temp[12];

unsigned int index=0,temp_flag=0;

char p[4]={'1','2','3','4'};

char fing_flag=0;

char rff=0;

void cmd(unsigned char c)

{

DATA=c;

RS=0;

E=1;

__delay_ms(10);

Page 39: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

39

E=0;

}

void data(unsigned char d)

{

DATA=d;

RS=1;

E=1;

__delay_ms(10);

E=0;

}

void printxy(const char *w,int r ,int c)

{

int i=0;

if(r==1)

{

for(i=c-1;i<*w!='\0';i++)

{

cmd(0x80+i);

data(*w);

w++;

}

}

if(r==2)

{

for(i=c-1;i<*w!='\0';i++)

Page 40: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

40

{

cmd(0xc0+i);

data(*w);

w++;

}

}

}

void digit4xy( unsigned int digit,int r,int c1)

{

int c=c1-1;

o=digit%10;

t=(digit%100)/10;

h=(digit%1000)/100;

th=(digit%10000)/1000;

if(r==1)

{

cmd(0x80+c);

data(th+0x30);

c++;

cmd(0x80+c);

data(h+0x30);

c++;

cmd(0x80+c);

data(t+0x30);

Page 41: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

41

c++;

cmd(0x80+c);

data(o+0x30);

}

if(r==2)

{

cmd(0xc0+c);

data(th+0x30);

c++;

cmd(0xc0+c);

data(h+0x30);

c++;

cmd(0xc0+c);

data(t+0x30);

c++;

cmd(0xc0+c);

data(o+0x30);

}

}

unsigned int getkey(void)

{

int row,co,dummy,flag=0;

Page 42: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

42

R1=R2=R3=R4=0;

//__delay_ms(1000);

R1=1;R2=0;R3=0;R4=0;

{

//__delay_ms(10);

if(C1==1){

while(C1==1);

return '1';

}

if(C2==1){

while(C2==1);

return '2';

}

if(C3==1){

while(C3==1);

return '3';

}

if(C4==1){

while(C4==1);

return 'A';}

}

R1=0;R2=1;R3=0;R4=0;

Page 43: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

43

{

//__delay_ms(10);

if(C1==1){

while(C1==1);

return '4';}

if(C2==1){

while(C2==1);

return '5';

}

if(C3==1){

while(C3==1);

return '6';

}

if(C4==1){

while(C4==1);

return 'B';

}

}

R1=0;R2=0;R3=1;R4=0;

{

//__delay_ms(10);

if(C1==1){

while(C1==1);

Page 44: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

44

return '7';}

if(C2==1){

while(C2==1);

return '8';

}

if(C3==1){

while(C3==1);

return '9';

}

if(C4==1){

while(C4==1);

return 'c';

}

}

R1=0;R2=0;R3=0;R4=1;

{

//__delay_ms(10);

if(C1==1){

while(C1==1);

Page 45: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

45

return '*';

}

if(C2==1){

while(C2==1);

return '0';

}

if(C3==1){

while(C3==1);

return '#';

}

if(C4==1){

while(C4==1);

return 'D';

}

}

return 0xff;

}

int keypressed()

{

int dummy;

do

{

Page 46: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

46

__delay_ms(10);

dummy=getkey();

}while(dummy==0xff);

return dummy;

}

void serial_initi()

{

//TXSTA REG

CSRC=0;TX9=0;TXEN=1;SYNC=0;BRGH=1;

TRMT=1;

TXIE=0;

RCIE=1;

//RCSTA REG

SPEN=1;

RX9=0;

SREN=0;

CREN=1;

SPBRG=25;

}

void uart_write(const char d)

{

Page 47: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

47

while(TXIF==0);

TXREG=d;

//__delay_ms(100);

}

void uart_write1(const char d)

{

while(TXIF==0);

TXREG=d;

__delay_ms(100);

}

void uart_string(const char *w)

{

do

{

uart_write1(*w);

w++;

}

while(*w!='\0');

}

void digit4_uart(unsigned int digit)

{

int a[4];

//int a1=digit;

a[0]=digit%10;

a[1]=(digit%100)/10;

a[2]=(digit%1000)/100;

Page 48: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

48

a[3]=digit/1000;

uart_write1(a[3]+0x30);

uart_write1(a[2]+0x30);

uart_write1(a[1]+0x30);

uart_write1(a[0]+0x30);

}

char uart_read()

{

//__delay_ms(100);

while(RCIF==0);

//RCIF=0;

return RCREG;

}

void uart_enter()

{

uart_write1(0x0d); //<CR>

uart_write1(0x0a); //<LF>

}

Page 49: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

49

void read_finger_1(int imm) //for char_buffer1

{

int i=0;

char k=1,ch=1;

uart_write(239);

uart_write(1);

uart_write(255);

uart_write(255);

uart_write(255);

uart_write(255);

uart_write(1);

uart_write(0);

Page 50: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

50

uart_write(3);

uart_write(1);

uart_write(0);

uart_write(5);

for(i=0;i<10;i++)

{

k=uart_read();

if(i==9)

{

ch=k;

k=uart_read();

k=uart_read();

Page 51: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

51

if(ch==0x00)

{

//PORTC|=(1<<0);

k=1;

uart_write(239);

uart_write(1);

uart_write(255);

uart_write(255);

uart_write(255);

uart_write(255);

uart_write(1);

uart_write(0);

uart_write(4);

uart_write(2);

Page 52: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

52

uart_write(imm);

uart_write(0);

uart_write(8);

i=0;

for(i=0;i<10;i++)

{

k=uart_read();

if(i==9)

{

ch=k;

k=uart_read();

k=uart_read();

if(ch==0x00)

Page 53: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

53

{

//PORTC|=(1<<1);

}

}

}

}

}

}

}

void read_finger_2(int imm) //for char_buffer2

{

int i=0;

char k=1,ch=1;

Page 54: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

54

uart_write(239);

uart_write(1);

uart_write(255);

uart_write(255);

uart_write(255);

uart_write(255);

uart_write(1);

uart_write(0);

uart_write(3);

uart_write(1);

uart_write(0);

uart_write(5);

Page 55: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

55

for(i=0;i<10;i++)

{

k=uart_read();

if(i==9)

{

ch=k;

k=uart_read();

k=uart_read();

if(ch==0x00)

{

// PORTC|=(1<<2);

k=1;

uart_write(239);

Page 56: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

56

uart_write(1);

uart_write(255);

uart_write(255);

uart_write(255);

uart_write(255);

uart_write(1);

uart_write(0);

uart_write(4);

uart_write(2);

uart_write(imm);

uart_write(0);

uart_write(9);

i=0;

for(i=0;i<10;i++)

Page 57: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

57

{

k=uart_read();

if(i==9)

{

ch=k;

k=uart_read();

k=uart_read();

if(ch==0x00)

{

// PORTC|=(1<<3);

}

}

}

Page 58: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

58

}

}

}

}

void make_template()

{

int i=0;

char k=1,ch=1;

k=1;

uart_write(239);

uart_write(1);

uart_write(255);

Page 59: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

59

uart_write(255);

uart_write(255);

uart_write(255);

uart_write(1);

uart_write(0);

uart_write(3);

uart_write(5);

uart_write(0);

uart_write(9);

for(i=0;i<10;i++)

{

k=uart_read();

Page 60: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

60

if(i==9)

{

ch=k;

k=uart_read();

k=uart_read();

if(ch==0x00)

{

}

// PORTC|=(1<<4);

}

}

}

void check_finger(int i1,int i2,int ck)

Page 61: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

61

{

int i=0;

char k=1,ch=1;

uart_write(239);

uart_write(1);

uart_write(255);

uart_write(255);

uart_write(255);

uart_write(255);

uart_write(1);

uart_write(0);

uart_write(8);

uart_write(4);

Page 62: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

62

uart_write(1);

uart_write(0);

uart_write(i1);

uart_write(0);

uart_write(i2);

uart_write(0);

uart_write(ck);

for(i=0;i<10;i++)

{

k=uart_read();

if(i==9)

{

Page 63: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

63

ch=k;

k=uart_read();

k=uart_read();

k=uart_read();

k=uart_read();

k=uart_read();

k=uart_read();

cmd(0x01);

if(ch==0x00)

{

fing_flag=1;

printxy("FINGER FOUND",1,1);

}

else

Page 64: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

64

{

fing_flag=0;

printxy("FINGER NOT FOUND",1,1);

}

}

}

}

unsigned int random()

{

cmd(0x01);

printxy("PRESS THE BUTTON",1,1);

printxy("TO GET OTP",2,5);

while(B1==1)

{

i1++;

//digit4xy(i1,2,7);

Page 65: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

65

}

__delay_ms(200);

return i1;

}

void lcd_initi()

{

ADCON1=0x8e; //AN0 ONLY ANALOGE PIN

cmd(0x38);

cmd(0x06);

cmd(0x0c);

cmd(0x01);

//cmd(0x0e);

}

clear_buf()

{

int b=0;

for(b=0;b<12;b++)

temp[b]=0;

Page 66: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

66

}

void interrupt isr()

{

//static int index=0;

if(RCIF==1)

{

temp[index]=RCREG;

index++;

RCIF=0;

}

if(index==12)

{

temp_flag=1;

index=0;

}

}

void main()

{

TRISD=0X00;

TRISC=0B10000100;

Page 67: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

67

TRISE=0X00;

TRISB=0XF0;

RELAY1=0;

RELAY2=0;

RELAY3=0;

RELAY4=0;

lcd_initi();

serial_initi();

int i=0,op=3333;

GIE=1;

PEIE=1;

RCIE=1;

RCIF=0;

char num;

char flag=0;

cmd(0x01);

printxy("<<>>..ATM..<<>>",1,3);

while(1)

{

if(temp_flag==1)

{

//180088F94F26

if(temp[0]=='1'&&temp[1]=='8'&&temp[2]=='0'&&temp[3]=='0'&&temp[4]=='8'

&&temp[5]=='8'&&temp[6]=='F'&&temp[7]=='9'&&temp[8]=='4'&&temp[9]=='

F'&&temp[10]=='2'&&temp[11]=='6'&&temp_flag==1)

{

Page 68: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

68

GIE=0;

PEIE=0;

RCIE=0;

RCIF=0;

RELAY3=1;

temp_flag=0;

clear_buf();

cmd(0x01);

printxy("FAHIM",1,3);

printxy("PLS SCAN UR FINGER",2,1);

__delay_ms(2000);

__delay_ms(2000);

read_finger_1(1); //scans and stores in char_buffer1

make_template(); //makes the template with info in char_buffer1 &

char_buffer2 and stores it in char_buffer1

__delay_ms(500);

check_finger(0,1,15); //checks for the finger authentication

__delay_ms(500);

__delay_ms(2000);

if( fing_flag==1)

{

flag=1;

char k;

k=random();

Page 69: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

69

RELAY4=1;

uart_string("AT");

uart_enter();

__delay_ms(500);

__delay_ms(500);

__delay_ms(500);

uart_string("AT+CMGF=1");

uart_enter();

__delay_ms(500);

__delay_ms(500);

__delay_ms(500);

uart_string("AT+CMGS=");

uart_write1('"');

uart_string("9677606971");

uart_write1('"');

uart_enter();

__delay_ms(500);

__delay_ms(500);

__delay_ms(500);

uart_string("YOUR OTP IS:");

//uart_enter();

__delay_ms(500);

digit4_uart(k);

uart_write1(0x0a);

__delay_ms(500);

uart_write1(0x1a); //control z

cmd(0x01);

Page 70: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

70

printxy("MSG SEND",1,1);

__delay_ms(500);

__delay_ms(500);

__delay_ms(500);

RELAY4=0;

printxy(" TYPE YOUR OTP",1,1);

char check[4];

check[3]=k%10;

check[2]=(k%100)/10;

check[1]=(k%1000)/100;

check[0]=k/1000;

__delay_ms(500);

for(i=0;i<4;i++)

{

in[i]=keypressed();

cmd(0xc0+i);

data(in[i]);

}

if(in[0]==(check[0]+0x30)&&in[1]==(check[1]+0x30)&&in[2]==(check[2]+0x30

)&&in[3]==(check[3]+0x30))

{

cmd(0x01);

printxy("MATCHED",1,1);

RELAY1=1;

Page 71: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

71

RELAY2=1;

__delay_ms(500);

__delay_ms(500);

cmd(0x01);

printxy(" ON",1,3);

__delay_ms(1000);

cmd(0x01);

//continue;

__delay_ms(2000);

__delay_ms(2000);

RELAY1=0;

RELAY2=0;

}

else

{cmd(0x01);

printxy("NOT MATCHED",1,1);

if(flag==1)

{

RELAY1=0;

RELAY2=0;

}

Page 72: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

72

}

}

RELAY3=0;

GIE=1;

PEIE=1;

RCIE=1;

RCIF=0;

}

//180088F82A42

if(temp[0]=='1'&&temp[1]=='8'&&temp[2]=='0'&&temp[3]=='0'&&temp[4]=='8'

&&temp[5]=='8'&&temp[6]=='F'&&temp[7]=='8'&&temp[8]=='2'&&temp[9]=='

A'&&temp[10]=='4'&&temp[11]=='2')

{

GIE=0;

PEIE=0;

RCIE=0;

RCIF=0;

RELAY3=1;

temp_flag=0;

clear_buf();

cmd(0x01);

printxy("SIDDHARTH",1,3);

Page 73: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

73

printxy("PLS SCAN UR FINGER",2,1);

__delay_ms(2000);

read_finger_1(1); //scans and stores in char_buffer1

make_template(); //makes the template with info in char_buffer1 &

char_buffer2 and stores it in char_buffer1

__delay_ms(500);

check_finger(1,2,17); //checks for the finger authentication

__delay_ms(500);

if( fing_flag==1)

{

flag=1;

char k;

k=random();

RELAY4=1;

uart_string("AT");

uart_enter();

__delay_ms(500);

__delay_ms(500);

uart_string("AT+CMGF=1");

uart_enter();

__delay_ms(500);

__delay_ms(500);

uart_string("AT+CMGS=");

uart_write1('"');

Page 74: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

74

uart_string("9566820050");

uart_write1('"');

uart_enter();

__delay_ms(500);

__delay_ms(500);

__delay_ms(500);

uart_string("YOUR OTP IS:");

//uart_enter();

__delay_ms(500);

digit4_uart(k);

uart_write1(0x0a);

__delay_ms(500);

uart_write1(0x1a); //control z

cmd(0x01);

printxy("MSG SEND",1,1);

__delay_ms(500);

__delay_ms(500);

__delay_ms(500);

__delay_ms(500);

RELAY4=0;

printxy(" TYPE YOUR OTP",1,1);

char check[4];

check[3]=k%10;

check[2]=(k%100)/10;

check[1]=(k%1000)/100;

check[0]=k/1000;

Page 75: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

75

__delay_ms(500);

for(i=0;i<4;i++)

{

in[i]=keypressed();

cmd(0xc0+i);

data(in[i]);

}

if(in[0]==(check[0]+0x30)&&in[1]==(check[1]+0x30)&&in[2]==(check[2]+0x30

)&&in[3]==(check[3]+0x30))

{

cmd(0x01);

printxy("MATCHED",1,1);

RELAY1=1;

RELAY2=1;

__delay_ms(500);

__delay_ms(500);

cmd(0x01);

printxy(" ON",1,3);

__delay_ms(1000);

cmd(0x01);

//continue;

__delay_ms(2000);

__delay_ms(2000);

Page 76: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

76

RELAY1=0;

RELAY2=0;

}

else

{cmd(0x01);

printxy("NOT MATCHED",1,1);

if(flag==1)

{

RELAY1=0;

RELAY2=0;

}

}

RELAY3=0;

}

RELAY3=0;

GIE=1;

PEIE=1;

RCIE=1;

RCIF=0;

}

}

}

}

Page 77: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

77

CHAPTER 6

RADIO FREQUENCY IDENTIFICATION

6.1 RFID TAG TECHNOLOGY

The majority of RFID tags produced today are passive RFID tags, comprised

basically of a micro-circuit and an antenna. They are referred to as passive tags

because the only time at which they are actively communicating is when they are

within relatively close proximity of a passive RFID tag reader or interrogator.

Another type of common RFID tag in the marketplace today is known as the active

RFID tag, which usually contains a battery that directly powers RF

communication. This onboard power source allows an active RFID tag to transmit

information about itself at great range, either by constantly beaconing this

information to a RFID tag reader or by transmitting only when it is prompted to do

so. Active tags are usually larger in size and can contain substantially more

information (because of higher amounts of memory) than do pure passive tag

designs.

6.2 PASSIVE RFID TAGS

Passive RFID tags typically do not possess an onboard source of power.

Instead, the passive RFID tag receives its power from the energizing

electromagnetic field of an RFID reader (or interrogator). The energy coupled from

the electromagnetic field undergoes rectification and voltage multiplication in

order to allow it to be used to power the passive tag's microelectronics. In the

typical passive RFID tag design, the tag cannot communicate with host

applications unless it is within the range of an RFID reader.

Page 78: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

78

Fig.6.1.PASSIVE RFID

6.3 ACTIVE RFID TAGS

Active tags are typically used in real-time tracking of high-value assets in

closed-loop systems (that is, systems in which the tags are not intended to

physically leave the control premises of the tag owner or originator). Higher value

assets can usually justify the higher cost of the active tag, and presents strong

motivation for tag reuse. Medical equipment, electronic test gear, computer

equipment, reusable shipping containers, and assembly line material-in-process are

all excellent examples of applications for active tag technology. Active RFID tags

(see Figure 6-8) can provide tracking in terms of presence (positive or negative

indication of whether an asset is present in a particular area) or real-time location.

Active RFID tags are usually physically larger than passive RFID tags. Most RTLS

systems are based on the use of active RFID tag technology.

Fig.6.2.Active RFID

Page 79: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

79

CHAPTER 7

DISPLAY

7.1 LIQUID CRYSTAL DISPLAY

LCD (Liquid Crystal Display) screen is an electronic display module and

find a wide range of applications. A 16x2 LCD display is very basic module and is

very commonly used in various devices and circuits. These modules are preferred

over seven segments and other multi segment LEDs. The reasons being: LCDs are

economical; easily programmable; have no limitation of displaying special &

even custom characters (unlike in seven segments), animations and so on.

A 16x2 LCD means it can 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.

Page 80: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

80

7.2.PIN DESCRIPTION

Pin No Function Name

1 Ground (0V) Ground

2 Supply voltage; 5V (4.7V – 5.3V) Vcc

3 Contrast adjustment; through a variable resistor VEE

4 Selects command register when low; and data register when high Register Select

5 Low to write to the register; High to read from the register Read/write

6 Sends data to data pins when a high to low pulse is given Enable

7

8-bit data pins

DB0

8 DB1

9 DB2

10 DB3

11 DB4

12 DB5

13 DB6

14 DB7

15 Backlight VCC (5V) Led+

16 Backlight Ground (0V) Led-

Page 81: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

81

CHAPTER 8

GSM Shield

8.1 Description

The GSM shield by Arduino is used to send/ receive messages and

make/receive calls just like a mobile phone by using a SIM card by a network

provider. We can do this by plugging the GSM shield into the Arduino board and

then plugging in a SIM card from an operator that offers GPRS coverage. The

shield employs the use of a radio modem by SIMComm. We can communicate

easily with the shield using the AT commands. The GSM library contains many

methods of communication with the shield. This GSM Modem can work with any

GSM network operator SIM card just like a mobile phone with its own unique

phone number. Advantage of using this modem will be that its RS232 port can be

used to communicate and develop embedded applications. Applications like SMS

Control, data transfer, remote control and logging can be developed easily using

this. The modem can either be connected to PC serial port directly or to any

microcontroller through MAX232. It can be used to send/receive SMS and

make/receive voice calls. It can also be used in GPRS mode to connect to internet

and run many applications for data logging and control. In GPRS mode you can

also connect to any remote FTP server and upload files for data logging This GSM

modem is a highly flexible plug and play quad band SIM900A GSM modem for

direct and easy integration to RS232 applications. It Supports features like Voice,

SMS, Data/Fax, GPRS and integrated TCP/IP stack. To be connected to a

cellular network, the shield requires a SIM card provided by a network

provider.

Page 82: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

82

8.2 SIM900A

This is an ultra compact and reliable wireless module. The SIM900A is a

complete Dual-band GSM/GPRS solution in a SMT module which can be

embedded in the customer applications allowing you to benefit from small

dimensions and cost-effective solutions. Featuring an industry-standard interface,

the SIM900A delivers GSM/GPRS 900/1800MHz performance for voice, SMS,

Data, and Fax in a small form factor and with low power consumption. With a tiny

configuration of 24mm x 24mm x 3 mm, SIM900A can fit in almost all the space

requirements in your applications, especially for slim and compact demand of

design.

Fig.8.1.GSM module

8.3 FEATURES

Dual-Band 900/ 1800 MHz

GPRS multi-slot class 10/8

GPRS mobile station class B

Page 83: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

83

Compliant to GSM phase 2/2+

• Class 4 (2 W @900 MHz)

• Class 1 (1 W @ 1800MHz)

Dimensions: 24*24*3 mm

Weight: 3.4g

Control via AT commands (GSM 07.07, 07.05 and SIMCOM enhanced AT

Commands)

SIM application toolkit

Supply voltage range: 3.1- 4.8V

Low power consumption: 1.5mA(sleep mode)

Operation temperature: -40° C to +85°C

8.4 ON BOARD INDICATORS

The shield contains a number of status LEDS:

ON: It shows that the shield is getting power and is switched on.

NET: This LED blinks when the modem is communicating with the radio

network.

8.5 NETWORK LED

Page 84: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

84

The Network LED indicates the various states of the GSM module i.e.

POWER ON, NETWORK REGISTERATION and GPRS CONNECTIVITY.

When the modem is powered up, this NETWORK LED will blink every second.

After the Modem registers in the network (it takes 10-60 seconds), this LED will

blink in step of 3 seconds at slow rate. At this stage we can start using the modem

for our application. This shows that the modem is registered with the network.

8.6 AT COMMANDS

CHECKING THE OPERATION AND CONNECTION OF GSM SHIELD:

AT Press ENTER This would print OK which signifies of working

connection and operation of the GSM shield.

SENDING A MESSAGE

For sending SMS in text Mode: AT+CMGF=1 Press ENTER

AT+CMGS=”mobile number” Press ENTER Once the AT commands is given’ >’

prompt will be displayed on the screen. Type the message to be sent via SMS.

After this, Press CTRL+Z to send the SMS. If the SMS sending is successful,

“OK” will be displayed along with the message number.

Page 85: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

85

8.7 EXPERIMENTAL SETUP

FINGERPRINT SECURITY SYSTEM FOR ATM USING PIC(16f877A)

Page 86: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

86

CHAPTER 9

CONCLUSION

Biometric authentication technology using fingerprint identifier may solve

this problem since a person’s biometric data is undeniably connected to its

owner, is non transferable and unique for every individual. Biometrics is not

only a fascinating pattern recognition research problem but, if carefully used,

could also be an enabling technology with the potential to make our society

safer, reduce fraud and lead to user convenience by broadly providing the

following three functionalities (a) positive identification (b) large scale

identification and (c) screening.

Page 87: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

87

CHAPTER 10

REFERENCES

[1] The Biometric Consortium, “Introduction to Biometrics”,

(http://www.biometrics.org), 2006.

[2] D. Maltoni, D. Maio, A.K. Jain, and S. Prabhakar, “Handbook of

Fingerprint Recognition”, Springer, London, 2009.

[3] Samir Nanavati, Michael Thieme, and Raj Nanavati, “Biometrics: Identity

Verification in a Networked World”, John Wiley & Sons, 2002.

4] Julian Ashbourn, “Biometrics: Advanced Identity Verification”, Springer-

Verlag, London, 2002.

[5] Edmund Spinella, “Biometric Scanning Technologies: Finger, Facial and

Retinal Scanning”, SANS Institute, San Francisco, CA, 2003.

[6] Peatman, John B., “Design with PIC Microcontrollers”, Pearson Education,

India, 1998.

[7] Microchip Technology Inc., “PIC16F87XA data sheet, DS39582C, 2013.

[8] B, Schouten and B. Jacobs, “Biometrics and their use in e-passport”, Image

and Vision Computing vol. 27, pp. 305–312.

[9] S.A. Shaikh and J.R. Rabaiotti, “Characteristic trade-offs in designing

large-scale biometric-based identity management systems”. Journal of Network

and Computer Applications vol. 33, pp. 342–351, 2010.

[10] C.A. Oyeka, An Introduction to Applied Statistical methods. Enugu,

Nigeria: Modern Avocation Publishing Company. Pp. 4, 36, 56. 1990.

[11] E.O. Akuezilo, and N. Agu, Research and Statistics in Education and

Social Sciences: Methods and Applications. Awka, Nigeria: Nuel Centi

Publishers and Academic Press Ltd, 1993.

Page 88: CHAPTER 1 INTRODUCTION - · PDF filefingerprint biometric authentication scheme for automated teller machine ... Fig.2.1 Block diagram of fingerprint based ATM ... The system will

88

[12] J.I. Eze, M.E. Obiegbu, and E.N. Jude-Eze, Statistics and Qualitative

Methods for Construction and Business Managers. Lagos, Nigeria: The

Nigerian Institute of Building, 2005.

[13] F.H. Zuwaylif, General Applied Statistics. 3rd. Ed., California: Addison

Wesley Publishing Company, 1999.

[14] L. O’Gorman, “Overview of fingerprint verification technologies”,

Elsevier Information Security Technical Report, vol. 3, no. 1, 1998.

[15] G.B. Iwasokun, O.C. Akinyokun, B.K. Alese, and O. Olabode.

“Fingerprint Image enhancement: Segmentation to thinning”, International

Journal of Advanced Computer Science and Applications, vol. 3, no. 1, pp. 15-

24, 2012.