fingerprint based electronic voting system
DESCRIPTION
FINGERPRINT BASED ELECTRONIC VOTING SYSTEMTRANSCRIPT
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
(or)
BIOMETRIC-SECURE E-VOTING SYSTEM FOR ELECTION PROCESS
DESCRIPTION:
According to ancient Greek scripts BIOMETRICS means study of life. Biometrics
studies commonly include fingerprint, face, iris, voice, signature, and hand geometry recognition
and verification. Many other modalities are in various stages of development and assessment.
Among these available biometric traits, Finger Print proves to be one of the best traits providing
good mismatch ratio and also reliable. To provide perfect security and to make our work easier,
we are taking the help of two different technologies viz. EMBEDDED SYSTEMS and
BIOMETRICS.
Firstly discussing about Biometrics we are concentrating on Fingerprint scanning.
For this, we are using FIM 3030N high voltage module as a scanner. This module has in-built
ROM, DSP and RAM. In this, we can store the fingerprints of up to 100 users. This module can
operate in 2 modes i.e., Master mode and User mode. We will be using Master mode to register
the fingerprints which will be stored in the ROM present on the scanner with a unique id.
The main aim of this project is to avoid rigging completely. Electronic voting
systems have come into picture to prevent rigging up to the maximum extent. But even there
may be some malfunctions during elections. Thus, fingerprint based electronic voting system has
been designed. When a person wants to register himself in the voter list, he has to provide his
complete details along with his fingerprint image. Thus, when the same person comes to poll his
vote during the elections, he needs to give his fingerprint image before polling his vote. Thus, the
system scans his fingerprint image, compares the image with the already stored image. If both
the images are matched, the person can enter into the room to poll his vote. The door will be
opened when the switch is pressed by the polling officer. If not, the system simply alerts the
buzzer not allowing the voter to poll his vote. LCD is used to display the related messages. There
is three buttons for three parties. We can poll votes through respective switches.
Department of ECE 1
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Here we use 8051 as a microcontroller with 5v DC Power supply. Serial (UART)
protocol is primary concern here. The heart of this project is Bio metric module which works on
serial (UART) protocol. 16X2 LCD display is connected to microcontroller through digital I/O
pins.
TECHNICAL SPECIFICATIONS:
HARDWARE SPECIFICATIONS
Micro controller : AT89S52
Crystal : 11.0592 MHz
LCD : HD44780
LED : 5mm Red LED
Bio Metric Module
Basic GPIOs
Buzzer
POWER SUPPLY
Transformer : 12V step down
Filter : 1000uf/25V
Voltage Regulator : 7805 / 7812
SOFTWARE SPECIFICATIONS
Software tools used
Keil IDE
Proteus VSM
UC flash
Department of ECE 2
Step down Transformer Filter Regulator Output Bridge Rectifier
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
APPLICATIONS
Elections
Public
Private
BLOCK DIAGRAM:
POWER SUPPLY BLOCK DIAGRAM
Department of ECE 3
8
05
1
Finger Print Module
Power Supply Buzzer
16X2 LCD
Max 232
Sw2
Sw3
Sw1
Step down Transformer Filter Regulator Output Bridge Rectifier
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
BLOCK DIAGRAM:
POWER SUPPLY BLOCK DIAGRAM
Department of ECE 4
8
0
5
1
Power
Supply
Max-232Finger Print Module
Buzzer
16X2 LCD
Sw1
Sw2
Sw3
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Schematic diagram
Department of ECE 5
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Department of ECE 6
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Introduction to Embedded Systems:
An embedded system is a system which is going to do a predefined specified task is
the embedded system and is even defined as combination of both software and hardware. A
general-purpose definition of embedded systems is that they are devices used to control, monitor
or assist the operation of equipment, machinery or plant. "Embedded" reflects the fact that they
are an integral part of the system. At the other extreme a general-purpose computer may be used
to control the operation of a large complex processing plant, and its presence will be obvious.
All embedded systems are including computers or microprocessors. Some of these
computers are however very simple systems as compared with a personal computer.
The very simplest embedded systems are capable of performing only a single
function or set of functions to meet a single predetermined purpose. In more complex systems an
application program that enables the embedded system to be used for a particular purpose in a
specific application determines the functioning of the embedded system. The ability to have
programs means that the same embedded system can be used for a variety of different purposes.
In some cases a microprocessor may be designed in such a way that application software for a
particular purpose can be added to the basic software in a second process, after which it is not
possible to make further changes. The applications software on such processors is sometimes
referred to as firmware.
The simplest devices consist of a single microprocessor (often called a "chip”),
which may itself be packaged with other chips in a hybrid system or Application Specific
Integrated Circuit (ASIC). Its input comes from a detector or sensor and its output goes to a
switch or activator which (for example) may start or stop the operation of a machine or, by
operating a valve, may control the flow of fuel to an engine.
As the embedded system is the combination of both software and hardware
Department of ECE 7
Software Hardware
ALPCVB Etc.,
ProcessorPeripheralsmemory
Embedded System
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Figure: Block diagram of Embedded System
Software deals with the languages like ALP, C, and VB etc., and Hardware deals with
Processors, Peripherals, and Memory.
Memory: It is used to store data or address.
Peripherals: These are the external devices connected
Processor: It is an IC which is used to perform some task
Applications of embedded systems
Manufacturing and process control
Construction industry
Transport
Buildings and premises
Domestic service
Communications
Office systems and mobile equipment
Banking, finance and commercial
Medical diagnostics, monitoring and life support
Testing, monitoring and diagnostic systems
Processors are classified into four types like:
Department of ECE 8
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Micro Processor (µp)
Micro controller (µc)
Digital Signal Processor (DSP)
Application Specific Integrated Circuits (ASIC)
Micro Processor (µp):
A silicon chip that contains a CPU. In the world of personal computers, the terms microprocessor
and CPU are used interchangeably. At the heart of all personal computers and most workstations
sits a microprocessor. Microprocessors also control the logic of almost all digital devices, from
clock radios to fuel-injection systems for automobiles.
Three basic characteristics differentiate microprocessors:
Instruction set: The set of instructions that the microprocessor can execute.
Bandwidth : The number of bits processed in a single instruction.
Clock speed : Given in megahertz (MHz), the clock speed determines how many
instructions per second the processor can execute.
In both cases, the higher the value, the more powerful the CPU. For example, a 32-bit
microprocessor that runs at 50MHz is more powerful than a 16-bit microprocessor that runs at
25MHz. In addition to bandwidth and clock speed, microprocessors are classified as being either
RISC (reduced instruction set computer) or CISC (complex instruction set computer).
A microprocessor has three basic elements, as shown above. The ALU performs
all arithmetic computations, such as addition, subtraction and logic operations (AND, OR, etc). It
is controlled by the Control Unit and receives its data from the Register Array. The Register
Array is a set of registers used for storing data. These registers can be accessed by the ALU very
quickly. Some registers have specific functions - we will deal with these later. The Control Unit
controls the entire process. It provides the timing and a control signal for getting data into and
out of the registers and the ALU and it synchronizes the execution of instructions (we will deal
with instruction execution at a later date).
Department of ECE 9
Timer, Counter, serial communication ROM, ADC, DAC, Timers, USART, Oscillators
Etc.,
ALU
CU
Memory
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Three Basic Elements of a Microprocessor
Micro Controller (µc):
A microcontroller is a small computer on a single integrated circuit containing a processor core,
memory, and programmable input/output peripherals. Program memory in the form of NOR
flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM.
Microcontrollers are designed for embedded applications, in contrast to the microprocessors used
in personal computers or other general purpose applications.
Figure: Block Diagram of Micro Controller (µc)
Digital Signal Processors (DSPs):
Digital Signal Processors is one which performs scientific and mathematical operation. Digital
Signal Processor chips - specialized microprocessors with architectures designed specifically for
Department of ECE 10
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
the types of operations required in digital signal processing. Like a general-purpose
microprocessor, a DSP is a programmable device, with its own native instruction code. DSP
chips are capable of carrying out millions of floating point operations per second, and like their
better-known general-purpose cousins, faster and more powerful versions are continually being
introduced. DSPs can also be embedded within complex "system-on-chip" devices, often
containing both analog and digital circuitry.
Application Specific Integrated Circuit (ASIC)
ASIC is a combination of digital and analog circuits packed into an IC to achieve the desired
control/computation function
ASIC typically contains
CPU cores for computation and control
Peripherals to control timing critical functions
Memories to store data and program
Analog circuits to provide clocks and interface to the real world which is analog in nature
I/Os to connect to external components like LEDs, memories, monitors etc.
Computer Instruction Set
There are two different types of computer instruction set there are:
1. RISC (Reduced Instruction Set Computer) and
2. CISC (Complex Instruction Set computer)
Reduced Instruction Set Computer (RISC)
A RISC (reduced instruction set computer) is a microprocessor that is designed to perform a
smaller number of types of computer instruction so that it can operate at a higher speed (perform
more million instructions per second, or millions of instructions per second). Since each
instruction type that a computer must perform requires additional transistors and circuitry, a
larger list or set of computer instructions tends to make the microprocessor more complicated
and slower in operation.
Department of ECE 11
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Besides performance improvement, some advantages of RISC and related design improvements
are:
A new microprocessor can be developed and tested more quickly if one of its aims is to
be less complicated.
Operating system and application programmers who use the microprocessor's instructions
will find it easier to develop code with a smaller instruction set.
The simplicity of RISC allows more freedom to choose how to use the space on a
microprocessor.
Higher-level language compilers produce more efficient code than formerly because they have
always tended to use the smaller set of instructions to be found in a RISC computer.
RISC characteristics
Simpleinstructionset:
In a RISC machine, the instruction set contains simple, basic instructions, from which more
complex instructions can be composed.
Samelengthinstructions.
Each instruction is the same length, so that it may be fetched in a single operation.
1machine-cycleinstructions.
Most instructions complete in one machine cycle, which allows the processor to handle several
instructions at the same time. This pipelining is a key technique used to speed up RISC
machines.
Complex Instruction Set Computer (CISC)
CISC, which stands for Complex Instruction Set Computer, is a philosophy for designing
chips that are easy to program and which make efficient use of memory. Each instruction in a
CISC instruction set might perform a series of operations inside the processor. This reduces the
number of instructions required to implement a given program, and allows the programmer to
learn a small but flexible set of instructions.
Department of ECE 12
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
TheadvantagesofCISC
At the time of their initial development, CISC machines used available technologies to optimize
computer performance.
Microprogramming is as easy as assembly language to implement, and much less
expensive than hardwiring a control unit.
The ease of micro-coding new instructions allowed designers to make CISC machines
upwardly compatible: a new computer could run the same programs as earlier computers because
the new computer would contain a superset of the instructions of the earlier computers.
As each instruction became more capable, fewer instructions could be used to implement
a given task. This made more efficient use of the relatively slow main memory.
Because micro program instruction sets can be written to match the constructs of high-
level languages, the compiler does not have to be as complicated.
ThedisadvantagesofCISC
Still, designers soon realized that the CISC philosophy had its own problems, including:
Earlier generations of a processor family generally were contained as a subset in every
new version --- so instruction set & chip hardware become more complex with each generation
of computers.
So that as many instructions as possible could be stored in memory with the least possible
wasted space, individual instructions could be of almost any length---this means that different
instructions will take different amounts of clock time to execute, slowing down the overall
performance of the machine.
Many specialized instructions aren't used frequently enough to justify their existence ---
approximately 20% of the available instructions are used in a typical program.
CISC instructions typically set the condition codes as a side effect of the instruction. Not
only does setting the condition codes take time, but programmers have to remember to examine
the condition code bits before a subsequent instruction changes them.
Memory Architecture
There two different type’s memory architectures there are:
Harvard Architecture
Department of ECE 13
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Von-Neumann Architecture
Harvard Architecture
Computers have separate memory areas for program instructions and data. There are two or more
internal data buses, which allow simultaneous access to both instructions and data. The CPU
fetches program instructions on the program memory bus.
The Harvard architecture is a computer architecture with physically separate storage and signal
pathways for instructions and data. The term originated from the Harvard Mark I relay-based
computer, which stored instructions on punched tape (24 bits wide) and data in electro-
mechanical counters. These early machines had limited data storage, entirely contained within
the central processing unit, and provided no access to the instruction storage as data. Programs
needed to be loaded by an operator, the processor could not boot itself.
Figure: Harvard Architecture
Modern uses of the Harvard architecture:
The principal advantage of the pure Harvard architecture - simultaneous access to more than one
memory system - has been reduced by modified Harvard processors using modern CPU cache
systems. Relatively pure Harvard architecture machines are used mostly in applications where
tradeoffs, such as the cost and power savings from omitting caches, outweigh the programming
penalties from having distinct code and data address spaces.
Department of ECE 14
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Digital signal processors (DSPs) generally execute small, highly-optimized audio or
video processing algorithms. They avoid caches because their behavior must be extremely
reproducible. The difficulties of coping with multiple address spaces are of secondary concern to
speed of execution. As a result, some DSPs have multiple data memories in distinct address
spaces to facilitate SIMD and VLIW processing. Texas Instruments TMS320 C55x processors,
as one example, have multiple parallel data busses (two write, three read) and one instruction
bus.
Microcontrollers are characterized by having small amounts of program (flash memory)
and data (SRAM) memory, with no cache, and take advantage of the Harvard architecture to
speed processing by concurrent instruction and data access. The separate storage means the
program and data memories can have different bit depths, for example using 16-bit wide
instructions and 8-bit wide data. They also mean that instruction pre-fetch can be performed in
parallel with other activities. Examples include, the AVR by Atmel Corp, the PIC by Microchip
Technology, Inc. and the ARM Cortex-M3 processor (not all ARM chips have Harvard
architecture).
Even in these cases, it is common to have special instructions to access program memory as data
for read-only tables, or for reprogramming.
Von-Neumann Architecture
A computer has a single, common memory space in which both program instructions and data
are stored. There is a single internal data bus that fetches both instructions and data. They cannot
be performed at the same time
The von Neumann architecture is a design model for a stored-program digital computer that
uses a central processing unit (CPU) and a single separate storage structure ("memory") to hold
both instructions and data. It is named after the mathematician and early computer scientist John
von Neumann. Such computers implement a universal Turing machine and have a sequential
architecture.
A stored-program digital computer is one that keeps its programmed instructions, as well as its
data, in read-write, random-access memory (RAM). Stored-program computers were
advancement over the program-controlled computers of the 1940s, such as the Colossus and the
Department of ECE 15
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
ENIAC, which were programmed by setting switches and inserting patch leads to route data and
to control signals between various functional units. In the vast majority of modern computers, the
same memory is used for both data and program instructions. The mechanisms for transferring
the data and instructions between the CPU and memory are, however, considerably more
complex than the original von Neumann architecture.
The terms "von Neumann architecture" and "stored-program computer" are generally used
interchangeably, and that usage is followed in this article.
Figure: Schematic of the Von-Neumann Architecture.
Basic Difference between Harvard and Von-Neumann Architecture
The primary difference between Harvard architecture and the Von Neumann architecture
is in the Von Neumann architecture data and programs are stored in the same memory and
managed by the same information handling system.
Whereas the Harvard architecture stores data and programs in separate memory devices
and they are handled by different subsystems.
In a computer using the Von-Neumann architecture without cache; the central processing
unit (CPU) can either be reading and instruction or writing/reading data to/from the memory.
Both of these operations cannot occur simultaneously as the data and instructions use the same
system bus.
In a computer using the Harvard architecture the CPU can both read an instruction and
access data memory at the same time without cache. This means that a computer with Harvard
Department of ECE 16
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
architecture can potentially be faster for a given circuit complexity because data access and
instruction fetches do not contend for use of a single memory pathway.
Today, the vast majority of computers are designed and built using the Von Neumann
architecture template primarily because of the dynamic capabilities and efficiencies gained in
designing, implementing, operating one memory system as opposed to two. Von Neumann
architecture may be somewhat slower than the contrasting Harvard Architecture for certain
specific tasks, but it is much more flexible and allows for many concepts unavailable to Harvard
architecture such as self programming, word processing and so on.
Harvard architectures are typically only used in either specialized systems or for very
specific uses. It is used in specialized digital signal processing (DSP), typically for video and
audio processing products. It is also used in many small microcontrollers used in electronics
applications such as Advanced RISK Machine (ARM) based products for many vendors.
AT89C51 MICROCONTROLLER
FEATURES
80C51 based architecture
4-Kbytes of on-chip Reprogrammable Flash Memory
128 x 8 RAM
Two 16-bit Timer/Counters
Full duplex serial channel
Boolean processor
Four 8-bit I/O ports, 32 I/O lines
Memory addressing capability
– 64K ROM and 64K RAM
Power save modes:
– Idle and power-down
Six interrupt sources
Most instructions execute in 0.3 us
CMOS and TTL compatible
Maximum speed: 40 MHz @ Vcc = 5V
Department of ECE 17
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Industrial temperature available
Packages available:
– 40-pin DIP
– 44-pin PLCC
– 44-pin PQFP
GENERAL DESCRIPTION:
THE MICROCONTROLLER:
A microcontroller is a general purpose device, but that is meant to read data, perform
limited calculations on that data and control its environment based on those calculations. The
prime use of a microcontroller is to control the operation of a machine using a fixed program that
is stored in ROM and that does not change over the lifetime of the system. The microcontroller
design uses a much more limited set of single and double byte instructions that are used to move
data and code from internal memory to the ALU. The microcontroller is concerned with getting
data from and to its own pins; the architecture and instruction set are optimized to handle data in
bit and byte size.
The AT89C51 is a low-power, high-performance CMOS 8-bit microcontroller with 4k
bytes of Flash Programmable and erasable read only memory (EROM). The device is
manufactured using Atmel’s high-density nonvolatile memory technology and is functionally
compatible with the industry-standard 80C51 microcontroller instruction set and pin out. By
combining versatile 8-bit CPU with Flash on a monolithic chip, the Atmel’s AT89c51 is a
powerful microcomputer, which provides a high flexible and cost- effective solution to many
embedded control applications.
Department of ECE 18
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Pin configuration of AT89c51 Microcontroller
Department of ECE 19
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
AT89C51 Block Diagram
Department of ECE 20
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
PIN DESCRIPTION:
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can sink eight
TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs.
Port 0 can also be configured to be the multiplexed low order address/data bus during
access to external program and data memory. In this mode, P 0 has internal pull-ups. Port 0 also
receives the code bytes during Flash programming and outputs the code bytes during program
verification. External pull-ups are required during program verification.
Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The port 1output buffers
can sink/source four TTL inputs. When 1s are written to port 1 pins, they are pulled high by the
internal pull-ups can be used as inputs. As inputs, Port 1 pins that are externally being pulled low
will source current (1) because of the internal pull-ups.
Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The port 2 output buffers
can sink/source four TTL inputs. When 1s are written to port 2 pins, they are pulled high by the
internal pull-ups can be used as inputs. As inputs, Port 2 pins that are externally being pulled low
will source current because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory
and during access to DPTR. In this application Port 2 uses strong internal pull-ups when emitting
1s. During accesses to external data memory that use 8-bit data address (MOVX@R1), Port 2
Department of ECE 21
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
emits the contents of the P2 Special Function Register. Port 2 also receives the high-order
address bits and some control signals during Flash programming and verification.
Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The port 3 output buffers
can sink/source four TTL inputs. When 1s are written to port 3 pins, they are pulled high by the
internal pull-ups can be used as inputs. As inputs, Port 3 pins that are externally being pulled low
will source current because of the internal pull-ups.
Port 3 also receives some control signals for Flash Programming and verification
Port pin Alternate Functions
P3.0 RXD(serial input port)
P3.1 TXD(serial input port)
P3.2 INT0(external interrupt 0)
P3.3 INT1(external interrupt 1)
P3.4 T0(timer 0 external input)
P3.5 T1(timer 1 external input)
P3.6 WR(external data memory write strobe)
P3.7 RD(external data memory read strobe)
RST
Rest input A on this pin for two machine cycles while the oscillator is running resets the device.
Department of ECE 22
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
ALE/PROG:
Address Latch Enable is an output pulse for latching the low byte of the address during
access to external memory. This pin is also the program pulse input (PROG) during Flash
programming.
In normal operation ALE is emitted at a constant rate of 1/16 the oscillator frequency and
may be used for external timing or clocking purpose. Note, however, that one ALE pulse is
skipped during each access to external Data memory.
_____
PSEN
Program Store Enable is the read strobe to external program memory when the AT89c51
is executing code from external program memory PSEN is activated twice each machine cycle,
except that two PSEN activations are skipped during each access to external data memory.
__
EA /VPP
External Access Enable (EA) must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000h up to FFFFH. Note,
however, that if lock bit 1 is programmed EA will be internally latched on reset. EA should be
strapped to Vcc for internal program executions. This pin also receives the 12-volt programming
enable voltage (Vpp) during Flash programming when 12-volt programming is selected.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL 2
Output from the inverting oscillator amplifier.
Department of ECE 23
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
OPERATING DESCRIPTION
The detail description of the AT89C51 included in this description is:
• Memory Map and Registers
• Timer/Counters
• Interrupt System
MEMORY MAP AND REGISTERS
Memory
The AT89C51 has separate address spaces for program and data memory. The program
and data memory can be up to 64K bytes long. The lower 4K program memory can reside on-
chip. The AT89C51 has 128 bytes of on-chip RAM. The lower 128 bytes can be accessed either
by direct addressing or by indirect addressing. The lower 128 bytes of RAM can be divided into
3 segments as listed below
1. Register Banks 0-3: locations 00H through 1FH (32 bytes). The device after reset defaults to
register bank 0. To use the other register banks, the user must select them in software. Each
register bank contains eight 1-byte registers R0-R7. Reset initializes the stack point to location
07H, and is incremented once to start from 08H, which is the first register of the second register
bank.
2. Bit Addressable Area: 16 bytes have been assigned for this segment 20H-2FH. Each one of
the 128 bits of this segment can be directly addressed (0-7FH). Each of the 16 bytes in this
segment can also be addressed as a byte.
3. Scratch Pad Area: 30H-7FH are available to the user as data RAM. However, if the data
pointer has been initialized to this area, enough bytes should be left aside to prevent SP data
destruction.
Department of ECE 24
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
SPECIAL FUNCTION REGISTERS
The Special Function Registers (SFR's) are located in upper 128 Bytes direct addressing
area. The SFR Memory Map in shows that. Not all of the addresses are occupied. Unoccupied
addresses are not implemented on the chip. Read accesses to these addresses in general return
random data, and write accesses have no effect. User software should not write 1s to these
unimplemented locations, since they may be used in future microcontrollers to invoke new
features. In that case, the reset or inactive values of the new bits will always be 0, and their active
values will be 1.
The functions of the SFR’s are outlined in the following sections.
Accumulator (ACC)
ACC is the Accumulator register. The mnemonics for Accumulator-specific instructions,
however, refer to the Accumulator simply as A.
Department of ECE 25
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
B Register (B)
The B register is used during multiply and divide operations. For other instructions it can be
treated as another scratch pad register.
Program Status Word (PSW)
The PSW register contains program status information.
Stack Pointer (SP)
The Stack Pointer Register is eight bits wide. It is incremented before data is stored during
PUSH and CALL executions. While the stack may reside anywhere in on chip RAM, the Stack
Pointer is initialized to 07H after a reset. This causes the stack to begin at location 08H.
Data Pointer (DPTR)
The Data Pointer consists of a high byte (DPH) and a low byte (DPL). Its function is to hold a
16-bit address. It may be manipulated as a 16-bit register or as two independent 8-bit registers.
Serial Data Buffer (SBUF)
The Serial Data Buffer is actually two separate registers, a transmit buffer and a receive buffer
register. When data is moved to SBUF, it goes to the transmit buffer, where it is held for serial
transmission. (Moving a byte to SBUF initiates the transmission.) When data is moved from
SBUF, it comes from the receive buffer.
Timer Registers
Register pairs (TH0, TL0) and (TH1, TL1) are the 16-bit Counter registers for Timer/Counters 0
and 1, respectively.
Control Registers
Special Function Registers IP, IE, TMOD, TCON, SCON, and PCON contain control and status
bits for the interrupt system, the Timer/Counters, and the serial port.
Department of ECE 26
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
TIMER/COUNTERS
The IS89C51 has two 16-bit Timer/Counter registers: Timer 0 and Timer 1. All two can
be configured to operate either as Timers or event counters. As a Timer, the register is
incremented every machine cycle. Thus, the register counts machine cycles. Since a machine
cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency.
As a Counter, the register is incremented in response to a 1-to-0 transition at its
corresponding external input pin, T0 and T1. The external input is sampled during S5P2 of every
machine cycle. When the samples show a high in one cycle and a low in the next
cycle, the count is incremented. The new count value appears in the register during S3P1 of the
cycle following the one in which the transition was detected. Since two machine cycles (24
oscillator periods) are required to recognize a 1-to-0 transition, the maximum count rate is 1/24
of the oscillator frequency. There are no restrictions on the duty cycle of the external input
signal, but it should be held for at least one full machine cycle to ensure that a given level is
sampled at least once before it changes.In addition to the Timer or Counter functions, Timer 0
and Timer 1 have four operating modes: 13-bit timer, 16-bit timer, 8-bit auto-reload, split timer.
TIMERS:
SFR’S USED IN TIMERS
The special function registers used in timers are,
TMOD Register
TCON Register
Timer(T0) & timer(T1) Registers
Department of ECE 27
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
(i) TMOD Register:
TMOD is dedicated solely to the two timers (T0 & T1).
The timer mode SFR is used to configure the mode of operation of each of the two
timers. Using this SFR your program may configure each timer to be a 16-bit timer, or 13
bit timer, 8-bit auto reload timer, or two separate timers. Additionally you may configure
the timers to only count when an external pin is activated or to count “events” that are
indicated on an external pin.
It can consider as two duplicate 4-bit registers, each of which controls the action of one
of the timers.
(ii) TCON Register
The timer control SFR is used to configure and modify the way in which the 8051’s two
timers operate. This SFR controls whether each of the two timers is running or stopped
and contains a flag to indicate that each timer has overflowed. Additionally, some non-
timer related bits are located in TCON SFR.
These bits are used to configure the way in which the external interrupt flags are
activated, which are set when an external interrupt occurs.
(iii) TIMER 0 (T0):
TO (Timer 0 low/high, address 8A/8C h)
These two SFR’s taken together represent timer 0. Their exact behavior depends
on how the timer is configured in the TMOD SFR; however, these timers always count
up. What is configurable is how and when they increment in value.
Department of ECE 28
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
(iv) TIMER 1 (T1):
T1 (Timer 1 Low/High, address 8B/ 8D h)
These two SFR’s, taken together, represent timer 1. Their exact behavior depends on how the
timer is configured in the TMOD SFR; however, these timers always count up. What is
Configurable is how and when they increment in value.
The Timer or Counter function is selected by control bits C/T in the Special Function Register
TMOD. These two Timer/Counters have four operating modes, which are selected by bit pairs
(M1, M0) in TMOD. Modes 0, 1, and 2 are the same for both Timer/Counters, but Mode 3 is
different.
The four modes are described in the following sections.
Mode 0:
Both Timers in Mode 0 are 8-bit Counters with a divide-by-32 pre scalar. Figure 8 shows
the Mode 0 operation as it applies to Timer 1. In this mode, the Timer register is configured as a
13-bit register. As the count rolls over from all 1s to all 0s, it sets the Timer interrupt flag TF1.
The counted input is enabled to the Timer when TR1 = 1 and either GATE = 0 or INT1 = 1.
Setting GATE = 1 allows the Timer to be controlled by external input INT1, to facilitate pulse
width measurements. TR1 is a control bit in the Special Function Register TCON. Gate is in
TMOD.
The 13-bit register consists of all eight bits of TH1 and the lower five bits of TL1. The
upper three bits of TL1 are indeterminate and should be ignored. Setting the run flag (TR1) does
not clear the registers.
Department of ECE 29
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Mode 0 operation is the same for Timer 0 as for Timer 1, except that TR0, TF0 and INT0
replace the corresponding Timer 1 signals. There are two different GATE bits, one for Timer 1
(TMOD.7) and one for Timer 0 (TMOD.3).
Mode 1
Mode 1 is the same as Mode 0, except that the Timer register is run with all 16 bits. The
clock is applied to the combined high and low timer registers (TL1/TH1). As clock pulses are
received, the timer counts up: 0000H, 0001H, 0002H, etc. An overflow occurs on the FFFFH-to-
0000H overflow flag. The timer continues to count. The overflow flag is the TF1 bit in TCON
that is read or written by software
Mode 2
Mode 2 configures the Timer register as an 8-bit Counter (TL1) with automatic reload, as
shown in Figure 10. Overflow from TL1 not only sets TF1, but also reloads TL1 with the
contents of TH1, which is preset by software. The reload leaves the TH1 unchanged. Mode 2
operation is the same for Timer/Counter 0.
Mode 3
Timer 1 in Mode 3 simply holds its count. The effect is the same as setting TR1 = 0.
Timer 0 in Mode 3 establishes TL0and TH0 as two separate counters. The logic for Mode 3 on
Timer 0 is shown in Figure 11. TL0 uses the Timer 0 control bits: C/T, GATE, TR0, INT0, and
TF0. TH0 is locked into a timer function (counting machine cycles) and over the use of TR1 and
TF1 from Timer 1. Thus, TH0 now controls the Timer 1 interrupt.
Mode 3 is for applications requiring an extra 8-bit timer or counter. With Timer 0 in
Mode 3, the AT89C51 can appear to have three Timer/Counters. When Timer 0 is in Mode 3,
Timer 1 can be turned on and off by switching it out of and into its own Mode 3. In this case,
Timer 1 can still be used by the serial port as a baud rate generator or in any application not
requiring an interrupt.
Department of ECE 30
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
INTERRUPT SYSTEM
An interrupt is an external or internal event that suspends the operation of micro
controller to inform it that a device needs its service. In interrupt method, whenever any device
needs its service, the device notifies the micro controller by sending it an interrupt signal. Upon
receiving an interrupt signal, the micro controller interrupts whatever it is doing and serves the
device. The program associated with interrupt is called as interrupt service subroutine
(ISR).Main advantage with interrupts is that the micro controller can serve many devices.
Baud Rate
The baud rate in Mode 0 is fixed as shown in the following equation. Mode 0 Baud Rate
= Oscillator Frequency /12 the baud rate in Mode 2 depends on the value of the SMOD bit in
Special Function Register PCON. If SMOD = 0 the baud rate is 1/64 of the oscillator frequency.
If SMOD = 1, the baud rate is 1/32 of the oscillator frequency.
Mode 2 Baud Rate = 2SMODx (Oscillator Frequency)/64.
In the IS89C51, the Timer 1 overflow rate determines the baud rates in Modes 1 and 3.
NUMBER OF INTERRUPTS IN 89C51:
There are basically five interrupts available to the user. Reset is also considered as an
interrupt. There are two interrupts for timer, two interrupts for external hardware interrupt and
one interrupt for serial communication.
Memory location Interrupt name
0000H Reset
0003H External interrupt 0
000BH Timer interrupt 0
0013H External interrupt 1
Department of ECE 31
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
001BH Timer interrupt 1
0023H Serial COM interrupt
Lower the vector, higher the priority. The External Interrupts INT0 and INT1 can each be
either level-activated or transition-activated, depending on bits IT0 and IT1 in Register TCON.
The flags that actually generate these interrupts are the IE0 and IE1 bits in TCON. When the
service routine is vectored, hardware clears the flag that generated an external interrupt only if
the interrupt was transition-activated. If the interrupt was level-activated, then the external
requesting source (rather than the on-chip hardware) controls the request flag.
The Timer 0 and Timer 1 Interrupts are generated by TF0and TF1, which are set by a
rollover in their respective Timer/Counter registers (except for Timer 0 in Mode 3).When a timer
interrupt is generated, the on-chip hardware clears the flag that is generated.
The Serial Port Interrupt is generated by the logical OR of RI and TI. The service routine
normally must determine whether RI or TI generated the interrupt, and the bit must be cleared in
software. All of the bits that generate interrupts can be set or cleared by software, with the same
result as though they had been set or cleared by hardware. That is, interrupts can be generated
and pending interrupts can be canceled in software.
Each of these interrupt sources can be individually enabled or disabled by setting or
clearing a bit in Special Function Register IE (interrupt enable) at address 0A8H. There is a
global enable/disable bit that is cleared to disable all interrupts or to set the interrupts.
IE (Interrupt enable register)
Steps in enabling an interrupt
Bit D7 of the IE register must be set to high to allow the rest of register to take effect. If
EA=1, interrupts are enabled and will be responded to if their corresponding bits in IE are high.
If EA=0, no interrupt will be responded to even if the associated bit in the IE register is high.
Description of each bit in IE register
Department of ECE 32
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
D7 bit: Disables all interrupts. If EA =0, no interrupt is acknowledged, if EA=1 each
interrupt source is individually enabled or disabled by setting or clearing its enable bit.
D6 bit: Reserved.
D5 bit: Enables or disables timer 2 over flow interrupt (in 8052).
D4 bit: Enables or disables serial port interrupt.
D3 bit: Enables or disables timer 1 over flow interrupt.
D2 bit: Enables or disables external interrupt 1.
D1 bit: Enables or disables timer 0 over flow interrupt.
D0 bit: Enables or disables external interrupt 0.
Interrupt priority in 89C51
There is one more SRF to assign priority to the interrupts which is named as interrupt
priority (IP). User has given the provision to assign priority to one interrupt. Writing one to that
particular bit in the IP register fulfils the task of assigning the priority.
Description of each bit in IP register
D7 bit: Reserved.
D6 bit: Reserved.
D5 bit: Timer 2 interrupt priority bit (in 8052).
D4 bit: Serial port interrupt priority bit.
D3 bit: Timer 1 interrupt priority bit.
D2 bit: External interrupt 1 priority bit.
D1 bit: Timer 0 interrupt priority bit.
D0 bit: External interrupt 0 priority bit.
Department of ECE 33
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
POWER SUPPLY
In this project we have power supplies with +5V & -5V option normally +5V is enough
for total circuit. Another (-5V) supply is used in case of OP amp circuit .Transformer primary
side has 230/50HZ AC voltage whereas at the secondary winding the voltage is step downed to
12/50hz and this voltage is rectified using two full wave rectifiers .the rectified output is given to
a filter circuit to fiter the unwanted ac in the signal After that the output is again applied to a
regulator LM7805(to provide +5v) regulator. Whereas LM7905 is for providing –5V regulation.
(+12V circuit is used for stepper motors, Fan and Relay by using LM7812 regulator same
process like above supplies.)
HEAT SINK:
More often transistors gets heated when the circuit is ON for long time. In order
to avoid heating up of transistors we use heat sinks.
BLOCK DIAGRAM OF POWER SUPPLY
DFD is the power supply pin for the circuit. A step down transformer is used to convert
230V 50HZ line voltage 12-0-12V ac input to the supply pin of the circuit. The ac voltage is
converted to pulsated dc using a center tapped full wave rectifier. Any ripples if present are
eliminated using a capacitive filter at the output of the full wave rectifier. The capacitive filter
output is input to 7805-voltage regulator, which produces a dc equivalent of ac 5V. This 5V dc
acts as VCC to the micro controller. The excess voltage is dissipated as heat via an Aluminum
heat sink attached to the voltage regulator.
TAPPED FULL WAVE RECTIFIER:
The circuit employs two diodes D1 and D2 as shown in the figure below. A
center tapped secondary winding AB is used with two diodes connected so that each uses one-
half cycle of the input ac voltage. In other words, D1 utilizes the ac voltage appearing across the
upper half (OA) of secondary winding for rectification while D2 uses the lower half winding OB.
Department of ECE 34
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Centertap full wave rectifier
1 5
6
4 8
D2
D1
RLAC Supply
OPERATION
During the positive half cycle of secondary voltage, the end A of the secondary
winding becomes positive and end B negative. This makes the diode D1 forward biased and D2
reverse biased. Therefore D1 conducts while D2 does not. The conventional current flow is
through diode D1, load resistor RL and upper half of secondary winding as shown by the dotted
arrows. During the negative half cycle, end A of the secondary winding becomes negative and
end B positive. Therefore D2 conducts while D1 does not. The conventional current flow is
through D2, load RL and lower half winding as shown by solid arrows in the figure above .It is
seen that current in the load RL is in the same direction for both half cycles of input ac voltage.
Therefore dc is obtained across the load RL. Also the polarities of the output across the load
should be noted
PEAK INVERSE VOLTAGE
Suppose Vm is the maximum voltage across the half secondary winding at the
instant secondary voltage reaches its maximum value in the positive direction. At this instant D1
is conducting while D2 is not conducting. Therefore whole of the secondary voltage appears
across the non-conducting diode. Consequently the peak inverse voltage is twice the maximum
voltage across the half secondary winding.
Department of ECE 35
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
FILTER CIRCUIT
A filter circuit is a device which removes the ac component of rectifier output but
allows the dc component to the load. The most commonly used filter circuits are capacitor filter,
choke input filter and capacitor input filter or pi-filter. We used capacitor filter here.
CAPACITOR FILTER
This consists of a capacitor C placed across the rectifier output in parallel with
the load RL. The pulsating direct voltage of the rectifier is applied across the capacitor. As the
rectifier voltage increases, it charges the capacitor and also supplies current to the load. At the
end of quarter cycle the capacitor is charged to the peak value Vm of the rectifier voltage. Now
the rectifier voltage starts to decrease. As this occurs the capacitor discharges through the load
and the voltage across it decrease. The voltage across load will decrease only slightly because
immediately the next voltage peak comes and recharges the capacitor. This process is repeated
again and again. At the output very little ripple is left. moreover output voltage is higher as it
remains substantially near the peak value of rectifier output voltage.
The capacitor filter circuit is extremely popular because of its low cost, small size,little
weight and good characteristics. For small load currents this type of filter is preferred. it is
commonly used in transistor radio battery eliminators.
RL
Capacitor Filter
CRectifier O/P
POWER SUPPLY
Department of ECE 36
Fig: 5.2.1
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Description
A variable regulated power supply, also called a variable bench power supply, is one where you
can continuously adjust the output voltage to your requirements. Varying the output of the power
supply is the recommended way to test a project after having double checked parts placement
against circuit drawings and the parts placement guide.
This type of regulation is ideal for having a simple variable bench power supply. Actually this is
quite important because one of the first projects a hobbyist should undertake is the construction
of a variable regulated power supply. While a dedicated supply is quite handy e.g. 5V or 12V, it's
much handier to have a variable supply on hand, especially for testing.
Most digital logic circuits and processors need a 5 volt power supply. To use these parts we need
to build a regulated 5 volt source. Usually you start with an unregulated power supply ranging
from 9 volts to 24 volts DC To make a 5 volt power supply, we use a LM7805 voltage regulator
IC (Integrated Circuit). The IC is shown below.
The LM7805 is simple to use. You simply connect the positive lead of your unregulated DC
power supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative lead to the
common pin and then when you turn on the power, you get a 5 volt supply from the Output pin.
Block Diagram:
Department of ECE 37
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Fig 5.2.2: - Block Diagram of Power supply
Circuit Features:
Brief description of operation: Gives out well regulated +5V output, output current
capability of 100 mA .Circuit protection: Built-in overheating protection shuts down output
when regulator IC gets too hot Circuit complexity: Very simple and easy to build Circuit
performance: Very stable +5V output voltage, reliable operation Availability of components:
Easy to get, uses only very common basic components Design testing: Based on datasheet
example circuit, I have used this circuit successfully as part of many electronics projects
Applications: Part of electronics devices, small laboratory power supply
Power supply voltage: Unregulated DC 8-18V power supply
Power supply current: Needed output current + 5 mA
Component costs: Few dollars for the electronics components + the input transformer cost.
Department of ECE 38
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
LED
Introduction:
A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps
in many devices, and are increasingly used for lighting. Introduced as a practical electronic
component in 1962, early LEDs emitted low-intensity red light, but modern versions are
available across the visible, ultraviolet and infrared wavelengths, with very high brightness.
The LED is based on the semiconductor diode. When a diode is forward biased, electrons are
able to recombine with holes within the device, releasing energy in the form of photons. This
effect is called electroluminescence and the color of the light (corresponding to the energy of the
photon) is determined by the energy gap of the semiconductor. An LED is usually small in area
(less than 1 mm2), and integrated optical components are used to shape its radiation pattern and
assist in reflection. LEDs present many advantages over incandescent light sources
including lower energy consumption, longer lifetime, improved robustness, smaller size, faster
switching, and greater durability and reliability. However, they are relatively expensive and
require more precise current and heat management than traditional light sources. Current LED
Department of ECE 39
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
products for general lighting are more expensive to buy than fluorescent lamp sources of
comparable output.
Working: Charge-carriers—electrons and holes
—flow into the junction from electrodes with
different voltages. When an electron meets a
hole, it falls into a lower energy level, and
releases energy in the form of a photon.
The wavelength of the light emitted, and
therefore its color, depends on the band
gap energy of the materials forming the p-n
junction. In silicon or germanium diodes, the
electrons and holes recombine by a non-
radiative transition which produces no optical
emission, because these are indirect band
gap materials. The materials used for the LED have a direct band gap with energies
corresponding to near-infrared, visible or near-ultraviolet light.
Department of ECE 40
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Colors and materials
ColorWavelength (nm
)Voltage (V) Semiconductor Material
Infrared λ > 760 ΔV < 1.9Gallium arsenide (GaAs)
Aluminum gallium arsenide (AlGaAs)
Red 610 < λ < 7601.63 < ΔV <
2.03
Aluminum gallium arsenide (AlGaAs)
Gallium arsenide phosphide (GaAsP)
Aluminium gallium indium phosphide (AlGaInP)
Gallium(III) phosphide (GaP)
Orange 590 < λ < 6102.03 < ΔV <
2.10
Gallium arsenide phosphide (GaAsP)
Aluminum gallium indium phosphide (AlGaInP)
Gallium(III) phosphide (GaP)
Yellow 570 < λ < 5902.10 < ΔV <
2.18
Gallium arsenide phosphide (GaAsP)
Aluminium gallium indium phosphide (AlGaInP)
Gallium(III) phosphide (GaP)
Green 500 < λ < 5701.9[42] < ΔV <
4.0
Indium gallium nitride (InGaN) / Gallium(III)
nitride (GaN)
Gallium(III) phosphide (GaP)
Aluminium gallium indium phosphide (AlGaInP)
Aluminium gallium phosphide (AlGaP)
Department of ECE 41
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Blue 450 < λ < 5002.48 < ΔV <
3.7
Zinc selenide (ZnSe)
Indium gallium nitride (InGaN)
Silicon carbide (SiC) as substrate
Silicon (Si) as substrate — (under development)
Violet 400 < λ < 4502.76 < ΔV <
4.0Indium gallium nitride (InGaN)
Purple multiple types2.48 < ΔV <
3.7
Dual blue/red LEDs,
blue with red phosphor,
or white with purple plastic
Ultraviole
tλ < 400
3.1 < ΔV <
4.4
Diamond (235 nm)
Boron nitride (215 nm)
Aluminium nitride (AlN) (210 nm)
Aluminium gallium nitride (AlGaN)
Aluminium gallium indium nitride (AlGaInN) —
(down to 210 nm)
White Broad spectrum ΔV = 3.5 Blue/UV diode with yellow phosphor
RS232:
RS232 is a asynchronous serial communication protocol widely used in computers and digital
systems. It is called asynchronous because there is no separate synchronizing clock signal as
there are in other serial protocols like SPI and I2C. The protocol is such that it automatically
synchronize itself. We can use RS232 to easily create a data link between our MCU based
projects and standard PC. Excellent example is a commercial Serial PC mouse (not popular these
Department of ECE 42
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
days, I had got one with my old PC which I bought in year 2000 in those days these were
famous). You can make a data loggers that reads analog value(such as temperatures or light
using proper sensors) using the ADC and send them to PC where a special program written by
you shows the data using nice graphs and charts etc.. actually your imagination is the limit!
Basics of Serial Communication.
In serial communication the whole data unit, say a byte is transmitted one bit at a time. While in
parallel transmission the whole data unit, say a byte (8bits) are transmitted at once. Obviously
serial transmission requires a single wire while parallel transfer requires as many wires as there
are in our data unit. So parallel transfer is used to transfer data within short range (e.g. inside the
computer between graphic card and CPU) while serial transfer is preferable in long range.
As in serial transmission only one wire is used for data transfer. Its logic level changes according
to bit being transmitted (0 or 1). But a serial communication need some way of synchronization.
If you don't understand what I mean by "synchronization" then don't worry just read on it will
become clear.
The animation below shows you how a serial transmission would look like (if you can see
electricity).
Fig- A Serial Line.(HIGH=RED & LOW=WHITE)
Can you make out what data is coming? No because you are not synchronized. You need a way
to know when a new byte start and when a bit ends and new bit start. Suppose the line is low for
some time that means a '0' but how many zeros? If we send data like 00001111 then line is first
low for some time and high after that. Then how we know it is four '0's and four '1's?
Department of ECE 43
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Now if we add another line called the clock line to synchronize you then it will become very
easy. You need to note down the value of data line only when you see the "clock line" high.
Lets understand this with help of an animation.
Fig- A Serial Line.(HIGH=RED & LOW=WHITE)
Now you can see how the "clock" line helps you in "synchronizing" the incoming data. In this
way many serial busses like SPI and I2C works. But USART is different in USART there is no
clock line. So it is called UART - Universal Asynchronous Receiver Transmitter. In USART a
start bit and stop bits are used to synchronize the incoming data the.
RS232
In RS232 there are two data lines RX and TX. TX is the wire in which data is sent out to other
device. RX is the line in which other device put the data it need to sent to the device.
Department of ECE 44
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Fig- RS232 transmission. The arrows indicates the direction of data transfer. In
addition to RX/TX lines there is a third line i.e. Ground (GND) or Common.
One more thing about RS232. We know that a HIGH =+5v and LOW=0v in TTL / MCU circuits
but in RS232 a HIGH=-12V and LOW=+12V. Ya this is bit weird but it increases the range and
reliability of data transfer. Now you must be wondering how to interface this to MCUs who
understand only 0 and 5v? But you will be very happy to know that there is a very popular IC
which can do this for you! It is MAX232 from Maxim Semiconductors. I will show you how to
make a level converter using MAX232 in next tutorial.
As there is no "clock" line so for synchronization accurate timing is required so transmissions are
carried out with certain standard speeds. The speeds are measured in bits per second. Number
of bits transmitted is also known as baud rate. Some standard baud rates are
1200
2400
4800
9600
19200
38400
57600
115200
... etc
Department of ECE 45
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
For our example for discussion of protocol we chose the speed as 9600bps(bits per second). As
we are sending 9600 bits per second one bits takes 1/9600 seconds or 0.000104 sec or 104 uS
(microsecond= 10^-6 sec).
To transmit a single byte we need to extra bits they are START BIT AND STOP BIT(more
about them latter). Thus to send a byte a total of ten bits are required so we are sending 960 bytes
per second.
Note: The number of stop bits can be one or two (for simplicity we will be using single stop bit)
There is one more bit the parity bit but again for simplicity we would not be using it)
RS232 Data Transmission.
The data transfer is done in following ways
Transmission
1. When there is no transmission the TX line sits HIGH (-12V See above para) ( STOP
CONDITION )
2. HIGH=-12V and LOW=+12V
3. When the device needs to send data it pulls the TX line low for 104uS (This is the start bit which
is always 0)
4. then it send each bits with duration = 104uS
5. Finally it sets TX lines to HIGH for at least 104uS (This is stop bits and is always 1). I said "at
least" because after you send the stop bit you can either start new transmission by sending a start
bit or you let the TX line remain HIGH till next transmission begin in this case the last bit is
more than 104uS.
Department of ECE 46
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Fig- Data Transmission on RS232 line.
Reception
1. The receiving device is waiting for the start bit i.e. the RX line to go LOW (+12V see above
para).
2. When it gets start bit it waits for half bit time i.e. 104/2 = 51uS now it is in middle of start bit it
reads it again to make sure it is a valid start bit not a spike.
3. Then it waits for 104uS and now it is in middle of first bit it now reads the value of RX line.
4. In same way it reads all 8 bits.
5. Now the receiver has the data.
Department of ECE 47
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Fig- How the Receiver receives the data on RS232 RX l
Fingerprint Sensor
The fingerprint sensor can read different fingerprints and store in its own flash
memory. The sensor can perform three functions namely Add(Enroll) , Empty Database or
search database and return the ID of stored fingerprint. Any of three functions can be called
simply by making the pin low of the sensor or pressing onboard three switches. The response is
either error or ok which is indicated by onboard LED. The response is also returned as single
serial data byte.
The return byte is a valid ID or error code. The response byte is a single byte at 9600
bps thus making whole sensor very easy to use. We have provided indicating LEDs and function
switch already so it’s ready to use when you receive it. Just give power and start using the sensor
using onboard switches. Then you can move on making external application using these
functions.
Inputs and Outputs of Sensor
Department of ECE 48
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Input: Two ways to trigger the function of fingerprint sensor
1) Onboard switch: Add, Empty or Search.
2) Make pin low from external microcontroller for 5ms as per function required to be executed.
Outputs(Response): Two ways to monitor output response after a function is executed
1) Onboard LEDs: ERROR or OK
2) Read byte after executing function
Types of function
There are namely three functions you can call for the fingerprint sensor. We will see each in
brief.
Add(Enroll) Function: Adds a fingerprint to database and return a byte of newly added ID.
Return values are from 0x00 to 0xFE. In case of error like no finger placed, return code is 0xFF.
Here 0xFF means error executing function
Search Function: When a finger is put and search funtion is called, it returns a matching ID if
found in its existing memory. Return values are from 0x00 to 0xFE. In case of error like no
finger placed, return code is 0xFF. Here 0xFF means error executing function.
Empty Function: When you wish to empty all fingerprint data stored on sensor you can use this
function. After executing this function, you will get 0xCC as OK or 0xFF in case of error.
About Fingerprint Recognition Sensor Module
The sensor is a solid-state fingerprint sensor that reliably captures fingerprint
information. It is designed to integrate into devices for improved security and convenience. The
sensor provides a reliable, quick and user-friendly alternative to passwords, PIN's and other
forms of user authentication.
This fingerprint scanner is capable of gathering and storing unique finger prints.
Simply hold your finger on the optical scanner, query the device over serial, and you will be
issued a unique ID. Use that ID within your embedded system to determine access levels, time
clocks, door locks, etc. Unit includes 4 pin connector cable to connect and read to controller. The
outputs is TTL level serial data.
A biometric sensor, fingerprint sensor to be specific, also known as the fingerprint
reader, is a fingerprint image capture device, the very front end of the biometric fingerprint
Department of ECE 49
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
identification/verification module. The fingerprint sensor captures the fingerprint images,
matches the uniqueness of each print read by the sensor and compares it to the one stored in its
module or local system database.
It consists of optical fingerprint sensor, high performance DSP processor and Flash. It
boasts of functions such as fingerprint enrollment, fingerprint deletion, fingerprint verification,
fingerprint upload, fingerprint download, etc.
Applications
· Computer peripherals – improves security and convenience
· Transportation systems – validation of operators, drivers and inspectors
· Medical equipment – authorization of operator or technician
· Physical access systems – approval for entry
· Kiosks and vending machines – confirmation of person receiving the selection
· Point of Sale terminals – authentication of tellers and cashiers
Features
· Rugged, solid-state optical fingerprint sensor
· High resolution 500 DPI imager
· Adapts to wet/dry fingers
· Simple Interfacing protocol
Department of ECE 50
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
· Status LEDs
· Function
Switches
· Single byte
· Works at 5V
· UART 9600bps
Specification
Fingerprint enrollment time <250ms
Fingerprint search time <1s(100 fingerprint, average value in test)
Resolutions 500 DPI
Security level 5, Adjustable
Capacity 768 Templates
FAR <0.0001%
FRR <0.01%
Power Supply 4.3V to 6V
Working Current <80mA
Peak Current <90mA
Communication Interface TTL
Communication Baud Rate 57600 bps
Working Temperature -10 deg C to +40 deg C
Working Humidity 40% RH to 85% TH (no dew)
Module Dimensions 60x21x25 mm (LxWxH)
Dimensions (mm)
Electrical Interface
Module is connected to HOST via 4 PIN cable(provided with module).
Pin Number Pin Name Details
Department of ECE 51
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
1 +Ve Positive power pin(+), Apply proper filtered DC regulated power (Typical 5V)
2 TXD Module Serial Transmit Output, Open-drain output, need to use pull-up
resistance to supply in application
(Typical value: 10KΩ)
3 RXD Module Serial Receive Input, Wide voltage input up to 7V (TTL level)
4 GND Power supply ground
Note: The PIN close to the edge of circuit board is PIN4: Ground
BUZZER:
1. Magnetic Transducer
Magnetic transducers contain a magnetic circuit consisting of a iron
core with a wound coil and a yoke plate, a permanent magnet and a
vibrating diaphragm with a movable iron piece. The diaphragm is
slightly pulled towards the top of the core by the magnet's magnetic
field. When a positive AC signal is applied, the current flowing
through the excitation coil produces a fluctuating magnetic field,
which causes the diaphragm to vibrate up and down, thus vibrating air. Resonance amplifies
vibration through resonator consisting of sound hole(s) and cavity and produces a loud sound.
2. Magnetic Buzzer (Sounder)
Buzzers like the TMB-series are magnetic audible signal devices with
built-in oscillating circuits. The construction combines an oscillation
circuit unit with a detection coil, a drive coil and a magnetic
transducer. Transistors, resistors, diodes and other small devices act as
circuit devices for driving sound generators. With the application of
voltage, current flows to the drive coil on primary side and to the
detection coil on the secondary side. The amplification circuit,
including the transistor and the feedback circuit, causes vibration. The
oscillation current excites the coil and the unit generates an AC magnetic field corresponding to
Department of ECE 52
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
an oscillation frequency. This AC magnetic field magnetizes the yoke comprising the magnetic
circuit. The oscillation from the intermittent magnetization prompts the vibration diaphragm to
vibrate up and down, generating buzzer sounds through the resonator.
Recommended Driving Circuit for Magnetic Transducer
ntroduction of Magnetic Buzzer (Transducer)
Department of ECE 53
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Specifications:
Rated Voltage: A magnetic buzzer is driven
by 1/2 square waves (V o-p).
Operating Voltage: For normal operating.
But it is not guaranteed to make the
minimum Sound Pressure Level (SPL) under
the rated voltage.
Consumption Current: The current is
stably consumed under the regular operation.
However, it normally takes three times of
current at the moment of starting to work.
Direct Current Resistance: The direct current resistance is measured by ammeter directly.
Department of ECE 54
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Sound Output: The sound output is measured by decibel meter. Applying rated voltage and 1/2
square waves, and the distance of 10 cm.
Rated Frequency: A buzzer can make sound on any frequencies, but we suggest that the highest
and the most stable SPL comes from the rated frequency.
Operating Temp. : Keep working well between -30℃ and +70℃.
How to choose:
Driving methods: AX series with built drive circuit will be the best choice when we cannot
provide frequency signal to a buzzer, it only needs direct current.
Dimension: Dimension affects frequency, small size result in high frequency.
Voltage: Depend on V o-p (1/2 square waves)
Fixed methods: From the highest cost to the lowest- DIP, wires/ connector, SMD.
Soldering methods: AS series is soldered by hand, the frequency is lower because of the holes
on the bottom. On the other hand, we suggest AC series for the reflow soldering, the reliability is
better.
How to choose a buzzer
There are many different kinds of buzzer to choose, first we need to know a few parameters,
such as voltage, current, drive method, dimension, mounting type, and the most important thing
is how much SPL and frequency we want.
Operating voltage: Normally, the operating voltage for a magnetic buzzer is from 1.5V to 24V,
for a piezo buzzer is from 3V to 220V. However, in order to get enough SPL, we suggest giving
at least 9V to drive a piezo buzzer.
Consumption current: According to the different voltage, the consumption current of a
magnetic buzzer is from dozens to hundreds of mill amperes; oppositely, the piezo type saves
much more electricity, only needs a few mill amperes, and consumes three times current when
the buzzer start to work.
Driving method: Both magnetic and piezo buzzer have self drive type to choose. Because of the
internal set drive circuit, the self drive buzzer can emit sound as long as connecting with the
Department of ECE 55
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
direct current. Due to the different work principle, the magnetic buzzer need to be driven by 1/2
square waves, and the piezo buzzer need square waves to get better sound output.
Dimension: The dimension of the buzzer affects its SPL and the frequency, the dimension of the
magnetic buzzer is from 7 mm to 25 mm; the piezo buzzer is from 12 mm to 50 mm, or even
bigger.
Connecting way: Dip type, Wire type, SMD type, and screwed type for big piezo buzzer are
usually seen.
Sound Pressure Level (SPL): Buzzer is usually tested the SPL at the distance of 10 cm, if
distance double, the SPL will decay about 6 dB; oppositely, the SPL will increase 6 dB when the
distance is shortened by one time. The SPL of the magnetic buzzer can reach to around 85 dB/
10 cm; the piezo buzzer can be designed to emit very loud sound, for example, the common
siren, are mostly made of piezo buzzer.
Introduction of Piezo Buzzer
Specifications:
Department of ECE 56
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Rated Voltage: A piezo buzzer is driven by square waves (V p-p).
Operating Voltage: For normal operating. But it is not guaranteed to make the minimum SPL
under the rated voltage.
Consumption Current: The current is stably consumed under the regular operation. However, it
normally takes three times of current at the moment of starting to work.
Capacitance: A piezo buzzer can make higher SPL with higher capacitance, but it consumes
more electricity.
Sound Output: The sound output is measured by decibel meter. Applying rated voltage and
square waves, and the distance of 10 cm.
Rated Frequency: A buzzer can make sound on any frequencies, but we suggest that the highest
and the most stable SPL comes from the rated frequency.
Operating Temp.: Keep working well between -30℃ and +70℃.
How to choose:
Driving methods: AZ-xxxxS-x series with built drive circuit will be the best choice when we
cannot provide frequency signal to a buzzer, it only needs direct current. Besides, there are
different tone nature for you to choose, such as continuous, fast pulse, and slow pulse.
Dimension: Dimension affects frequency, small size result in high frequency.
Voltage: Driven by square waves (V p-p), the higher voltage results in the higher SPL.
Pin Pitch: The numerous spec. for the piezo buzzers lead to the difficulty in finding a spec. in
facsimile, therefore we suggest that you can firstly choose a spec. with the same pitch and similar
frequency.
Introduction of Micro Speaker
How to choose:
The factors which affect the SPL: the
square measure of diaphragm, the
amplitude of vibration, magnetic field
intensity, power, impedance, resonant
chamber, the pattern and the thickness
of diaphragm, and the holes.
Power vs. SPL: Suppose all the
Department of ECE 57
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
conditions are the same, increasing the power dose not mean the SPL will increase as well. We
need to revise the diaphragm and the sound coil to load the higher power, but it leads to lower
SPL instead.
Dimension vs. SPL: A larger speaker can vibrate more air, therefore it provides higher SPL. In
addition, the thicker speaker can give wider amplitude of vibration which also leads to higher
SPL.
Acoustics: What we request most is how much SPL a micro speaker can output.
Matching: It will be better to provide the power slight higher than the rated power for the
enlarged circuit.
Question for mechanism:
The volume of the resonant chamber: The general problem of the consuming products is that
the resonant chambers are not big enough. We can only try to find space to enlarge the volume of
the resonant chamber.
Sound Hole: Must be more than 1/8 of the diaphragm’s area at least.
Airtight: The front and back sound fields of the speaker should be separated to avoid
neutralization.
Shock absorber: When a speaker works the vibration will also happen at the same time. In order
to reduce interference, it will do good to have some material between speaker and case to absorb
the shock.
Mounting: The speakers are usually fixed on the case. Firmly fixed is important especially for
the iron housing or the large size to avoid separating in the drop test.
How to choose the speaker
Dimension: To the micro speaker, size has decisive influence on its volume. 5mm difference of
diameter might result in double or half area of diaphragm, therefore the SPL is quite different.
Besides, the thicker speaker has more space to vibrate the air, and usually has bigger magnet, so
it will be more powerful to push the air and emit louder sound.
Power: Mainly refer to how much power can a speaker bear, there is no direct relation to the
SPL. The speaker with larger power needs to use thicker diaphragm and sound coil to bear larger
power, which will lead to lower efficiency (SPL). Therefore, according to the mechanical design,
Department of ECE 58
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
try to select a larger speaker which matches the outputting power from the amplified circuit, then
the best SPL would be emitted.
Impedance: Higher impedance can save more electricity, however, the SPL and the loaded
power will go down. The reason is that we have to use thinner wire or to coil more, the front
makes the power lower, and the after leads to heaviness and low efficiency. The material of
diaphragm: Most speakers (diameter less than 50mm) use mylar diaphragms, which are easily
finished, cheaper and waterproof. However, mylar diaphragm is not good at heatproof and the
sound is stiff. The patterns of diaphragm: The speaker with concentric circles diaphragm is good
for the speech sounds. Generally, the SPL is good at the frequency before 5-6 KHz, but will
dramatically decrease after 6 KHz. On the other hand, the speaker with radiate diaphragm has
average frequency response. Supposing other conditions are all the same, the SPL of radiate
diaphragm will lower than the concentric circles one at the frequency before 6 KHz.
LCD (Liquid Cristal Display):
A liquid crystal display (LCD) is a thin, flat display device made up of any number of
color or monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of
a column of liquid crystal molecules suspended between two transparent electrodes, and two
polarizing filters, the axes of polarity of which are perpendicular to each other. Without the
liquid crystals between them, light passing through one would be blocked by the other. The
liquid crystal twists the polarization of light entering one filter to allow it to pass through the
other.
A program must interact with the outside world using input and output devices that
communicate directly with a human being. One of the most common devices attached to an
controller is an LCD display. Some of the most common LCDs connected to the contollers are
16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1 line 16 characters per line
by 2 lines and 20 characters per line by 2 lines, respectively.
Many microcontroller devices use 'smart LCD' displays to output visual information.
LCD displays designed around LCD NT-C1611 module, are inexpensive, easy to use, and it is
even possible to produce a readout using the 5X7 dots plus cursor of the display. They have a
Department of ECE 59
available. Line lengths of
8, 16,
20, 24,
32 and
40
charact
ers are
all
standar
d, in
one,
two
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
standard ASCII set of characters and mathematical symbols. For an 8-bit data bus, the display
requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3 D2 D1 D0). For a 4-bit data
bus it only requires the supply lines plus 6 extra lines(RS RW D7 D6 D5 D4). When the LCD
display is not enabled, data lines are tri-state and they do not interfere with the operation of the
microcontroller.
Features:
(1) Interface with either 4-bit or 8-bit microprocessor.
(2) Display data RAM
(3) 80x8 bits (80 characters).
(4) Character generator ROM
(5). 160 different 5 7 dot-matrix character patterns.
(6). Character generator RAM
(7) 8 different user programmed 5 7 dot-matrix patterns.
(8).Display data RAM and character generator RAM may be
Accessed by the microprocessor.
(9) Numerous instructions
(10) .Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF,
Blink Character, Cursor Shift, Display Shift.
(11). Built-in reset circuit is triggered at power ON.
(12). Built-in oscillator.
Description Of 16x2:
Department of ECE 60
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
This is the first interfacing example for the Parallel Port. We will start with something simple.
This example doesn't use the Bi-directional feature found on newer ports, thus it should work
with most, if no all Parallel Ports. It however doesn't show the use of the Status Port as an input.
So what are we interfacing? A 16 Character x 2 Line LCD Module to the Parallel Port. These
LCD Modules are very common these days, and are quite simple to work with, as all the logic
required to run them is on board.
Schematic Diagram:
o Above is the quite simple schematic. The LCD panel's Enable and Register
Select is connected to the Control Port. The Control Port is an open collector /
open drain output. While most Parallel Ports have internal pull-up resistors, there
are a few which don't. Therefore by incorporating the two 10K external pull up
resistors, the circuit is more portable for a wider range of computers, some of
which may have no internal pull up resistors.
o We make no effort to place the Data bus into reverse direction. Therefore we hard
wire the R/W line of the LCD panel, into write mode. This will cause no bus
conflicts on the data lines. As a result we cannot read back the LCD's internal
Busy Flag which tells us if the LCD has accepted and finished processing the last
Department of ECE 61
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
instruction. This problem is overcome by inserting known delays into our
program.
o The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy
here. As with all the examples, I've left the power supply out. You can use a
bench power supply set to 5v or use a onboard +5 regulator. Remember a few de-
coupling capacitors, especially if you have trouble with the circuit working
properly.
The 2 line x 16 character LCD modules are available from a wide range of
manufacturers and should all be compatible with the HD44780. The one I used to
test this circuit was a Power tip PC-1602F and an old Philips LTN211F-10 which
was extracted from a Poker Machine! The diagram to the right, shows the pin
numbers for these devices. When viewed from the front, the left pin is pin 14 and
the right pin is pin 1
.
16 x 2 Alphanumeric LCD Module Features:
Intelligent, with built-in Hitachi HD44780 compatible LCD controller and RAM
providing simple interfacing
61 x 15.8 mm viewing area
5 x 7 dot matrix format for 2.96 x 5.56 mm characters, plus cursor line
Can display 224 different symbols
Low power consumption (1 mA typical)
Powerful command set and user-produced characters
TTL and CMOS compatible
Connector for standard 0.1-pitch pin headers
16 x 2 Alphanumeric LCD Module Specifications:
Pin Symbol Level Function
1 VSS - Power, GND
Department of ECE 62
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
2 VDD - Power, 5V
3 Vo - Power, for LCD Drive
4 RS H/L
Register Select Signal
H: Data Input
L: Instruction Input
5 R/W H/LH: Data Read (LCD->MPU)
L: Data Write (MPU->LCD)
6 E H,H->L Enable
7-14 DB0-DB7 H/L Data Bus; Software selectable 4- or 8-bit mode
15 NC - NOT CONNECTED
16 NC - NOT CONNECTED
FEATURES:
• 5 x 8 dots with cursor
• Built-in controller (KS 0066 or Equivalent)
• + 5V power supply (Also available for + 3V)
• 1/16 duty cycle
• B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)
• N.V. optional for + 3V power supply
Department of ECE 63
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Data can be placed at any location on the LCD. For 16×1 LCD, the address locations are:
Fig :15: Address locations for a 1x16 line LCD
Even limited to character based modules, there is still a wide variety of shapes and
sizes available. Line lengths of 8,16,20,24,32 and 40 characters are all standard, in one, two and
four line versions.
Several different LC technologies exists. “supertwist” types, for example, offer
Improved contrast and viewing angle over the older “twisted nematic” types. Some modules are
available with back lighting, so that they can be viewed in dimly-lit conditions. The back
lighting may be either “electro-luminescent”, requiring a high voltage inverter circuit, or simple
LED illumination.
Electrical Block Diagrm
Department of ECE 64
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Power supply for LCD driving:
Fig: 18:power supply for LCD
PIN DESCRIPTION:
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two pins are
extra in both for back-light LED connections).
Fig 19: pin diagram of 1x16 lines LCD
Department of ECE 65
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Fig 17: Pin specifications
CONTROL LINES:
EN: Line is called "Enable." This control line is used to tell the LCD that you are sending it
data. To send data to the LCD, your program should make sure this line is low (0) and then set
the other two control lines and/or put data on the data bus. When the other lines are completely
ready, bring EN high (1) and wait for the minimum amount of time required by the LCD
datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.
RS:
Line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1),
the data being sent is text data which sould be displayed on the screen. For example, to display
the letter "T" on the screen you would set RS high.
Department of ECE 66
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
RW:
Line is the "Read/Write" control line. When RW is low (0), the information on the data
bus is being written to the LCD. When RW is high (1), the program is effectively querying (or
reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are
write commands, so RW will almost always be low.
Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected
by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3,
DB4, DB5, DB6, and DB7.
Logic status on control lines:
• E - 0 Access to LCD disabled
- 1 Access to LCD enabled
• R/W - 0 Writing data to LCD
- 1 Reading data from LCD
• RS - 0 Instructions
- 1 Character
Writing data to the LCD:
1) Set R/W bit to low
2) Set RS bit to logic 0 or 1 (instruction or character)
3) Set data to data lines (if it is writing)
4) Set E line to high
5) Set E line to low
Department of ECE 67
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Read data from data lines (if it is reading) on LCD:
1) Set R/W bit to high
2) Set RS bit to logic 0 or 1 (instruction or character)
3) Set data to data lines (if it is writing)
4) Set E line to high
5) Set E line to low
Entering Text:
First, a little tip: it is manually a lot easier to enter characters and commands in hexadecimal
rather than binary (although, of course, you will need to translate commands from binary couple
of sub-miniature hexadecimal rotary switches is a simple matter, although a little bit into hex so
that you know which bits you are setting). Replacing the d.i.l. switch pack with a of re-wiring is
necessary.
SWITCHES:
The switches must be the type where On = 0, so that when they are turned to the zero position, all
four outputs are shorted to the common pin, and in position “F”, all four outputs are open circuit.
All the available characters that are built into the module are shown in Table 3. Studying the table,
you will see that codes associated with the characters are quoted in binary and hexadecimal, most
significant bits (“left-hand” four bits) across the top, and least significant bits (“right-hand” four
bits) down the left.
Most of the characters conform to the ASCII standard, although the Japanese and Greek
characters (and a few other things) are obvious exceptions. Since these intelligent modules were
designed in the “Land of the Rising Sun,” it seems only fair that their Katakana phonetic symbols
should also be incorporated. The more extensive Kanji character set, which the Japanese share
with the Chinese, consisting of several thousand different characters, is not included!
Using the switches, of whatever type, and referring to Table 3, enter a few characters onto the
Department of ECE 68
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
display, both letters and numbers. The RS switch (S10) must be “up” (logic 1) when sending the
characters, and switch E (S9) must be pressed for each of them. Thus the operational order is: set
RS high, enter character, trigger E, leave RS high, enter another character, trigger E, and so on.
The first 16 codes in Table 3, 00000000 to 00001111, ($00 to $0F) refer to the CGRAM. This is
the Character Generator RAM (random access memory), which can be used to hold user-defined
graphics characters. This is where these modules really start to show their potential, offering such
capabilities as bar graphs, flashing symbols, even animated characters. Before the user-defined
characters are set up, these codes will just bring up strange looking symbols. Codes 00010000 to
00011111 ($10 to $1F) are not used and just display blank characters. ASCII codes “proper” start
at 00100000 ($20) and end with 01111111 ($7F). Codes 10000000 to 10011111 ($80 to $9F) are
not used, and 10100000 to 11011111 ($A0 to $DF) are the Japanese characters.
Department of ECE 69
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Fig 20: character details in LCD
Department of ECE 70
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
Initialization by Instructions:
Fig 21: flow chart of lcd
Department of ECE 71
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
If the power conditions for the normal operation of the internal reset circuit are not satisfied,
then executing a series of instructions must initialize LCD unit. The procedure for this
initialization process is as above show.
FLOWCHART:
Department of ECE 72
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
KEIL SOFTWARE TOOL (STEPS)
Click on the Keil uVision Icon on DeskTop
1. The following fig will appear
2. Click on the Project menu from the title bar
3. Then Click on New Project
Department of ECE 73
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
4. Save the Project by typing suitable project name with no extension in u r own folder
sited in either C:\ or D:\
5. Then Click on Save button above.
6. Select the component for u r project. i.e. Atmel……
7. Click on the + Symbol beside of Atmel
Department of ECE 74
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
8. Select AT89C52 as shown below
9. Then Click on “OK”
10. The Following fig will appear
Department of ECE 75
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
11. Then Click either YES or NO………mostly “NO”
12. Now your project is ready to USE
13. Now double click on the Target1, you would get another option “Source group 1” as
shown in next page.
14. Click on the file option from menu bar and select “new”
Department of ECE 76
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
15. The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.
16. Now start writing program in either in “C” or “ASM”
17. For a program written in Assembly, then save it with extension “. asm” and for “C”
based program save it with extension “ .C”
Department of ECE 77
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
18. Now right click on Source group 1 and click on “Add files to Group Source”
19. Now you will get another window, on which by default “C” files will appear.
20. Now select as per your file extension given while saving the file
21. Click only one time on option “ADD”
22. Now Press function key F7 to compile. Any error will appear if so happen.
Department of ECE 78
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
23. If the file contains no error, then press Control+F5 simultaneously.
24. The new window is as follows
25. Then Click “OK”
26. Now Click on the Peripherals from menu bar, and check your required port as shown
in fig below
Department of ECE 79
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
27. Drag the port a side and click in the program file.
28. Now keep Pressing function key “F11” slowly and observe.
29. You are running your program successfully
Department of ECE 80
FINGERPRINT BASED ELECTRONIC VOTING SYSTEM
BIBILIOGRAPHY
The 8051 Micro controller and Embedded Systems
Muhammad Ali Mazidi
Janice Gillispie Mazidi
The 8051 Micro controller Architecture, Programming & Applications
Kenneth J. Ayala
Fundamentals of Micro processors and Micro computers
B. Ram
Micro processor Architecture, Programming & Applications
Ramesh S. Gaonkar
Electronic Components
REFFERENCE
www.national.com
www.atmel.com
www.microsoftsearch.com
Department of ECE 81