Vous êtes sur la page 1sur 20

Microcontroller Based EVM-Electronic Voting Machine

India is the largest democratic country in the world. Active involvement of the

public in the formation of the government is an essential aspect of a democratic

government. This is confirmed by an election. Conducting elections in a populated

country like India is a difficult task. It’s a test to conduct elections for collection of

candidates to signify the people of the country at different levels. Even more

important is the timely announcement of results. This is required to bring

steadiness in the governance and stable financial growth of the nation. To

overcome this problem, An EVM (electronic voting machine) is an answer to all

these complications. In the worldwide, several countries have shown their interest

in learning the mechanism behind this powerful machine. It’s got a very simple

interface, its tamper proof, avoids the fake voting and it has helped in receiving rid

of the time consuming duty of counting.

What is an Electronic Voting Machine?

The term EVM or electronic voting machine was designed by the election

commission of India in association with two public sector undertakings BEL,

Banglore and ECIL, Hyderabad. In the year 1982 these devices were first used in
the by-election to the Assembly Constituency of Prarur, Kerala for fifty polling

stations. EVM’s make polling much faster and also more reliable than ballot

papers, by avoiding bogus voting to a great range. The electronic voting machine

saves time, money and manpower. It helps in keeping the secrecy of voting data.

At the end of the elections, you can check the result by pressing a button.
EVM-Electronic Voting Machine Project

The Project Electronic Voting System is an interesting project which uses

microcontroller as its brain. The project is designed for three contestants. Voters

can poll their vote to any one of the contestant. In this project one port is dedicated

for push button switches for eight contestants, master switch for polling officer.

The “Electronic Voting Machine” project is built with transformer (230 – 12V

AC), voltage regulator (LM 7805), rectifier, filter, microcontroller

(at89s52/at89c51), led, push buttons, buzzers, BC547, 1n4007, resistor and

capacitor.

Electronic Voting Machine Block Diagram


Power Supply

The 230V AC power supply is the first step down to 12V AC using a step-down

transformer. This is then converted to the DC using a bridge rectifier.The AC

ripples are filtered out by using a capacitor and given to the input pin of the voltage

regulator 7805.At the output pin of this regulator, we get a constant 5V DC which

is used for MC and other ICs in this project.

Microcontroller

A Microcontroller is a small computer on a single integrated circuit containing a

processor core, memory, and programmable input /output peripherals. The

Atmel 8-bit AVR RISC-based microcontroller combines 32 kB ISP flash memory

with read-while-write capabilities, 1 kB EEPROM, 2 kB SRAM, 23 general

purpose I/O lines, 32 general purpose working registers, three flexible

timer/counters with compare modes, internal and external interrupts, serial

programmable USART, a byte-oriented 2-wire serial interface, SPI serial port, 6-

channel 10-bit A/D converter (8-channels in TQFP and QFN/MLF packages),


programmable watchdog timer with internal oscillator, and five software selectable

power saving modes. The device operates between 1.8-5.5 volts. The device

achieves throughput approaching 1 MIPS per MHz.

As of 2013 the ATmega328 is commonly used in many projects and autonomous

systems where a simple, low-powered, low-cost micro-controller is needed[citation


needed]
. Perhaps the most common implementation of this chip is on the

popular Arduino development platform, namely the Arduino Uno and Arduino

Nano models.

ATMEGA 328
Pin Configuration

Pin Diagram of ATMEGA 328

Microcontrollers are designed for embedded applications, in contrast to

microprocessors used in personal computers or other general purpose applications

consisting of various discrete chips. Microcontrollers are used in automatically

controlled products and devices, such as automobile engine control systems,

remotes controls, toys. By reducing the size and cost compared to a design that

uses a separate microprocessor, memory, and input /output devices,


microcontrollers make it economical to digitally control even ,ore devices and

processes.It is a smaller computer and it has on-chip RAM, ROM, I/O ports

Features of AT89S51/52 includes the following.

LEDS

LEDs are semiconductor devices are made out of silicon. When current passes

through the LED, it emits photons as a byproduct. Normal light bulbs produce light

by heating a metal filament until its white hot. LEDs present many advantages over

traditional light sources, including lower energy consumption, longer lifetime,

improved robustness, smaller size and faster switching.


LEDs

Piezo Buzzer

This buzzer is a piece type audio signaling device, which has a piece element and a

oscillating circuit inside which oscillates the piezo brass base plate, which when

given voltage difference produces the sound of a predefined frequency.


Piezo Buzzer

Features

 These high reliability piezo buzzers are applicable to general electronics

equipment.

Compact, pin terminal type Piezo buzzer with 4 KHz output.

 Pin type terminal construction enables direct mounting onto printed circuit

boards.

BC547 Transistor

The BC547 transistor is an NPN Epitaxial Silicon Transistor. The BC547 transistor

is a general-purpose transistor in small plastic packages. It is used in general-

purpose switching and amplification BC847/BC547 series 45 V, 100 mA NPN

general-purpose transistors. Whenever base is high, then current starts flowing


through the base and emitter and after that only current will pass from collector to

emitter.

BC547 Transistor

Software Requirements

Keil an ARM Company makes C compilers, macro assemblers, real-time kernels,

debuggers, simulators, integrated environments, evaluation boards, and emulators

for ARM7/ARM9/Cortex-M3, XC16x/C16x/ST10, 251, and 8051 MCU families.

Compilers are programs used to convert a High Level Language to object code.

Desktop compilers produce an output object code for the underlying


microprocessor, but not for other microprocessors. i.e., the programs written in one

of the HLL like ‘C’ will compile the code to run on the system for a particular

processor like x86 (underlying microprocessor in the computer). For example,

compilers for DOS platform is different from the Compilers for Unix platform So

if one wants to define a compiler then compiler is a program that translates source

code into object code.

EEPROM Memory

EEPROM memory is used to store the voting sum. The advantage of this memory

is that it stores data in memory even after power is turned off. The interfacing of

the I2C bus protocol is used for communication with EEPROM.

EEPROM Memory
Working of Electronic Voting Machine

This is an interesting project designed with a microcontroller which works as a

brain. This project is designed for 8-contestants. Electorates can poll their vote to

any one of the competitors. In this proposed system, one port is devoted to 8-push

button switches for 8-contestants, and a master switch for voting officer.

The simple programming of this project can be written in assembly language, and

it is dumped into the microcontroller to accept votes and, to keep calculating the

total votes polled. A Polling-officer switch is provided to avoid numerous polling

by only voter. Every voter gets support from the voting officer. If the officer issues

sanction with his control switch, then only the elector can poll his vote.

This polling of approval is specified by a long buzzing sound. The elector count is

stored in EEPROM. An LCD display is offered to display the total votes count

polled, and separate contestant -vise votes polled.

A Remove button is also offered in order to make sure the insides of the EEPROM

is zeroed before the polling process starts. A beeper is offered for audio effect of

the switch bounce. When a switch is bounced, the system recognizes the bounce by
a small beep sound. If an elector tries to vote several times a lengthy beep sound is

produced.

The project can be enhanced by adding a GSM or WIFI module which facilities the

voting operation by sending a simple SMS over the network or access through a

Web page over the internet network.

Advantages and Applications

The advantages and application of electronic voting machine include the following.

 It is inexpensive

 It requires less manpower

 Time conscious, as less time necessary for polling and counting

 Avoids illegal voting

 Saves the cost of transportation due to its compact size

 Suitable on the voter’s part.

 This project could be used for the purpose of voting in any necessary place
Program:

#define F_CPU 1000000UL


#include <avr/io.h>
#include <util/delay.h>
#include "lcd.h"
#include "lcd.c"
#include <stdio.h>

void EEPROM_write(uint16_t add,char data)


{
while(EECR & 1<<EEWE);
EEAR=add;
EEDR=data;
EECR|=1<<EEMWE;
EECR|=1<<EEWE;
while(EECR & 1<<EEWE);
}

char EEPROM_read(uint16_t add)


{
while(EECR & 1<<EEWE);
EEAR=add;
EECR|=1<<EERE;
while(EECR & 1<<EERE);
return EEDR;
}

int main()
{

char a[20];

unsigned char A=0,B=0,C=0,D=0;

DDRC=0;
PORTC=255;
DDRB=0xff;

lcd_init(LCD_DISP_ON);

_delay_ms(100);
lcd_gotoxy(0,0);

lcd_puts("Iinitlizig...");

_delay_ms(1000);

while(1)
{

lcd_clrscr();
_delay_ms(52);
while(1)
{

A=EEPROM_read(0);
B=EEPROM_read(1);
C=EEPROM_read(2);
D=EEPROM_read(3);

lcd_gotoxy(0,0);
lcd_puts("Wait For Enable");

if((PINC & 0x01)==0x00)


{
_delay_ms(50);
if ((PINC & 0x01)==0x00)
{
break;
}
}
if((PINC & 0x02)==0x00)
{
_delay_ms(50);
if ((PINC & 0x02)==0x00)
{
lcd_clrscr();
sprintf(a,"BJP %d",A);
lcd_gotoxy(0,0);
lcd_puts(a);

sprintf(a,"CON %d",B);
lcd_gotoxy(8,0);
lcd_puts(a);

sprintf(a,"SP %d",C);
lcd_gotoxy(0,1);
lcd_puts(a);

sprintf(a,"BSP %d",D);
lcd_gotoxy(8,1);
lcd_puts(a);
while((PINC & 0x02)==0x00);

lcd_clrscr();
_delay_ms(100);
}
}

if ((PINC & 0x04)==0x00)


{
_delay_ms(50);
if ((PINC & 0x04)==0x00)
{

EEPROM_write(0,0);
EEPROM_write(1,0);
EEPROM_write(2,0);
EEPROM_write(3,0);
while((PINC & 0x04)==0x00);
lcd_clrscr();
_delay_ms(52);
lcd_gotoxy(0,0);
lcd_puts("All Vote clear");
_delay_ms(2000);
lcd_clrscr();
_delay_ms(52);
}
}

//wait until first passwrd enter

lcd_clrscr();
lcd_gotoxy(0,0);
lcd_puts("Now U enter the Vote");
lcd_gotoxy(0,1);
lcd_puts("Wait For Option");
_delay_ms(2000);

lcd_clrscr();
_delay_ms(100);
lcd_gotoxy(0,0);
lcd_puts("BJP");

lcd_gotoxy(8,0);
lcd_puts("CON");

lcd_gotoxy(0,1);
lcd_puts("SP");

lcd_gotoxy(8,1);
lcd_puts("BSP");
while(1)
{
if ((PINC & 0x02)==0x00)
{
_delay_ms(50);
if ((PINC & 0x02)==0x00)
{
A++;
EEPROM_write(0,A);

lcd_clrscr();
lcd_gotoxy(0,0);
lcd_puts("Your Vote is");
lcd_gotoxy(0,1);
lcd_puts("SucessFull Thanks");
_delay_ms(5000);

lcd_clrscr();

break;
}
}

if ((PINC & 0x04)==0x00)


{
_delay_ms(50);
if ((PINC & 0x04)==0x00)
{

B++;
EEPROM_write(1,B);

lcd_clrscr();
lcd_gotoxy(0,0);
lcd_puts("Your Vote is");
lcd_gotoxy(0,1);
lcd_puts("SucessFull Thanks");
_delay_ms(5000);

lcd_clrscr();

break;
}

if ((PINC & 0x08)==0x00)


{
_delay_ms(50);
if ((PINC & 0x08)==0x00)
{
C++;
EEPROM_write(2,C);

lcd_clrscr();
lcd_gotoxy(0,0);
lcd_puts("Your Vote is");
lcd_gotoxy(0,1);
lcd_puts("SucessFull Thanks");
_delay_ms(5000);

lcd_clrscr();

break;
}

if ((PINC & 0x10)==0x00)


{
_delay_ms(50);
if ((PINC & 0x10)==0x00)
{

D++;
EEPROM_write(3,D);

lcd_clrscr();
lcd_gotoxy(0,0);
lcd_puts("Your Vote is");
lcd_gotoxy(0,1);
lcd_puts("SucessFull Thanks");
_delay_ms(5000);

lcd_clrscr();

break;
}

}
}

Vous aimerez peut-être aussi