Nothing Special   »   [go: up one dir, main page]

Major Project Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 87

AADHAAR BASED ELECTRONIC VOTING MACHINE

CHAPTER 1
INTRODUCTION

This project examines policy regarding the electronic approaches and


developments towards electronic data storage and transmission. Finger print 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 finger print based
voting machine where the people no need to carry his ID which contains his entire details.
The person at the polling booth has to show his Finger. This Finger print reader reads the
details from the tag. This data is passed to the controlling unit for the verification. The
controller reads the data from the reader and compares this data with the already existing
data. If the data matches with the already stored information, the person is allowed to poll
his vote. If not, a message is displayed on LCD and the person is not allowed to poll his
vote. The polling mechanism carries out manually using the switches. LCD is used to
display the related messages.
Voting is a method by which the electorates appoint their representatives. In
current voting system the voter has to show his voter ID card whenever a person goes to
the polling booth to poll one’s vote. This process is a time consuming process as the
person has to check the voter ID card with the list he has, confirm it as an authorized card
and then allow the person to poll his vote. Thus, to avoid this kind of problems, we have
designed a finger print based voting machine where the person no needs to carry his ID
which contains his entire details.
The objective of voting is to allow voters to exercise their right to express their
choices regarding specific issues, pieces of legislation, citizen initiatives, constitutional
amendments, recalls and/or to choose their government and political representatives.
Technology is being used more and more as a tool to assist voters to cast their votes. To
allow the exercise of this right, almost all voting systems around the world include the
following steps: voter identification and authentication, voting and recording of votes
cast, vote counting, publication of election results.

Department of Electronics & Communication Engineering 1


AADHAAR BASED ELECTRONIC VOTING MACHINE

Voter identification is required during two phases of the electoral process: first for
voter registration in order to establish the right to vote and afterwards, at voting time, to
allow a citizen to exercise their right to vote by verifying if the person satisfies all the
requirements needed to vote (authentication).
Security is a heart of e-voting process. Therefore the necessity of designing a
secure e-voting system is very important. Usually, mechanisms that ensure the security
and privacy of an election can be time consuming, expensive for election administrators,
and inconvenient for voters. There are different levels of e-voting security. Therefore
serious measures must be taken to keep it out of public domain. Also, security must be
applied to hide votes from publicity. There is no measurement for acceptable security
level, because the level depends on type of the information. An acceptable security level
is always a compromise between usability and strength of security method.
The secured e-voting process can be done by linking the voting machines with the
Aadhaar, an Indian citizen identification data base with a unique identification number for
each citizen. The Aadhaar based EVM will result in secured e-voting process. Because no
two or more voter’s data will match as this system uses biometrics.
Biometrics is the science and technology of measuring and analyzing biological
data. In information technology, biometrics refers to technologies that measure and
analyze human body characteristics, such as DNA, fingerprints, eye retinas and irises,
voice patterns, facial patterns and hand measurements, for authentication purposes. In this
paper we have used thumb impression for the purpose of voter identification or
authentication. As the thumb impression of every individual is unique, it helps in
maximizing the accuracy.
Aadhaar database is created containing the thumb impressions of all the voters in
the constituency. Illegal votes and repetition of votes is checked for in this system. Hence
if this system is employed the elections would be fair and free from rigging.

Department of Electronics & Communication Engineering 2


AADHAAR BASED ELECTRONIC VOTING MACHINE

CHAPTER-2
EMBEDDED SYSTEMS
This chapter introduces the world of embedded systems. Everything that we look
around us today is electronic. The days are gone where almost everything was manual.
Now even the food that we eat is cooked with the assistance of a microchip (oven) and
the ease at which we wash our clothes is due to the washing machine. This world of
electronic items is made up of embedded system. In this chapter we will understand the
basics of embedded system right from its definition.

An embedded system is a computer system with a dedicated function within a


larger mechanical or electrical system, often with real-time computing constraints. It
is embedded as part of a complete device often including hardware and mechanical parts.
Embedded systems control many devices in common use today.

Properties typical of embedded computers when compared with general-purpose


ones are e.g. low power consumption, small size, rugged operating ranges and low per-
unit cost. This comes at the price of limited processing resources, which make them
significantly more difficult to program and to interface with. However, by building
intelligence mechanisms on the top of the hardware, taking advantage of possible existing
sensors and the existence of a network of embedded units, one can both optimally manage
available resources at the unit and network levels as well as provide augmented
functionalities, well beyond those available. For example, intelligent techniques can be
designed to manage power consumption of embedded systems.

Modern embedded systems are often based on microcontrollers (i.e. CPUs with


integrated memory or peripheral interfaces) but ordinary microprocessors (using external
chips for memory and peripheral interface circuits) are also still common, especially in
more complex systems. In either case, the processor(s) used may be types ranging from
general purpose to those specialized in certain class of computations, or even custom
designed for the application at hand. A common standard class of dedicated processors is
the digital signal processor (DSP).

Since the embedded system is dedicated to specific tasks, design engineers can
optimize it to reduce the size and cost of the product and increase the reliability and
performance. Some embedded systems are mass-produced, benefiting from economies of
scale.
Department of Electronics & Communication Engineering 3
AADHAAR BASED ELECTRONIC VOTING MACHINE

Embedded systems range from portable devices such as digital watches and MP3 players,
to large stationary installations like traffic lights, factory controllers, and largely complex
systems like hybrid vehicles, MRI, and avionics. Complexity varies from low, with a
single microcontroller chip, to very high with multiple units, peripherals and networks
mounted inside a large chassis or enclosure.

2.1 CLASSIFICATION OF EMBEDDED SYSTEMS


The classification of embedded system is based on following criteria's:
 On generation
 On complexity & performance
 On deterministic behaviour
 On triggering
2.2.1 ON GENERATION
1. First generation:
 Built around 8bit microprocessor & microcontroller.
 Simple in hardware circuit & firmware developed.
Examples: Digital telephone keypads.
2. Second generation:
 Built around 16-bit μp & 8-bit μc.
They are more complex & powerful than 1G μp & μc.
Examples: SCADA systems
3. Third generation:
 Built around 32-bit μp & 16-bit μc.
 Concepts like Digital Signal Processors(DSPs),
 Application Specific Integrated Circuits (ASICs) evolved.
Examples: Robotics, Media, etc.
4. Fourth generation:
 Built around 64-bit μp & 32-bit μc.
 The concept of System on Chips (SOC), Multicore Processors evolved.
 Highly complex & very powerful.
Examples: Smart Phones.

Department of Electronics & Communication Engineering 4


AADHAAR BASED ELECTRONIC VOTING MACHINE

2.2.2 ON COMPLEXITY & PERFORMANCE


1. Small-scale:
 Simple in application need
 Performance not time-critical.
 Built around low performance & low cost 8 or 16 bit μp/μc.
Example: an electronic toy
2. Medium-scale:
 Slightly complex in hardware & firmware requirement.
 Built around medium performance & low cost 16 or 32 bit μp/μc.
 Usually contain operating system.
Examples: Industrial machines.
3. Large-scale:
 Highly complex hardware & firmware.
 Built around 32 or 64 bit RISC μp/μc or PLDs or Multicore Processors. Response
is time-critical.
Examples: Mission critical applications.
2.2.3 ON DETERMINISTIC BEHAVIOUR
This classification is applicable for “Real Time” systems.
 The task execution behavior for an embedded system may be deterministic or
non-deterministic.
 Based on execution behavior Real Time embedded systems are divided into Hard
and Soft.
2.2.4 ON TRIGGERING
Embedded systems which are “Reactive” in nature can be based on triggering.
Reactive systems can be:
 Event triggered
 Time triggered
2.3 PURPOSE OF AN EMBEDDED SYSTEM
1. Data Collection/Storage/Representation
 Embedded system designed for the purpose of data collection performs acquisition
of data from the external world.

Department of Electronics & Communication Engineering 5


AADHAAR BASED ELECTRONIC VOTING MACHINE

 Data collection is usually done for storage, analysis, manipulation and


transmission.
 Data can be analog or digital.
 Embedded systems with analog data capturing techniques collect data directly in
the form of analog signal whereas embedded systems with digital data collection
mechanism converts the analog signal to the digital signal using analog to digital
converters.
 If the data is digital it can be directly captured by digital embedded system.
 A digital camera is a typical example of an embedded System with data
collection/storage/representation of data.
 Images are captured and the captured image may be stored within the memory of
the camera. The captured image can also be presented to the user through a
graphic LCD unit.
2. Data communication
 Embedded data communication systems are deployed in applications from
complex satellite communication to simple home networking systems.
 The transmission of data is achieved either by a wire-line medium or by a wire-
less medium.
 Data can either be transmitted by analog means or by digital means.
 Wireless modules-Bluetooth, Wi-Fi.
 Wire-line modules-USB, TCP/IP.
 Network hubs, routers, switches are examples of dedicated data transmission
embedded systems.
3. Data signal processing
 Embedded systems with signal processing functionalities are employed in
applications demanding signal processing like speech coding, audio video codec,
transmission applications etc.
 A digital hearing aid is a typical example of an embedded system employing data
processing.
 Digital hearing aid improves the hearing capacity of hearing impaired person
4. Monitoring
 All embedded products coming under the medical domain are with monitoring
functions.

Department of Electronics & Communication Engineering 6


AADHAAR BASED ELECTRONIC VOTING MACHINE

 Electro cardiogram machine is intended to do the monitoring of the heartbeat of a


patient but it cannot impose control over the heartbeat.
 Other examples with monitoring function are digital CRO, digital multi-meters,
and logic analyzers.
5. Control
 A system with control functionality contains both sensors and actuators.
 Sensors are connected to the input port for capturing the changes in environmental
variable and the actuators connected to the output port are controlled according to
the changes in the input variable.
 Air conditioner system used to control the room temperature to a specified limit is
a typical example for control purpose.
6. Application specific user interface
 Buttons, switches, keypad, lights, bells, display units etc are application specific
user interfaces.
 Mobile phone is an example of application specific user interface.
 In mobile phone the user interface is provided through the keypad, system
speaker, vibration alert etc.
2.4.1 USER INTERFACE

Embedded systems range from no user interface at all, in systems dedicated only
to one task, to complex graphical user interfaces that resemble modern computer desktop
operating systems. Simple embedded devices use buttons, LEDs, graphic or
character LCDs(HD44780 LCD for example) with a simple menu system.

More sophisticated devices which use a graphical screen with touch sensing or


screen-edge buttons provide flexibility while minimizing space used: the meaning of the
buttons can change with the screen, and selection involves the natural behavior of
pointing at what's desired. Handheld systems often have a screen with a "joystick button"
for a pointing device. Some systems provide user interface remotely with the help of a
serial (e.g. RS-232, USB, I²C, etc.) or network (e.g. Ethernet) connection.

This approach gives several advantages: extends the capabilities of embedded


system, avoids the cost of a display, simplifies BSP and allows one to build a rich user
interface on the PC. A good example of this is the combination of an embedded web
server running on an embedded device (such as an IP camera) or a network router. The

Department of Electronics & Communication Engineering 7


AADHAAR BASED ELECTRONIC VOTING MACHINE

user interface is displayed in a web browser on a PC connected to the device, therefore


needing no software to be installed.

2.4.2 PROCESORS IN EMBEDDED SYSSTEMS

PC/104 and PC/104+ are examples of standards for readymade computer boards


intended for small, low-volume embedded and ruggedized systems, mostly x86-based.
These are often physically small compared to a standard PC, although still quite large
compared to most simple (8/16-bit) embedded systems. They often
use DOS, Linux, NetBSD, or an embedded real-time operating system such
as MicroC/OS-II, QNX or VxWorks. Sometimes these boards use non-x86 processors.

In certain applications, where small size or power efficiency are not primary
concerns, the components used may be compatible with those used in general purpose
x86 personal computers. Boards such as the VIA EPIA range help to bridge the gap by
being PC-compatible but highly integrated, physically smaller or have other attributes
making them attractive to embedded engineers. The advantage of this approach is that
low-cost commodity components may be used along with the same software development
tools used for general software development.

Systems built in this way are still regarded as embedded since they are integrated
into larger devices and fulfill a single role. Examples of devices that may adopt this
approach are ATMs and arcade machines, which contain code specific to the application.

However, most ready-made embedded systems boards are not PC-centered and do
not use the ISA or PCI busses. When a System-on-a-chip processor is involved, there may
be little benefit to having a standardized bus connecting discrete components, and the
environment for both hardware and software tools may be very different.

One common design style uses a small system module, perhaps the size of a
business card, holding high density BGA chips such as an ARM-based System-on-a-
chip processor and peripherals, external flash memory for storage, and DRAM for
runtime memory. The module vendor will usually provide boot software and make sure
there is a selection of operating systems, usually including Linux and some real time
choices. These modules can be manufactured in high volume, by organizations familiar
with their specialized testing issues, and combined with much lower volume custom main
boards with application-specific external peripherals.

Department of Electronics & Communication Engineering 8


AADHAAR BASED ELECTRONIC VOTING MACHINE

2.4.4 PERIPHERALS

Embedded Systems talk with the outside world via peripherals, such as:

 Serial Communication Interfaces (SCI): RS-232, RS-422, RS-485 etc.


 Synchronous Serial Communication Interface: I2C, SPI, SSC and ESSI (Enhanced
Synchronous Serial Interface)
 Universal Serial Bus (USB)
 Multi Media Cards (SD Cards, Compact Flash etc.)
 Networks: Ethernet, LAN Works, etc.
 Field buses: CAN-Bus, LIN-Bus, PROFIBUS, etc.
 Timers: PLL(s), Capture/Compare and Time Processing Units
 Discrete IO: aka General Purpose Input/output (GPIO)
 Analog to Digital/Digital to Analog (ADC/DAC)
 Debugging: JTAG, ISP, ICSP, BDM Port, BITP, and DP9 ports.

2.4.5 TOOLS

As with other software, embedded system designers use compilers, assemblers,


and debuggers to develop embedded system software. However, they may also use some
more specific tools:

 In circuit debuggers or emulators.


 Utilities to add a checksum or CRC to a program, so the embedded system can
check if the program is valid.
 For systems using digital signal processing, developers may use a math
workbench
as Scilab / Scicos, MATLAB / Simulink, EICASLAB, MathCad, Mathematica,orFlo
wStone DSP to simulate the mathematics. They might also use libraries for both the
host and target which eliminates developing DSP routines as done in DSP nano
RTOS.
 A model based development tool like VisSim lets you create and simulate
graphical data flow and UML State chart diagrams of components like digital filters,
motor controllers, communication protocol decoding and multi-rate
tasks. Interrupt handlers can also be created graphically.

Department of Electronics & Communication Engineering 9


AADHAAR BASED ELECTRONIC VOTING MACHINE

 After simulation, you can automatically generate C-code to


the Vissim RTOS which handles the main control task and preemption of background
tasks, as well as automatic setup and programming of on-chip peripherals.
 Custom compilers and linkers may be used to optimize specialized hardware.
 An embedded system may have its own special language or design tool, or add
enhancements to an existing language such as Forth or Basic.
 Another alternative is to add a real-time operating system or embedded operating
system, which may have DSP capabilities like DSP nano RTOS.
 Modeling and code generating tools often based on state machines

Software tools can come from several sources:

 Software companies that specialize in the embedded market


 Ported from the GNU software development tools
 Sometimes, development tools for a personal computer can be used if the
embedded processor is a close relative to a common PC processor

As the complexity of embedded systems grows, higher level tools and operating
systems are migrating into machinery where it makes sense. For
example, cellphones, personal digital assistants and other consumer computers often need
significant software that is purchased or provided by a person other than the manufacturer
of the electronics. In these systems, an open programming environment such
as Linux, NetBSD, OSGi or Embedded Java is required so that the third-party software
provider can sell to a large market.

2.4.6 DEBUGGING

Embedded debugging may be performed at different levels, depending on the facilities


available. From simplest to most sophisticate they can be roughly grouped into the
following areas:

 Interactive resident debugging, using the simple shell provided by the embedded
operating system (e.g. Forth and Basic)
 External debugging using logging or serial port output to trace operation using
either a monitor in flash or using a debug server like the Remedy Debugger which
even works for heterogeneous multi core systems.

Department of Electronics & Communication Engineering 10


AADHAAR BASED ELECTRONIC VOTING MACHINE

 An in-circuit debugger (ICD), a hardware device that connects to the


microprocessor via a JTAG or Nexus interface. This allows the operation of the
microprocessor to be controlled externally, but is typically restricted to specific
debugging capabilities in the processor.
 An in-circuit emulator (ICE) replaces the microprocessor with a simulated
equivalent, providing full control over all aspects of the microprocessor.
 A complete emulator provides a simulation of all aspects of the hardware,
allowing all of it to be controlled and modified, and allowing debugging on a normal
PC. The downsides are expense and slow operation, in some cases up to 100X slower
than the final system.
 For SOC designs, the typical approach is to verify and debug the design on an
FPGA prototype board. Tools such as Certus are used to insert probes in the FPGA
RTL that make signals available for observation. This is used to debug hardware,
firmware and software interactions across multiple FPGA with capabilities similar to
a logic analyzer.

Unless restricted to external debugging, the programmer can typically load and
run software through the tools, view the code running in the processor, and start or stop
its operation. The view of the code may be as HLL source-code, assembly code or
mixture of both. Because an embedded system is often composed of a wide variety of
elements, the debugging strategy may vary. For instance, debugging a software (and
microprocessor) centric embedded system is different from debugging an embedded
system where most of the processing is performed by peripherals (DSP, FPGA, and co-
processor). An increasing number of embedded systems today use more than one single
processor core. A common problem with multi-core development is the proper
synchronization of software execution. In such a case, the embedded system design may
wish to check the data traffic on the busses between the processor cores, which requires
very low-level debugging, at signal/bus level, with a logic analyzer, for instance.

2.4.8 RELIABILITY

Embedded systems often reside in machines that are expected to run continuously
for years without errors, and in some cases recover by themselves if an error occurs.
Therefore the software is usually developed and tested more carefully than that for
personal computers, and unreliable mechanical moving parts such as disk drives, switches
or buttons are avoided.
Department of Electronics & Communication Engineering 11
AADHAAR BASED ELECTRONIC VOTING MACHINE

Specific reliability issues may include:

 The system cannot safely be shut down for repair, or it is too inaccessible to
repair. Examples include space systems, undersea cables, navigational beacons, bore-
hole systems, and automobiles.
 The system must be kept running for safety reasons. "Limp modes" are less
tolerable. Often backups are selected by an operator. Examples include aircraft
navigation, reactor control systems, safety-critical chemical factory controls, train
signals.
 The system will lose large amounts of money when shut down: Telephone
switches, factory controls, bridge and elevator controls, funds transfer and market
making, automated sales and service.

A variety of techniques are used, sometimes in combination, to recover from


errors—both software bugs such as memory leaks, and also soft errors in the hardware:

 watchdog timer that resets the computer unless the software periodically notifies
the watchdog
 subsystems with redundant spares that can be switched over to
 software "limp modes" that provide partial function
 Designing with a Trusted Computing Base (TCB) architecture ensures a highly
secure & reliable system environment.
 A Hypervisor designed for embedded systems, is able to provide secure
encapsulation for any subsystem component, so that a compromised software
component cannot interfere with other subsystems, or privileged-level system
software. This encapsulation keeps faults from propagating from one subsystem to
another, improving reliability. This may also allow a subsystem to be automatically
shut down and restarted on fault detection.
 Immunity Aware Programming.

2.5 EMBEDDED SOFTWARE ARCHITECTURE

There are several different types of software architecture in common use.

2.5.1 SIMPLE CONTROL LOOP

Department of Electronics & Communication Engineering 12


AADHAAR BASED ELECTRONIC VOTING MACHINE

In this design, the software simply has a loop. The loop calls subroutines, each of
which manages a part of the hardware or software.

2.5.2 INTERRUPT-CONTROLLED SYSTEM

Some embedded systems are predominantly controlled by interrupts. This means


that tasks performed by the system are triggered by different kinds of events; an interrupt
could be generated, for example, by a timer in a predefined frequency, or by a serial port
controller receiving a byte.

These kinds of systems are used if event handlers need low latency, and the event
handlers are short and simple. Usually, these kinds of systems run a simple task in a main
loop also, but this task is not very sensitive to unexpected delays. Sometimes the interrupt
handler will add longer tasks to a queue structure. Later, after the interrupt handler has
finished, these tasks are executed by the main loop. This method brings the system close
to a multitasking kernel with discrete processes.

2.5.3 COOPERATIVE MULTITASKING

A non-preemptive multitasking system is very similar to the simple control loop


scheme, except that the loop is hidden in an API. The programmer defines a series of
tasks, and each task gets its own environment to “run” in. When a task is idle, it calls an
idle routine, usually called “pause”, “wait”, “yield”, “nop” (stands for no operation), etc.

The advantages and disadvantages are similar to that of the control loop, except
that adding new software is easier, by simply writing a new task, or adding to the queue.

2.5.4 PREEMPTIVE MULTITASKING OR MULTI-THREADING

In this type of system, a low-level piece of code switches between tasks or threads
based on a timer (connected to an interrupt). This is the level at which the system is
generally considered to have an "operating system" kernel. Depending on how much
functionality is required, it introduces more or less of the complexities of managing
multiple tasks running conceptually in parallel.

As any code can potentially damage the data of another task (except in larger
systems using an MMU) programs must be carefully designed and tested, and access to
shared data must be controlled by some synchronization strategy, such as message
queues, semaphores or a non-blocking synchronization scheme. Because of these
complexities, it is common for organizations to use a real-time operating system (RTOS),

Department of Electronics & Communication Engineering 13


AADHAAR BASED ELECTRONIC VOTING MACHINE

allowing the application programmers to concentrate on device functionality rather than


operating system services, at least for large systems; smaller systems often cannot afford
the overhead associated with a generic real time system, due to limitations regarding
memory size, performance, or battery life. The choice that an RTOS is required brings in
its own issues, however, as the selection must be done prior to starting to the application
development process. This timing forces developers to choose the embedded operating
system for their device based upon current requirements and so restricts future options to
a large extent. The restriction of future options becomes more of an issue as product life
decreases.

Additionally the level of complexity is continuously growing as devices are


required to manage variables such as serial, USB, TCP/IP, Bluetooth, Wireless LAN,
trunk radio, multiple channels, data and voice, enhanced graphics, multiple states,
multiple threads, numerous wait states and so on. These trends are leading to the uptake
of embedded middleware in addition to a real-time operating system.

Department of Electronics & Communication Engineering 14


AADHAAR BASED ELECTRONIC VOTING MACHINE

CHAPTER 3
LITERATURE SURVEY

3.1 Issues of Existing Voting System


Electronic Voting Machines ("EVM"), Idea mooted by the Chief Election
Commissioner in 1977. The EVMs were devised and designed by Election Commission
of India in collaboration with Bharat Electronics Limited (BEL), Bangalore and
Electronics Corporation of India Limited (ECIL), Hyderabad. The EVMs are now
manufactured by the above two undertakings. An EVM consists of two units,
i) Control Unit
ii) Balloting Unit
The two units are joined by a five-meter cable. The Control Unit is with the Presiding
Officer or a Polling Officer and the Balloting Unit is placed inside the voting
compartment.

Figure 1.1 Sub-units of EVM

There are many types of problems with EVM which is currently in use they are:

1. Accuracy: It is not possible for a vote to be altered e laminated the invalid vote
cannot be counted from the finally tally.
2. Democracy: It permits only eligible voters to vote and, it ensures that eligible
voters vote only once.
Department of Electronics & Communication Engineering 15
AADHAAR BASED ELECTRONIC VOTING MACHINE

3. Security Problems - One can change the program installed in the EVM and tamper
the results after the polling. By replacing a small part of the machine with a look-
alike component that can be silently instructed to steal a percentage of the votes in
favor of a chosen candidate. These instructions can be sent wirelessly from a
mobile phone.
4. Illegal Voting (Rigging) - The very commonly known problem Rigging which is
faced in every electoral procedure. One candidate casts the votes of all the
members or few amounts of members in the electoral list illegally. This results in
the loss of votes for the other candidates participating and also increases the
number votes to the candidate who performs this action. This can be done
externally at the time of voting.
5. Privacy: Neither authority nor anyone else can link any ballot to the voter
6. Verifiability: Independently verification of that all votes have been counted
correctly.
7. Resistance: No electoral entity (any server participating in the e lection) or group
of entities, running the election can work in a conspiracy to introduce votes or to
prevent voters from voting.
8. Availability: The system works properly as long as the poll stands and any voter
can have access to it from the beginning to the end of the poll.
9. Resume Ability: The system allows any voter to interrupt the voting process to
resume it or restart it while the poll stands. The existing elections were done in
traditional way, using ballot, ink and tallying the votes later. But the proposed
system prevents the election from being accurate.

3.2 Proposed Methodology

In this method, the details of the voter will get from the AADHAR card database.
It was a newly developed database which is having all the information about the people.
By using this database we took the voter’s information will be stored in the Personal
Computer. At the time of e lections, for finger print accessing we use finger sensing
module.
Fingerprint recognition or fingerprint authentication refers to the automated
method of verifying a match between two human fingerprints. Fingerprints are one of
Department of Electronics & Communication Engineering 16
AADHAAR BASED ELECTRONIC VOTING MACHINE

many forms of biometrics used to identify individuals and verify their identity. A
fingerprint looks at the patterns found on a fingertip. There are a variety of approaches to
fingerprint verification. Some e mu late the traditional police method of matching pattern;
others use straight minutiae matching devices and still others are a bit more unique,
including things like moiré fringe patterns and ultrasonic. A greater variety of fingerprint
devices are available than for any other biometric.
Fingerprint verification may be a good choice for in e-voting systems, where you
can give users adequate explanation and training, and where the system operates in a
controlled environment. It is not surprising that the work-station access application area
see ms to be based almost exclusively on finger prints, due to the relatively low cost,
small size, and ease of integration of fingerprint authentication devices Capture the finger
vein image and compare or match to database, capture finger vein and database finger
vein matched means this person will be valid for polling section and if condition is
satisfied automatically, E-voting machine buttons will be activate otherwise deactivate
buttons After the E-voting machine buttons are activated, the voter cast his/her vote. After
completion of his/her voting process, a “voting process completed” message will be
displayed on the screen. The number of votes is counted by the E-Voting machine and the
information will be sent to the Server through the web technology.

2.3 Securities of the Aadhaar Based E-voting system

The main goal of a secure e-voting is to ensure the privacy of the voters and of the
votes. A secure e-voting system are satisfies the following requirements,

1. Eligibility: only votes of legitimate voters shall be taken into account.


2. Anonymity: votes are set secret
3. Accuracy: cast ballot cannot be altered. Therefore, it must not be possible to
delete ballots nor to add ballots, once the election has been closed.
4. Fairness: partial tabulation is impossible.
5. Vote and go: once a voter has casted their vote, no further action prior to the end
of the election.
6. Public verifiability: anyone should be able to readily check the validity of the
whole voting process.

Department of Electronics & Communication Engineering 17


AADHAAR BASED ELECTRONIC VOTING MACHINE

CHAPTER 3
DESIGN AND IMPLEMENTATION
The design of Aadhaar based EVM consisting of the following components
connected together as shown in figure. They are
1. Power Supply
2. Arduino Uno
3. Keypad
4. I2C
5. Liquid Crystal Display
6. Security Alarm (Buzzer)
7. Switches
8. Finger print module
9. Raspberry Pi
The above components can be explained in detail as given below

1. Power Supply
The input power supply applied to the circuit is from the regulated power supply
which supplies constant 5V to the microcontroller. The A.C input of 230V from the mains
supply is fed to the step down transformer to step down the voltage to 12V which is
supplied as input to the rectifier. The output obtained from the rectifier is a pulsating D.C
voltage. Now in order to obtain 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. This voltage
is given to a voltage regulator (7805) to obtain a pure constant 5V dc voltage. The block
diagram of regulated power supply is shown in the figure 4.1

Department of Electronics & Communication Engineering 18


AADHAAR BASED ELECTRONIC VOTING MACHINE

Fig 4.1 Block diagram of power supply

2. Arduino Uno
The Arduino Uno is a microcontroller board based on the ATmega328. It has 14
digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a
16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset
button. It contains everything needed to support the microcontroller; simply connect it to
a computer with a USB cable or power it with a AC-to-DC adapter or battery to get
started.

The microcontroller is used for controlling purpose and is connected to the controlling
unit. The ATMEGA328p is used in the Arduino Uno because of the following features
like

1. 28-pin AVR Microcontroller


2. Flash Program Memory: 32 kilobytes
3. EEPROM Data Memory: 1 kilobyte
4. SRAM Data Memory: 2 kilobytes
5. Input-Output Pins: 23
6. Timers: Two 8-bit or One 16-bit
7. Analog-Digital Converter: 10-bit Six Channel
8. PWM: Six Channels
9. RTC: Yes with Separate Oscillator
10. MSSP: SPI and I²C Master and Slave Support
11. USART: Yes
12. External Oscillator: up to 20MHz

All other equipment’s (like fingerprint scanner, LED glow, switches, LCD etc.)
function is controlled by the programming the microcontroller. The fingerprint
verification of the voters with the already stored data in its database is done inside the
microcontroller. Pin mapping of ATmega328 and Arduino is shown in the figure 4.2

Department of Electronics & Communication Engineering 19


AADHAAR BASED ELECTRONIC VOTING MACHINE

Fig 4.2 Pin Mapping of ATmega328p and Arduino

"Uno" means one in Italian and is named to mark the upcoming release of Arduino
1.0. The Uno and version 1.0 will be the reference versions of Arduino, moving forward.
The Uno is the latest in a series of USB Arduino boards, and the reference model for the
Arduino platform; for a comparison with previous versions, see the index of Arduino
boards.

Summary of arduino:

Microcontroller ATmega328
Operating Voltage 5V
Input Voltage
7-12V
(recommended)
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 Ma
DC Current for 3.3V Pin 50 Ma
32 KB (ATmega328) of which 0.5 KB used by
Flash Memory
bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)

Department of Electronics & Communication Engineering 20


AADHAAR BASED ELECTRONIC VOTING MACHINE

Clock Speed 16 MHz


Length 68.6 mm
Width 53.4 mm

25 g
Weight

Fig 4.3 Arduino Uno

Power:

The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically.

Department of Electronics & Communication Engineering 21


AADHAAR BASED ELECTRONIC VOTING MACHINE

External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or
battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the
board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers
of the POWER connector.

The board can operate on an external supply of 6 to 20 volts. If supplied with less than
7V, however, the 5V pin may supply less than five volts and the board may be unstable. If
using more than 12V, the voltage regulator may overheat and damage the board. The
recommended range is 7 to 12 volts.

The power pins are as follows:

 VIN. The input voltage to the Arduino board when it's using an external power
source (as opposed to 5 volts from the USB connection or other regulated power source).
You can supply voltage through this pin, or, if supplying voltage via the power jack,
access it through this pin.
 5V.This pin outputs a regulated 5V from the regulator on the board. The board can
be supplied with power either from the DC power jack (7 - 12V), the USB connector
(5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins
bypasses the regulator, and can damage your board. We don't advise it.
 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current
draw is 50 mA.
 GND. Ground pins.
 IOREF. This pin on the Arduino board provides the voltage reference with which
the microcontroller operates. A properly configured shield can read the IOREF pin
voltage and select the appropriate power source or enable voltage translators on the
outputs for working with the 5V or 3.3V.

Memory

The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2


KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM
library).

Department of Electronics & Communication Engineering 22


AADHAAR BASED ELECTRONIC VOTING MACHINE

Input and Output:Each of the 14 digital pins on the Uno can be used as an input or output,
using pin Mode(), digital Write(), and digitalRead() functions. They operate at 5 volts.
Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor
(disconnected by default) of 20-50 k Ohms. In addition, some pins have specialized
functions:

 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-
TTL Serial chip.
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt
on a low value, a rising or falling edge, or a change in value. See the attach
Interrupt() function for details.
 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog
Write() function.
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
 LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and
the analog Reference() function. Additionally, some pins have specialized functionality:

 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using


the Wire library.

There are a couple of other pins on the board:

 AREF. Reference voltage for the analog inputs. Used with analogReference().


 Reset. Bring this line LOW to reset the microcontroller. Typically used to add a
reset button to shields which block the one on the board.

See also the mapping between Arduino pins and ATmega328 ports. The mapping for the
Atmega8, 168, and 328 is identical.

Department of Electronics & Communication Engineering 23


AADHAAR BASED ELECTRONIC VOTING MACHINE

Communication:

The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX).
An ATmega16U2 on the board channels this serial communication over USB and appears
as a virtual com port to software on the computer. The '16U2 firmware uses the standard
USB COM drivers, and no external driver is needed. However, on Windows, a .inf file is
required. The Arduino software includes a serial monitor which allows simple textual
data to be sent to and from the Arduino board. The RX and TX LEDs on the board will
flash when data is being transmitted via the USB-to-serial chip and USB connection to
the computer (but not for serial communication on pins 0 and 1). A Software Serial
library allows for serial communication on any of the Uno's digital pins.

The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software


includes a Wire library to simplify use of the I2C bus; see the documentation for details.
For SPI communication, use the SPI library.

Programming

The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino Uno from the Tools > Board menu (according to the microcontroller on your
board). For details, see the reference and tutorials.

The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows you
to upload new code to it without the use of an external hardware programmer. It
communicates using the original STK500 protocol (reference, C header files).

You can also bypass the bootloader and program the microcontroller through the ICSP
(In-Circuit Serial Programming) header using Arduino ISP or similar; see these
instructions for details.

The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available
. The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated by:

Department of Electronics & Communication Engineering 24


AADHAAR BASED ELECTRONIC VOTING MACHINE

 On Rev1 boards: connecting the solder jumper on the back of the board (near the
map of Italy) and then resetting the 8U2.
 On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to
ground, making it easier to put into DFU mode.

You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X


and Linux) to load a new firmware. Or you can use the ISP header with an external
programmer (overwriting the DFU bootloader). See this user-contributed tutorial for more
information.

Automatic (Software) Reset

Rather than requiring a physical press of the reset button before an upload, the Arduino
Uno is designed in a way that allows it to be reset by software running on a connected
computer. One of the hardware flow control lines (DTR) of theATmega8U2/16U2 is
connected to the reset line of the ATmega328 via a 100 nano farad capacitor. When this
line is asserted (taken low), the reset line drops long enough to reset the chip. The
Arduino software uses this capability to allow you to upload code by simply pressing the
upload button in the Arduino environment. This means that the bootloader can have a
shorter timeout, as the lowering of DTR can be well-coordinated with the start of the
upload.

This setup has other implications. When the Uno is connected to either a computer
running Mac OS X or Linux, it resets each time a connection is made to it from software
(via USB). For the following half-second or so, the bootloader is running on the Uno.
While it is programmed to ignore malformed data (i.e. anything besides an upload of new
code), it will intercept the first few bytes of data sent to the board after a connection is
opened. If a sketch running on the board receives one-time configuration or other data
when it first starts, make sure that the software with which it communicates waits a
second after opening the connection and before sending this data.

The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side
of the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may
also be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to the
reset line; see this forum thread for details.

Department of Electronics & Communication Engineering 25


AADHAAR BASED ELECTRONIC VOTING MACHINE

USB Over current Protection: The Arduino Uno has a resettable poly fuse that protects
your computer's USB ports from shorts and over current. Although most computers
provide their own internal protection, the fuse provides an extra layer of protection. If
more than 500 mA is applied to the USB port, the fuse will automatically break the
connection until the short or overload is removed.

Physical Characteristics

The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with
the USB connector and power jack extending beyond the former dimension. Four screw
holes allow the board to be attached to a surface or case. Note that the distance between
digital pins 7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the
other pins.

3. Keypad

In this project we use membrane switch, which is an electrical switch for turning a
circuit on and off. It differs from a mechanical switch, which is usually made of copper
and plastic parts: a membrane switch is a circuit printed on PET or ITO. The ink used for
screen printing is usually copper / silver /graphite filled and therefore conductive.

Membrane switches are user-equipment interface utilities that allow for the
communication of commands from users to electronic devices. Membrane switches can
be thought of as one category of interface utilities alongside touch screens, plastic
keyboards, toggle switches and many other kinds of control systems. Interface utilities
can be as simple as tactile switches for controlling lighting, and they can be as
complicated as membrane keyboards and switch panels for use with computers.

Department of Electronics & Communication Engineering 26


AADHAAR BASED ELECTRONIC VOTING MACHINE

Fig 4.4 3x4 Membrane Switches

As can be seen from the diagram below, the membrane keyboard basically consists of
three layers; two of these are membrane layers containing conductive traces. The center
layer is a "spacer" containing holes wherever a "key" exists. It keeps the other two layers
apart.

Fig 4.5 Cross-section diagram of a typical membrane keyboard

The thickness of the bottom three layers has been exaggerated for clarity; in
reality, they are not much thicker than pieces of paper or thin cardstock.

Under normal conditions, the switch (key) is open, because current cannot cross the non-
conductive gap between the traces on the bottom layer. However, when the top layer is
pressed down (with a finger), it makes contact with the bottom layer. The conductive

Department of Electronics & Communication Engineering 27


AADHAAR BASED ELECTRONIC VOTING MACHINE

traces on the underside of the top layer can then bridge the gap, allowing current to flow.
The switch is now "closed", and the parent device registers a key-press.

4. I2C Controller

I²C (Inter-Integrated Circuit), pronounced I-squared-C, is a multi-master, multi-


slave, single-ended, serial computer bus invented by Philips Semiconductor (known today
as NXP Semiconductors). It is used for attaching lower-speed peripherals to processors
on computer motherboards and embedded systems. Alternatively I²C is
spelled I2C (pronounced I-two-C) or IIC (pronounced I-I-C).

Since October 10, 2006, no licensing fees are required to implement the I²C protocol.
However, fees are still required to obtain I²C slave addresses allocated by NXP.

SM Bus, defined by Intel in 1995, is a subset of I²C that defines the protocols more
strictly. One purpose of SM Bus is to promote robustness and interoperability.
Accordingly, modern I²C systems incorporate policies and rules from SM Bus, sometimes
supporting both I²C and SM Bus, requiring only minimal reconfiguration.

Design:

I²C uses only two bidirectional open-drain lines, Serial Data Line (SDA) and Serial Clock
Line (SCL), pulled up with resistors. Typical voltages used are +5 V or +3.3 V although
systems with other voltages are permitted.

The I²C reference design has a 7-bit or a 10-bit (depending on the device used) address


space.[3] Common I²C bus speeds are the 100 k bit/s standard mode and the 10 k bit/s low-
speed mode, but arbitrarily low clock frequencies are also allowed. Recent revisions of
I²C can host more nodes and run at faster speeds (400 k bit/s Fast mode, 1 M bit/s Fast
mode plus or Fm+, and 3.4 M bit/s High Speed mode). These speeds are more widely
used on embedded systems than on PCs. There are also other features, such as 16-bit
addressing.

Note the bit rates are quoted for the transactions between master and slave without clock
stretching or other hardware overhead. Protocol overheads include a slave address and
perhaps a register address within the slave device as well as per-byte ACK/NACK bits.
Thus the actual transfer rate of user data is lower than those peak bit rates alone would
imply. For example, if each interaction with a slave inefficiently allows only 1 byte of
data to be transferred, the data rate will be less than half the peak bit rate.

Department of Electronics & Communication Engineering 28


AADHAAR BASED ELECTRONIC VOTING MACHINE

The maximum number of nodes is limited by the address space, and also by the total
bus capacitance of 400 pF, which restricts practical communication distances to a few
meters.

A sample schematic with one master (a microcontroller), three slave nodes

I²C defines basic types of messages, each of which begins with a START and ends
with a STOP:

 Single message where a master writes data to a slave;


 Single message where a master reads data from a slave;
 Combined messages, where a master issues at least two reads and/or writes to one
or more slaves.

In a combined message, each read or write begins with a START and the slave address.
After the first START in a combined message these are also called repeated START bits.
Repeated START bits are not preceded by STOP bits, which is how slaves know the next
transfer is part of the same message.

Any given slave will only respond to certain messages, as specified in its product
documentation.

Pure I²C systems support arbitrary message structures. SM Bus is restricted to nine of
those structures, such as read word N and writes word N, involving a single slave. PM
Bus extends SM Bus with a Group protocol, allowing multiple such SM Bus transactions
to be sent in one combined message. The terminating STOP indicates when those grouped
actions should take effect. For example, one PM Bus operation might reconfigure three
power supplies (using three different I2C slave addresses), and their new configurations
would take effect at the same time: when they receive that STOP.

Department of Electronics & Communication Engineering 29


AADHAAR BASED ELECTRONIC VOTING MACHINE

With only a few exceptions, neither I²C nor SM Bus define message semantics, such as
the meaning of data bytes in messages. Message semantics are otherwise product-
specific. Those exceptions include messages addressed to the I²C general call address
(0x00) or to the SM Bus Alert Response Address; and messages involved in the SM Bus
Address Resolution Protocol (ARP) for dynamic address allocation and management.

In practice, most slaves adopt request/response control models, where one or more bytes
following a write command are treated as a command or address. Those bytes determine
how subsequent written bytes are treated and/or how the slave responds on subsequent
reads. Most SM Bus operations involve single byte commands.

Timing diagram

1. Data Transfer is initiated with a START bit (S) signaled by SDA being pulled low
while SCL stays high.
2. SDA sets the 1st data bit level while keeping SCL low (during blue bar time.)
3. The data is sampled (received) when SCL rises (green) for the first bit (B1).
4. This process repeats, SDA transitioning while SCL is low, and the data being read
while SCL is high (B2, Bn).
5. A STOP bit (P) is signaled when SDA is pulled high while SCL is high.

In order to avoid false marker detection, SDA is changed on the SCL falling edge and is
sampled and captured on the rising edge of SCL.

I²C is appropriate for peripherals where simplicity and low manufacturing cost are more
important than speed. Common applications of the I²C bus are:

 Reading configuration data from SPD EEPROMs on SDRAM, DDR


SDRAM, DDR2 SDRAM memory sticks (DIMM) and other stacked PC boards
 Supporting systems management for PCI cards, through an SM Bus 2.0
connection.
 Accessing NVRAM chips that keep user settings.
 Accessing low speed DACs and ADCs.

Department of Electronics & Communication Engineering 30


AADHAAR BASED ELECTRONIC VOTING MACHINE

 Changing contrast, hue, and color balance settings in monitors (Display Data
Channel).
 Changing sound volume in intelligent speakers.
 Controlling OLED/LCD displays, like in a cell phone.
 Reading hardware monitors and diagnostic sensors, like a CPU thermistor fan
speed.
 Reading real-time clocks.
 Turning on and turning off the power supply of system components.

A particular strength of I²C is the capability of a microcontroller to control a network of


device chips with just two general purpose I/O pins and software. Many other bus
technologies used in similar applications, such as Serial Peripheral Interface Bus, require
more pins and signals to connect devices.

5. LCD
An LCD or a liquid crystal display consists of liquid crystals between electrodes.
The arrangement consists of polarization filters which are aligned perpendicular to each
other. This arrangement doesn’t allow any visible light if there was no liquid crystal
between the filters. This arrangement is aligned in between transparent conductors.

When sufficient voltage is applied to a certain pixel, the crystal at that pixel aligns
such that no light passes through it. Therefore that particular pixel appears dark. if such
an electric field is applied for a longer period, the alignment of the crystal change, and
the quality of LCD degrades. In a bigger LCD display, to provide voltage sources to
each pixel, the rows and column lines are multiplexed.

The command register stores the command instructions given to the LCD. A
command is an instruction given to LCD to do a predefined task like initializing it,
clearing its screen, setting the cursor position, controlling display etc. The data register
stores the data to be displayed on the LCD. The data is the ASCII value of the character
to be displayed on the LCD

Department of Electronics & Communication Engineering 31


AADHAAR BASED ELECTRONIC VOTING MACHINE

Pin description of the LCD:

Table: 4.1 pin description of LCD

LCD Interface with microcontroller:

Microcontroller
P
O
R
T
P
I
N
S

Figure: 4.7 interfacing LCD to microcontroller

Department of Electronics & Communication Engineering 32


AADHAAR BASED ELECTRONIC VOTING MACHINE

The LCD is generally interfaced in 8-bit mode or 4-bit mode. In this project LCD is
connected in 4-bit mode the interface connections of LCD with microcontroller are as
follows

RS of LCD is connected to p0.0 of microcontroller

EN of LCD is connected to p0.1 of microcontroller

D4 of LCD is connected to p0.4 of microcontroller

D5 of LCD is connected to p0.5 of microcontroller

D6 of LCD is connected to p0.6 of microcontroller

D7 of LCD is connected to p0.7 of microcontroller

In 8-bit mode, the complete ASCII code is sent at once along with the control
signals. But in 4-bit mode, the data is divided into two parts, i.e. Msb&Lsb, and are called
upper nibble & lower nibble.

The control signals are RS, R/W & E. RS is used to select the internal registers i.e.
data register & command register. R/W is used to set the mode of LCD to read mode or
write mode. e is used as chip select and is used to push the data internally to the
corresponding registers.

To transfer the data/command in 8-bit mode, the data is written to the 8-bit data bus
after selecting the required register and setting the mode to write mode. The e signal pin
is then given a high to low signal to transfer the data.

To transfer the data/command in 4-bit mode, the higher nibble is first written to the
MSB of the data port and the e is given a high to low signal. After a little delay or when
the LCD is not busy, the lower nibble is transferred in the same procedure.

16×2 LCD module has a set of preset command instructions. Each command will
make the module to do a particular task. The commonly used commands and their
function are given in the table below.

Department of Electronics & Communication Engineering 33


AADHAAR BASED ELECTRONIC VOTING MACHINE

LCD commands

6. Security alarm (Buzzer)

Electronic symbol for a buzzer

A buzzer or beeper is an audio device, which will


be mechanical, electromechanical, or piezoelectric. Typical uses of buzzers and beepers
include alarm devices, timers and confirmation of user input such as a mouse click or
keystroke.

Department of Electronics & Communication Engineering 34


AADHAAR BASED ELECTRONIC VOTING MACHINE

Piezoelectric disk beeper

Early devices were based on an electromechanical system identical to an electric


bell without the metal gong. Similarly, a relay may be connected to interrupt its own
actuating current, causing the contacts to buzz. Often these units were anchored to a wall
or ceiling to use it as a sounding board. The word "buzzer" comes from the rasping noise
that electromechanical buzzers made.

A piezoelectric element may be driven by an oscillating electronic circuit or other audio


signal source, driven with a piezoelectric audio amplifier. Sounds commonly used to
indicate that a button has been pressed are a click, a ring or a beep.

7. Finger module r303:

8.

Raspberry Pi is a credit-card sized computer manufactured and designed in the United


Kingdom by the Raspberry Pi foundation with the intention of teaching basic computer
science to school students and every other person interested in computer hardware,
programming and DIY-Do-it Yourself projects.

The Raspberry Pi is manufactured in three board configurations through licensed


manufacturing deals with Newark element14 (Premier Farnell), RS Components and
Egoman. These companies sell the Raspberry Pi online. Egoman produces a version for
distribution solely in China and Taiwan, which can be distinguished from other Pis by
their red coloring and lack of FCC/CE marks. The hardware is the same across all
manufacturers.

Department of Electronics & Communication Engineering 35


AADHAAR BASED ELECTRONIC VOTING MACHINE

The Raspberry Pi has a Broadcom BCM2835 system on a chip (SoC), which


includes an ARM1176JZF-S 700 MHz processor, VideoCore IV GPU and was
originally shipped with 256 megabytes of RAM, later upgraded (Model B & Model B+)
to 512 MB. It does not include a built-in hard disk or solid-state drive, but it uses an SD
card for booting and persistent storage, with the Model B+ using a Micro SD.

The Foundation provides Debian and Arch Linux ARM distributions for
download. Tools are available for Python as the main programming language, with
support for BBC BASIC (via the RISC OS image or the Brandy Basic clone for Linux),
C, Java and Perl.

Inception of Raspberry pi:

The Idea to create the Raspberry Pi

The idea behind a tiny and affordable computer for kids came in 2006, when Eben
Upton, Rob Mullins, Jack Lang and Alan Mycroft, based at the University of
Cambridge’s Computer Laboratory, became concerned about the year-on-year decline in
the numbers and skills levels of the A Level students applying to read Computer Science.
From a situation in the 1990s where most of the kids applying were coming to interview
as experienced hobbyist programmers, the landscape in the 2000s was very different; a
typical applicant might only have done a little web design. Something had changed the
way kids were interacting with computers. A number of problems were identified:
majority of curriculums with lessons on using Word and Excel, or writing webpages; the
end of the dot-com boom; and the rise of the home PC and games console to replace the
Amigas, BBC Micros, Spectrum ZX and Commodore 64 machines that people of an
earlier generation learned to program on.

Department of Electronics & Communication Engineering 36


AADHAAR BASED ELECTRONIC VOTING MACHINE

Figure 3.3: A complete Commodore 64 System

There isn’t much any small group of people can do to address problems like an
inadequate school curriculum or the end of a financial bubble. But those students felt that
they could try to do something about the situation where computers had become so
expensive and arcane that programming experimentation on them had to be forbidden by
parents; and to find a platform that, like those old home computers, could boot into a
programming environment. Thus came the idea of creating the device which kids could
buy and learn programming or hardware on – The Raspberry Pi.

Initial Design Considerations:

From 2006 to 2008 they created many designs and prototypes of what we now
know as the Raspberry Pi. One of the earliest prototypes is shown below:

Figure 3.4: One of the earliest prototype of the Pi

Department of Electronics & Communication Engineering 37


AADHAAR BASED ELECTRONIC VOTING MACHINE

Hardware Layout:

Figure 3.5: Block Diagram of Raspberry Pi

Department of Electronics & Communication Engineering 38


AADHAAR BASED ELECTRONIC VOTING MACHINE

Brief description of the components on the Pi:

1) Processor / SoC (System on Chip)


The Raspberry Pi has a Broadcom BCM2835 System on Chip module. It has a
ARM1176JZF-S processor. The Broadcom SoC used in the Raspberry Pi is
equivalent to a chip used in an old smartphone (Android or iPhone). While
operating at 700 MHz by default, the Raspberry Pi provides a real world
performance roughly equivalent to the 0.041 GFLOPS. On the CPU level the
performance is similar to a 300 MHz Pentium II of 1997-1999, but the GPU,
however, provides 1 Gpixel/s, 1.5 Gtexel/s or 24 GFLOPS of general purpose
compute and the graphics capabilities of the Raspberry Pi are roughly equivalent
to the level of performance of the Xbox of 2001. The Raspberry Pi chip operating
at 700 MHz by default, will not become hot enough to need a heatsink or special
cooling.
2) Power source
The Pi is a device which consumes 700mA or 3W or power. It is powered by a
MicroUSB charger or the GPIO header. Any good smartphone charger will do the
work of powering the Pi.
3) SD Card
The Raspberry Pi does not have any onboard storage available. The operating
system is loaded on a SD card which is inserted on the SD card slot on the
Raspberry Pi. The operating system can be loaded on the card using a card reader
on any computer.
4) GPIO
GPIO – General Purpose Input Output
General-purpose input/output (GPIO) is a generic pin on an integrated circuit
whose behaviour, including whether it is an input or output pin, can be controlled
by the user at run time.

Department of Electronics & Communication Engineering 39


AADHAAR BASED ELECTRONIC VOTING MACHINE

GPIO pins have no special purpose defined, and go unused by default. The idea is
that sometimes the system designer building a full system that uses the chip might find it
useful to have a handful of additional digital control lines, and having these available
from the chip can save the hassle of having to arrange additional circuitry to provide
them.

GPIO capabilities may include:


 GPIO pins can be configured to be input or output
 GPIO pins can be enabled/disabled
 Input values are readable (typically high=1, low=0)
 Output values are writable/readable
 Input values can often be used as IRQs (typically for wakeup events)
The production Raspberry Pi board has a 26-pin 2.54 mm (100 mil) expansion
header, marked as P1, arranged in a 2x13 strip. They provide 8 GPIO pins plus
access to I²C, SPI, UART), as well as +3.3 V, +5 V and GND supply lines. Pin
one is the pin in the first column and on the bottom row.

Department of Electronics & Communication Engineering 40


AADHAAR BASED ELECTRONIC VOTING MACHINE

Figure 3.6: GPIO connector on RPi

5) DSI Connector
The Display Serial Interface (DSI) is a specification by the Mobile Industry
Processor Interface (MIPI) Alliance aimed at reducing the cost of display
controllers in a mobile device. It is commonly targeted at LCD and similar display
technologies. It defines a serial bus and a communication protocol between the
host (source of the image data) and the device (destination of the image data). A
DSI compatible LCD screen can be connected through the DSI connector,
although it may require additional drivers to drive the display.
6) RCA Video
RCA Video outputs (PAL and NTSC) are available on all models of Raspberry Pi.
Any television or screen with a RCA jack can be connected with the RPi.

Department of Electronics & Communication Engineering 41


AADHAAR BASED ELECTRONIC VOTING MACHINE

Figure 3.7: RCA Video Connector

7) Audio Jack
A standard 3.5 mm TRS connector is available on the RPi for stereo audio output.
Any headphone or 3.5mm audio cable can be connected directly. Although this
jack cannot be used for taking audio input, USB mics or USB sound cards can be
used.
8) Status LEDs
There are 5 status LEDs on the RPi that show the status of various activities as
follows:
 “OK” - SDCard Access (via GPIO16) - labelled as "OK" on Model B
Rev1.0 boards and "ACT" on Model B Rev2.0 and Model A boards
 “POWER” - 3.3 V Power - labelled as "PWR" on all boards
 “FDX” - Full Duplex (LAN) (Model B) - labelled as "FDX" on all boards
 “LNK” - Link/Activity (LAN) (Model B) - labelled as "LNK" on all
boards
 “10M/100” - 10/100Mbit (LAN) (Model B) - labelled (incorrectly) as
"10M" on Model B Rev1.0 boards and "100" on Model B Rev2.0 and
Model A boards

Department of Electronics & Communication Engineering 42


AADHAAR BASED ELECTRONIC VOTING MACHINE

Figure 3.8: Status LEDs

9) USB 2.0 Port


USB 2.0 ports are the means to connect accessories such as mouse or keyboard to
the Raspberry Pi. There is 1 port on Model A, 2 on Model B and 4 on Model B+.
The number of ports can be increased by using an external powered USB hub
which is available as a standard Pi accessory.
10) Ethernet
Ethernet port is available on Model B and B+. It can be connected to a network or
internet using a standard LAN cable on the Ethernet port. The Ethernet ports are
controlled by Microchip LAN9512 LAN controller chip.
11) CSI connector
CSI – Camera Serial Interface is a serial interface designed by MIPI (Mobile
Industry Processor Interface) alliance aimed at interfacing digital cameras with a
mobile processor. The RPi foundation provides a camera specially made for the Pi
which can be connected with the Pi using the CSI connector.
12) JTAG headers
JTAG is an acronym for ‘Joint Test Action Group', an organization that started
back in the mid 1980's to address test point access issues on PCB with surface
mount devices. The organization devised a method of access to device pins via a
serial port that became known as the TAP (Test Access Port). In 1990 the method
became a recognised international standard (IEEE Std 1149.1).
Many thousands of devices now include this standardised port as a feature to
allow test and design engineers to access pins.
13) HDMI
HDMI – High Definition Multimedia Interface
HDMI 1.3 a type A port is provided on the RPi to connect with HDMI screens.
Specifications:

Model A Model B Model B+

Target price: US$25 US$35

SoC: Broadcom BCM2835 (CPU, GPU, DSP, SDRAM, and single USB

Department of Electronics & Communication Engineering 43


AADHAAR BASED ELECTRONIC VOTING MACHINE

port)

CPU: 700 MHz ARM1176JZF-S core (ARM11 family, ARMv6


instruction set)

GPU: Broadcom VideoCore IV @ 250 MHz

Memory 256 MB (shared 512 MB (shared with GPU) as of 15 October


(SDRAM): with GPU) 2012

USB 2.0 ports: 1 (direct from 2 (via the on-board 4 (via the on-board 5-
BCM2835 chip) 3-port USB hub) port USB hub)

Video input: 15-pin MIPI camera interface (CSI) connector, used with the
Raspberry Pi Camera Addon.

Video outputs: Composite RCA (PAL and NTSC) –in model B+ via 4-pole 3.5 mm
jack, HDMI (rev 1.3 & 1.4), raw LCD Panels via DS

Audio outputs: 3.5 mm jack, HDMI, and, as of revision 2 boards, I²S audio (also
potentially for audio input)
Onboard SD / MMC / SDIO card slot (3.3 V card MicroSD
storage: power support only)
Onboard None 10/100 Mbit/s Ethernet (8P8C) USB adapter
network: on the third/fifth port of the USB hub
Low-level 8× GPIO, UART, I²C bus, SPI bus with 17× GPIO
peripherals: two chip selects, I²S audio +3.3 V, +5 V,
ground
Power ratings: 300 mA (1.5 W) 700 mA (3.5 W) 600 mA (3.0 W)
Power source: 5 V via MicroUSB or GPIO header
Size: 85.60 mm × 56 mm (3.370 in × 2.205 in) – not including protruding
connectors
Weight: 45 g (1.6 oz)

Table 1 Specifications

Department of Electronics & Communication Engineering 44


AADHAAR BASED ELECTRONIC VOTING MACHINE

Brief description of System on Chip (SoC)

Since smartphones and tablets are basically smaller computers, they require pretty
much the same components we see in desktops and laptops in order to offer us all the
amazing things they can do (apps, music and video playing, 3D gaming support,
advanced wireless features, etc).

But smartphones and tablets do not offer the same amount of internal space as
desktops and laptops for the various components needed such as the logic board, the
processor, the RAM, the graphics card, and others. That means these internal parts need
to be as small as possible, so that device manufacturers can use the remaining space to fit
the device with a long-lasting battery life.

Thanks to the wonders of miniaturization, SoC manufacturers, like Qualcomm,


Nvidia or Texas Instruments, can place some of those components on a single chip, the
System on a Chip that powers smartphones.

A system on a chip or system on chip (SoC or SOC) is an integrated circuit (IC)


that integrates all components of a computer or other electronic system into a single chip.
It may contain digital, analog, mixed-signal, and often radio-frequency functions—all on
a single chip substrate. SoCs are very common in the mobile electronics market because
of their low power consumption. A typical application is in the area of embedded
systems.

The contrast with a microcontroller is one of degree. Microcontrollers typically


have under 100 kB of RAM (often just a few kilobytes) and often really are single-chip-
systems, whereas the term SoC is typically used for more powerful processors, capable of
running software such as the desktop versions of Windows and Linux, which need
external memory chips (flash, RAM) to be useful, and which are used with various
external peripherals. In short, for larger systems, the term system on a chip is a hyperbole,
indicating technical direction more than reality: increasing chip integration to reduce
manufacturing costs and to enable smaller systems. Many interesting systems are too
complex to fit on just one chip built with a process optimized for just one of the system's
tasks.

A typical SoC consists of:

Department of Electronics & Communication Engineering 45


AADHAAR BASED ELECTRONIC VOTING MACHINE

 A microcontroller, microprocessor or DSP core(s). Some SoCs—called


multiprocessor system on chip (MPSoC)—include more than one processor core.
 memory blocks including a selection of ROM, RAM, EEPROM and flash
memory
 timing sources including oscillators and phase-locked loops
 peripherals including counter-timers, real-time timers and power-on reset
generators
 external interfaces, including industry standards such as USB, FireWire, Ethernet,
USART, SPI
 analog interfaces including ADCs and DACs
 voltage regulators and power management circuits

Accessories

Raspberry Pi being a very cheap computer has attracted millions of users around
the world. Thus it has a large user base. Many enthusiasts have created accessories and
peripherals for the Raspberry Pi. This range from USB hubs, motor controllers to
temperature sensors. There are some official accessories for the Raspberry Pi as follows:

Camera – On 14 May 2013, the foundation and the distributors RS Components &
Premier Farnell/Element 14 launched the Raspberry Pi camera board with a firmware
update to support it. The Raspberry Pi camera board contains a 5 MPixel sensor, and
connects via a ribbon cable to the CSI connector on the Raspberry Pi. In Raspbian support
can be enabled by the installing or upgrading to the latest version of the OS and then
running Raspi-config and selecting the camera option. The cost of the camera module is
20 EUR in Europe (9 September 2013). and supports 1080p, 720p, 640x480p video. The
footprint dimensions are 25 mm x 20 mm x 9 mm.

Gertboard – A Raspberry Pi Foundation sanctioned device designed for educational


purposes, and expands the Raspberry Pi's GPIO pins to allow interface with and control
of LEDs, switches, analog signals, sensors and other devices. It also includes an optional
Arduino compatible controller to interface with the Pi. The Gertboard can be used to
control motors, switches etc. for robotic projects.

Department of Electronics & Communication Engineering 46


AADHAAR BASED ELECTRONIC VOTING MACHINE

Figure 3.9: Gertboard (left) & Raspberry Pi(Right)

USB Hub – Although not an official accessory, it is a highly recommended accessory for
the Pi. A powered USB Hub with 7 extra ports is available at almost all online stores. It is
compulsory to use a USB Hub to connect external hard disks or other accessories that
draw power from the USB ports, as the Pi cannot give power to them.

Software

Operating System

The Raspberry Pi primarily uses Linux kernel-based operating systems. The


ARM11 is based on version 6 of the ARM which is no longer supported by several
popular versions of Linux, including Ubuntu. The install manager for Raspberry Pi is
NOOBS. The OSs included with NOOBS are:

 Archlinux ARM
 OpenELEC
 Pidora (Fedora Remix)
 Raspbmc and the XBMC open source digital media center
 RISC OS – The operating system of the first ARM-based computer

Department of Electronics & Communication Engineering 47


AADHAAR BASED ELECTRONIC VOTING MACHINE

 Raspbian (recommended) – Maintained independently of the Foundation; based


on ARM hard-float (armhf)-Debian 7 'Wheezy' architecture port, that was
designed for a newer ARMv7 processor whose binaries would not work on the
Rapberry Pi, but Raspbian is compiled for the ARMv6 instruction set of the
Raspberry Pi making it work but with slower performance. It provides some
available deb software packages, pre-compiled software bundles. A minimum size
of 2 GB SD card is required, but a 4 GB SD card or above is recommended. There
is a Pi Store for exchanging programs. The 'Raspbian Server Edition (RSEv2.4)',
is a stripped version with other software packages bundled as compared to the
usual desktop computer oriented Raspbian.

Boot Process

The Raspberry Pi does not boot as a traditional computer. The VideoCore i.e. the
Graphics processor actually boots before the ARM CPU.

The boot process of the Raspberry Pi can be explained as follows:

 When the power is turned on, the first bits of code to run is stored in a ROM chip
in the SoC and is built into the Pi during manufacture. This is the called the first-
stage bootloader.
 The SoC is hardwired to run this code on startup on a small RISC Core (Reduced
Instruction Set Computer). It is used to mount the FAT32 boot partition in the SD
Card so that the second-stage bootloader can be accessed. So what is this ‘second-
stage bootloader’ stored in the SD Card? It’s ‘bootcode.bin’. This file can be seen
while mount process of an operating system on the SD Card in windows.
 Now here’s something tricky. The first-stage bootloader has not yet initialized the
ARM CPU (meaning CPU is in reset) or the RAM. So, the second-stage
bootloader also has to run on the GPU. The bootloader.bin file is loaded into the
128K 4 way set associative L2 cache of the GPU and then executed. This enables
the RAM and loads start.elf which is also in the SD Card. This is the third-stage
bootloader and is also the most important. It is the firmware for the GPU, meaning
it contains the settings or in our case, has instructions to load the settings from
config.txt which is also in the SD Card.  We can think of the config.txt as the
‘BIOS settings’.

Department of Electronics & Communication Engineering 48


AADHAAR BASED ELECTRONIC VOTING MACHINE

 The start.elf also splits the RAM between the GPU and the ARM CPU. The ARM
only has access the to the address space left over by the GPU address space. For
example, if the GPU was allocated addresses from 0x000F000 – 0x0000FFFF, the
ARM has access to addresses from 0x00000000 – 0x0000EFFF.
 The physical addresses perceived by the ARM core is actually mapped to another
address in the VideoCore (0xC0000000 and beyond) by the MMU (Memory
Management Unit) of the Video Core.
 The config.txt is loaded after the split is done so the splitting amounts cannot be
specified in the config.txt. However, different .elf files having different splits exist
in the SD Card. So, depending on the requirement, the file can be renamed to
start.elf and boot the Pi. In the Pi, the GPU is King!
 Other than loading config.txt and splitting RAM, the start.elf also loads
cmdline.txt if it exists. It contains the command line parameters for whatever
kernel that is to be loaded. This brings us to the final stage of the boot process.
The start.elf finally loads kernel.img which is the binary file containing the OS
kernel and releases the reset on the CPU. The ARM CPU then executes whatever
instructions in the kernel.img thereby loading the operating system.
 After starting the operating system, the GPU code is not unloaded. In fact, start.elf
is not just firmware for the GPU, It is a proprietary operating system called
VideoCore OS (VCOS). When the normal OS (Linux) requires an element not
directly accessible to it, Linux communicates with VCOS using the mailbox
messaging system.

Department of Electronics & Communication Engineering 49


AADHAAR BASED ELECTRONIC VOTING MACHINE

Power On

Hardwired First Stage Bootloader

Second Stage Bootloader

Mount bootcode.bin from FAT32 boot partition from SD Card to L2 cache of GPU.

Third Stage Bootloader


bootcode.bin starts start.elf which splits the ram. Then load kernel.img. Operating
System is now loaded.

Figure 3.10: Boot process of Raspberry Pi

3.4.3 The NOOBS installer

The Raspberry Pi package only comes with the main board and nothing else. It
does not come shipped with an operating system. Operating systems are loaded on a SD
card from a computer and then the SD card is inserted in the Pi which becomes the
primary boot device.

Installing operating system can be easy for some enthusiasts, but for some
beginners working with image files of operating systems can be difficult. So the
Raspberry Pi foundation made a software called NOOBS – New Out Of Box Software
which eases the process of installing an operating system on the Pi.

The NOOBS installer can be downloaded from the official website. A user only
needs to connect a SD card with the computer and just run the setup file to install
NOOBS on the SD card. Next, insert the card on the Raspberry Pi. On booting the first
time, the NOOBS interface is loaded and the user can select from a list of operating
systems to install. It is much convenient to install the operating system this way. Also
once the operating system is installed on the card with the NOOBS installer, every time
the Pi boots, a recovery mode provided by the NOOBS can be accessed by holding the
shift key during boot. It also allows editing of the config.txt file for the operating system.

Department of Electronics & Communication Engineering 50


AADHAAR BASED ELECTRONIC VOTING MACHINE

Raspberry Pi compatible operating systems

Distribution Type Memory Packages


footprint
Arch Linux ARM Linux 8,700
BerryTerminal Linux
Bodhi Linux Raspbian 35,000+
ARMHF
Debian ARM Linux 20,000+
Fedora Remix Linux 16,464?
Gentoo Linux Linux ~23 MiB
IPFire Linux ~20 MiB 144
I2PBerry Linux 20,000+

Meego MER + XBMC Linux (embedded) ~34 MiB + ~320 (core)


XBMC
Moebius Raspbian ~20 MiB (core) + Raspbian
Repositories
nOS Linux ~90 MiB 35,000+
openSUSE Linux 3.11 28 MiB (inc. 6300
X11)
OpenWRT Linux 3,3MiB 3358
PiBang Linux Linux_3.6.11 &
SystemD
PwnPi Linux 20,000+
QtonPi Linux
VPNbian Linux ~40 MiB w/o 35,000+
desktop
Raspbian Linux ~30 MiB w/o 35,000+
desktop
OpenELEC Linux 3.10.16 95 MiB (incl. ~140 (+ 7 via xbmc)
(embedded) XBMC)
XBian Raspbian 35,000+
raspbmc Raspbian 20,000+
RISC OS RISC OS
Aros hosted on Mixed Debian6 and <~50 MiB
Raspbian Limited Aros
Demo
Plan9 Plan 9
SlaXBMCRPi Linux 3.10.36+ 476
(+ Official
SlackwareARM 14.1

Department of Electronics & Communication Engineering 51


AADHAAR BASED ELECTRONIC VOTING MACHINE

Packages)
PiMAME Linux
PiBox Linux/Buildroot
pipaOS Raspbian ~32 MiB 37.500
Raspberry WebKiosk Raspbian
Volumio Raspbian
Nard SDK Embedded Linux ~40 MB

Table 2: List of supported Operating Systems

Software Programming

In Raspberry Pi we are installing Linux debian operating system. We can operate


Raspberry Pi using the Linux commands. The Extra Putty software is used to
communicate with the Raspberry Pi. The Putty software is used Pi IP address to
communicate with device. The putty configuration window is given below

Fig 5.2 Putty Configuration window

When the Raspberry is connected with modem, modem will assign the IP address
to the Raspberry Pi, that IP we will give in Host name in Putty configuration. The

Department of Electronics & Communication Engineering 52


AADHAAR BASED ELECTRONIC VOTING MACHINE

connection type is in SSH mode. The SSH or Secure Shell is a cryptographic network
protocol for initiating text-based shell sessions on remote machines in a secure way.

After setting connection type, we are click on open. Then the window will appear like
below

Fig 5.3 Raspberry Pi Log in page in Putty

We can login into Raspberry Pi using username and password. After entering the
username and password the window will appear like below.

Fig 5.4 Putty window after entering into Raspberry Pi

5.3 Linux Commands


Department of Electronics & Communication Engineering 53
AADHAAR BASED ELECTRONIC VOTING MACHINE

LS:

Lists the content of the current directory (or one that is specified). Can be used with
the  -l  flag to display additional information (permissions, owner, group, size, date and

timestamp of last edit) about each file and directory in a list format. The  -a  flag allows

you to view files beginning with  .  (i.e. dotfiles).

CD:

Changes the current directory to the one specified. Can use relative (i.e.  cd directoryA )

or absolute (i.e.  cd /home/pi/directoryA ) paths

PWD:

Displays the name of the current working directory, i.e.  pwd  will output something

like  /home/pi.

MKDIR:

Makes a new directory, e.g.  mkdir newDir  would create the directory  newDir in the
present working directory.

RMDIR:

Remove empty directories, e.g.  rmdir oldDir  will remove the directory  oldDir  only if it
is empty.

RM:

Removes the specified file (or recursively from a directory when used with  -r ). Be
careful with this! Files deleted in this way are mostly gone for good!

CP:

Makes a copy of a file and places it at the specified location (essentially doing a 'copy-
paste'), for example -  cp ~/fileA /home/otherUser/  would copy the file fileA  from your

home directory to that of the user  otherUser  (assuming you have permission to copy it

there!). This command can either take  FILE FILE  ( cp fileA fileB ),  FILE DIR  ( cp

fileA /directoryB/ ) or  -r DIR DIR (which recursively copies the contents of directories)
as arguments.
Department of Electronics & Communication Engineering 54
AADHAAR BASED ELECTRONIC VOTING MACHINE

MV:

Moves a file and places it at the specified location (so where  cp  performs a 'copy-

paste',  mv  performs a 'cut-paste'). The usage is similar to  cp , so  mv ~/fileA

/home/otherUser/  would move the file  fileA  from your home directory to that of the

user otherUser. This command can either take  FILE FILE  ( mv fileA fileB ),  FILE

DIR  ( mv fileA /directoryB/ ) or  DIR DIR  ( mv /directoryB /directoryC ) as


arguments. This command is also useful as a method to rename files and directories after
they've been created

TOUCH:

Either sets the last modified time-stamp of the specified file(s) or creates it if it does not
already exist.

CAT:

Lists the contents of file(s), e.g.  cat thisFile  will display the contents of  thisFile . Can

be used to list the contents of multiple files, i.e.  cat *.txt  will list the contents of

all  .txt  files in the current directory.

HEAD:

Displays the beginning of a file. Can be used with  -n  to specify the number of lines to
show (by default 10), or with  -c  to specify the number of bytes.

TAIL:

Department of Electronics & Communication Engineering 55


AADHAAR BASED ELECTRONIC VOTING MACHINE

Displays the end of a file. The starting point in the file can be specified either through  -

b  for 512 byte blocks,  -c  for bytes, or  -n  for number of lines.

SSH:

Secure shell. Connect to another computer using an encrypted network connection. For
more details see SSH (secure shell)

SCP:

Copies a file from one computer to another using ssh. For more details see SCP

SUDO:

Run a command as a superuser, or another user. Use  sudo -s  for a superuser shell. For
more details see Root user / sudo

DD:

Copies a file converting the file as specified. It is often used to copy an entire disk to a
single file or back again eg.  dd if=/dev/sdd of=backup.img  will create a backup image
from an SD card or USB disk drive at /dev/sdd. Make sure to use the correct drive when
copying an image to the SD card as it can overwrite the entire disk.

DF:

Display the disk space available and used on the mounted filesystems. Use  df -h  to see
the output in a human readable format using M for MBs rather than showing number of
bytes.

UNZIP:

Extracts the files from a compressed zip file.

TAR:

Department of Electronics & Communication Engineering 56


AADHAAR BASED ELECTRONIC VOTING MACHINE

Store or extract files from a tape archive file. It can also reduce the space required by
compressing the file similar to a zip file.

To create a compressed file use  tar -cvzf *filename.tar.gz* *directory/*  To extract the
contents of a file use  tar -xvzf *filename.tar.gz*

PIPES:

A pipe allows the output from one command to be used as the input for another
command. The pipe symbol is a vertical line  | . For example to only show the first 10
entries of the ls command it can be piped through the head command  ls | head

TREE:

Show a directory and all subdirectories and files indented as a tree structure.

Run a command in the background freeing up the shell for future commands.

WGET:

Download a file from the web directly to the computer e.g.  wget
http://www.raspberrypi.org/documentation/linux/usage/commands.md  will download
this file to your computer as  commands.md

CURL:

Download or upload a file to/from a server. By default it will output the file contents of
the file to the screen.

MAN:

Show the manual page for a file. To find out more run  man man  to view the manual
page of the man command.

GREP:

Department of Electronics & Communication Engineering 57


AADHAAR BASED ELECTRONIC VOTING MACHINE

Search inside files for certain search patterns e.g.  grep "search" *.txt  will look in all the
files in the current directory ending with .txt for the string search.

Supports regular expressions which allows special letter combinations to be included in


the search.

AWK:

Programming language useful for searching and manipulating text files.

FIND:

Searches a directory and subdirectories for files matching certain patterns.

WHEREIS:

Finds the location or a command. Looks through standard program locations until it finds
the requested command.

CHAPTER 3

SYSTEM OPERATION
In earlier days the election process is in such a way that there will a ballot box and a
paper with all the political parties list. While voting the voter needs to put a stamp over
the party symbol of his/her desired candidate in a particular consistency. This is a long
time consuming process and very much prone to errors. Also the chances for rigging were
more in this traditional method. To overcome all these ballot papers, stamps, boxes etc.,
we are going for Aadhaar based EVM. So that, we overcome time consumption, Rigging,
insecurities etc.,

Here in Aadhaar based EVM, we are using the data based server for Aadhaar
details, Raspberry-pi for the web technology and arduino is used for interfacing
Raspberry-pi. The voter is allowed into election booth with Aadhaar card ID. Here the
voter first gives his Aadhaar card for QR reading/Keypad operator. The voter is allowed

Department of Electronics & Communication Engineering 58


AADHAAR BASED ELECTRONIC VOTING MACHINE

into the ballot box room after the QR reading/UID authentication is done successfully by
the operator. After Authentication the LCD in EVM displays as “welcome voter”. The
voter needs to scan his thumb using the biometric and only if the thumb information that
is scanned is matched with the pre-loaded server data the voter will allow to cast the vote.
Otherwise the Authentication will fail and voter will not be able to cast the vote. Once the
voter is authenticated the switches of parties will enable and also the information of voter
will be shown on display of EVM. After casting the vote the switches will be disabled
until next voter is authenticated and EVM shows a message as “thank you for voting”. At
the same time the printer connected to EVM will print the casted vote information along
with a message “Please drop the token into ballot box”. The token is also useful to verify
the vote casted by the voter. And finally the voter will check the token and drop it into the
ballot box. The total information of casted votes is sent to the server using web
technology so that the results can be declared among all the consistencies.

This concludes that the Aadhaar based EVM will useful

- To avoid Rigging
- To avoid time consumption
- To keep the voter’s information more secured.
-

Block Diagram:

Department of Electronics & Communication Engineering 59


AADHAAR BASED ELECTRONIC VOTING MACHINE

Flow Chart:

Department of Electronics & Communication Engineering 60


AADHAAR BASED ELECTRONIC VOTING MACHINE

Programming Code:

Department of Electronics & Communication Engineering 61


AADHAAR BASED ELECTRONIC VOTING MACHINE

//#include <LiquidCrystal.h>

#include <Adafruit_Fingerprint.h>

#include <SoftwareSerial.h>

#include <Keypad.h>

#include <Wire.h>

#include <EEPROM.h>

#include <LiquidCrystal_I2C.h>

int cvote = 0, testz=0;

LiquidCrystal_I2C lcd(0x20, 16, 2);

int break1;

int getFingerprintIDez();

SoftwareSerial mySerial(13, 12);

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

int temp1, temp2, temp3;

int MrA = 11, MrB = 10, MrC = 0;

int MrA1 = 0, MrB1 = 0, MrC1 = 0;

int a = 0;

int TRS, TDP, CONG, AAP;

int i = 0, j, count = 0;

int buz = 9;

int z;

int addr = 0;

char test[4];

const byte ROWS = 4; //four rows

const byte COLS = 3; //three columns

char keys[ROWS][COLS] = {

Department of Electronics & Communication Engineering 62


AADHAAR BASED ELECTRONIC VOTING MACHINE

'1', '2', '3'

},

'4', '5', '6'

},

'7', '8', '9'

},

'*', '0', '#'

};

byte rowPins[ROWS] = {

5, 4, 3, 2

}; //connect to the row pinouts of the keypad

byte colPins[COLS] = {

8, 7, 6

}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

char test1[] = "12418";

char test2[] = "12435";

char test3[] = "12423";

char clr[]="#####";

char res[]="*****";

//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

Department of Electronics & Communication Engineering 63


AADHAAR BASED ELECTRONIC VOTING MACHINE

void setup()

lcd.init();

pinMode(buz,OUTPUT);

Serial.begin(9600);

// lcd.begin(16, 2);

//Serial.println("fingertest");

// set the data rate for the sensor serial port

finger.begin(57600);

if (finger.verifyPassword()) {

//Serial.println("Found fingerprint sensor!");

lcd.print("Enter your Adhar No");

else {

Serial.println("Did not find fingerprint sensor :(");

while (1);

//Serial.println("Waiting for valid finger...");

pinMode(MrA, INPUT);

pinMode(MrB, INPUT);

pinMode(MrC, INPUT);

void loop()

while(1)

Department of Electronics & Communication Engineering 64


AADHAAR BASED ELECTRONIC VOTING MACHINE

char key = keypad.getKey();

//lcd.setCursor(16,1);

//lcd.print("Enter adhar no.");

delay(100);

//Serial.println("Enter your aadhar");

if (key)

//Serial.println("Test Point:");

delay(100);

//Serial.print(key);

test[i] = key;

//lcd.print(key);

delay(100);

lcd.clear();

lcd.print(test);

//delay(400);

//lcd.clear();

i++;

if (i == 5)

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

//Serial.print(test[j]);

delay(100);

if (test[j] == clr[j])

Department of Electronics & Communication Engineering 65


AADHAAR BASED ELECTRONIC VOTING MACHINE

for (int i = 0; i < 512; i++)

EEPROM.write(i, 0);

lcd.clear();

lcd.print("votes cleared");

if (test[j] == test1[j])

temp1++;

if (test[j] == test2[j])

temp2++;

if (test[j] == test3[j])

temp3++;

if (test[j] == res[j])

lcd.clear();

lcd.print("AAP:");

addr=1;

MrA1 = EEPROM.read(addr);

Department of Electronics & Communication Engineering 66


AADHAAR BASED ELECTRONIC VOTING MACHINE

lcd.print(MrA1);

lcd.print(" BJP:");

addr=2;

MrB1 = EEPROM.read(addr);

lcd.print(MrB1);

lcd.setCursor(16,2);

lcd.print(" JNP:");

addr=3;

MrC1 = EEPROM.read(addr);

lcd.print(MrC1);

lcd.print(" TRS:");

addr=4;

MrC1 = EEPROM.read(addr);

lcd.print(MrC1);

while(1);

if (temp1 == 5)

int vot;

vot=EEPROM.read(11);

if(vot==0){

lcd.clear();

lcd.print("welcome subbu");

delay(100);

Department of Electronics & Communication Engineering 67


AADHAAR BASED ELECTRONIC VOTING MACHINE

lcd.setCursor(16,2);

lcd.print(" Place your Thumb");

count = 1;

while (break1<100)

getFingerprintIDez();

cvote=0;

delay(50);

break1++;

if (break1 == 100)

break;

else{

lcd.clear();

lcd.print("already voted");

buz=9;

digitalWrite(buz,HIGH);

delay(3000);

digitalWrite(buz,LOW);

delay(200);

break;

Department of Electronics & Communication Engineering 68


AADHAAR BASED ELECTRONIC VOTING MACHINE

if (temp2 == 5)

{ int vot;

vot=EEPROM.read(12);

if(vot==0){

lcd.clear();

lcd.print("welcome praveen");

delay(100);

lcd.setCursor(16,2);

lcd.print(" Place your Thumb");

count = 2;

while (break1<100)

getFingerprintIDez();

delay(50);

cvote=0;

break1++;

if (break1 == 100)

break;

else{

lcd.clear();

lcd.print("already voted");

buz=9;

Department of Electronics & Communication Engineering 69


AADHAAR BASED ELECTRONIC VOTING MACHINE

digitalWrite(buz,HIGH);

delay(3000);

digitalWrite(buz,LOW);

delay(200);

break;

if (temp3 == 5)

int vot;

vot=EEPROM.read(13);

if(vot==0){

lcd.clear();

lcd.print("welcome Mahesh");

delay(100);

lcd.setCursor(16,2);

lcd.print(" Place your Thumb");

count = 3;

while (break1<100)

getFingerprintIDez();

cvote=0;

delay(50);

break1++;

if (break1 == 100)

Department of Electronics & Communication Engineering 70


AADHAAR BASED ELECTRONIC VOTING MACHINE

break;

else{

lcd.clear();

lcd.print("already voted");

buz=9;

digitalWrite(buz,HIGH);

delay(3000);

digitalWrite(buz,LOW);

delay(200);

break;

// returns -1 if failed, otherwise returns ID #

uint8_t getFingerprintID() {

uint8_t p = finger.getImage();

switch (p) {

case FINGERPRINT_OK:

Serial.println("Image taken");

break;

case FINGERPRINT_NOFINGER:

Department of Electronics & Communication Engineering 71


AADHAAR BASED ELECTRONIC VOTING MACHINE

Serial.println("No finger detected");

return p;

case FINGERPRINT_PACKETRECIEVEERR:

Serial.println("Communication error");

return p;

case FINGERPRINT_IMAGEFAIL:

Serial.println("Imaging error");

return p;

default:

Serial.println("Unknown error");

return p;

// OK success!

p = finger.image2Tz();

switch (p) {

case FINGERPRINT_OK:

Serial.println("Image converted");

break;

case FINGERPRINT_IMAGEMESS:

Serial.println("Image too messy");

return p;

case FINGERPRINT_PACKETRECIEVEERR:

Serial.println("Communication error");

return p;

case FINGERPRINT_FEATUREFAIL:

Serial.println("Could not find fingerprint features");

Department of Electronics & Communication Engineering 72


AADHAAR BASED ELECTRONIC VOTING MACHINE

return p;

case FINGERPRINT_INVALIDIMAGE:

Serial.println("Could not find fingerprint features");

return p;

default:

Serial.println("Unknown error");

return p;

// OK converted!

p = finger.fingerFastSearch();

if (p == FINGERPRINT_OK) {

Serial.println("Found a print match!");

} else if (p == FINGERPRINT_PACKETRECIEVEERR) {

Serial.println("Communication error");

return p;

} else if (p == FINGERPRINT_NOTFOUND) {

Serial.println("Did not find a match");

return p;

} else {

Serial.println("Unknown error");

return p;

// found a match!

Serial.print("Found ID #"); Serial.print(finger.fingerID);

Serial.print(" with confidence of "); Serial.println(finger.confidence);

Department of Electronics & Communication Engineering 73


AADHAAR BASED ELECTRONIC VOTING MACHINE

int getFingerprintIDez()

uint8_t p = finger.getImage();

if (p != FINGERPRINT_OK) return -1;

p = finger.image2Tz();

if (p != FINGERPRINT_OK) return -1;

p = finger.fingerFastSearch();

if (p != FINGERPRINT_OK) return -1;

while (count == 1)

delay(1000);

a = finger.fingerID;

if (a == 1)

if (finger.confidence > 20)

lcd.clear();

lcd.print("Cast your vote");

delay(500);

int reada = digitalRead(MrA);

int readb = digitalRead(MrB);

int readc = digitalRead(MrC);

while (cvote == 0)

if (digitalRead(MrA) == LOW && digitalRead(MrB) == HIGH &&


digitalRead(MrC) == HIGH)

{
Department of Electronics & Communication Engineering 74
AADHAAR BASED ELECTRONIC VOTING MACHINE

addr=1;

MrA1 = EEPROM.read(addr);

MrA1 = MrA1 + 1;

EEPROM.write(addr, MrA1);

lcd.clear();

lcd.print("vote counted");

EEPROM.write(11, 1);

delay(100);

cvote = 1;

break;

if (digitalRead(MrA) == HIGH && digitalRead(MrB) == LOW &&


digitalRead(MrC) == HIGH)

//Serial.println(readb);

//Serial.print("cond matched");

addr=2;

MrB1 = EEPROM.read(addr);

MrB1 = MrB1 + 1;

EEPROM.write(addr, MrB1);

lcd.clear();

lcd.print("vote counted");

//Serial.println("Voted for BJP");

//Serial.println(MrB1,DEC);

delay(1000);

EEPROM.write(11, 1);

cvote = 1;
Department of Electronics & Communication Engineering 75
AADHAAR BASED ELECTRONIC VOTING MACHINE

break;

if (digitalRead(MrA) == HIGH && digitalRead(MrB) == HIGH &&


digitalRead(MrC) == LOW)

addr=3;

MrC1 = EEPROM.read(addr);

MrC1 = MrC1 + 1;

EEPROM.write(addr, MrC1);

lcd.clear();

lcd.print("vote counted");

delay(1000);

cvote = 1;

EEPROM.write(11, 1);

break;

for(int s=1;s<4;s++)

int k=EEPROM.read(s);

Serial.print(k);

Serial.print(" ");

Serial.println();

delay(100);

break;
Department of Electronics & Communication Engineering 76
AADHAAR BASED ELECTRONIC VOTING MACHINE

else

lcd.clear();

lcd.print("Access Failed");

digitalWrite(buz,HIGH);

delay(1000);

digitalWrite(buz,LOW);

delay(200);

break;

while (count == 2)

delay(1000);

a = finger.fingerID;

if (a == 2)

if (finger.confidence > 20)

lcd.clear();

lcd.print("Cast your vote");

delay(500);

int reada = digitalRead(MrA);

int readb = digitalRead(MrB);

int readc = digitalRead(MrC);

Department of Electronics & Communication Engineering 77


AADHAAR BASED ELECTRONIC VOTING MACHINE

while (cvote == 0)

if (digitalRead(MrA) == LOW && digitalRead(MrB) == HIGH &&


digitalRead(MrC) == HIGH)

addr=1;

MrA1 = EEPROM.read(addr);

MrA1 = MrA1 + 1;

EEPROM.write(addr, MrA1);

lcd.clear();

lcd.print("vote counted");

delay(100);

EEPROM.write(12, 1);

cvote = 1;

break;

if (digitalRead(MrA) == HIGH && digitalRead(MrB) == LOW &&


digitalRead(MrC) == HIGH)

addr=2;

MrB1 = EEPROM.read(addr);

MrB1 = MrB1 + 1;

EEPROM.write(addr, MrB1);

lcd.clear();

lcd.print("vote counted");

delay(1000);

cvote = 1;

Department of Electronics & Communication Engineering 78


AADHAAR BASED ELECTRONIC VOTING MACHINE

EEPROM.write(12, 1);

break;

if (digitalRead(MrA) == HIGH && digitalRead(MrB) == HIGH &&


digitalRead(MrC) == LOW)

addr=3;

MrC1 = EEPROM.read(addr);

MrC1 = MrC1 + 1;

EEPROM.write(addr, MrC1);

lcd.clear();

lcd.print("vote counted");

EEPROM.write(12, 1);

delay(100);

cvote = 1;

break;

//Serial.print("inside");

for(int s=1;s<4;s++)

int k=EEPROM.read(s);

Serial.print(k);

Serial.print(" ");

Serial.println();

}
Department of Electronics & Communication Engineering 79
AADHAAR BASED ELECTRONIC VOTING MACHINE

delay(100);

break;

else

lcd.clear();

lcd.print("Access Failed");

digitalWrite(buz,HIGH);

delay(1000);

digitalWrite(buz,LOW);

delay(200);

break;

while (count == 3)

//Serial.println("Inside While");

delay(1000);

a = finger.fingerID;

if (a == 3)

//Serial.print(finger.confidence);

if (finger.confidence > 20)

lcd.clear();

lcd.print("Cast your vote");

Department of Electronics & Communication Engineering 80


AADHAAR BASED ELECTRONIC VOTING MACHINE

delay(500);

int reada = digitalRead(MrA);

int readb = digitalRead(MrB);

int readc = digitalRead(MrC);

//Serial.println(reada);

//Serial.println(readb);

//Serial.println(readc);

while (cvote == 0)

if (digitalRead(MrA) == LOW && digitalRead(MrB) == HIGH &&


digitalRead(MrC) == HIGH)

// Serial.println(reada);

// Serial.println("cond matched");

addr=1;

MrA1 = EEPROM.read(addr);

MrA1 = MrA1 + 1;

EEPROM.write(addr, MrA1);

//Serial.println("Voted for AAP");

//Serial.println(MrA1,DEC);

lcd.clear();

lcd.print("vote counted");

delay(1000);

EEPROM.write(13, 1);

cvote = 1;

break;

}
Department of Electronics & Communication Engineering 81
AADHAAR BASED ELECTRONIC VOTING MACHINE

if (digitalRead(MrA) == HIGH && digitalRead(MrB) == LOW &&


digitalRead(MrC) == HIGH)

//Serial.println(readb);

//Serial.print("cond matched");

addr=2;

MrB1 = EEPROM.read(addr);

MrB1 = MrB1 + 1;

EEPROM.write(addr, MrB1);

lcd.clear();

lcd.print("vote counted");

//Serial.println("Voted for BJP");

//Serial.println(MrB1,DEC);

delay(1000);

EEPROM.write(13, 1);

cvote = 1;

break;

if (digitalRead(MrA) == HIGH && digitalRead(MrB) == HIGH &&


digitalRead(MrC) == LOW)

//Serial.println(reada);

//Serial.println(readb);

//Serial.println(readc);

//Serial.print("cond matched");

addr=3;

MrC1 = EEPROM.read(addr);

Department of Electronics & Communication Engineering 82


AADHAAR BASED ELECTRONIC VOTING MACHINE

MrC1 = MrC1 + 1;

EEPROM.write(addr, MrC1);

lcd.clear();

lcd.print("vote counted");

//Serial.print("Voted for TRS");

//Serial.println(MrC1,DEC);

delay(1000);

EEPROM.write(13, 1);

cvote = 1;

break;

for(int s=1;s<4;s++)

int k=EEPROM.read(s);

Serial.print(k);

Serial.print(" ");

Serial.println();

delay(100);

break;

else

lcd.clear();

Department of Electronics & Communication Engineering 83


AADHAAR BASED ELECTRONIC VOTING MACHINE

lcd.print("Access");

lcd.setCursor(16,2);

lcd.print(" Failed");

delay(1000);

digitalWrite(buz,HIGH);

delay(1000);

digitalWrite(buz,LOW);

delay(200);

break;

}}

Raspberry code:

import serial as io

import time

ser=io.Serial('/dev/ttyUSB6',9600);

while 1:

a=ser.readline();

time.sleep(5);

f=open('data1.txt','w');

f.write(a);

f.write('\n');

f.close();

website code:

<!DOCTYPE html>

Department of Electronics & Communication Engineering 84


AADHAAR BASED ELECTRONIC VOTING MACHINE

<html>

<head>

<title> VEHICLE TRACKING </title>

<?php

$url1=$_SERVER['REQUEST_URI'];

header("Refresh: 5; URL=$url1");

?>

<?php

$filename="/home/pi/subbu/res.txt";

$file=fopen($filename,"r");

$filesize=filesize($filename);

$filetext=fread($file,$filesize);

fclose($file);

$i=0;

$a=$filetext[0];

$b=$filetext[2];

$c=$filetext[4];

?>

</head>

<body style="background:#E3F6CE;">

<center>

<h1>AADHAR BASED EVM !<h1>

</center>

<div>

<table border="5" width=1000;height=1000;>

<tbody>

Department of Electronics & Communication Engineering 85


AADHAAR BASED ELECTRONIC VOTING MACHINE

<tr>

<th><h4>PARTY</h4><th>

<th><h4>NO. OF VOTES</h4><th>

<tr>

<tr>

<th style="color:RED;font-size:32pt">JSP<th>

<th>

<script>

var a = <?php echo json_encode($a); ?>;

document.write(a);

</script>

</th>

</tr>

<tr>

<th style="color:ORANGE;font-size:32pt">BJP<th>

<th><script>

var b = <?php echo json_encode($b); ?>;

document.write(b);

</script>

</th>

</tr>

<tr>

<th style="color:PINK;font-size:32pt">TRS<th>

<th><script>

var c = <?php echo json_encode($c); ?>;

document.write(c);

Department of Electronics & Communication Engineering 86


AADHAAR BASED ELECTRONIC VOTING MACHINE

</script>

</th>

</tr>

</tbody>

</table>

</div>

</body>

</html>

CHAPTER 4
CONCLUSION

This review discussed introduction about EVM and its variation, Issues of EVM,
Taxonomy, and Biometric based EVM. Our efforts to understand electronic voting
systems leave us optimistic, but concerned. This paper suggest that the EVM system has
to be further studied and innovated to reach all level of community, so that the voter
confidence will increase and election officials will make more involvement in purchasing
the innovated EVM’s for conduct smooth, secure, tamper- resistant Elections.

Department of Electronics & Communication Engineering 87

You might also like