Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The user has to show his voter ID card whenever he goes to the polling
booth to poll his vote. This is a time consuming process as the person has to check
the voter ID card with the list he has, confirm it as an authorized card and then
allow the person to poll his vote. Thus, to avoid this kind of problems, we have
designed a finger print based voting machine where the person no need to carry his
ID which contains his entire details.
The person at the polling booth has to show his Finger. This Finger print
reader reads the details from the tag. This data is passed to the controlling unit for
the verification. The controller reads the data from the reader and compares this
data with the already existing data. If the data matches with the already stored
information, the person is allowed to poll his vote. If not, a message is displayed
on LCD and the person is not allowed to poll his vote. The polling mechanism
carries out manually using the switches. LCD is used to display the related
messages.
Page 1
Finger print based electronic voting machine
The project demands the user to submit his Finger print at the polling booth.
The project uses the Finger print technology and Embedded Systems to design this
application. The main objective of this project is to design a system that asks the
user to show his Finger print as an identity proof. The system reads the data from
the Finger print and verifies this data with the already stored data in its database. If
the details present in the data base it matches with the stored data, the system
allows the person to enter into and poll his vote. If the details of the Finger do not
match with the stored data, the system immediately activates the display and the
security authorities can come and take the further action.
This project is a device that collects data from the tag and codes the data into
a format that can be understood by the controlling section. This system also
collects information from the master device and implements commands that are
directed by the master.
The objective of the project is to develop a microcontroller based security
and alert system. It consists of a Finger print reader, microcontroller, the
interfacing unit to allow the communication between the microcontroller and
Finger print module, and the LCD.
Page 2
Finger print based electronic voting machine
already existing data in the controllers memory and then implement the
commands directed by the controller section. The performance of the design is
maintained by controlling unit.
Page 3
Finger print based electronic voting machine
Chapter 2
OVERVIEW OF THE TECHNOLOGIES USED
Embedded Systems:
An embedded system can be defined as a computing device that does a
specific focused job. Appliances such as the air-conditioner, VCD player, DVD
player, printer, fax machine, mobile phone etc. are examples of embedded systems.
Each of these appliances will have a processor and special hardware to meet the
specific requirement of the application along with the embedded software that is
executed by the processor for meeting that specific requirement.
The embedded software is also called firm ware. The desktop/laptop
computer is a general purpose computer. You can use it for a variety of applications
such as playing games, word processing, accounting, software development and
soon.
In contrast, the software in the embedded systems is always fixed listed below:
Embedded systems do a very specific task, they cannot be programmed to
do different things. Embedded systems have very limited resources, particularly the
memory. Generally, they do not have secondary storage devices such as the
CDROM or the floppy disk. Embedded systems have to work against some
deadlines. A specific job has to be completed within a specific time. In some
embedded systems, called real-time systems, the deadlines are stringent. Missing a
deadline may cause a catastrophe-loss of life or damage to property. Embedded
Page 4
Finger print based electronic voting machine
systems are constrained for power. As many embedded systems operate through a
battery, the power consumption has to be very low. Some embedded systems have
to operate in extreme environmental conditions such as very high temperatures and
humidity.
Following are the advantages of Embedded Systems:
1. They are designed to do a specific task and have real time performance
constraints which must be met.
2. They allow the system hardware to be simplified so costs are reduced.
3. They are usually in the form of small computerized parts in larger devices
which serve a general purpose.
4. The program instructions for embedded systems run with limited computer
hardware resources, little memory and small or even non-existent keyboard
or screen.
Page 5
Finger print based electronic voting machine
Chapter 3
Hardware Implementation of the Project
This chapter briefly explains about the Hardware Implementation of the
project. It discusses the design and working of the design with the help of block
diagram and circuit diagram and explanation of circuit diagram in detail. It
explains the features, timer programming, serial communication, interrupts of Lpc
2148 microcontroller. It also explains the various modules used in this project.
Page 6
Finger print based electronic voting machine
Power
Supply
Finger
Print
Module
16 X 2
LCD
LPC2148
Crystal
Oscillato Switches
r Page 7
Finger print based electronic voting machine
Page 8
Finger print based electronic voting machine
Filter:
Capacitive filter is used in this project. It removes the ripples from the
output of rectifier and smoothens the D.C. Output received from this filter is
constant until the mains voltage and load is maintained constant. However, if either
of the two is varied, D.C. voltage received at this point changes. Therefore a
regulator is applied at the output stage.
Voltage regulator:
As the name itself implies, it regulates the input applied to it. A voltage
regulator is an electrical regulator designed to automatically maintain a constant
voltage level. In this project, power supply of 5V and 12V are required. In order to
obtain these voltage levels, 7805 and 7812 voltage regulators are to be used. The
first number 78 represents positive supply and the numbers 05, 12 represent the
required output voltage levels
Page 9
Finger print based electronic voting machine
LPC2148:
LPC2148 arm processor is used for controlling. ARM processor is used
because of its extra features when compared to microcontroller. It controls LCD
and finger print module. It receives input commands from switches and control
finger print module when to receive the data, performs comparison , gives
command to LCD to display messages to direct the users to use it properly and
also displays the results.
Page 10
Finger print based electronic voting machine
The switches are used to activate the controller for registration during
enrollment, for comparisons to the database while identifying the user, for selecting
the party while casting the vote, finally for display of results.
LCD screen functions as interface between the user and microcontroller,
which displays messages that facilitates the user to know when to register and
when to vote, and also whether their vote is valid are not.
It displays welcome messages initially and enrolling message during
enrollment, identifying message when controller is comparing the data base
whether the user is valid are not, if valid displays please vote message, if not
displays no access message, and finally displays the result with party name with
their respective number of votes.
Page 11
Finger print based electronic voting machine
Page 12
Finger print based electronic voting machine
Page 13
Finger print based electronic voting machine
The user, who wants to poll his vote, has to submit the identity proof at the
counter at the polling booth. In this project, the necessary and, upto an extent, the
sufficient material, the user no need to carry with him is the Voter card.
Voter card is nothing but an Finger Print which stores the details of the
person like the name of the user, location of place, mobile number for contact etc.
When the user is asked to show his Finger print. The Finger print module reads the
data present.
Page 14
Finger print based electronic voting machine
Before casting the vote the candidate has to check for validity .so after user
pressing the identify button the controller displays identifying .. message.
During this mode the fingerprint of the candidate casting the vote is compared
with the finger prints already enrolled in the memory. If it is matched a message
PLEASE VOTE will be displayed on LCD. Once the voter presses the
button corresponding to the candidate of her/his choice, a four-bit code is
generated and sent to the control unit. Once the casting is over message is
displayed to whom they voted for.No ACCESS.. message will be displayed if
the same user tries to cast again. The machine returns to the identifying mode and
starts all over again for next voting.
RESULTS MODE
The contestant name and the secured votes will be displayed on the LCD
when the controller receives results instruction through the switches.
Page 15
Finger print based electronic voting machine
Chapter 4
Microcontroller
4.1.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.
Easy to Use
"burn" the chip and a demonstration board. Some packages include a high level
language compiler such as a C compiler and more sophisticated libraries.
The heart of the microcontroller is the CPU core. In the past this has
traditionally been based on an 8-bit microprocessor unit. Figure 4.1 above Shows a
typical microcontroller device and its different subunits
Page 17
Finger print based electronic voting machine
4.3 LPC214x
edge or level sensitive external interrupt pins make these microcontrollers suitable
for industrial control and medical systems
4.3.1Key features
Page 19
Finger print based electronic voting machine
Fast I2C-bus (400 Kbit/s),SPI and SSP with buffering and variable data
length capabilities.
Vectored Interrupt Controller (VIC) with configurable priorities and vector
addresses.
Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64
package.
Up to 21 external interrupt pins available.
60 MHz maximum CPU clock available from programmable on-chip PLL
with settling time of 100 s.
On-chip integrated oscillator operates with an external crystal from 1 MHz
to 25 MHz
Power saving modes include Idle and Power-down.
Individual enable/disable of peripheral functions as well as peripheral clock
scaling for additional power optimization.
Processor wake-up from Power-down mode via external interrupt or BOD.
Single power supply chip with POR and BOD circuits: CPU operating
voltage range of 3.0 V to 3.6 V (3.3 V 10 %) with 5 V tolerant I/O pads.
Page 20
Finger print based electronic voting machine
Page 21
Finger print based electronic voting machine
Page 22
Finger print based electronic voting machine
Page 23
Finger print based electronic voting machine
Page 24
Finger print based electronic voting machine
Page 25
Finger print based electronic voting machine
Page 26
Finger print based electronic voting machine
Page 27
Finger print based electronic voting machine
Page 28
Finger print based electronic voting machine
Page 29
Finger print based electronic voting machine
Page 30
Finger print based electronic voting machine
Page 31
Finger print based electronic voting machine
FIQ, because then the FIQ service routine does not need to branch into the
interrupt service routine but can run from the interrupt vector location. If more than
one request is assigned to the FIQ class, the FIQ service routine will read a word
from the VIC that identifies which FIQ source(s) is (are) requesting an interrupt.
Vectored IRQs have the middle priority. Sixteen of the interrupt requests can be
assigned to this category. Any of the interrupt requests can be assigned to any of
the 16 vectored IRQ slots, among which slot 0 has the highest priority and slot 15
has the lowest. Non-vectored IRQs have the lowest priority. The VIC combines the
requests from all the vectored and non-vectored IRQs to produce the IRQ signal to
the ARM processor. The IRQ service routine can start by reading a register from
the VIC and jumping there. If any of the vectored IRQs are pending, the VIC
provides the address of the highest-priority requesting IRQs service routine,
otherwise it provides the address of a default routine that is shared by all the non-
vectored IRQs. The default routine can read another VIC register to see what IRQs
are active.
Interrupt sources
Each peripheral device has one interrupt line connected to the Vectored
Interrupt Controller, but may have several internal interrupt flags. Individual
interrupt flags may also represent more than one interrupt source.
Page 32
Finger print based electronic voting machine
Features
Bit-level set and clear registers allow a single instruction set or clear of any
number of bits in one port.
Direction control of individual bits.
Separate control of output set and clear.
All I/O default to inputs after reset.
10-bit ADC
The LPC2141/42 contain one and the LPC2144/46/48 contain two analog to
digital converters. These converters are single 10-bit successive approximation
analog to digital converters. While ADC0 has six channels, ADC1 has eight
channels. Therefore, total number of available ADC inputs for LPC2141/42 is 6
and for LPC2144/46/48 is 14.
Features
Measurement range of 0 V to VREF (2.0 V VREF VDDA).
Page 33
Finger print based electronic voting machine
Each converter capable of performing more than 400,000 10-bit samples per
second.
Every analog input has a dedicated result register to reduce interrupt overhead.
Burst conversion mode for single or multiple inputs.
10-bit DAC
The DAC enables the LPC2141/42/44/46/48 to generate a variable analog
output. The maximum DAC output voltage is the VREF voltage.
Features
10-bit DAC.
Buffered output.
Power-down mode available.
Selectable speed versus power.
The USB is a 4-wire serial bus that supports communication between a host
and a number (127 max) of peripherals. The host controller allocates the USB
bandwidth to attached devices through a token based protocol. The bus supports
hot plugging, unplugging, and dynamic configuration of the devices. All
transactions are initiated by the host controller. The LPC2141/42/44/46/48 is
equipped with a USB device controller that enables 12 Mbit/s data exchange with a
USB host controller. It consists of a register interface, serial interface engine,
endpoint buffer memory and DMA controller. The serial interface engine decodes
the USB data stream and writes data to the appropriate end point buffer memory.
Page 34
Finger print based electronic voting machine
The status of a completed USB transfer or error condition is indicated via status
registers. An interrupt is also generated if enabled. A DMA controller (available in
LPC2146/48 only) can transfer data between an endpoint buffer and the USB
RAM.
Features
Fully compliant with USB 2.0 Full-speed specification.
Supports 32 physical (16 logical) endpoints.
Supports control, bulk, interrupt and isochronous endpoints.
Scalable realization of endpoints at run time.
Endpoint maximum packet size selection (up to USB maximum specification) by
software at run time.
RAM message buffer size based on endpoint realization and maximum packet
size.
Supports SoftConnect and GoodLink LED indicator. These two functions are
sharing one pin.
Supports bus-powered capability with low suspend current.
Supports DMA transfer on all non-control endpoints (LPC2146/48 only).
One duplex DMA channel serves all endpoints (LPC2146/48 only).
Allows dynamic switching between CPU controlled and DMA modes (only in
LPC2146/48).
Double buffer implementation for bulk and isochronous endpoints.
Page 35
Finger print based electronic voting machine
Features
Compliant with standard I2C-bus interface.
Easy to configure as master, slave, or master/slave.
Programmable clocks allow versatile rate control.
Bidirectional data transfer between masters and slaves.
Multi-master bus (no central master).
Arbitration between simultaneously transmitting masters without corruption of
serial data on the bus.
Serial clock synchronization allows devices with different bit rates to
communicate via one serial bus.
Serial clock synchronization can be used as a handshake mechanism to suspend
and resume serial transfer.
The I2C-bus can be used for test and diagnostic purposes.
Page 36
Finger print based electronic voting machine
interface during a given data transfer. During a data transfer the master always
sends a byte of data to the slave, and the slave always sends a byte of data to the
master.
Features
Compliant with Serial Peripheral Interface (SPI) specification.
Synchronous, Serial, Full Duplex, Communication.
Combined SPI master and slave.
Maximum data bit rate of one eighth of the input clock rate.
Features
Compatible with Motorolas SPI, TIs 4-wire SSI and National Semiconductors
Microwire buses.
Synchronous serial communication.
Master or slave operation.
8-frame FIFOs for both transmit and receive.
Page 37
Finger print based electronic voting machine
Page 38
Finger print based electronic voting machine
Toggle on match.
Do nothing on match.
Watchdog timer:
The purpose of the watchdog is to reset the microcontroller within a
reasonable amount of time if it enters an erroneous state. When enabled, the
watchdog will generate a system reset if the user program fails to feed (or reload)
the watchdog within a predetermined amount of time.
Features
Internally resets chip if not periodically reloaded.
Debug mode.
Enabled by software but requires a hardware reset or a watchdog reset/interrupt to
be disabled.
Incorrect/Incomplete feed sequence causes reset/interrupt if enabled.
Flag to indicate watchdog reset.
Programmable 32-bit timer with internal pre-scaler.
Selectable time period from (TPCLK 256 4) to (TPCLK 232 4) in
multiples of TPCLK 4.
Real-time clock
The RTC is designed to provide a set of counters to measure time when
normal or idle operating mode is selected. The RTC has been designed to use little
power, making it suitable for battery powered systems where the CPU is not
running continuously (Idle mode).
Features
Measures the passage of time to maintain a calendar and clock.
Ultra-low power design to support battery powered systems.
Page 39
Finger print based electronic voting machine
Provides Seconds, Minutes, Hours, Day of Month, Month, Year, Day of Week,
and Day of Year.
Can use either the RTC dedicated 32 kHz oscillator input or clock derived from
the external crystal/oscillator input at XTAL1. Programmable reference clock
divider allows fine adjustment of the RTC.
Dedicated power supply pin can be connected to a battery or the main 3.3 V.
System control
Crystal oscillator
On-chip integrated oscillator operates with external crystal in range of 1
MHz to 25 MHz. The oscillator output frequency is called fosc and the ARM
Page 40
Finger print based electronic voting machine
Page 41
Finger print based electronic voting machine
initialized to predetermined values. The Wake-up Timer ensures that the oscillator
and other analog functions required for chip operation are fully functional before
the processor is allowed to execute instructions. This is important at power on, all
types of reset, and whenever any of the aforementioned functions are turned off for
any reason. Since the oscillator and other functions are turned off during Power-
down mode, any wake-up of the processor from Power-down mode makes use of
the Wake-up Timer.
The Wake-up Timer monitors the crystal oscillator as the means of checking
whether it is safe to begin code execution. When power is applied to the chip, or
some event caused the chip to exit Power-down mode, some time is required for
the oscillator to produce a signal of sufficient amplitude to drive the clock logic.
The amount of time depends on many factors, including the rate of VDD ramp (in
the case of power on), the type of crystal and its electrical characteristics (if a
quartz crystal is used), as well as any other external circuitry (e.g. capacitors), and
the characteristics of the oscillator itself under the existing ambient conditions.
Brownout detector
The LPC2141/42/44/46/48 include 2-stage monitoring of the voltage on the
VDD pins. If this voltage falls below 2.9 V, the BOD asserts an interrupt signal to
the VIC. This signal can be enabled for interrupt; if not, software can monitor the
signal by reading dedicated register. The second stage of low voltage detection
asserts reset to inactivate the LPC2141/42/44/46/48 when the voltage on the VDD
pins falls below 2.6 V. This reset prevents alteration of the flash as operation of the
various elements of the chip would otherwise become unreliable due to low
voltage. The BOD circuit maintains this reset down below 1 V, at which point the
POR circuitry maintains the overall reset. Both the 2.9 V and 2.6 V thresholds
include some hysteresis. In normal operation, this hysteresis allows the 2.9 V
Page 42
Finger print based electronic voting machine
Page 43
Finger print based electronic voting machine
Idle mode eliminates power used by the processor itself, memory systems and
related controllers, and internal buses. In Power-down mode, the oscillator is shut
down and the chip receives no internal clocks. The processor state and registers,
peripheral registers, and internal SRAM values are preserved throughout Power-
down mode and the logic levels of chip output pins remain static. The Power-down
mode can be terminated and normal operation resumed by either a reset or certain
specific interrupts that are able to function without clocks. Since all dynamic
operation of the chip is suspended, Power-down mode reduces chip power
consumption to nearly zero.
VPB bus
The VPB divider determines the relationship between the processor clock
(CCLK) and the clock used by peripheral devices (PCLK). The VPB divider serves
two purposes. The first is to provide peripherals with the desired PCLK via VPB
bus so that they can operate at the speed chosen for the ARM processor. In order to
achieve this, the VPB bus may be slowed down to 12 to 14 of the processor clock
rate. Because the VPB bus must work properly at power-up (and its timing cannot
be altered if it does not work since the VPB divider control registers reside on the
VPB bus), the default condition at reset is for the VPB bus to run at 14 of the
processor clock rate. The second purpose of the VPB divider is to allow power
savings when an application does not require any peripherals to run at the full
processor rate. Because the VPB divider is connected to the PLL output, the PLL
remains active (if it was running) during Idle mode.
Page 44
Finger print based electronic voting machine
functions are multiplexed only with GPIOs on Port 1. This means that all
communication, timer and interface peripherals residing on Port 0 are available
during the development and debugging phase as they are when the application is
run in the embedded system itself.
EmbeddedICE
Standard ARM EmbeddedICE logic provides on-chip debug support. The
debugging of the target system requires a host computer running the debugger
software and an EmbeddedICE protocol convertor. EmbeddedICE protocol
convertor converts the remote debug protocol commands to the JTAG data needed
to access the ARM core.
The ARM core has a Debug Communication Channel (DCC) function built-
in. The DCC allows a program running on the target to communicate with the host
debugger or another separate host without stopping the program flow or even
entering the debug state. The DCC is accessed as a co-processor 14 by the program
running on the ARM7TDMI-S core. The DCC allows the JTAG port to be used for
sending and receiving data without affecting the normal program flow. The DCC
data and control registers are mapped in to addresses in the EmbeddedICE logic.
Real Monitor
Real Monitor is a configurable software module, developed by ARM Inc.,
which enables real-time debug. It is a lightweight debug monitor that runs in the
background while users debug their foreground application. It communicates with
the host using the DCC, which is present in the Embedded ICE logic. The
Page 45
Finger print based electronic voting machine
UARTs
The LPC2141/42/44/46/48 each contain two UARTs. In addition to standard
transmit and receive data lines, the LPC2144/46/48 UART1 also provide a full
modem control handshake interface. Compared to previous LPC2000
microcontrollers, UARTs in LPC2141/42/44/46/48 introduce a fractional baud rate
generator for both UARTs, enabling these microcontrollers to achieve standard
baud rates such as 115200 with any crystal frequency above 2 MHz In addition,
auto-CTS/RTS flow-control functions are fully implemented in hardware (UART1
in LPC2144/46/48 only).
Features
16 byte Receive and Transmit FIFOs.
Register locations conform to 550 industry standard.
Receiver FIFO trigger points at 1, 4, 8, and 14 bytes
Built-in fractional baud rate generator covering wide range of baud rates without
a need for external crystals of particular values.
Transmission FIFO control enables implementation of software (XON/XOFF)
flow control on both UARTs.
LPC2144/46/48 UART1 equipped with standard modem interface signals. This
module also provides full support for hardware flow control (auto-CTS/RTS).
Page 46
Finger print based electronic voting machine
Register description
UART0 contains registers organized as shown in Table 4.4. The Divisor
Latch Access Bit (DLAB) is contained in U0LCR[7] and enables access to the
Divisor Latches.
Page 47
Finger print based electronic voting machine
Page 48
Finger print based electronic voting machine
Page 49
Finger print based electronic voting machine
Page 50
Finger print based electronic voting machine
Page 51
Finger print based electronic voting machine
and how to clear the active interrupt. The U0IIR must be read in order to clear the
interrupt prior to exiting the Interrupt Service Routine. The UART0 RLS interrupt
(U0IIR[3:1] = 011) is the highest priority interrupt and is set whenever any one of
four error conditions occur on the UART0 Rx input: overrun error (OE), parity
error (PE), framing error (FE) and break interrupt (BI). The UART0 Rx error
condition that set the interrupt can be observed via U0LSR[4:1]. The interrupt is
cleared upon an U0LSR read. The UART0 RDA interrupt (U0IIR[3:1] = 010)
shares the second level priority with the CTI interrupt (U0IIR[3:1] = 110).
The RDA is activated when the UART0 Rx FIFO reaches the trigger level
defined in U0FCR[7:6] and is reset when the UART0 Rx FIFO depth falls below
the trigger level. When the RDA interrupt goes active, the CPU can read a block of
data defined by the trigger level. The CTI interrupt (U0IIR[3:1] = 110) is a second
level interrupt and is set when the UART0 Rx FIFO contains at least one character
and no UART0 Rx FIFO activity has occurred in 3.5 to 4.5 character times. Any
UART0 Rx FIFO activity (read or write of UART0 RSR) will clear the interrupt.
This interrupt is intended to flush the UART0 RBR after a message has been
received that is not a multiple of the trigger level size. For example, if a peripheral
wished to send a 105 character message and the trigger level was 10 characters, the
CPU would receive 10 RDA interrupts resulting in the transfer of 100 characters
and 1 to 5 CTI interrupts (depending on the service routine) resulting in the
transfer of the remaining 5 characters.
Page 52
Finger print based electronic voting machine
The UART0 THRE interrupt (U0IIR[3:1] = 001) is a third level interrupt and
is activated when the UART0 THR FIFO is empty provided certain initialization
conditions have been met. These initialization conditions are intended to give the
UART0 THR FIFO a chance to fill up with data to eliminate many THRE
interrupts from occurring at system start-up. The initialization conditions
implement a one character delay minus the stop bit whenever THRE=1 and there
have not been at least two characters in the U0THR at one time since the last
THRE = 1 event. This delay is provided to give the CPU time to write data to
U0THR without a THRE interrupt to decode and service. A THRE interrupt is set
immediately if the UART0 THR FIFO has held two or more characters at one time
and currently, the U0THR is empty. The THRE interrupt is reset when a U0THR
write occurs or a read of the U0IIR occurs and the THRE is the highest interrupt
(U0IIR[3:1] = 001).
Page 53
Finger print based electronic voting machine
Architecture
The architecture of the UART0 is shown below in the block diagram 4.3.
The VPB interface provides a communications link between the CPU or host and
the UART0. The UART0 receiver block, U0RX, monitors the serial input line,
RXD0, for valid input. The UART0 RX Shift Register (U0RSR) accepts valid
characters via RXD0. After a valid character is assembled in the U0RSR, it is
passed to the UART0 RX Buffer Register FIFO to await access by the CPU or host
via the generic host interface. The UART0 transmitter block, U0TX, accepts data
written by the CPU or host and buffers the data in the UART0 TX Holding
Register FIFO (U0THR). The UART0 TX Shift Register (U0TSR) reads the data
stored in the U0THR and assembles the data to transmit via the serial output pin,
TXD0. The UART0 Baud Rate Generator block, U0BRG, generates the timing
enables used by the UART0 TX block. The U0BRG clock input source is the VPB
clock (PCLK). The main clock is divided down per the divisor specified in the
Page 54
Finger print based electronic voting machine
U0DLL and U0DLM registers. This divided down clock is a 16x oversample
clock, NBAUDOUT. The interrupt interface contains registers U0IER and U0IIR.
The interrupt interface receives several one clock wide enables from the U0TX and
U0RX blocks. Status information from the U0TX and U0RX is stored in the
U0LSR. Control information for the U0TX and U0RX is stored in the U0LCR.
Page 55
Finger print based electronic voting machine
The following table 5.1 gives the specifications of finger print module R303a
Page 56
Finger print based electronic voting machine
Page 57
Finger print based electronic voting machine
(PC) be in RS-232 mode, please add level converting circuit, like MAX232,
between the Module and PC. Serial communication protocol The mode is semi
duplex asynchronies serial communication. And the default baud rate is 57600bps.
User may set the baud rate in 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.
Reset time
At power on, it takes about 500ms for initialization. During this period, the
Module cant accept commands for upper computer. Electrical parameter (All
electrical level takes GND as reference)
Power supply
The logic levels and their corresponding voltage levels are given in the table
5.3 below
Page 58
Finger print based electronic voting machine
IV System Resources
To address demands of different customer, Module system provides
abundant resources at users use.
Notepad
The system sets aside a 512-bytes memory (16 pages* 32 bytes) for users
notepad, where data requiring power-off protection can be stored. The host can
access the page by instructions of PS_WriteNotepad and PS_Read Notepad.
Note: when write on one page of the pad, the entire 32 bytes will be written
in wholly covering the original contents.
Buffer
There are an image buffer and two 512-byte-character-file buffer within the
RAM space of the module. Users can read & write any of the buffers by
instructions.
Note: Contents of the above buffers will be lost at power-off.
Page 59
Finger print based electronic voting machine
Image buffer
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 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. Thats 8-bit BMP
format. When transferring through USB, the image is 8-bit pixel, thats 256 grey
degrees.
Character file buffer
Character file buffer, CharBuffer1, CharBuffer2, can be used to store both
character file and template file.
Page 60
Finger print based electronic voting machine
Note:
Busy1 bit. 1: system is executing commands; 0: system is free;
Pass1 bit. 1: find the matching finger; 0: wrong finger;
PWD1 bit. 1: Verified devices handshaking password.
ImgBufStat1 bit. 1: image buffer contains valid image.
Page 61
Finger print based electronic voting machine
Module password
At power-on reset, system first checks whether the handshaking password
has been modified. If not, system deems upper computer has no requirement of
verifying password and will enter into normal operation mode. Thats, when
Module password remains the default, verifying process can be jumped. The
password length is 4 bytes, and its default factory value is 0FFH, 0FFH, 0FFH,
0FFH. Should the password have be modified, refer to instruction SetPwd, then
Module (or device) handshaking password must be verified before the system enter
into normal operation mode. Or else, system will refuse to execute and command.
The new modified password is stored in Flash and remains at power off.
Module address:
Each module has an identifying address. When communicating with upper
computer, each instruction/data is transferred in data package form, which contains
the address item. Module system only responds to data package whose address
item value is the same with its identifying address. The address length is 4 bytes,
and its default factory value is 0xFFFFFFFF. User may modify the address via
instruction SetAdder. The new modified address remains at power off.
Random number generator Module integrates a hardware 32-bit random
number generator (RNG) (without seed). Via instruction GetRandomCode, system
will generate a random number and upload it.
Communication Protocol
The protocol defines the data exchanging format when ZFM-20 series
communicates with upper computer. The protocol and instruction sets apples for
both UART and USB communication mode. For PC, USB interface is strongly
recommended to improve the exchanging speed, especially in fingerprint scanning
device.
Page 62
Finger print based electronic voting machine
The new modified password is stored in Flash and remains at power off.
Module address
Each module has an identifying address. When communicating with upper
computer, each instruction/data is transferred in data package form, which contains
the address item. Module system only responds to data package whose address
item value is the same with its identifying address. The address length is 4 bytes,
and its default factory value is 0xFFFFFFFF. User may modify the address via
instruction SetAdder. The new modified address remains at power off. Random
Page 63
Finger print based electronic voting machine
Page 64
Finger print based electronic voting machine
state. The reasons for this are: vibrations, slight rough spots and dirt. Anyway, this
whole process does not last long (a few micro- or milliseconds), but long enough to
be registered by the microcontroller. Concerning the pulse counter, error occurs in
almost 100% of cases.
Page 65
Finger print based electronic voting machine
free of charge, effects of disturbances are eliminated and it can be adjusted to the
worst-quality contacts.
These components are specialized for being used with the microcontrollers,
which means that they cannot be activated by standard IC circuits. They are used
for writing different messages on a miniature LCD.
Page 66
Finger print based electronic voting machine
Pins Functions
There are pins along one side of the small printed board used for connection
to the microcontroller. There are total of 14 pins marked with numbers (16 in case
the background light is built in). Their function is described in the table 6.1 below:
Pin Logic
Function Name Description
Number State
Ground 1 Vss - 0V
Power supply 2 Vdd - +5V
Contrast 3 Vee - 0 Vdd
Control of D0 D7 are interpreted as
operating 0 commands
4 RS
1 D0 D7 are interpreted as
data
5 R/W 0 Write data (from controller
1 to LCD)
Read data (from LCD to
controller)
Page 67
Finger print based electronic voting machine
Page 68
Finger print based electronic voting machine
Execution
Command RS RW D7 D6 D5 D4 D3 D2 D1 D0
Time
Clear display 0 0 0 0 0 0 0 0 0 1 1.64mS
Cursor home 0 0 0 0 0 0 0 0 1 x 1.64mS
Entry mode set 0 0 0 0 0 0 0 1 I/D S 40uS
Display on/off control 0 0 0 0 0 0 1 D U B 40uS
Cursor/Display Shift 0 0 0 0 0 1 D/C R/L X x 40uS
Page 69
Finger print based electronic voting machine
Page 70
Finger print based electronic voting machine
line
F 1 Character
format 5x10
dots
0 Character
format 5x7
dots
D/C 1 Display shift
0 Cursor shift
LCD Connection
Depending on how many lines are used for connection to the
microcontroller, there are 8-bit and 4-bit LCD modes. The appropriate mode is
determined at the beginning of the process in a phase called initialization. In the
first case, the data are transferred through outputs D0-D7 as it has been already
explained. In case of 4-bit LED mode, for the sake of saving valuable I/O pins of
the microcontroller, there are only 4 higher bits (D4-D7) used for communication,
while other may be left unconnected.
Consequently, each data is sent to LCD in two steps: four higher bits are sent
first (that normally would be sent through lines D4-D7), four lower bits are sent
afterwards. With the help of initialization, LCD will correctly connect and interpret
each data received. Besides, with regards to the fact that data are rarely read from
LCD (data mainly are transferred from microcontroller to LCD) one more I/O pin
may be saved by simple connecting R/W pin to the Ground. Even though message
Page 71
Finger print based electronic voting machine
displaying will be normally performed, it will not be possible to read from busy
flag since it is not possible to read from display.
LCD Initialization
Once the power supply is turned on, LCD is automatically cleared. This
process lasts for approximately 15mS. After that, display is ready to operate. The
mode of operating is set by default. This means that:
1. Display is cleared
2. Mode
DL = 1 Communication through 8-bit interface
N = 0 Messages are displayed in one line
F = 0 Character font 5 x 8 dots
3. Display/Cursor on/off
D = 0 Display off
U = 0 Cursor off
B = 0 Cursor blink off
4. Character entry
ID = 1 Addresses on display are automatically incremented by 1
S = 0 Display shift off
Automatic reset is mainly performed without any problems. If for any reason
power supply voltage does not reach full value in the course of 10mS, display will
start perform completely unpredictably. If voltage supply unit can not meet this
condition or if it is needed to provide completely safe operating, the process of
initialization by which a new reset enabling display to operate normally must be
applied.
Page 72
Finger print based electronic voting machine
Contrast Control:
To have a clear view of the characters on the LCD, contrast should be
adjusted. To adjust the contrast, the voltage should be varied. For this, a preset is
used which can behave like a variable voltage device. As the voltage of this preset
is varied, the contrast of the LCD can be adjusted.
Page 73
Finger print based electronic voting machine
Potentiometer
Variable resistors used as potentiometers have all three terminals
connected. This arrangement is normally used to vary voltage, for example to set
the switching point of a circuit with a sensor, or control the volume (loudness) in
an amplifier circuit. If the terminals at the ends of the track are connected across
the power supply, then the wiper terminal will provide a voltage which can be
varied from zero up to the maximum of the supply.
LCD interface with the microcontroller (4-bit mode):
Chapter 7
Firmware Implementation of the project design
Page 74
Finger print based electronic voting machine
KEIL ARM Is Used For The Development Of Finger Print Based Electronic Voting
Machine
7.1.Vision3 Overview
Page 75
Finger print based electronic voting machine
Advanced GDI interface for software debugging in the target hardware and
for connection to Keil ULINK,
The Vision3 IDE offers numerous features and advantages that help you
quickly and successfully develop embedded applications. They are easy to use and
are guaranteed to help you achieve your design goals.
The Vision3 IDE and Debugger is the central part of the Keil development
tool chain. Vision3 offers a Build Mode and a Debug Mode.In the Vision3 Build
Mode you maintain the project files and generate the application.
In the Vision3 Debug Mode you verify your program either with a powerful CPU
and peripheral simulator or with the Keil ULINK USB-JTAG Adapter (or other
AGDI drivers) that connect the debugger to the target system. The ULINK allows
you also to download your application into Flash ROM of your target system.
Feature Benefit
The Vision3 Simulator is the only Write and test application code before
debugger that completely simulates production hardware is available. Investigate
all on-chip peripherals. different hardware configurations to optimize
Page 76
Finger print based electronic voting machine
The Vision3 IDE integrates Quickly access development tools and third-
additional third-party tools like VCS, party tools. All configuration details are
CASE, and FLASH/Device saved in the Vision3 project.
Programming.
The ULINK USB-JTAG Adapter The same tool can be used for debugging and
supports both Debugging and Flash programming. No extra configuration time
programming with configurable required.
algorithm files.
Interface
The menu bar provides menus for editor operations, project maintenance,
development tool option settings, program debugging, external tool control,
window selection and manipulation, and on-line help.
The following sections list the Vision3 commands that can be reached by menu
commands, toolbar buttons, and keyboard shortcuts. The Vision3 commands are
grouped mainly based on the appearance in the menu bar:
Outlining Menu
Advanced Menu
Page 78
Finger print based electronic voting machine
View Menu
Flash Menu
Peripherals Menu
Tools Menu
SVCS Menu
Window Menu
Help Menu
7.2.Creating Applications
This chapter describes the Build Mode of Vision3 and is grouped into the
following sections:
Project Target and File Groups: shows how to create application variants and
organized the files that belong to a project.
Tips and Tricks: provides information about the advanced features of the
Vision3 Project Manager.
Page 79
Finger print based electronic voting machine
This chapter uses the ARM as target architecture and only explains generic
features of the Vision3 IDE. Architecture specific information (like bank
switching for 8051) can be found in the Getting Started User's Guide of the
related toolchain.
Debugging
This chapter describes the Debug Mode of Vision3 and shows you how to
use the user interface to test a sample program. Also discussed are simulation mode
and the different options available for program debugging.
You can use Vision3 Debugger to test the applications you develop. The
Vision3 Debugger offers two operating modes that are selected in the Options for
Target Debug dialog.
Use Advanced GDI drivers, like the ULINK Debugger to interface to your
target hardware. For Vision3 various drivers are available that interface to:
Page 80
Finger print based electronic voting machine
The Status Bar shows the current active debugging tool. In simulation mode,
timing statistics are provided.
Simulation
The Vision3 simulator simulates the timing and logical behavior of serial
communication protocols like UART, IC, SPI, and CAN. But Vision3 does not
simulate the I/O port toggling of the physical communication pins on the I/O port.
Page 81
Finger print based electronic voting machine
registers that are listed with the DIR VTREG command. This has the benefit that
you can easily write debug functions that stimulate complex peripherals.
The chapter contains several Signal function temples that you may use to
simulate:
Digital Input
Push Button
Interrupt Signal
Impulse Patterns
Analog Input
Sine Wave
Noise Signal
Signal Combination
UART Communication
CAN Communication
IC Communication
SPI Communication
Page 82
Finger print based electronic voting machine
You may use external command-line driven utilities (usually provided by the chip
vendor) or the Keil ULINK USB-JTAG Adapter. The Flash Programming Utilities
are configured under
Flash Programming may be started from the Flash Menu or before starting the
Vision3 Debugger when you enable Project Options Utilities Update
Target before Debugging.
Configure Flash Menu: configures the Flash Menu for using an external
command-line based utility or the Keil ULINK USB-JTAG Adapter.
HEX File Flash Download: explains how to program existing HEX files.
Page 83
Finger print based electronic voting machine
Page 84
Finger print based electronic voting machine
Page 85
Finger print based electronic voting machine
#include <lpc214x.h>
#include "serial.h"
#include"lcd.h"
unsignedchar
enroll[12]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X03,0X01,0X00,0
X05};
unsignedchar
generate_ch[13]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X04,0x02,0X
01,0X00,0X08};
unsignedchar
store[11]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X06,0X06,0X01};
unsignedchar
identify[12]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X03,0X11,0X00,
0X15};
unsigned char
b1=0,b2=0,i1=0,i2=0,id=0,id1=0,id2=0,cnt=0,eeprom_add=0,aa,n=0;
void clearfp(void);
Page 86
Finger print based electronic voting machine
unsignedchar
part_A=0,part_B=0,part_C=0,part_D=0,check=0,count=0,enroll_check=0,en_byte;
/*-------------------------------------------------------------------------
main program
--------------------------------------------------------------------------*/
int main (void )
{
lcd_init();
again:
lcd_cmd(0x01,0);
delay(1000);
message(0," welcome ");
//lcd_cmd(0x01,0);
lcd_cmd(0xc0,0);
message(0,"EVM with FP");
delay(1000);
i=0;
while(1)
{
/******* Enrolling your ID *********************/
Page 87
Finger print based electronic voting machine
Page 88
Finger print based electronic voting machine
message(0,"Enrolling ok");
}
else
{
lcd_cmd(0x01,0);
message(0,"Enrolling not ok");
goto again;
}
i=0;
while(i<13)
{
send_ch_UART0(generate_ch[i]);
i++;
}
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
Page 89
Finger print based electronic voting machine
dummy=UART1_getch();
dummy=UART1_getch();
if(!rec)
{
lcd_cmd(0x01,0);
message(0,"gen char ok");
}
else
{
lcd_cmd(0x01,0);
message(0,"genchar not ok");
goto again;
}
i=0;
while(i<11)
{
send_ch_UART0(store[i]);
i++;
}
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
Page 90
Finger print based electronic voting machine
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
rec=UART1_getch();
dummy=UART1_getch();
dummy=UART1_getch();
if(!rec)
{
lcd_cmd(0x01,0);
message(0,"store ok");
}
else
{
lcd_cmd(0x01,0);
message(0,"store not ok");
goto again;
}
//check=1;
//enroll_check =0;
//en_byte=12;
}
Page 91
Finger print based electronic voting machine
message(0,"Identfying...");
i=0;
while(i<12)
{
send_ch_UART0(identify[i]);
i++;
}
check=1;
enroll_check =1;
en_byte=16;
}
Page 92
Finger print based electronic voting machine
message(1,"A B C D");
lcd_cmd(0xc0,0);
convert(part_A);
lcd_cmd(0xc4,0);
convert(part_B);
lcd_cmd(0xc7,0);
convert(part_C);
lcd_cmd(0xcc,0);
convert(part_D);
long_delay();
long_delay();
part_A=part_B=part_C=part_D=0;
goto again;
if(check==1)
{
count=0;
check=0;
while(count<en_byte)
{
fp[count]=UART0_getch();
Page 93
Finger print based electronic voting machine
count++;
}
long_delay();
n=0;
while(n<20)
{
if((fp[n]==0xEF)&&(fp[n+1]==0x01)&&(fp[n+9]==0x00))
{
lcd_cmd(0x01,0);
lcd_cmd(0x80,0);
message(1," Successfully ");
lcd_cmd(0xc0,0);
message(0xc0," completed");
b1=0; b2=0; i1=0; i2=0; id=0;
b1=fp[n+11]/10;
b2=fp[n+11]%10;
long_delay();
long_delay();
long_delay();
// lcd_cmd(0xc0,0);
// message(0xc0,"Id:");
// lcd_cmd(0xC3,0);
// lcd_cmd(b1+0x30,1);
Page 94
Finger print based electronic voting machine
// lcd_cmd(b2+0x30,1);
i1=b1-48;
i1=i1*10;
i2=b2-48;
i2=i2*1;
id=i1+i2;
long_delay();
if(enroll_check ==1)
{
lcd_cmd(0x01,0);
message(1," Plz poll ur vote ");
// clearfp();
enroll_check=0;
goto poll;
}
goto again;
}
else
{
lcd_cmd(0x01,0);
message(1," Failed");
long_delay();
goto again;
}
Page 95
Finger print based electronic voting machine
}
}
}
/*-----------------------------------------------------
polling your vote
----------------------------------------------------*/
poll:
while(1)
{
if((IOPIN0&sw1)==0) //sw1
{
part_A++;
lcd_cmd(0x01,0);
message(1,"Vote for part A");
long_delay();
goto again;
}
if((IOPIN0&sw2)==0) //sw2
{
part_B++;
lcd_cmd(0x01,0);
message(1,"Vote for part B");
long_delay();
Page 96
Finger print based electronic voting machine
goto again;
// goto again;
}
if((IOPIN0&sw3)==0) //sw3
{
part_C++;
lcd_cmd(0x01,0);
message(1,"Vote for part C");
long_delay();
goto again;
// goto again;
}
if((IOPIN0&sw4)==0) //sw4
{
part_D++;
lcd_cmd(0x01,0);
message(1,"Vote for part D");
long_delay();
goto again;
// goto again;
}
}
}
/*------------------------------------------------
Page 97
Finger print based electronic voting machine
void clearfp(void)
{
unsigned char cl=0;
while(cl<20)
{
fp[cl]=' ';
cl++;
}
j=0;
}
/*---------------------------------------------------------------------------------------
;convertion program Binary to ASCii ;
--------------------------------------------------------------------------------------*/
{
unsigned char value,d1,d2,d3,k=0;
temp_value = temp_value;
value=temp_value/10;
d3=temp_value%10;
d1=value/10;
d2=value%10;
Page 98
Finger print based electronic voting machine
d1=d1+30;
// lcddata(d1);
delay(10);
d2=d2+30;
lcd_cmd(d2,1);
delay(4);
k++;
// msgdisplay(".");
d3=d3+0x30;
lcd_cmd(d3,1);
delay(10);
k=0;
}
/*---------------------------------------------------------------------------------
; long delay ;
----------------------------------------------------------------------------------*/
void long_delay (void )
{
unsigned int g;
for(g=0;g<500;g++)
delay(40000);
}
Chapter 8
Page 99
Finger print based electronic voting machine
In total, the complete system (including all the hardware components and
software routines) is working as per the initial specifications and requirements of
our project. Because of the creative nature of the design, and due to lack of time,
some features could not be fine-tuned and are not working properly. So certain
aspects of the system can be modified as operational experience is gained with it.
As the users work with the system, they develop various new ideas for the
development and enhancement of the project
Page 100
Finger print based electronic voting machine
8.2 Conclusion
The implementation of Finger print based voting machine using
microcontroller is done successfully. The communication is properly done without
any interference between different modules in the design. Design is done to meet
all the specifications and requirements. Software tools like Keil Uvision Simulator,
Flash Magic to dump the source code into the microcontroller, Orcad Lite for the
schematic diagram have been used to develop the software code before realizing
the hardware.
The performance of the system is more efficient. Reading the Data and
verifying the information with the already stored data and perform the specified
task is the main job of the microcontroller. The mechanism is controlled by the
microcontroller.
Page 101
Finger print based electronic voting machine
Page 102
Finger print based electronic voting machine
CHAPTER 9
FUTURE SCOPE
Number of candidates could be increased.
It could be interfaced with printer to get the hard copy of the result almost
instantly from the machine itself.
It could also be interfaced with the personal computer and result could be stored
in the central server and its backup could be taken on the other backend
servers.
Again, once the result is on the server it could be relayed on the network to
various offices of the election conducting authority. Thus our project could
make the result available any corner of the world in a matter of seconds
Page 103
Finger print based electronic voting machine
CHAPTER 10
REFERENCES
1. http://www.aimglobal.org/technologies/rfid/what_is_rfid.asp
2. http://www.rfidjournal.com/faq
3. http://www.technovelgy.com/ct/Technology-Article.asp
4. http://www.perada.eu/documents/articles-perspectives/an-introduction-to-
rfid-technology.pdf
5. http://csrc.nist.gov/publications/nistpubs/800-98/SP800-98_RFID-2007.pdf
6. www.ieee.org
7. http://www.zntu.edu.ua/base/lection/rpf/lib/zhzh03/8051_tutorial.pdf
8. http://www.taltech.com/TALtech_web/resources/intro-sc.html
9. http://focus.ti.com/lit/ds/symlink/max232.pdf
10.http://www.kmitl.ac.th/~kswichit/89prog/index.html
11.http://www.microdigitaled.com/8051/Software/keil_tutorial.pdf
Page 104