44
1 CHAPTER 1 INTRODUCTION In this project we use PIC 16F877A microcontroller. It is a 8-bit controller. It has high transfer speed. The block diagram consists of the following: PIC micro controller. (PIC16F877A) Finger print sensor. Keypad. Personal computer/Laptop. LCD Display. Power Supply. Candidate Selection. On the day of voting, the individual has to enter the ATM center and once he swipes his card it will ask for Banking or Voting. If voting option is chosen the finger has to be placed on the finger print sensor. The finger print module recognizes the finger print of the individual and it compares with the finger prints stored in main server. This processing is done by PIC micro controller. The details of the individual gets displayed once the finger print is matched. Then the individual has to choose their desired candidate and cast the vote accordingly using the candidate selection. The votes of the citizens will be stored in the main server and the results will be manipulated. The results are then displayed in the main server.

CHAPTER 1 INTRODUCTION - · PDF file1.1.2 BLOCK DIAGRAM OF ATM MACHINE USING PIC 16 F 877A ... down transformer will provide 12v AC supply. ... overload protection all in a single

  • Upload
    vulien

  • View
    215

  • Download
    1

Embed Size (px)

Citation preview

1

CHAPTER 1

INTRODUCTION

In this project we use PIC 16F877A microcontroller. It is a 8-bit controller. It has

high transfer speed. The block diagram consists of the following:

PIC micro controller. (PIC16F877A)

Finger print sensor.

Keypad.

Personal computer/Laptop.

LCD Display.

Power Supply.

Candidate Selection.

On the day of voting, the individual has to enter the ATM center and once he

swipes his card it will ask for Banking or Voting. If voting option is chosen the

finger has to be placed on the finger print sensor. The finger print module

recognizes the finger print of the individual and it compares with the finger prints

stored in main server. This processing is done by PIC micro controller. The details

of the individual gets displayed once the finger print is matched. Then the

individual has to choose their desired candidate and cast the vote accordingly using

the candidate selection. The votes of the citizens will be stored in the main server

and the results will be manipulated. The results are then displayed in the main

server.

2

1.1 HARDWARE TOOLS DESCRIPTION

1.1.2 BLOCK DIAGRAM OF ATM MACHINE USING PIC 16 F 877A

Fig:1.1 BLOCK DIAGRAM OF ATM MACHINE

DESCRIPTION

ATM machines generally have an inbuilt micro controller which performs

banking operations.To perform voting process we feed the programmed

micro controller(PIC 16 F 877A) into the ATM machine. PIC 16 F 877A is

interfaced with the microcontroller which is already present in the ATM

machine

3

Fig:1.2 BLOCK DIAGRAM USING PIC 16 F 877A

DESCRIPTION

In this project we use PIC 16F877A microcontroller. It is a 8-bit controller On the

day of voting, the individual has to enter the ATM center and once he swipes his

card it will ask for Banking or Voting. If voting option is chosen the finger has to

be placed on the finger print sensor. The finger print module recognizes the finger

print of the individual and it compares with the finger prints stored in main server.

This processing is done by PIC micro controller. The details of the individual gets

displayed once the finger print is matched. Then the individual has to choose their

desired candidate and cast the vote accordingly using the candidate selection. The

votes of the citizens will be stored in the main server and the results will be

manipulated. The results are then displayed in the main server.

4

1.1.3 PIC MICROCONTROLLER

Pin Details

Fig:1.3 Pin Details of PIC microcontroller (PIC 16 F877A)

PINDESCRIPTION:

The PIC16F887 having 40pins and 5 ports. In this PIC microcontroller the first pin

is connected with the master clear circuit, it is used for the clear purpose. For this

circuit we will provide +5v supply. For this project we won‟t use port A and port

E. 11th and 12th pin for the purpose of VSS and VDD. 13th and 14th pin

connected with the crystal oscillator. For PIC16F887 we can use 4MHz to 20MHz

crystal oscillator frequency here we are using 4MHz. It will provide clock pulse for

digital circuit. In port C 17th pin is connected with buzzer circuit. In D port

19,20,21,27,28,29,30 pins are connected with the LCD. For LCD we will provide

+5v supply. For RF communication TX and RX C port 25th and 26th pins are

used. For RF we will provide +5v supply. In power supply circuit first the step

down transformer will provide 12v AC supply. Then this alternating current

5

converted into direct current with the help of bridge rectifier. At last with the help

of particular rectified IC we can get particular voltage level.

1.1.4 High Performance RISC CPU:

• Only 35 single word instructions to learn

• All single cycle instructions except for program branches, which are two-

cycle

• Operating speed: DC - 20 MHz clock input DC - 200 ns instruction cycle

• 2K x 14 words of Program Memory, 128 x 8 bytes of Data Memory (RAM)

• Pinout compatible to PIC16C72/72A and PIC16F872

• Interrupt capability

• Eight-level deep hardware stack

• Direct, Indirect and Relative Addressing modes

1.1.5 Peripheral Features:

• High Sink/Source Current: 25 mA

• Timer0: 8-bit timer/counter with 8-bit prescaler

• Timer1: 16-bit timer/counter with prescaler, can be incremented during

SLEEP via external crystal/clock

• Timer2: 8-bit timer/counter with 8-bit period register, prescaler and

postscaler

• Capture, Compare, PWM (CCP) module

• Capture is 16-bit, max. resolution is 12.5 ns

• Compare is 16-bit, max. resolution is 200 ns

• PWM max. resolution is 10-bit

• 8-bit, 5-channel analog-to-digital converter

• Synchronous Serial Port (SSP) with SPI™ (Master/Slave) and I2C™ (Slave)

6

• Brown-out detection circuitry for Brown-out Reset (BOR)

1.1.6 CMOS Technology:

• Low power, high speed CMOS FLASH technology

• Fully static design

• Wide operating voltage range: 2.0V to 5.5V

• Industrial temperature range

• Low power consumption:

• < 0.6 mA typical @ 3V, 4 MHz

• 20 μA typical @ 3V, 32 kHz

• < 1 μA typical standby current

1.1.7 Special Microcontroller Features:

• 1,000 erase/write cycle FLASH program memory

• typical

• Power-on Reset (POR), Power-up Timer (PWRT)

• and Oscillator Start-up Timer (OST)

• Watchdog Timer (WDT) with its own on-chip

• RC oscillator for reliable operation

• Programmable code protection

• Power saving SLEEP mode

• Selectable oscillator options

• In-Circuit Serial Programming™ (ICSP™) via 2 pins

• Processor read access to program memory

1.1.8 Memory organization:

There are two memory blocks in the PIC16F877A device. These are the program

memory and the data memory. Each block has separate buses so that concurrent

7

access can occur. Program memory and data memory are explained in this section.

Program memory can be read internally by the user code. The data memory can

further be broken down into the general purpose RAM and the Special Function

Registers (SFRs). The operation of the SFRs that control the “core” are described

here. The SFRs used to control the peripheral modules are described in the section

discussing each individual peripheral module.

1.1.9 STATUS Register:

The STATUS register, contains the arithmetic status of the ALU, the RESET status

and the bank select bits for data memory. The STATUS register can be the

destination for any instruction, as with any other register. If the STATUS register

is the destination for an instruction that affects the Z, DC or C bits, then the write

to these three bits is disabled. These bits are set or cleared according to the device

logic. Furthermore, the TO and PD bits are not writable. Therefore, the result of an

instruction with the STATUS register as destination may be different than

intended.

1.1.10 I/O PORTS:

Some pins for these I/O ports are multiplexed with an alternate function for the

peripheral features on the device. In general, when a peripheral is enabled, that pin

may not be used as a general purpose I/O pin.

1.1.11 Timer0 module:

The Timer0 module timer/counter has the following

features:

• 8-bit timer/counter

• Readable and writable

8

• 8-bit software programmable prescaler

• Internal or external clock select

• Interrupt on overflow from FFh to 00h

• Edge select for external clock

1.1.12 Timer1 module:

The Timer1 module timer/counter has the following

features:

• 16-bit timer/counter

• (Two 8-bit registers; TMR1H and TMR1L)

• Readable and writable (both registers)

• Internal or external clock select

• Interrupt on overflow from FFFFh to 0000h

• RESET from CCP module trigger

1.1.13 Timer2 module:

The Timer2 module timer has the following features:

• 8-bit timer (TMR2 register)

• 8-bit period register (PR2)

• Readable and writable (both registers)

• Software programmable prescaler (1:1, 1:4, 1:16)

• Software programmable postscaler (1:1 to 1:16)

• Interrupt on TMR2 match of PR2

• SSP module optional use of TMR2 output to generate clock shift

9

1.1.14 Capture/compare/pwm module:

The CCP (Capture/Compare/PWM) module contains a

16-bit register that can operate as a:

• 16-bit capture register

• 16-bit compare register

• PWM master/slave duty cycle register.

1.1.15 Analog-to-digital converter (a/d) module:

The analog-to-digital (A/D) converter module has five inputs for the PIC16F72.

The A/D allows conversion of an analog input signal to a corresponding 8-bit

digital number. The output of the sample and hold is the input into the converter,

which generates the result via successive approximation. The analog reference

voltage is software selectable to either the device‟s positive supply voltage (VDD)

or the voltage level on the RA3/AN3/VREF pin. The A/D converter has a unique

feature of being able to operate while the device is in SLEEP mode. To operate in

SLEEP, the A/D conversion clock must be derived from the A/D‟s internal RC

oscillator.The A/D module has three registers:

• A/D Result Register ADRES

• A/D Control Register 0 ADCON0

• A/D Control Register 1 ADCON1

A device RESET forces all registers to their RESET state. This forces the A/D

module to be turned off and any conversion is aborted. The ADCON0 register,

shown in Register 10-1, controls the operation of the A/D module. The ADCON1

register, shown in Register 10-2, configures the functions of the port pins.

10

1.2 POWER SUPPLIES

1.2.1 BLOCK DIAGRAM:

Fig:1.4 Block Diagram of Power Supply

1.2.1.1 DESCRIPTION

The block diagram is shown in figure 11. Switch ON the power supply 230V AC

comes to the transformer primary winding and it converts 12V AC step down

transformer in secondary winding side. Using bridge rectifier (DIODE) 12V AC is

converted to 12V DC. Because PIC controllerneeds DC supply. Then filter

capacitor filters some minute AC signal. Then IC Regulator regulates to remove

the ripple and remaining voltage is send to the circuit. This IC regulator now

produces 5V dc for other circuits.

1.2.2 WORKING PRINCIPLE

1.2.2.1 TRANSFORMER

The potential transformer will step down the power supply voltage (0-230V) to (0-

6V) level. Then the secondary of the potential transformer will be connected to the

precision rectifier, which is constructed with the help of op–amp. The advantages

11

of using precision rectifier are it will give peak voltage output as DC, rest of the

circuits will give only RMS output.

1.2.2.2 BRIDGE RECTIFIER:

Fig:1.5 Bridge Rectifier Circuit

When the four diodes are connected is called bridge rectifier. The inputs are apply

diagonally opposite corners and the output is taken from the remaining corners.

Now we assuming the transformer is properly working. The potential A has + ve

polarity and the B potential has – ve polarity. The + ve potential point A will

forward bias D3 and reverse bias D4.

Likewise – ve potential point B will forward bias D1 and reverse bias D2. D3 and

D1 are a forward bias allows the current flow and blocks the current flow in

reverse bias D4 and D2. The current path from point B through D1 and it up

through RL through D3 through secondary back to point B and this gives one half

waveforms are get same as process happens in the diodes D4 and D4. Now D4 and

D2 is forward biasing D3 and D1 is reverse biasing and remaining half wave forms

get this point A.

12

1.2.2.3 IC voltage regulators

Voltage regulators comprise a class of widely used ICs. Regulator IC units contain

the circuitry for reference source, comparator amplifier, control device, and

overload protection all in a single IC. IC units provide regulation of either a

fixedpositive voltage, a fixed negative voltage, or an adjustably set voltage. The

regulators can be selected for operation with load currents from hundreds of milli

amperes to tens of amperes, corresponding to power ratings from milli watts to

tens of watts.

1.2.2.4 THREE-TERMINAL VOLTAGE REGULATORS:

Fig shows the basic connection of a three-terminal voltage regulator IC to a load.

The fixed voltage regulator has an unregulated dc input voltage, Vi, applied to one

input terminal, a regulated output dc voltage, Vo, from a second terminal, with the

third terminal connected to ground. For a selected regulator, IC device

specifications list a voltage range over which the input voltage can vary to

maintain a regulated output voltage over a range of load current. The specifications

also list the amount of output voltage change resulting from a change in load

current (load regulation) or in input voltage (line regulation).

1.2.2.5 Fixed Positive Voltage Regulators:

The series 78 regulators provide fixed regulated voltages from 5 to 24 V. Figure

19.26 shows how one such IC, a 7812, is connected to provide voltage regulation

with output from this unit of +12V dc. An unregulated input voltage Vi is filtered

by capacitor C1 and connected to the IC‟s IN terminal. The IC‟s OUT terminal

provides a regulated + 12V which is filtered by capacitor C2 (mostly for any high-

frequency noise). The third IC terminal is connected to ground (GND). While the

input voltage may vary over some permissible voltage range, and the output load

13

may vary over some acceptable range, the output voltage remains constant within

specified voltage variation limits. These limitations are spelled out in the

manufacturer‟s specification sheets. A table of positive voltage regulated ICs is

provided in table.

TABLE 1.1 Positive Voltage Regulators in 7800 series

IC Part Output Voltage

(V)

Minimum Vi

(V)

7805 +5 7.3

7806 +6 8.3

7808 +8 10.5

Circuit description:

Fig:1.6 Positive Voltage circuit

14

A three-terminal voltage regulator has an unregulated dc input voltage, Vi, applied

to one input terminal, a regulated dc output voltage, Vo, from a second terminal,

with the third terminal connected to ground.The series 78 regulators provide fixed

positive regulated voltages from 5 to 24 volts. Similarly, the series 79 regulators

provide fixed negative regulated voltages from 5 to 24 volts

For ICs, microcontroller, LCD --------- 5 volts

For alarm circuit, op-amp, relay circuits ---------- 12 volts

1.3 FINGERPRINT SENSORS

A fingerprint sensor is an electronic device used to capture a digital image of the

fingerprint pattern. The captured image is called a live scan. This live scan is

digitally processed to create a biometric template which is stored and used for

matching. This is an overview of some of the more commonly used fingerprint

sensor.

1.3.1 Fingerprint recognition:

The analysis of fingerprints for matching purposes generally requires the

comparison of several features of the print pattern. These include patterns, which

sare aggregate characteristics of ridges, and minutia points, which are unique

features found within the patterns. It is also necessary to know the structure and

properties of human skin n order to successfully employ some of the imaging

technologies.

1.3.2 Patterns

The three basic patterns of fingerprint ridges are the arch, loop, and whorl. An

arch is a pattern where the ridges enter from one side of the finger, rise in the

15

center forming an arc, and then exit the other side of the finger. The loop is a

pattern where the ridges enter from one side of a finger, to exit from the same side

they enter. In the whorl pattern, ridges form circularly around a central point on the

finger. Scientists have found that family members often share the same general

fingerprint patterns, leading to the belief that these patterns are inherited.

Fig:1.7Patterns of Fingerprint

1.3.3 How Fingerprint Scanners Work

Fig:1.8 Fingerprint Scanner Working

16

Fingerprint scanners generate an image of the ridges and valleys that make up a

fingerprint. But instead of sensing the print using light, the capacitors use electrical

current. The diagram below shows a simple capacitive sensor. The sensor is made

up of one or more. Semiconductor chips containing an array of tiny cells. Each cell

includes two conductor plates, covered with an insulating layer. The cells are tiny

smaller than the width of one ridge on a finger.

The sensor is connected to an integrator, an electrical circuit built around

aninverting operational amplifier.The inverting amplifier is a complex

semiconductor device, made up of a number of transistors, resistors and capacitors.

The details of its operation would fill an entire article by itself, but here we can get

a general sense of what it does in a capacitance scanner.

1.3.3.1 WORKING PRINCIPLE:

To scan the finger, the processor first closes the reset switch for each cell, which

shorts each amplifier's input and output to "balance" the integrator circuit. When

the switch is opened again, and the processor applies a fixed charge to the

integrator circuit, the capacitors charge up. The capacitance of the feedback loop's

capacitor affects the voltage at the amplifier's input, which affects the amplifier's

output. Since the distance to the finger alters capacitance, a finger ridge will result

in a different voltage output than a finger valley. The scanner processor reads this

voltage output and determines whether it is characteristic of a ridge or a valley. By

reading every cell in the sensor array, the processor can put together an overall

picture of the fingerprint, similar to the image captured by an optical scanner.

The main advantage of a capacitive scanner is that it requires a real fingerprint-

type shape, rather than the pattern of light and dark that makes up the visual

impression of a fingerprint. This makes the system harder to trick. Additionally,

17

since they use a semiconductor chip rather than a CCD unit, capacitive scanners

tend to be more compact that optical devices.

FIG:1.9 Fingerprint Sensing Stages

Fingerprint Sensing three stages

1. Capture Fingerprint image

2. Process image and extract features

3. Store data for comparison or compare with stored templates

1.3.4 Fingerprint Sensors general characteristics:

• Optic Reflexive

Finger lies on a prism. Total internal reflection produces image

of fingerprint on a camera chip

• Optic Transmissive with Fiber Optic Plate

Light source illuminates through the finger

18

Finger lies on fiber-optic plate that transmits image data to

camera chip

• Optical Line

Pixel array measures the light reflected by the finger

• Capacitive Line

Capacitor array measures the capacitance at each pixel

• Thermal Line

Finger is moved across a narrow array of thermal sensors

Temperature varies across the grooves and ridges

Thermal sensors measure the temperature differences over time

• Pressure Sensitive

Sensor measures the pressure per pixel

• Dynamic Capacitive

Capacitance is measured by A/C voltage

• Static Capacitive

One electrode per pixel

Capacitance measured w.r.t neighboring pixel.

If pixel is on a groove capacitance is small

If pixel is on a ridge then capacitance is large

• Acoustic (Ultrasound)

Image of fingerprint is recorded by very high frequency soun

19

• Fingerprint consists of tightly spaced ridges and valleys

Sensor consists of a capacitive array

Capacitive array acts as one plate of a capacitor while the finger acts

as the other

Each pixel in the array is charged to a reference voltage and allowed

to discharge with a reference current

• The rate of change of potential at each pixel is proportional capacitance

1.3.5 Data Storage and Matching :

Minutiae or Galton Characteristics

Termination of Ridge lines

Bifurcation of Ridge lines

FIG:1.10 Minutiae Characteristics

20

Data Storage and Matching

Fig: 1.11 Data Storage and Matching

Directional Map

Discrete matrix whose elements denote the orientation of the tangent

to ridge lines

Fig:1.12 Fingerprint and Directional Image

21

1.4 LCD (16 x 2 Characters)

Fig:1.13 LCD Display

1.4.1 WORKING

We are using 16x2 LCD display to display the voting procedures and select

candidate , view the vote counts.This display has to occupy 16 characters in a rowIn

first row ASCII value is 0X80 -0X8F and second row ASCII value is 0XC0-

0XCF. The LCD internal display structure is shown in the above figure. It need 5V

power supply and it‟s duty cycle is 1/16.

1.4.2 FEATURES

• 5 x 8 dots with cursor

• Built-in controller (KS 0066 or Equivalent)

• + 5V power supply (Also available for + 3V)

• 1/16 duty cycle and N.V. optional for + 3V power supply

•B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)

1.5 MATRIX KEYPAD:

The Series 96 is the most economical 3x4 and 4x4 keypad families. The contact

system utilizes conductive rubber to mate the appropriate PC board traces. Offered

in matrix circuitry, with shielded and backlit options. Built with quality component

22

parts, the Series 96 is subjected to our rigid statistical process control to insure that

it meets our reliability standards.

FIG:1.14 Matrix Keypad

1.5.1 WORKING

Here we are using 4x4 matrix keypad which is used to reduce less lines for 16

switches. Normal method use 8 lines. In this we are used register select to select

the command or data. Command is used where we have to display the data. And

data is used for what type of message to give. If the LED is ON the LCD back

lights to display the messages. It has 8-pins D0 to D7.

1.5.2 FEATURES

• Quality, Economical Keyboards

• Easily Customized Legends

• Matrix Circuitry

• Backlit and Shielded Options Available

• Termination Mates With Standard Connectors

• Tactile Feedback to Operator

• 1,000,000 Operations per Button

• Compatible With High Resistance Logic Inputs

23

1.5.3 SPECIFICATIONS

• Rating at 12 Vdc: 5 milliamps for .5 seconds

• Contact Bounce: < 12 milliseconds

• Contact Resistance: < 300 milliohms max.

• Voltage Breakdown: 250 Vac between components

• Mechanical Operation Life: 1,000,000 operations per key

• Insulation Resistance: > 1012 ohms @ 500 Vdc

• Push Out Force Per Pin: 5 lbs

1.5.4 OPERATING FEATURES

• Travel: .040 minimum

• Operating Force: 175 ± 40 grams

• Operating Temperature: -30°C to +80°C

24

1.6 CIRCUIT DIAGRAM OF VOTING SYSTEM

Fig:1.15Circuit Diagram Of Voting System

1.6.1 Circuit diagram description

It converts 230 Volts AC supply into 5V DC using bridge rectifier, filter, voltage

regulator. This serves as the minimum power supply to the other components. Here

PIC 16 F 877A micro controller is used. The program for the voting process is fed

into this micro controller.16 x 2 Characters LCD has a Built-in controller. It is

given a +5V power supply.

This sensor captures the fingerprint as a digital image(Live scan) which is digitally

processed to create a biometric template which is stored and used for matching. It

25

requires +5V supply.The Series 96 is the most economical 3x4 and 4x4 keypad

families. Offered in matrix circuitry, with shielded and backlit options. The

Operating voltage required for keypad is +5V

1.7 SOFTWARE TOOLS :

Here we have used Embedded C Programming to implement the voting tasks. Let

us see about Embedded C programming.

1.7.1 INTRODUCTION TO 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

memorybanks, and basic I/O operations.In 2008, the C Standards Committee

extended the C language to address these issues by providing a common standard

for all implementations to adhere to. It includes a number of features not available

in normal C, such as, fixed-point arithmetic, named address spaces, and basic I/O

hardware addressing. Embedded C uses most of the syntax and semantics of

standard C, e.g., main() function, variable definition, datatype declaration,

conditional statements (if, switch, case), loops (while, for), functions, arrays and

strings, structures and union, bit operations, macros, etc.

26

1.7.2 ALGORITHM

• Start the program.

• Initialise the values of Ports and registers.

• Function calls for LCD and Keypad functions are made.

• Display the Options “1.FINGER STORED 2.VOTING 3.COUNT”in the

lcd.

• Using while condition check the keyvalue,ifkeyvalue is equal to „1‟

CALL Datastorefunc() or if it is equal to „2‟ CALL Voting func() or if it

is equal to‟3‟ CALL Counting func() .

• Using DatastoreFunc() we are storing the Fingerprint data and it can store

upto 8 finger prints.

• If the CheckFinger is equal to 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 then

display“ENTER YOUR PROOF” else display “PUT YOUR FINGER” in

lcd.

• In VotingFunc() the finger print is checked against the stored finger print

data.If Fingerprint matches with any of the 8 finger print data then

DISPLAY “poling press‟*‟ else press‟#‟ “ otherwise display “Your Data

is Not Stored”.

• If keyvalue equals to „*‟ check for the condition checkarr[checkfinger} is

equal to 1 or not.If true display “YOU ALREADY POLLED” otherwise

display “You select polling” and “1.ADMK 2.DMK 3.MDMK

4.DMDK”.

27

• Check the keyvalue . If it equals to „1‟, increment value of admk or if it

equals to „2‟ increment value of dmk or if it equals to „3‟ increment value

of mdmk or if it equals to „4‟ increment value dmdk.

• Write the incremented values in respective address of EEPROM.

• Display “Your polling is registered” and “Thank you for your co-

operate”in LCD.

• In Counting func() check the password. If true read the values from

eepromand convert it to Ascii values and display the count in LCD

otherwise display “Secret code wrong”.

1.7.3 Program Code

#include <lcd.c>

#include <keypad.c>

#include "sam77a.c"

#bit Motor = 0x06.2

#bit key = 0x06.0

#define StoreCode 4567

#define VotingCode 7654

#bit txrelay = 0x09.0

#bit rxrelay = 0x09.1

int8 HeaderDataArr[8]={0XEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00};

int8 *FingerInitArr[9]={0X07,0X13,0X00,0X00,0X00,0X00,0X00,0X1B,0x99};

int8 *FingerImageGenArr[5]={0X03,0x01,0x00,0x05,0x99};

int8 *Char1BufferArr[6]={0X04,0x02,0x01,0x00,0x08,0x99};

int8 *Char2BufferArr[6]={0X04,0x02,0x02,0x00,0x09,0x99};

int8 *TempStorArr[5]={0x03,0x05,0x00,0x09,0x99};

int8 *FingerCodeStoreArr[8]={0X06,0x06,0x02,0x00,0x01,0x00,0x10,0x99};

28

int8*SearchFingerArr[10]={0X08,0x1B,0x01,0x00,0x00,0x00,0xA3,0x00,0xC8,0

x99};

int8 *deleteArr[9]={0x07,0x0c,0x00,0x00,0x00,0x01,0x00,0x00,0x99};

int8ASciiArr[5],Receive_Data,rx_buff_cnt,rx_buff[20],i;

int1DataReady;

int8 Receive_Flag,DataRead,cunt=0;

int16 Keyvalue1;

int8FingerData=0,checkfinger,keyvalue=0,checkarr[10];

int8 ADMK,DMK,MDMK,DMDK,CheckFinger1=0,polladdr=0;

void Dec2Ascii(int16 decval)

{

Asciiarr[0]=(decval/1000)+48;

decval=decval%1000;

Asciiarr[1]=(decval/100)+48;

decval=decval%100;

Asciiarr[2]=(decval/10)+48;

decval=decval%10;

Asciiarr[3]=decval+48;

}

intPasswordCheckFunc()

{

lcd_gotoxy(8,2);

lcd_putc("\v");

keyvalue=0;

while(!keyvalue)keyvalue=kbd_getc();

Keyvalue1=(keyValue-48)*1000;

lcd_putc('*');

delay_ms(500);

keyvalue=0;

while(!keyvalue)keyvalue=kbd_getc();

Keyvalue1=keyvalue1+((keyValue-48)*100);

lcd_putc('*');

delay_ms(500);

29

keyvalue=0;

while(!keyvalue)keyvalue=kbd_getc();

Keyvalue1=keyvalue1+((keyValue-48)*10);

lcd_putc('*');

delay_ms(500);

keyvalue=0;

while(!keyvalue)keyvalue=kbd_getc();

Keyvalue1=keyvalue1+(keyValue-48);

lcd_putc('*');

delay_ms(500);

return(keyvalue1);

}

voidReceive_init()

{

Dataready=1;

Receive_Flag = 0;

rx_buff_cnt=0;

GIE=1;

PEIE=1;

SPEN = 1;

RCSTA = 0x90; // SPEN enable,CREN Enable

SPBRG = 25;//0;//0x19; // 9.6k baud rate

RCIE = 1; // Enable intrrupt

RCIF = 0; //Interrupt Flag

BRGH=1;

CREN=1;

}

voidTransmit_Data(unsigned char a)

{

TXSTA = 0x24; // BRGH = 0(Low Speed is slected),Transmit Enabled

SPBRG =25;// 0;//25; // Baud Rate

SPEN = 1; // Serial Port Enabled

TXEN = 1; // Transmission Enabled

30

TXREG = a; // Data Loaded

while(!TXMT); // Transmit Shift Register != 1

SPEN = 1;

TXEN = 1;

}

voidTransFunc(int16 *FingerTrans)

{

Receive_Flag =0;

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

Transmit_Data(HeaderDataArr[i]);

while(*FingerTrans!=0x99)

Transmit_Data(*FingerTrans++);

// Receive_Flag = 0;

delay_ms(4);

SPEN=1;

TXEN=1;

TXSTA = 0x24;

//Receive_init();

// lcd_putc("\fT:000.0 RPM:0000");

// lcd_putc("\nF-OFF LV-0 M-OFF");

}

#INT_RDA

voidserial_receive_isr()

{

if(DataReady==1)

{

Receive_Data = RCREG;

if((Receive_Data==0xEF)&&(receive_Flag==0))

{

Receive_Flag = 1;

rx_buff_cnt=0;

31

// rx_buff[rx_buff_cnt++]= Receive_Data;

}

if(receive_flag==1)

{

rx_buff[rx_buff_cnt++]= Receive_Data;

}

}//while(DataReady==1);

Receive_data=0;

RCIF = 0;

//RCIE =1;

// lcd_putc("\fALL IS WELL");

}

charConditionCheckFunc()

{

if(rx_buff[9]==0x00)

{

checkfinger=rx_buff[11];

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

rx_buff[i]=0;

return(1);

}

else

{

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

rx_buff[i]=0;

return(0);

}

}

charFingercheckFunc(int8 Fingercheck)

{

Receive_init();

if(FingerCheck==1)TransFunc(&FingerInitArr[0]);

if(FingerCheck==2)TransFunc(&FingerImageGenArr[0]);

if(FingerCheck==3)TransFunc(&Char1BufferArr[0]);

32

if(FingerCheck==4)TransFunc(&Char2BufferArr[0]);

if(Fingercheck==5)TransFunc(&TempStorArr[0]);

Dataread=0;

if(FingerCheck==6)

{

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

{

Dataread=DataRead+FingerCodeStoreArr[i];

}

FingerCodeStoreArr[6]=Dataread+1;

TransFunc(&FingerCodeStoreArr[0]);

}

if(FingerCheck==7)TransFunc(&SearchFingerArr[0]);

Dataread=0;

if(FingerCheck==8)

{

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

{

Dataread=DataRead+deleteArr[i];

}

deleteArr[7]=Dataread+1;

TransFunc(&deleteArr[0]);

}

// deleteArr[9]

while(Receive_flag==0);

delay_ms(100);

return(ConditioncheckFunc());

}

voidDatastoreFunc()

{

Lcd_putc("\fYOU HAVE SELECT ");

lcd_putc("\nDATA STORE FUNC");

delay_ms(1000);

while(true)

{

FingerData=1;

if(FingerData)Fingerdata=FingerCheckFunc(2);

if(FingerData)Fingerdata=FingerCheckFunc(3);

if(FingerData)Fingerdata=FingerCheckFunc(7);

33

if(FingerData)

{

if((CheckFinger==0)||(CheckFinger==1)||(CheckFinger==2)||(CheckFinger==3)||(C

heckFinger==4)||(CheckFinger==5)||(CheckFinger==6)||(CheckFinger==7))

{

lcd_putc("\fENTER YOUR PROF");

lcd_putc(CheckFinger+0x30);

txrelay=0;

rxrelay=0;

RcIE=0;

Rcif=0;

delay_ms(2000);

RCSTA = 0x90; // SPEN enable,CREN Enable

SPBRG = 0x19; // 9.6k baud rate

do

{

SPEN = 1; // UART enabled

CREN = 1;

i=0;

while(!RCIF);// Wait for Reception Flag

CREN = 0;

rx_buff[0] = RCREG;

}while(rx_buff[0]!='$');

cunt=0;

do

{

SPEN = 1; // UART enabled

CREN = 1;

i=0;

while(!RCIF);// Wait for Reception Flag

CREN = 0;

rx_buff[cunt++] = RCREG;

}while((RCREG!='#')&&(cunt<=30));

CheckFinger=CheckFinger*30;

delay_ms(2000);

for(i=0;i<cunt-1;i++)

{

write_eeprom(CheckFinger+i,rx_buff[i]);

34

delay_ms(20);

Transmit_data(rx_buff[i]);

}

txrelay=1;

rxrelay=1;

}

delay_ms(500);

}

else

{

Lcd_putc("\fPUT YOUR ");

lcd_putc("\nFINGER...");

delay_ms(500);

}

}

}

charVotingFunc()

{

Lcd_putc("\fYOU HAVE SELECT ");

lcd_putc("\nVOTING FUNC");

delay_ms(500);

while(true)

{

FingerData=1;

if(FingerData)Fingerdata=FingerCheckFunc(2);

if(FingerData)Fingerdata=FingerCheckFunc(3);

if(FingerData){Fingerdata=FingerCheckFunc(7);

if(fingerData)

if((CheckFinger==0)||(CheckFinger==1)||(CheckFinger==2)||(CheckFinger==3)||(C

heckFinger==4)||(CheckFinger==5)||(CheckFinger==6)||(CheckFinger==7))

{

txrelay=0;

rxrelay=0;

lcd_putc(checkfinger+0x30);

delay_ms(2000);

CheckFinger1=CheckFinger*30;

delay_ms(2000);

35

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

{

delay_ms(20);

Transmit_data(read_eeprom(i+CheckFinger1));

}

lcd_putc("\fPOLING PRESS '*'\nELSE PRESS '#'");

keyvalue=0;

txrelay=1;

rxrelay=1;

while((keyvalue!='*')&&(keyvalue!='#'))keyvalue=kbd_getc();

if(keyvalue=='*')

{

if(checkarr[checkfinger]==1)

{

lcd_putc("\fYOU ALREADY\nPOLLED....");

delay_ms(2000);

lcd_putc("\f1.FINGER STORED ");

lcd_putc("\n2.VOTING 3.COUNT ");

return(0);

}

checkarr[checkfinger]=1;

lcd_putc("\fYOU HAVE SELECT\nPOLLING");

delay_ms(2000);

lcd_putc("\f1.ADMK 3.MDMK");

lcd_putc("\n2.DMK 4.DMDK");

buzzer=0;

delay_ms(2000);

buzzer=1;

keyvalue=0;

while(!keyvalue)keyvalue=kbd_getc();

if(keyvalue=='1')write_eeprom(0xFa,++ADMK);

if(keyvalue=='2')write_eeprom(0xFb,++DMK);

if(keyvalue=='3')write_eeprom(0xFc,++MDMK);

if(keyvalue=='4')write_eeprom(0xFd,++DMDK);

lcd_putc("\fYOUR POLLING IS");

lcd_putc("\nREGISTERED ");

36

buzzer=0;

delay_ms(3000);

buzzer=1;

lcd_putc("\fTHANK YOU FOR ");

lcd_putc("\nYOUR CO-OPERATE");

delay_ms(3000);

lcd_putc("\f1.FINGER STORED ");

lcd_putc("\n2.VOTING 3.COUNT ");

return(0);

}

else return(0);

}

else

{

Lcd_putc("\fYOUR DATA IS");

lcd_putc("\nNOT STORED...");

delay_ms(500);

}

}

lcd_putc("\fPUT YOUR");

lcd_putc("\nTHUMB....");

delay_ms(500);

}

}

voidCountingFunc()

{

Lcd_putc("\fYOU HAVE SELECT ");

lcd_putc("\nVOTE COUNTING ");

buzzer=0;

delay_ms(2000);

buzzer=1;

lcd_putc("\fENTER SECRET ");

37

lcd_putc("\nCODE : 0000 ");

if(VotingCode==PasswordCheckFunc())

{

lcd_putc("\fADMK-00 MDMK-00");

lcd_putc("\nDMK -00 DMDK-00");

dec2Ascii(read_eeprom(0xFa));

lcd_gotoxy(6,1);

Lcd_putc(AsciiArr[2]);

Lcd_putc(AsciiArr[3]);

dec2Ascii(read_eeprom(0xFB));

lcd_gotoxy(6,2);

Lcd_putc(AsciiArr[2]);

Lcd_putc(AsciiArr[3]);

dec2Ascii(read_eeprom(0xFC));

lcd_gotoxy(15,1);

Lcd_putc(AsciiArr[2]);

Lcd_putc(AsciiArr[3]);

dec2Ascii(read_eeprom(0xFD));

lcd_gotoxy(15,2);

Lcd_putc(AsciiArr[2]);

Lcd_putc(AsciiArr[3]);

buzzer=0;

delay_ms(5000);

buzzer=1;

Lcd_Putc("\fPRESS '*' CANCEL");

lcd_putc("\nELSE PRS ANY KEY");

keyvalue=0;

while(!KeyValue)KeyValue=kbd_getc();

polladdr=0xfa;

if(keyvalue=='*')

{

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

{

Write_eeprom(polladdr+i,0x00);

checkarr[i]=0;

}

admk=0;

38

dmk=0;

mdmk=0;

dmdk=0;

}

}

else

{

lcd_putc("\fSECRET CODE");

lcd_putc("\nIS WRONG ");

buzzer=0;

delay_ms(3000);

buzzer=1;

}

lcd_putc("\f1.FINGER STORED ");

lcd_putc("\n2.VOTING 3.COUNT ");

}

void main()

{

porta=0xFF;

portb=0x00;

portc=0x04;

portd=0x00;

porte =0x00;

trisa=0x00;

trisb=0x01;

trisc=0x80;

trisd=0x00;

trise=0x00;

Portb=0x00;

OPTION_REG = 0xC7; //enable portb full disable & enable rising edge

INTCON = 0xC0; //enable GIE,INTE,INTF=0

lcd_init();

kbd_init();

lcd_putc("\fBIOMETRIC VOTING");

lcd_putc("\nSYSTEM");

39

Motor=0;

porte=0x03;

delay_ms(1500);

KeyValue=0;

lcd_putc("\f1.FINGER STORED ");

lcd_putc("\n2.VOTING 3.COUNT ");

while(true)

{

while(!KeyValue)KeyValue=kbd_getc();

if(keyvalue=='1')

DatastoreFunc();

if(KeyValue=='2')

VotingFunc();

if(KeyValue=='3')

CountingFunc();

Keyvalue=0;

}

}

40

CHAPTER 2

RESULT

Thus the project “Biometric voting System incorporated in ATM machines”

makes use of ATM machines for casting votes from any part of the country and

gives absolute transparency as it uses finger print for casting the votes.

Fig:2.1 Demo Picture

41

CHAPTER 3

ADVANTAGES

1. This system reduces the complexity in election process by enabling the voter

to cast his vote from any remote places .

2. Also the economic burden incurred during election process is reduced to a

great extent.

3. Security based system because of the use of finger print recognition & due to

the presence of security cameras in ATM centers. Rigging will be eliminated

completely

4. Preserves voting secrecy, No scope for invalid votes

5. Facilitates quick and accurate counting – possible to declare results

instantaneously.

6. Re-usable by simply erasing votes recorded in earlier poll

7. Easier to manage with less demand on man-power.

42

CHAPTER 4

CONCLUSION

Bank servers are leased line networked so it is highly secured and also used

security camera. Since the voting is enhanced at the doorstep, the voting

percentage gets increased. Fake voting can be avoided. The working model can be

implemented in the low level election premises. The controller is interfaced with

the ATM machines and is enabled at the time of elections

43

CHAPTER 5

REFERENCE

1. A.J. Jegede, G.I.O. Aimufua and N.I. Akosu, Electronic Voting: A Panacea

for Electoral Irregularities in Developing Countries , Journal of Mobile

Communication, Published by IEEE , pp. 22-33, 2009.

2. B.B., “Science vs. Crime: The Evolution of the Police IEEE PublicationNew

York, (1979).

3. D. Ashok Kumar and T. UmmalSariba Begum, A Novel design of Electronic

Voting System Using fingerprint, International Journal of Innovative

Technology & Creative Engineering, Vol. 1, pp. 12-19, 2011.

4. David Chaum, Secret-Ballot Receipts: True Voter-Verifiable Elections,

Published by IEEE Computer Society, pp. 38-47, 2004.

5. FirasHazzaa, SeifedineKadry, New System of E-voting Using Fingerprint,

International Journal of Emerging Technology and Advanced Engineering”,

Vol 2, pp 355-363, 2012.

6. Introducing Electronic voting: Essential Consideration, a policy paper

December 2011 http://www.idea.int/publications/introducing-

electronicvoting/ upload/PP_e-voting.pdf.

7. James M., “Catching the Killers: A History of Crime Detection”, Ebury

Press: London, (2001).

8. Jain A.K., Bolle R., Pankanti S., “Biometrics: Personal Identification in a

Networked Society”, Kluwer cademic Publishers, (1999)

9. Katherine R., “The Forensic Science of C.S.I.”, Berkley Boulevard Books:

New York, (2001).

44

10. Murthy R.K..M., “Latent Fingerprint Matching Using Descriptor-Based

Hough Transform” IEEE Transactions On Information Forensics And

Security, Vol. 8 (Issue 1), (Jan 2013).

11. Maltoni D., “Handbook of Fingerprint Recognition”, Springer, (2003).

12. Marasco L.L., “Interoperability in Fingerprint Recognition: A Large-Scale

Empirical Study”, IEEE/IFIP International Conference on Dependable

Systems and Networks, P.P. 24 – 27, (Jun 2013).

13. Michael L., Simon A.C., Ruth M., Kathleen J., “Truth Machine: The

Contentious History of DNA Fingerprinting”, University of Chicago Press:

Chicago.(Jan 2009)

14. PaulinoA.A,Kumar D.V., “Fingerprint Based ATM Security by using PIC”,

IOSR Journal of Electronics and Communication Engineering (Issue 5),

(Sep-Oct 2012).

15. SobiaBaig, UmmerIshtiaq, Ayesha Kanwal, UsmanIshtiaq, and M. Hassan

Javed, Electronic Voting System Using Fingerprint Matching with Gabor

Filter, Proceedings of International Bhurban Conference on Applied

Sciences &echnology Islamabad, Pakistan, pp 130-135, 2011