Sei sulla pagina 1di 45

RFID BASED ELECTRONIC VOTING MACHINE

Chapter 1
INTRODUCTION

This project examines policy regarding the electronic approaches and developments
towards electronic data storage and transmission. RFID devices for Voting machines and other
existing identity documents are discussed and implemented in this project.

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 RFID 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 RFID. This RFID 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.

1.1 Objective of the project


The project demands the user to submit his RFID at the polling booth. The project uses
the RFID 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 RFID as an identity proof. The
system reads the data from the RFID 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.

1
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 RFID reader, microcontroller, the interfacing unit to allow the
communication between the microcontroller and RFID module, and the LCD.

1.2 Background of the Project


The software application and the hardware implementation help the microcontroller read
the data from the RFID verify the data with the already stored data and take the next action. The
system is totally designed using RFID module and embedded systems technology.
The Controlling unit has an application program to allow the microcontroller interface
with the RFID module, the reader reads the data from the tag, passes the data to the
microcontroller and the controller verifies this data with the already existing data in the
controller’s memory and then implement the commands directed by the controller section. The
performance of the design is maintained by controlling unit.

2
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
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.

Chapter 3
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.
3.1 Project Design
The implementation of the project design can be divided in two parts.
 Hardware implementation
 Firmware implementation

Hardware implementation deals in drawing the schematic on the plane paper according to
the application, testing the schematic design over the breadboard using the various IC’s to find if
the design meets the objective, carrying out the PCB layout of the schematic tested on
breadboard, finally preparing the board and testing the designed hardware.

The firmware part deals in programming the microcontroller so that it can control the
operation of the IC’s used in the implementation. In the present work, we have used the Orcad
design software for PCB circuit design, the Keil µv3 software development tool to write and
compile the source code, which has been written in the C language. The Flash maic programmer
has been used to write this compile code into the microcontroller. The firmware implementation
is explained in the next chapter.
The project design and principle are explained in this chapter using the block diagram
and circuit diagram. The block diagram discusses about the required components of the design
and working condition is explained using circuit diagram and system wiring diagram.

4
3.2 Block Diagram of the Project and its Description
The block diagram of the project is as shown in the figure 3.1

Power
Supply
RFID
Module

16 X 2 LCD

MAX 232 ARM 7TDMI


EEPROM
LPC2148

Crystal
Oscillator Switches

Fig 3.1 : block diagram


Brief explanation of functioning of each block of the system is given below the detailed
is given in next chapters
3.2 Power Supply:
The input to the circuit is applied from the regulated power supply. The a.c. input i.e.,
230V from the mains supply is step down by the transformer to 12V and is fed to a rectifier. The
output obtained from the rectifier is a pulsating d.c voltage. So in order to get a pure d.c voltage,
the output voltage from the rectifier is fed to a filter to remove any a.c components present even
after rectification. Now, this voltage is given to a voltage regulator to obtain a pure constant dc
voltage. The block diagram of regulated power supply is shown in the figure 3.2

5
Fig 3.2 components of power supply
Transformer:
Usually, DC voltages are required to operate various electronic equipment and these
voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the a.c input
available at the mains supply i.e., 230V is to be brought down to the required voltage level. This
is done by a transformer. Thus, a step down transformer is employed to decrease the voltage to a
required level.
Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into pulsating D.C.
The rectifier may be a half wave or a full wave rectifier. In this project, a bridge rectifier is used
because of its merits like good stability and full wave rectification.

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

6
voltage regulators are to be used. The first number 78 represents positive supply and the numbers
05, 12 represent the required output voltage levels

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 RFID module. It receives
input commands from switches and control RFID 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.
RFID Module :
RFID – Radio Frequency Identification is a technology for tagging using radio waves. A
RFID tag is a small electronic device, supplemented with an antenna that can transmit and
receive data. The RFID technology is designed for unique identification of different kinds of
objects.
RFID systems usually contain three parts:

1. Tag – a microchip that can send and receive data (messages).


2. Verifier – interfacing with the Tag, the Verifier can read/write data and sends messages to
access the Tags data.
3. Data base – a small amount of memory that uses as a data base that can be changed.
Limitations of RFID systems
Limits of RFID systems are very important. These systems were designed to be low cost
in order to enable mass production. Broadcast range is limited to a few meters, therefore the Tag
and the Verifier must be sufficiently close Due to their small size the RFID systems have a
limited computational power, and limited memory.
Hence, we can conclude that a "heavy" encryption algorithm can not be used by RFID systems.
There for we need a simple, low cost encryption protocol that is based on hardware efficiency
that will be embedded in the RFID existing systems.

7
LCD display and Switches:
Switches here function as inputs that gives command to the controller what to do and
LCD display as output that directs the users how to use the module and also to display the final
results.

The firmware programmed in LPC2148 is designed to communicate with RFID and


operates according the commands received from the Switches. Therefore, after Receiving the
Data from RFID and processing and validating, It takes the data from switches and comparing
with the data base and updating the data base and display the command and display the result
with respect to the switch operations.

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.

3.3.System wiring diagram and working procedure:


Wiring diagram of the project is as shown in the figure 3.3 below

8
Fig 3.3: wiring diagram
Working procedure:
Voting machine using RFID is basically an embedded system that makes the things easy
in the polling booths during the time of elections. The project RFID technology and Embedded
systems to implement the application.

9
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 RFID 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
RFID. The RFID module reads the data present.

The working of our EVM an be explained in three modes


1.Enrolling mode
2.Identification and vote casting mode
3. Results
When the power of Ballot unit is turned on, the ballot unit awaits a “READY SIGNAL”
from controller. After getting “READY SIGNAL”, ballot unit displays its “welcome to EVM”
message on LCD indicating that the machine is ready and waits for user input. The mode of operation
depends on command given by the user from the switches.
Enrolling Mode
If enrolling mode command is given, the controller waits for input and activates the
scanner to accept the RFID, displaying “Enrolling…”on the LCD display . The candidate’s RFID
is scanned and generates a unique characters code. During the character code generation,
“GENRATING CHARACTER CODE…” is displayed on LCD. This unique code is stored in the
EEPROM memory of the controller for the future reference. After all enrollments the system is
ready for vote cast.
Identification and vote casting mode

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 RFIDs 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.
10
RESULTS MODE
The contestant name and the secured votes will be displayed on the LCD when the
controller receives results instruction through the switches.

Chapter 4
Microcontroller

11
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.

The key features of microcontrollers include:

 High Integration of Functionality


 Microcontrollers sometimes are called single-chip computers because they have on-chip
memory and I/O circuitry and other circuitries that enable them to function as small
standalone computers without other supporting circuitry.

 Field Programmability, Flexibility

 Microcontrollers often use EEPROM or EPROM as their storage device to allow field
programmability so they are flexible to use. Once the program is tested to be correct then
large quantities of microcontrollers can be programmed to be used in embedded systems.

 Easy to Use

Assembly language is often used in microcontrollers and since they usually follow RISC
architecture, the instruction set is small. The development package of microcontrollers often
includes an assembler, a simulator, a programmer to "burn" the chip and a demonstration
board. Some packages include a high level language compiler such as a C compiler and more
sophisticated libraries.

Most microcontrollers will also combine other devices such as:

 A Timer module to allow the microcontroller to perform tasks for certain time periods.
 A serial I/O port to allow data to flow between the microcontroller and other devices such
as a PC or another microcontroller.

 An ADC to allow the microcontroller to accept analogue input data for processing.
12
Figure 4.1 a typical microcontroller device and its different subunits

The heart of the microcontroller is the CPU core. In the past this has traditionally been
based on an 8-bit microprocessor unit. Figure 4.1 above Shows a typical microcontroller device
and its different subunits

4.2. Microcontrollers versus Microprocessors

Microcontroller differs from a microprocessor in many ways. First and the most
important is its functionality. In order for a microprocessor to be used, other components such as
memory, or components for receiving and sending data must be added to it. In short that means
that microprocessor is the very heart of the computer. On the other hand, microcontroller is
designed to be all of that in one. No other external components are needed for its application
because all necessary peripherals are already built into it. Thus, we save the time and space
needed to construct devices.

4.3 LPC214x

13
The LPC2141/42/44/46/48 microcontrollers are based on a 16-bit/32-bit ARM7TDMI-S
CPU with real-time emulation and embedded trace support, that combine microcontroller with
embedded high speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide memory
interface and a unique accelerator architecture enable 32-bit code execution at the maximum
clock rate. For critical code size applications, the alternative 16-bit Thumb mode reduces code by
more than 30 % with minimal performance penalty. Due to their tiny size and low power
consumption, LPC2141/42/44/46/48 are ideal for applications where miniaturization is a key
requirement, such as access control and point-of-sale. Serial communications interfaces ranging
from a USB 2.0 Full-speed device, multiple UARTs, SPI, SSP to I2C-bus and on-chip SRAM of
8 kB up to 40 kB, make these devices very well suited for communication gateways and protocol
converters, soft modems, voice recognition and low end imaging, providing both large buffer
size and high processing power. Various 32-bit timers, single or dual 10-bit ADC(s), 10-bit DAC,
PWM channels and 45 fast GPIO lines with up to nine edge or level sensitive external interrupt
pins make these microcontrollers suitable for industrial control and medical systems

4.3.1Key features

 16-bit/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.


 8 kB to 40 kB of on-chip static RAM and 32 kB to 512 kB of on-chip flash memory.
 128-bit wide interface/accelerator enables high-speed 60 MHz operation.
 In-System Programming/In-Application Programming (ISP/IAP) via on-chip boot loader
software. Single flash sector or full chip erase in 400 ms and programming of 256 bytes
in 1 ms.
 Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the
on-chip Real Monitor software and high-speed tracing of instruction execution.
 USB 2.0 Full-speed compliant device controller with 2 KB of endpoint RAM. In
addition, the LPC2146/48 provides 8 kB of on-chip RAM accessible to USB by DMA.
 One or two (LPC2141/42 vs. LPC2144/46/48) 10-bit ADCs provide a total of 6/14 analog
inputs, with conversion times as low as 2.44 μs per channel.
 Single 10-bit DAC provides variable analog output (LPC2142/44/46/48 only).
 Two 32-bit timers/external event counters (with four capture and four compare channels
each), PWM unit (six outputs) and watchdog.
14
 Low power Real-Time Clock (RTC) with independent power and 32 kHz clock input
Multiple serial interfaces including two UARTs (16C550), two 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.

15
The block diagram of LPC2148 is shown in figure 4.2 below

Fig : 4.2Block diagram


1) Pins shared with GPIO
2) LPC2144/46/48 only
3) USB DMA controller with 8KBof Ram accessible as general purpose RAmand/or DMA
available in LPC2146/48 only.
4) LPC21422/44/46/48 only

The pin description of the controller is shown in the figure 4.3

16
Fig 4.2: pin diagram

17
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 processor clock frequency is referred
to as CCLK for purposes of rate equations, etc. fosc and CCLK are the same value unless the
PLL is running and connected.
PLL
The PLL accepts an input clock frequency in the range of 10 MHz to 25 MHz. The input
frequency is multiplied up into the range of 10 MHz to 60 MHz with a Current Controlled
Oscillator (CCO). The multiplier can be an integer value from 1 to 32 (in practice, the multiplier
value cannot be higher than 6 on this family of microcontrollers due to the upper frequency limit
of the CPU). The CCO operates in the range of 156 MHz to 320 MHz, so there is an additional
divider in the loop to keep the CCO within its frequency range while the PLL is providing the
desired output frequency. The output divider may be set to divide by 2, 4, 8, or 16 to produce the
output clock. Since the minimum output divider value is 2, it is insured that the PLL output has a
50 % duty cycle. The PLL is turned off and bypassed following a chip reset and may be enabled
by software. The program must configure and activate the PLL, wait for the PLL to Lock, then
connect to the PLL as a clock source. The PLL settling time is 100 μs.
Reset and wake-up timer
Reset has two sources on the LPC2141/42/44/46/48: the RESET pin and watchdog reset.
The RESET pin is a Schmitt trigger input pin with an additional glitch filter. Assertion of chip
reset by any source starts the Wake-up Timer (see Wake-up Timer description below), causing
the internal chip reset to remain asserted until the external reset is de-asserted, the oscillator is
running, a fixed number of clocks have passed, and the on-chip flash controller has completed its
initialization. When the internal reset is removed, the processor begins executing at address 0,
which is the reset vector. At that point, all of the processor and peripheral registers have been
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.
18
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 detection to reliably interrupt, or a regularly-
executed event loop to sense the condition.
Code security
This feature of the LPC2141/42/44/46/48 allow an application to control whether it can
be debugged or protected from observation. If after reset on-chip boot loader detects a valid
checksum in flash and reads 0x8765 4321 from address 0x1FC in flash, debugging will be
disabled and thus the code in flash will be protected from observation. Once debugging is
disabled, it can be enabled only by performing a full chip erase using the ISP.
External interrupt inputs
The LPC2141/42/44/46/48 include up to nine edge or level sensitive External Interrupt
Inputs as selectable pin functions. When the pins are combined, external events can be processed
as four independent interrupt signals. The External Interrupt Inputs can optionally be used to
wake-up the processor from Power-down mode. Additionally capture input pins can also be used
as external interrupts without the option to wake the device up from Power-down mode.
Memory mapping control

19
The Memory Mapping Control alters the mapping of the interrupt vectors that appear
beginning at address 0x0000 0000. Vectors may be mapped to the bottom of the on-chip flash
memory, or to the on-chip static RAM. This allows code running in different memory spaces to
have control of the interrupts
Power control
The LPC2141/42/44/46/48 supports two reduced power modes: Idle mode and Power-
down mode. In Idle mode, execution of instructions is suspended until either a reset or interrupt
occurs. Peripheral functions continue operation during Idle mode and may generate interrupts to
cause the processor to resume execution. 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 1⁄2
to 1⁄4 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 1⁄4 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.

Emulation and debugging


The LPC2141/42/44/46/48 support emulation and debugging via a JTAG serial port. A
trace port allows tracing program execution. Debugging and trace functions are multiplexed only
with GPIOs on Port 1. This means that all communication, timer and interface peripherals
20
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 LPC2141/42/44/46/48 contains a specific configuration of Real
Monitor software programmed into the on-chip flash memory.

Chapter-5
R303A Series Fingerprint Identification Module

21
Fig 5.1: photograph of RFID module

RFID stands for Radio-Frequency IDentification. The acronym refers to small


electronic devices that consist of a small chip and an antenna. The chip typically is capable of
carrying 2,000 bytes of data or less.

The RFID device serves the same purpose as a bar code or a magnetic strip on the back of
a credit card or ATM card; it provides a unique identifier for that object. And, just as a bar code
or magnetic strip must be scanned to get the information, the RFID device must be scanned to
retrieve the identifying information.

5.1.RFID Works Better Than Barcodes


A significant advantage of RFID devices over the others mentioned above is that the
RFID device does not need to be positioned precisely relative to the scanner. We're all familiar
with the difficulty that store checkout clerks sometimes have in making sure that a barcode can
be read. And obviously, credit cards and ATM cards must be swiped through a special reader.

In contrast, RFID devices will work within a few feet (up to 20 feet for high-frequency
devices) of the scanner. For example, you could just put all of your groceries or purchases in a
bag, and set the bag on the scanner. It would be able to query all of the RFID devices and total
your purchase immediately. (Read a more detailed article on RFID compared to barcodes.)

RFID technology has been available for more than fifty years. It has only been recently
that the ability to manufacture the RFID devices has fallen to the point where they can be used as
22
a "throwaway" inventory or control device. Alien Technologies recently sold 500 million RFID
tags to Gillette at a cost of about ten cents per tag.

One reason that it has taken so long for RFID to come into common use is the lack of standards
in the industry. Most companies invested in RFID technology only use the tags to track items
within their control; many of the benefits of RFID come when items are tracked from company
to company or from country to country.

5.2 Serial Communication(P1)


When the FP module communicates with user device, definition of J1 is as shown in the
table 5.2:

Table 5.2: pin description of FP


5.3 Hardware connection and features
Via serial interface, the Module may communicate with MCU of 3.3V or 5V power: TD
(pin 2 of P1) connects with RXD (receiving pin of MCU), RD (pin 3 of P1) connects with TXD
(transferring pin of MCU). Should the upper computer (PC) be in RS-232 mode, please add level
converting circuit, like MAX232, between the Module and PC. 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

23
At power on, it takes about 500ms for initialization. During this period, the Module can’t
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

Table 5.3: logic levels and power supply specifications

IV System Resources

24
To address demands of different customer, Module system provides abundant resources at
user’s use.
Notepad
The system sets aside a 512-bytes memory (16 pages* 32 bytes) for user’s 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.

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. That’s 8-bit BMP format. When transferring through USB, the image is 8-bit
pixel, that’s 256 grey degrees.
Character file buffer
Character file buffer, CharBuffer1, CharBuffer2, can be used to store both character file
and template file.
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.
25
Module Instruction System
R303A series provide 23 instructions. Through combination of different instructions,
application program may realize muti finger authentication functions. All commands/data are
transferred in package format.

26
Chapter-6
Switches and Pushbuttons and LCD display
6.1Switches and Pushbuttons

This is the simplest way of controlling appearance of some voltage on microcontroller’s


input pin. There is also no need for additional explanation of how these components operate.

Fig 6.1 switch bounce patterns

This is about something commonly unnoticeable when using these components in


everyday life. It is about contact bounce, a common problem with mechanical switches as shown
in figure 6.1. If contact switching does not happen so quickly, several consecutive bounces can
be noticed prior to maintain stable 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.

Fig 6.2 Switch interfacing with microcontroller

27
The simplest solution is to connect simple RC circuit as shown in figure 6.2 which will
suppress each quick voltage change. Since the bouncing time is not defined, the values of
elements are not strictly determined. In the most cases, the values shown on figure are sufficient.

If complete safety is needed, radical measures should be taken. The circuit (RS flip-flop)
changes logic state on its output with the first pulse triggered by contact bounce. Even though
this is more expensive solution (SPDT switch), the problem is definitely resolved. Besides, since
the condensator is not used, very short pulses can be also registered in this way. In addition to
these hardware solutions, a simple software solution is also commonly applied. When a program
tests the state of some input pin and finds changes, the check should be done one more time after
certain time delay. If the change is confirmed, it means that switch (or pushbutton) has changed
its position. The advantages of such solution are: it is free of charge, effects of disturbances are
eliminated and it can be adjusted to the worst-quality contacts.

6.2 LIQUID CRYSTAL DISPLAY:


LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs
(seven segment LEDs or other multi segment LEDs) because of the following reasons:
1. The declining prices of LCDs.
2. The ability to display numbers, characters and graphics. This is in contrast to LEDs,
which are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the
task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep
displaying the data.
4. Ease of programming for characters and graphics.

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.

28
Fig 6.3 LCD display
A model as shown in figure 6.3 here is for its low price and great possibilities most
frequently used in practice. It is based on the HD44780 microcontroller (Hitachi) and can display
messages in two lines with 16 characters each. It displays all the alphabets, Greek letters,
punctuation marks, mathematical symbols etc. In addition, it is possible to display symbols that
user makes up on its own. Automatic shifting message on display (shift left and right),
appearance of the pointer, backlight etc. are considered as useful characteristics.

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)

29
0 Access to LCD disabled
1 Normal operating
6 E
From 1 Data/commands are
to 0 transferred to LCD
7 D0 0/1 Bit 0 LSB
8 D1 0/1 Bit 1
9 D2 0/1 Bit 2
Data / 10 D3 0/1 Bit 3
commands 11 D4 0/1 Bit 4
12 D5 0/1 Bit 5
13 D6 0/1 Bit 6
14 D7 0/1 Bit 7 MSB
Table 6.1 pin description of LCD
LCD screen:
LCD screen consists of two lines with 16 characters each. Each character consists of 5x7
dot matrix. Contrast on display depends on the power supply voltage and whether messages are
displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied on pin marked as
Vee. Trimmer potentiometer is usually used for that purpose the connections are as shown in
figure 6.4. Some versions of displays have built in backlight (blue or green diodes). When used
during operating, a resistor for current limitation should be used (like with any LE diode).

Fig 6.4:power supply connection to LCD


LCD Basic Commands
All data transferred to LCD through outputs D0-D7 will be interpreted as commands or as
data, which depends on logic state on pin RS:

30
 RS = 1 - Bits D0 - D7 are addresses of characters that should be displayed. Built in
processor addresses built in “map of characters” and displays corresponding symbols.
Displaying position is determined by DDRAM address. This address is either previously
defined or the address of previously transferred character is automatically incremented.
 RS = 0 - Bits D0 - D7 are commands which determine display mode. List of commands
which LCD recognizes are given in the table 6.2 below:

Command RS RW D7 D6 D5 D4 D3 D2 D1 D0 Execution 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
Function set 0 0 0 0 1 DL N F X x 40uS
Set CGRAM address 0 0 0 1 CGRAM address 40uS
Set DDRAM address 0 0 1 DDRAM address 40uS
Read “BUSY” flag (BF) 0 1 BF DDRAM address -
Write to CGRAM or DDRAM 1 0 D7 D6 D5 D4 D3 D2 D1 D0 40uS
Read from CGRAM or DDRAM 1 1 D7 D6 D5 D4 D3 D2 D1 D0 40uS

Function Value Operation


I/D 1 Increment by 1
0 Decrement by 1
S 1 Display shift on
0 Display shift off
D 1 Display on
0 Display off
U 1 Cursor on
0 Cursor off
B 1 Cursor blink on
0 Cursor blink off
R/L 1 Shift right
0 Shift left
DL 1 8-bit interface
0 4-bit interface
N 1 Display in two lines
0 Display in one line
F 1 Character format
5x10 dots
0 Character format
5x7 dots
D/C 1 Display shift
0 Cursor shift

31
Table 6.2: LCD command description

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 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
32
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.
Algorithm according to the initialization is being performed depends on whether
connection to the microcontroller is through 4- or 8-bit interface. All left over to be done after
that is to give basic commands and of course- to display messages. The algorithm is as shown in
the figure 6.5

Fig 6.5 algorithm for initialization of 8-bit LCD

33
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.

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):

34
Chapter 7
Firmware Implementation of the project design

The firmware programmed in LPC2148 is designed to communicate with RFID and


operates according the commands received from the Switches. Therefore, the main firmware
programmed can be divided into three parts:
1. Receive the Data from RFID and processing and validating.
2. And take the data from switches and comparing with the data base and updating
the data base.
3. and display the command and display the result with respect to the switch
operations.

KEIL ARM Is Used For The Development Of RFID Based Electronic Voting Machine
7.1.µVision3 Overview

The µVision3 IDE is a Windows-based software development platform that combines a


robust editor, project manager, and makes facility. µVision3 integrates all tools including the C
compiler, macro assembler, linker/locator, and HEX file generator. µVision3 helps expedite the
development process of your embedded applications by providing the following:

 Full-featured source code editor,

 Device database for configuring the development tool setting,

 Project manager for creating and maintaining your projects,

 Integrated make facility for assembling, compiling, and linking your embedded
applications,

35
 Dialogs for all development tool settings,

 True integrated source-level Debugger with high-speed CPU and peripheral simulator,

 Advanced GDI interface for software debugging in the target hardware and for
connection to Keil ULINK,

 Flash programming utility for downloading the application program into Flash ROM,

 Links to development tools manuals, device datasheets & user's guides.

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.

Features and Benefits

Feature Benefit

The µVision3 Simulator is the only Write and test application code before production
debugger that completely simulates all on- hardware is available. Investigate different hardware
chip peripherals. configurations to optimize the hardware design.

Simulation capabilities may be expanded Sophisticated systems can be accurately simulated by


using the Advanced Simulation Interface adding your own peripheral drivers.
(AGSI).

The Code Coverage feature of the µVision3 Safety-critical systems can be thoroughly tested and

36
Simulator provides statistical analysis of validated. Execution analysis reports can be viewed
your program's execution. and printed for certification requirements.

The µVision3 Device Database Mistakes in tool settings are practically eliminated
automatically configures the development and tool configuration time is minimized.
tools for the target microcontroller.

The µVision3 IDE integrates additional Quickly access development tools and third-party
third-party tools like VCS, CASE, and tools. All configuration details are saved in the
FLASH/Device Programming. µVision3 project.

The ULINK USB-JTAG Adapter supports The same tool can be used for debugging and
both Debugging and Flash programming programming. No extra configuration time required.
with configurable algorithm files.

Identical Target Debugger and Simulator Shortens your learning curve.


User Interface.

µVision3 incorporates project manager, Accelerates application development. While editing,


editor, and debugger in a single you may configure debugger features. While
environment. debugging, you may make source code
modifications.

Interface

The µVision3 User Interface consists of menus, toolbar buttons, keyboard shortcuts, dialog
boxes, and windows that you use as you interact with and manage the various aspects of your
embedded project.

 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 toolbar buttons allow you to rapidly execute µVision3 commands. A Status Bar
provides editor and debugger information. The various toolbars and the status bar can be
enabled or disabled from the View Menu commands.

37
 Keyboard shortcuts offer quick access to µVision3 commands and may be configured via
the menu command Edit — Configuration — Shortcut Key.

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:

 File Menu and File Commands

 Edit Menu and Editor Commands

 Outlining Menu

 Advanced Menu

 Selecting Text Commands

 View Menu

 Project Menu and Project Commands

 Debug Menu and Debug Commands

 Flash Menu

 Peripherals Menu

 Tools Menu

 SVCS Menu

 Window Menu

 Help Menu

38
7.4.CODE:
/* Voting mechain using RFID; */

*
* All the resources for this project: https://www.hackster.io/Aritro
* Modified by Aritro Mukherjee
*
*
*/

#include <SPI.h>
#include <MFRC522.h>

#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.

void setup()
{
Serial.begin(9600); // Initiate a serial communication
SPI.begin(); // Initiate SPI bus
mfrc522.PCD_Init(); // Initiate MFRC522
Serial.println("Approximate your card to the reader...");
Serial.println();

}
void loop()
{
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent())
{
return;
}
// Select one of the cards

39
if ( ! mfrc522.PICC_ReadCardSerial())
{
return;
}
//Show UID on serial monitor
Serial.print("UID tag :");
String content= "";
byte letter;
for (byte i = 0; i < mfrc522.uid.size; i++)
{
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : "
"));
content.concat(String(mfrc522.uid.uidByte[i], HEX));
}
Serial.println();
Serial.print("Message : ");
content.toUpperCase();
if (content.substring(1) == "BD 31 15 2B") //change here the UID of
the card/cards that you want to give access
{
Serial.println("Authorized access");
Serial.println();
delay(3000);
}

else {
Serial.println(" Access denied");
delay(3000);
}
}

40
Chapter 8
Results and Discussions
8.1 Results
Assemble the circuit on the PCB as shown in Fig 5.1. After assembling the circuit on the
PCB, check it for proper connections before switching on the power supply.
 The EVM consists of a controller and switching unit , both the units are working
independently and in collaboration with each other as well.
 The CU is accepting fingerprints in enrolling mode and is responding accordingly.
 In identifying and vote casting mode, the CU checks for RFID detection routine
 In identifying and vote casting mode, CU communicates with switching unit in order to
exchange various signals.
 CU is counting the votes for individual candidate (20 in number) and total number of votes
cast can be checked at anytime.
 In result mode, the CU displays the votes of individual candidate, in consecutive order,
whenever the “Result Button” is pressed.
 The total number of votes can be checked in result mode.

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

41
8.2 Conclusion
The implementation of RFID 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.

Circuit is implemented in Orcad and implemented on the microcontroller board. The


performance has been verified both in software simulator and hardware design. The total circuit
is completely verified functionally and is following the application software. It can be concluded
that the design implemented in the present work provide portability, flexibility and the data
transmission is also done with low power consumption.
8.3.Advantages
 Cost effective
 Low power consumption
 It is economical
 Less manpower required
 Time conscious, as less time required for voting & counting
 Avoids invalid voting
 Saves transportation cost due to its compact size
 Convenient on the part of voter
8.4.Applications
42
This project can be used as an voting machine that can prevent rigging during the elections in
the polling booths.
 Fast track voting which could be used in small scale elections, like resident welfare
association, “panchayat” level election and other society level elections.
 It could also be used to conduct opinion polls during annual share holders meeting.
 It could also be used to conduct general assembly elections where number of candidates
are less than or equal to eight in the current situation

43
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

44
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

45

Potrebbero piacerti anche