Professional Documents
Culture Documents
Project On Evm Main
Project On Evm Main
2015/2016 SEMESTER II
MINI PROJECT LONG REPORT
PROJECT TITLE:
ELECTRONIC VOTING MACHINE
UNDER SUPERVISION OF
EN. AREBU D.
CONTENTS
CHAPT
ER
1
ABSTRACT
Pag
e
3
ACKNOWLEDGEMENT
INTRODUCTION
OBJECTIVE
LITERATURE REVIEW
Title
METHODOLOGY
HOW DOES THE
SYSTEM WORK?
LIST OF COMPONENT
HARDWARE
DESCRIPTION
SCHEMATIC DIAGRAM
BLOCK DIAGRAM
FLOW CHART
816
17
CONCLUSION
1819
20
APPENDIX
2127
2
10
REFERENCE
28
Abstract
Voting is most pivotal process of democratic society
through which people determine its decision. Nowadays
electronic voting machine has become an effective voting
tool compare with traditional paper-based voting schemes.
Flawless voting is ensure by electronic voting machine.
This is the reason it became more widespread. People are
make sure that their vote is secured. One more feature is
that it avoids any kind of malpractice or invalid votes.
Besides that, talking about economic benefits, this system
is more economical than traditional paper-based voting
schemes since the expenditure incurred on manpower is
saved. It is also make voter feels convenient because he
or she has to press only one button of the respective
candidates to vote. Thus, we are decided to design an
electronic voting machine to replace the traditional paperbased voting schemes due to several advantages like
security, automatic counting, economic etc.
This project presents a way to develop an electronic
voting machine by using a 16x2 LCD. The electronic voting
machine contains 4 reset switches which are New Entry
switch, 2 switches for 2 candidates, and a Result switch.
The New Entry switch is to avoid any kind of malpractice
or invalid votes. The New Entry switch is under supervision
and control of a conservator and a user can only vote after
the New Entry is pressed. Besides that, the electronic
voting machine only allows 1 vote for each user. If any
user tries to press the switch multiple times to vote more,
only the first vote will be registered. The 2 switches
represent the respective candidates, voter can vote to the
candidate that he or she desired to vote by press the
switch that represents the candidate. The result will only
display on the LCD screen at the end when the Result
switch is press. So that, the result would not affect the
decision of the voter during the voting process is on the
way. Of course, the Result switch also under supervision
3
Acknowledgement
We would like to express our deepest appreciation to
all those who provided us the possibility to complete this
report. A special gratitude we give to our supervisor,
Arebu D. ,whose contribute in stimulating suggestions and
encouragement, helped us to coordinate our project
especially in writing this report. We also would like to
thanks other lecturers such as Dr. Zaini binti Abdul Halim
and Dr. Syed Sahal Nazli Alhady bin Syed Hassan and the
tutors who guide us during lab sessions so that we applied
it in our mini project which is Electronic Voting Machine.
Moreover, this mini project makes us realized the
value of working together as a team and as a new
experience in working environment, which challenges us
every minute.
and
Introduction
This LCD based electronic voting machine is designed
for two candidates. The input part consists of a set of 4
switches. The switches and 16x2 LCD are interfaced to
microcontroller for various operations and displays. The
provision of casting votes for the candidates has been
provided through 2 of these switches (one for each
candidate). These switches are made active high and
connected to input pins of the controller. The remaining 2
switches are New Entry and Result. The New Entry switch
initializes the voting system when pressed, while the
Result switch ends the voting and displays the result (total
number of votes for respective candidate)and winner on
LCD screen. This system is set to 1 vote for each voter. In
other word, the voter cannot make the second vote even
he or she press the switch as long as the New Entry switch
is press. Besides that, each of the switch has connected to
a 1k ohm resistor and a LED. The resistor act as a pull
down resistor which make the input normal LOW while the
LED is to indicate the switch is being press.
The main objective of this project is to design and
create a general electronic voting machine to replace the
traditional paper-based voting schemes so that we can
take an advantages in term of economic and convenient.
Electronic voting machine is more economic because less
manpower is required and may saves transportation cost
due to its compact size. It is also more convenient and
time conscious as less time required for voting and
counting. Besides that, it is also more secure due to avoid
invalid voting such asa people make a vote twice. Other
than that, paper-based voting can actually miss ballots
due to human mistakes in placing the paper-based ballot
6
Literature Review
According to the electronic voting machine that
designed by others, we found that it is similar to our
design. First of all, their security system has control by 2
buttons. The first switch is New Entry switch to display the
Welcome from thanks after a vote has been casted.
While the second switch is Ready switch to indicate the
voter ready to cast a vote. Then the voter can only cast a
vote after the New Entry is pressed and follow by Ready
button. Our security system is only control by one switch
which is New Entry switch. After a vote has been casted,
our voting machine will be display Welcome
automatically from thanks after some delay. Then the
voter can only cast a vote after the New Entry switch has
pressed. Otherwise, any vote will not be counted. Besides
that, their voting system is designed for 4 candidates and
the counter for number of votes for each candidate can
reach 3-digits number while we had designed for 2
candidates and the counter for number of votes for each
candidate can only reach 2-digits number. But, we can add
the number of candidate and also the counter by modified
the program as well. Due to the time constraints we
designed this as a prototype.
Moreover, we had found that some weakness and
flaw in their system. We found that their electronic voting
machine will display the number of votes for respective
candidates after a vote has been casted. This phenomena
8
Methodology
How does it works?
First, the LCD screen will always display Welcome to
vote! as long as the voting is started by pressing the New
Entry switch after which the user is prompted to vote.
Then, the LCD screen will display Please vote to
indicate the voter could start to cast a vote. The count of
votes is stored in two different variables. As soon as the
user votes for a candidate by pressing one of the switches,
the value of the corresponding variable is increased by
one. After this, a Thank you message is displayed on LCD
to acknowledge the registration of users vote and the LCD
screen will be automatically display back Welcome to
vote! after some delay. The message will be stays on the
screen until the next voter come and a conservator
presses the New Entry switch. Then the voters have to
press the switch to cast another vote and finally the Result
switch is pressed to get the poll results. When the Result
button is pressed the names of the candidates are
displayed along with their vote counts. After some delay,
the result is displayed which could be either declaration of
the winner candidate or the candidates with a clash of
their number of votes.
Component List
Component/Equipment
8051 Development System
Light Emitted Diode (LED)
Reset Button Switch
1k ohm Resistor
2x16 LCD Screen
Quantity
1
4
4
4
1
10
Hardware Description
Microcontroller board 8051
The 8051 Microcontroller was designed in 1980s
by Intel. Its foundation was on Harvard
Architecture and was developed
principally for bringing into play in
Embedded Systems. At first it was
created
by
means
of
NMOS
technology but as NMOS technology
needs more power to function therefore Intel re-intended
Microcontroller 8051 employing CMOS technology and a
new edition came into existence with a letter C in the
title name, for illustration: 80C51. These most modern
Microcontrollers need fewer amount of power to function
in comparison to their forerunners.
There are two buses in 8051 Microcontroller one for
program and other for data. As a result, it has two storage
rooms for both program and data of 64K by 8 size. The
microcontroller comprise of 8 bit accumulator & 8 bit
processing unit. It also consists of 8 bit B register as
majorly functioning blocks and 8051 microcontroller
programming is done with embedded C language using
Keil software. It also has a number of other 8 bit and 16 bit
registers.
For internal functioning & processing Microcontroller 8051
comes with integrated built-in RAM. This is prime memory
and is employed for storing temporary data. It is
unpredictable memory i.e. its data can get be lost when
the power supply to the Microcontroller switched OFF.
11
13
is
passive
components
two
which
LED
Light-Emitting Diode (LED) is a
basic component we widely use
in the circuit. It usually connect
in series with resistor to emit
light.
We
used
the
LED
to
Reset Button
15
16
SCHEMATIC DIAGRAM
17
805
1
825
5
4
switches/res
et buttons
4 LEDs
2x16
LCD
18
Flow Chart
Sta
rt
LCD display:
WELCOME TO
VOTE!
YES
LCD display:
PLEASE
LCD
display:
C1
AFTER A
XX>
NO
Is the switch
that
represent
YES
Is the switch
that
represent
C2 being
The number
YES
of
votes for C2
XX<
LCD display:
CONGRATULATI
ON!!
LCD display:
CONGRATULATI
XX=Y
ON!!
The number
of
AFTER A
NO
LCD display:
DRAW!! PROCEED TO THE NEXT
VOTING...
LCD display:
THANK
19
Example:
23H
A, 10H
B
DIV AB
A=2, B=3
A
R5+30H, B
R6+30H
21
Switch
Switch
Switch
Switch
22
23
Result
Declare The
Based on the figures above candidate1 (C1) get 18 votes
while candidate2 (C2) only 11 votes. So C1 has wins the
poll and the LCD screen will make a congratulation and
declare that C1 wins! Conversely the LCD screen will
display C2 wins if the number of votes for C2 is more
than C1. In case of the number of votes for both
candidates clash, the LCD screen will ask for proceed to
another voting.
In this project, we still require to make some
improvement to make it more effective for future scope.
First, we can make an option initially to choose how much
the candidate will be involved. Next, in security system,
we could add a finger print scanning to mark down the
people who has voted to ensure that a same people
cannot vote for the second times. We can also provide
several different languages to voters for whom English is
not the first language. Finally, there are also advantages
when it comes to disabled people, such as blind
individuals. Electronic voting machine can provide
headphones to read off instructions to blind voters.
Additional tools can be incorporated into these voting
machines to help with other disabilities and to aid the
elderly as well. Due to time constraints we have not been
24
25
Conclusion
This project show that we can use the microcontroller
8051 to design a electronic voting machine which is more
secured, convenient, and economic compare with the
traditional
paper-based
voting
scheme.
We
are
successfully build up an electronic voting machine which
can be used for school and college level council elections
or any voting purpose event.The function of the circuit is
working according to what are we predicted and the
objectives is achieve. This show that our program code
and circuit design can be implemented to a real life
In this project, we learned some extra code of
microcontroller 8051 which we did not learn from the lab
session and we are able to use those code. For an
instance, we had used the registers from Bank 1 and the
alternative way to display a message on LCD screen. We
learned how to interface the microcontroller 8051 with PPI
8255, LCD screen, and LED. We are able to use the ports
from PPI 8255 to send an output from microcontroller 8051
or send an input to microcontroller 8051. We learned how
to solve the problem that we faced during this project.
We hope that our project will not only work on our
circuit design, but also it can work in a real life by do some
improvement on it. So that it could be used for voting
purpose at any required place.
26
Appendix
Assembly program code:
CPU"8051.TBL"
INCL"8051.INC"
MOV SP, #030H
ORG 2000H
PA: EQU 4000H
PB: EQU 4001H
PC: EQU 4002H
PCTR: EQU 4003H
MOV A, #10010000B
MOV DPTR, #PCTR
MOVX @DPTR, A
MOV A, #38H
LCALL COMNWRT
LCALL DELAY
MOV A, #0CH
LCALL COMNWRT
LCALL DELAY
MOV A, #10H
LCALL COMNWRT
LCALL DELAY
MOV A, #01H
LCALL COMNWRT
LCALL DELAY
MOV R0, #0H
MOV R6, #0H
MOV R1, #0H
MOV R2, #0H
MOV R3, #0H
MOV R4, #0H
MOV R5, #0H
MOV R7, #0H
SETB F0
;
=============================================
==============================;
;
=============================================
==============================
START:
LCALL BUTTONPRESS
LCALL FIRSTLINE
LCALL SECONDLINE
CJNE R0, #2, START1
MOV R0, #0
LCALL DELAY1
LCALL DELAY1
27
START1:
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
CJNE R0, #3, START
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL WINNER
SJMP AGAIN
AGAIN:
;
=============================================
==============================;
SCAN BUTTON
;
=============================================
==============================
BUTTONPRESS:
MOV DPTR, #PA
MOVX A, @DPTR
ANL A, #00001111B
CJNE A, #00000001B, RCHECK1
MOV R0, #1
CLR F0
RET
RCHECK1:
RCHECK2:
RCHECK3:
DONTH:
RET
;
=============================================
==============================
;
DISPLAY MESSAGES ON LCD
;
=============================================
==============================
FIRSTLINE: LCALL DELAY
MOV A, #80H
LCALL COMNWRT
LCALL DELAY
MOV R4, #0
LOOP1:
MOV A, R4
LCALL COND0
MOVC A, @A+DPTR
INC R4
JZ PROCEED1
LCALL DATAWRT
LCALL DELAY
SJMP LOOP1
PROCEED1: RET
;
=============================================
==============================
;
DISPLAY THE TOTAL NUMBER OF VOTES
;
=============================================
==============================
SECONDLINE:
MOV DPTR, #PA
MOVX A, @DPTR
ANL A, #00001000B
CJNE A, #00001000B, DONTH1
MOV A, #0C0H
LCALL COMNWRT
LCALL DELAY
MOV A, R1
MOV R7, A
LCALL HEXTOBCD
MOV A, R5
ADD A, #30H
LCALL DATAWRT
LCALL DELAY
MOV A, R6
ADD A, #30H
LCALL DATAWRT
LCALL DELAY
MOV A, #20H
29
LCALL DATAWRT
LCALL DELAY
MOV A, #20H
LCALL DATAWRT
LCALL DELAY
MOV A, R2
MOV R7, A
LCALL HEXTOBCD
MOV A, R5
ADD A, #30H
LCALL DATAWRT
LCALL DELAY
MOV A, R6
ADD A, #30H
LCALL DATAWRT
LCALL DELAY
RET
DONTH1:
RET
;
=============================================
==============================;
DECLARE
WINNER
;
=============================================
==============================
WINNER:
CLR C
MOV A, #01H
LCALL COMNWRT
LCALL DELAY
MOV A, #80H
LCALL COMNWRT
LCALL DELAY
MOV R4, #0
LOOP2:
MOV A, R1
MOV 50H, R2
CJNE A, 50H, LOOP3
LCALL COND6
MOV A, R4
MOVC A, @A+DPTR
INC R4
JZ PROCEED2
LCALL DATAWRT
LCALL DELAY
SJMP LOOP2
LOOP3:
JC LOOP4
MOV A, R4
LCALL COND4
MOVC A, @A+DPTR
INC R4
JZ PROCEED2
30
LCALL DATAWRT
LCALL DELAY
SJMP LOOP3
LOOP4:
MOV A, R4
LCALL COND5
MOVC A, @A+DPTR
INC R4
JZ PROCEED2
LCALL DATAWRT
LCALL DELAY
SJMP LOOP4
COND2:
COND3:
COND4:
COND5:
COND6:
31
;
=============================================
==============================; CONVERT HEX TO BCD
;
=============================================
==============================
HEXTOBCD: CLR C
MOV A, R7
MOV B, #10
DIV AB
MOV R5, A
MOV R6, B
RET
;
=============================================
==============================; LCD COMMAND
;
=============================================
==============================
COMNWRT: MOV DPTR, #PC
MOVX @DPTR, A
CLR P1.0 ;RS
CLR P1.1 ;RW
SETB P1.2;E
ACALL DELAY
CLR P1.2
RET
DATAWRT:
;
=============================================
==============================;
DELAY
;
=============================================
==============================
DELAY:
MOV R3, #225
HERE1:
DJNZ R3, HERE1
32
RET
DELAY1:
HERE:
HERE2:
SETB PSW.4
MOV R7, #255
MOV R3, #255
DJNZ R3, HERE2
DJNZ R7, HERE
CLR PSW.4
RET
;
=============================================
==============================;
DECLARE
MESSAGE TO BE DISPLAY ON LCD
;
=============================================
==============================
ORG 3800H
MSG0: DFB "WELCOME TO VOTE!", 0H
ORG 3830H
MSG1: DFB "PLEASE VOTE... ", 0H
ORG 3850H
MSG2: DFB "THANK YOU...
ORG 3870H
MSG3: DFB "C1 C2
", 0H
", 0H
ORG 3890H
MSG4: DFB "CONGRATULATION!! C1 WINS!!!", 0H
ORG 3910H
MSG5: DFB "CONGRATULATION!! C2 WINS!!!", 0H
ORG 3950H
MSG6: DFB " DRAW!! PROCEED TO THE NEXT VOTING...", 0H
END
33
REFERENCE
1.
http://www.electronics.dit.ie/staff/tscarff/8255PPI/8255.htm
2. http://www.circuitstoday.com/8051-microcontroller
3. http://en.wikipedia.org/wiki/Intel_8255
4.http://www.cdrummond.qc.ca/cegep/informat/professeur
s/alain/files/asc ii.htm
5. Laboratory Manual EEE226 Microprocessor I
6. The 8051 Microcontroller and Embedded Systems
7. Appendix 8051 Instructions, Timing, And Registers
34