Do-it-yourself
120 July 2017 | ElEctronics For you http://www.EFymag.com
Voting Machine
Using AVR Microcontroller
Ankush AggArwAl
S.C.
Dwive
Di
P
olling by electronic voting
machines (EVMs) has become
a norm during elections.
Unlike paper ballot systems, EVMs
are safe and reliable as these rule
out the possibility of invalid voting.
These are more economical and ef-
ficient too. Their compact size saves
transportation costs.
Here we describe the design of
an electronic voting machine based
on ATmega16A microcontroller. To
cast a vote, users
need to press the key
against the name of
the candidate of their
choice. The vote is
automatically saved
in the microcontroller,
and simultaneously
the LCD shows the
message “Thank You.”
The author’s prototype
is shown in Fig. 1.
Circuit and working
As shown in Fig. 2, the circuit of the
electronic voting machine is built around
ATmega16A microcontroller (IC2), IC
7805 (IC1), a 16×2 LCD (LCD1) and
other associated components.
The controller used here operates off
5V DC supply. So a 7805 voltage regula-
tor IC is used to step 9V DC down to 5V.
Capacitors C1 and C2 are used to reduce
ripples. ATmega16A has 32 general
purpose input/output (I/O) pins. An ex-
ternal 8MHz crystal oscillator is used to
provide the timing pulse. Four switches
(S1 through S4) are connected to Port B
(PB0, PB1, PB2 and PB3) of IC2.
The LCD (LCD1) operates in 4-bit
1
2
IC1 3
7805
C2
10u
16V
CON1
FOR 9V
C1
100u
XTAL1
C3 8MHz
22p
C4
22p
(^1) PB0
Vcc
10
(^2) PB1
(^3) PB2
(^4) PB3
(^5) PB4
(^6) PB5
(^7) PB6
(^8) PB7
(^9) RST
(^15) (TXD)PD1
(^14) (RXD)PD0
(^21) PD7
(^20) PD6
(^19) PD5
(^18) PD4
(^17) PD3
(^16) PD2
XTAL2
13
XTAL1
12
(^11) GND
PA0^40
PA1^39
PA2^38
PA4^36
PA5^35
PA6^34
PA7^33
AREF
32
AVCC^30
GND^31
PC7^29
PC6^28
PC5^27
PC4^26
PC3^25
PC2^24
PC1^23
PC0^22
PA3^37
IC2
ATMEGA16A
25V
S5
RESET
R10
10K
R3
R2
R5
R4
S1
S2
S3
S4
LED2
R7
LED3
R8
LED4
R9
4
RS
5
R/W
6
EN
7
D0
8
D1
9
D2
10
D3
11
D4
12
D5
13
D6
14
D7
1 Vss
3 VO
2 VDD A/VEE 15
LCD1 K 16
16X2 LCD
VR1
10K
GND
LED5
POWER
R1
220E
LED1
R6
R2 − R5 = 10K
R6 − R9 = 220E
S1 = FOR FIRST PARTY i.e. AAP
S2 = FOR SECOND PARTY i.e. KKK
S3 = FOR THIRD PARTY i.e BJP
S4 = FOR RESULT
D5 = FOR RESET
Fig. 1: Author’s prototype
Fig. 2: Circuit diagram of the electronic voting machine using ATmega16A microcontroller