You are on page 1of 14

ELECTRONIC VOTING MACHINE USING ATMEGA-32 MICROCONTROLLER

ABSTRACT:
The main objective of this project is to implement the model of EVM using AVR Atmega32
Microcontroller. Since this is an advanced microcontroller, the design of EVM becomes
much simpler and more robust using AVR. This design can be used both for casting and
counting the votes. Also the hardware prototype of the EVM is designed using Arduino Nano
to ensure proper functioning. Being fast and absolutely reliable, the EVM saves considerable
time, money and manpower. And, of course, helps maintain total voting secrecy without the
use of ballot papers.

INTRODUCTION:
Electronic Voting Machine is introduced in 2004 by Election Commission for Indian
Elections to replace paper ballot system and make it secure, time effective in casting and even
time effective in counting the votes. The EVM machine has two units namely Balloting unit
and Control Unit, the balloting has 16 buttons for respective candidates and uses two
programmable logics whereas Control unit consist of Renesas H8/3644-series microcontroller
driven by an 8.8672 Mhz crystal oscillator, buzzer, buttons for input, two EPROM chips and
seven segment display.
The balloting and control unit is connected by 5m log cable. Electronic Voting Machine
(EVM) retains all the characteristics of voting by ballot papers, while making polling a lot
more expedient. The EVM is 100 percent tamper proof. And, at the end of the polling, just
press a button and there you have the results.
Also such kind of system becomes more economical as consequent expenditure incurred on
manpower is saved. It is also convenient on the part of voter, as he has to just press one key
whichever belongs to his candidates. Voting machines are the total combination of
mechanical, electromechanical, or electronic equipment (including software, firmware, and
documentation required to program control, and support equipment), that is used to define
ballots; to cast and count votes; to report or display election results; and to maintain and
produce any audit trail information.

Fig 1. Control Unit (at right) and Balloting unit (at left)
DESIGN METHODOLOGY:
 The EVM machine in Proteus Software has two units namely Balloting unit and
Control Unit, the balloting has 3 buttons for respective candidates and other 3
buttons Control, count and displaying the winner.
 The buzzer buzzes after every cast of vote and the status is displayed on the LCD
screen.
 The role of Balloting unit is to take the casted votes and control unit is where we can
control the casting system, can also to see the result and to seal the EVM.
 There are two modes of operations
o Voting mode : to cast vote and wait for authority switch
o Counting mode: to display total number of votes of parties and display the
winner
 Control switch is to enable the voting, it is under voting authority
 Buzzer indicator: Pressing of a key is indicated by a buzzer sound
 For the hardware cicuit also, there are two units namely Balloting unit and Control
Unit, the balloting has 4 buttons for respective candidates.
 The corresponding voting status is displayed on the serial monitor.

BLOCK DIAGRAM:

Fig 2: Block diagram of EVM which was used for Proteus simulation
Fig 3: Block diagram of EVM which is used for hardware implementation

TOOLS USED:
 Software Components • Jumper wires
• Proteus software Hardware Components
• AVR studio Arduino Nano
• Atmega 32 Arduino IDE
• LCD Switches
• BUZZER LED
• Switches Jumper wires
• LED Bread board
Laptop

PROGRAM CODE:
/*
* GccApplication3.c
*
* Created: 07-09-2020 21:09:23
* Author : Personal
*/

#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <string.h>
#define F_CPU 4000000UL
char D[50]=" ";
int main(void)
{
DDRA=0xff;//output port declaration
DDRB=0xff;//output port declaration
DDRD=0x00;
DDRC=0xff;
int i=0; int j=0; int k=0;
LCDcmd(0x01);// clear display screen
LCDcmd(0x0c);//Display on, Cursor Off
LCDcmd(0x38);// 8-bit, 2 lines mode
LCDcmd(0x06);
LCDcmd(0x80);
sprintf(D,"VOTING MACHINE");
LCDGoto(0,0);
LCDdisplay(D);
while(1)
{
if(PIND & 0b00010000)
{
sprintf(D,"You can Vote...");
LCDGoto(0,0);
LCDdisplay(D);
sprintf(D,"1>A 2>B 3>C");
LCDGoto(0,1);
LCDdisplay(D);
if(PIND & 0b00000001)
{
PORTC=0x01;
i=i+1;
LCDcmd(0x01);
sprintf(D,"accepted A");
LCDGoto(0,0);
LCDdisplay(D);

LCDcmd(0x01);
LCDGoto(0,0);

}
if(PIND & 0b00000010)
{
PORTC=0x01;
j=j+1;
LCDcmd(0x01);
sprintf(D,"accepted B");
LCDGoto(0,0);
LCDdisplay(D);
LCDcmd(0x01);
LCDGoto(0,0);
}

if(PIND & 0b00000100)


{
PORTC=0x01;
k=k+1;
LCDcmd(0x01);
sprintf(D,"accepted C");
LCDGoto(0,0);
LCDdisplay(D);

LCDcmd(0x01);
LCDGoto(0,0);
}
}
else if(PIND & 0b00001000)
{
if(i>j)
{
if(i>k)
{
LCDcmd(0x01);

sprintf(D,"winner is A");
LCDGoto(0,0);
LCDdisplay(D);
sprintf(D,"%d",i);
LCDGoto(0,1);
LCDdisplay(D);
_delay_ms(500);
}
}
else if(j>k)
{
LCDcmd(0x01);
sprintf(D,"winner is B");
LCDGoto(0,0);
LCDdisplay(D);
sprintf(D,"%d",j);
LCDGoto(0,1);
LCDdisplay(D);
_delay_ms(500);
}
else
{
LCDcmd(0x01);
sprintf(D,"winner is C");
LCDGoto(0,0);
LCDdisplay(D);
sprintf(D,"%d",k);
LCDGoto(0,1);
LCDdisplay(D);
_delay_ms(500);
}
}

else if(PIND & 0b00100000)


{
LCDcmd(0x01);
sprintf(D,"A-%d B-%d C-%d",i,j,k);
LCDGoto(0,0);
LCDdisplay(D);
}
else
{
LCDcmd(0x01);
sprintf(D,"No Access");
LCDGoto(0,0);
LCDdisplay(D);
if((PIND & 0b00000001)||(PIND & 0b00000010)||(PIND & 0b00000100))

{
LCDcmd(0x01);
sprintf(D,"You cannot Vote");;
LCDGoto(0,0);
LCDdisplay(D);
}

}
}
void LCDcmd(char k)
{
PORTB=k;
PORTA=0x01;// 0 for RS, 0 for RW, 1 for EN makes 00000001 equals 1.
_delay_ms(200);
PORTA=0x00;// 0 for RS, 0 for RW, 0 for EN. High to low pulse required to give
EN.
}
void LCDdisplay(char a[])
{
for(int i = 0; i <strlen(a) ; i++ )
{
PORTB = a[i];
PORTA = 0x05;
_delay_ms(200);
PORTA = 0x04;
}
}
void LCDGoto(char x, char y)
{char add;// address
char c=0x00;
char b=0x40;
switch(y)
{
case 0: add = c+x;break;// address = 0x00+x- For first row
case 1: add = b+x;break;// address = 0x40+x- For second row
}
char addcmd=(0x80|add);// final address command needed to send.
LCDcmd(addcmd);// Sending the final address command
}

PROTEUS SIMULATION RESULTS:

Fig 4. EVM when CONTROL = 0 does not provide access to vote


Fig 5. When CONTROL = 1, the user can vote for one of the parties

Fig 6. As CONTROL = 1 and A=1 the vote is accepted


Fig 7. Making the WINNER high, displays the party with maximum votes

WORKING:
 The programming of AVR ATMEGA32 and LCD are done using Atmel Studio 8
using Embedded C. Port A is connected to LCD and is used as output port and Port B
is used for taking inputs for the users where are all the push buttons are connected.
 The Balloting unit gets activated only when CONTROL pin goes high. This control
pin is handled by the election authority to give access for the voters to vote.
 When the control pin goes high, “You can vote 1.A 2.B 3.C”is displayed on the LCD.
 The voter can vote for their favourite party and a buzzer is buzzed after the vote is
casted. This buzzer action is to prevent multiple voting of a single voter. Also when
the vote is successfully taken, a message “Accepted” is displayed on the LCD.
 When the control pin goes low a message “No access” is displayed on the LCD.
 The voting status and the number of votes secured by each of the parties is displayed
when the COUNT button is pressed
 Also the party with maximum number of votes can also be known by pressing the
WINNER button. . As this should not be disclosed at the time of counting, this button
is handled by Election Authorities.
 Every time the system gets turned ON, the system is reset and all the vote count is
lost.
HARDWARE IMPLEMENTION OF EVM USING ARDUINO NANO:

Fig 8: Circuit is Designed using tinker cad

Fig 9: Picture of hardware implementation


Fig 10: Results on Serial Monitor

WORKING:
 When the systems turns ON, it asks for the user to Enter the password.
 If the password matches, then there is access granted for the authorities to take the
votes.
 In the circuit, the access to the voters is given by pressing the letter ‘V’(which means
Vote) by the authority.
 Then the voter is allowed to cast the vote by pressing the respective push button in the
circuit.
 To know the status of the voting, the letter ‘D’ is to be pressed (which means
Display).
 To prevent multiple time voting by a single voter, the circuit is designed in such a
way that only the first pressed button is taken care of. The remaining votes are
discarded by the system itself.
CONCLUSION:
The protocol of Indian EVM has been successfully implemented on Microcontroller. The
prototype is working as per specifications. Some additional features are also added in the
original design. The prototype has been thoroughly tested and can be used in a real Indian
election if required.Hence we developed a robust and secured EVM and hardware
implementation is done.We used Arduino Nano for hardware implementation and Atmega 32
for software based simulation in Proteus. Atmel studio and Arduino Ide for developing
software and we used embedded C language.

REFERENCES:
 Public Notice :PN/ECI/41/2009 INDIA, Election Commission of India(2009).
Electronic Voting Machines-regarding.
 D. Ashok Kumar and T. Ummal Sariba Begum “Electronic voting machine — A
review” Pattern Recognition, Informatics and Medical Engineering (PRIME),
2012,IEEE Conference 21-23 March 2012
 Hari K. Prasad , J. Alex Halderman , Rop Gonggrijp , “Security Analysis of
India’s Electronic Voting Machines” appeared in
 Proc. 17th ACM Conference on Computer and Communications Security , July
2010
 From Wikipedia, the free encyclopedia, the web page on Indian EVM
https://en.wikipedia.org/wiki/Electronic_voting_in_India

You might also like