Documente Academic
Documente Profesional
Documente Cultură
UNDER SUPERVISION OF
MR. AREBU D.
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 our senior students(5th
year),We have to appreciate the guidance given by our seniors and friends
in our project presentation by giving their comments and advices. Last but
not least, we appreciate everyone who help us either directly or indirectly
to complete our mini project.
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 paper-based voting
schemes due to several advantages like security, automatic counting,
economic etc.
CONTENTS
Chapter one: Introduction
1.1 Introduction......................................................................................................................................................
1.2 Project overview............................................................................................................................................
1.3 Objective of project.......................................................................................................................................
Chapter two: Literature Review......................................................................................................................
Chapter Three: Methodology
3.1 How does the system work?....................................................................................................................
3.2 List of component...........................................................................................................................................
3.3 Hardware description..................................................................................................................................
3.4 Schematic diagram..........................................................................................................................................
3.5 Block diagram.....................................................................................................................................................
3.6 Flow chart..............................................................................................................................................................
Chapter Four: Software description
4.1 Keil u vision 4..............................................................................................................................
4.2 Proteus 8 professional.................................................................................................................
Chapter Five: Result and discussion
5.1 Problem statement and analysis................................................................................................
5.2 Result and discussion..................................................................................................................
Chapter Six: Conclusion
6.1 Conclusion...................................................................................................................................
6.2 Future work.................................................................................................................................
Appendix
References
Like in earlier system, your name is called and you are asked to sign
or put your thumb impression in a register.
2.
3.
Then the Election Officer gives you a slip that bears the Voter register
number where you signed or put your thumb impression.
4.
You hand over this slip to the presiding officer who confirms the
serial number and permits you to vote by pressing the button of the
Control Unit of EVM.
5.
You are not given any ballot thereafter, and are sent to the EV
Machine placed behind a card board in a corner. The machine is
placed in such a way that your polled vote will be a secret.
6.
On the EVM, you press the switch placed in front of your favorite
candidate and release.
7.
As soon as the button is pressed, the LED indicator lights off and a
buzzer sound comes from the machine. This signifies that your vote
has been casted rightly. Now you can come out.
After the hour fixed for the close of the poll and the last voter has recorded
his vote, the EVM is closed so that no further recording of votes in the
machine is possible.
1.4.2 Disadvantages
Security issues and unequal internet access.
We have to use external chip to store the votes.
We have provide continuous power supply,
really clear. The LCD screen will display nothing when the period for voter
ready to cast their vote. This may confused the users of this voting machine.
Thus, we are enhance the system by hide the number of votes for
each candidates as long as the Result button is pressed. Once the result are
out, the voting process is end and the LCD screen will declare the winner.
Next, we also enhance the guideline of the system by adding the message
Please vote during the period for voter ready to cast a vote. So that the
voter would not be confused.
Quantity
1k ohm Resistor
For describing pin diagram and pin configuration of 8051, we are taking
into consideration a 40 pin DIP (Dual inline
package). Now lets go through pin configuration in
detail.
Pin-40 : Named as Vcc is the main power source.
Usually its +5V DC.
You may note some pins are designated with two
signals (shown in brackets).
Pins 32-39: Known as Port 0 (P0.0 to P0.7) In
addition to serving as I/O port, lower order
address and data bus signals are multiplexed with
this port (to serve the purpose of external memory
interfacing). This is a bi directional I/O port (the
only one in 8051) and external pull up resistors are
required to function this port as I/O.
Pin-31:- ALE aka Address Latch Enable is used to demultiplex the addressdata signal of port 0 (for external memory interfacing.) 2 ALE pulses are
available for each machine cycle.
Pin-30:- EA/ External Access input is used to enable or disallow external
memory interfacing. If there is no external memory requirement, this pin is
pulled high by connecting it to Vcc.
Pin- 29:- PSEN or Program Store Enable is used to read signal from external
program memory.
configuration. The 8255 is a 40 pin integrated circuit (IC), designed to perform a variety
of interface functions in a computer environment. The 8255 wasnt originally designed
to be connected to the Z80. It was manufactured by Intel for the 8080 microprocessor.
LCD2x16
is
passive
two
terminal
LED
Reset Button
4
switches/reset
buttons
8051
8255
4 LEDs
2x16 LCD
screen
LCD display:
WELCOME TO
VOTE!
NO
NO
YES
YES
LCD display:
PLEASE
LCD
display:
C1 C2
AFTER A
XX>Y
NO
Is the switch
that
represent
C1 being press?
YES
YES
The number of
votes for C1 +1
XX<Y
The number of
votes for C2 +1
LCD display:
CONGRATULATION
!!
LCD display:
CONGRATULATION
!!
C2 WINS!!!
XX=Y
LCD display:
DRAW!! PROCEED TO THE NEXT
VOTING...
AFTER A
LCD display:
THANK
name and click save. The window will appear where you will be asked to
select a device for Target 'Target 1'
3. From the list at the left, seek for the brand name ATMEL, then under
ATMEL, select AT89S51. You will notice that a brief description of the
device appears on the right. Leave the two upper check boxes unchecked
and click OK. The AT89S52 will be called your 'Target device', which is the
final destination of your source code. You will be asked whether to 'copy
standard
8051
startup
code'
click
No.
4. Click File, New, and something similar to the following window should
appear. The box named 'Text1' is where your code should be written later.
5. Now you have to click 'File, Save as' and choose a file name for your
source code ending with the letter '.c'. You can name as 'code.c' for example
and click save. Then you have to add this file to your project work space at
the left as shown in the following
6. After right-clicking on 'source group 1', click on 'Add files to group...',
then you will be prompted to browse the file to add to 'source group 1',
choose the file that you just saved, eventually 'code.c' and add it to the
source group. You will notice that the file is added to the project tree at the
left.
8. You can then start to write the source code in the window titled 'code.c'
then before testing your source code; you have to compile your source
code, and correct eventual syntax errors. In KEIL IDE, this step is called
'rebuild all targets' and has this icon:
9. If after rebuilding the targets, the 'output window' shows that there is 0
errors, then you are ready to test the performance of your code. In keil, like
in most development environment, this step is called Debugging, and has
this icon:
. After clicking on the debug icon, you will notice that some part
of the user interface will change; some new icons will appear, like the run
icon circled in the following figure:
Problem 2:
We are going to display the number of votes of candidate that have
stored in register on LCD screen. Then, we realise that the LCD display the
other character instead of the number.
Solution:
We found that LCD can only read ASCII code and the number that
stored in the register is HEX code. By refer to the table of comparison
between ASCII code and HEX code, we found that we could convert the HEX
code to ASCII code by adding 30H for the numbering part. In other word,
30H will display 0 on LCD, 31H will display 1 on LCD.
Problem 3:
After we solved the problem 2, we are facing the other problem that
we can only display the single digit (0-9) to LCD screen due to only 0-9
available on ASCII code. Double digits such as 17, 23 will display the other
characters on LCD.
Solution:
First we move the number that stored in the register to Accumulator
and move 10H to register B. After that, we use the function DIV AB and
move the content of A and B to another 2 registers follow by add 30H for
both registers and finally display on LCD screen.
Example:
23H
A, 10H
DIV AB
A=2, B=3
A
R5+30H, B
R6+30H
After that, the LCD screen will display PLEASE VOTE immediately to
indicate the voter could start to cast their vote. The result is shown in
figure below.
Result
Declare The
Chapter 6: 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.
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
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
LCALL DELAY1
START1:
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
AGAIN:
SJMP 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:
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
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
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
PROCEED2:
LCALL DELAY
DEC R0
MOV A, R0
JNZ PROCEED2
RET
;=========================================================================;
SELECT WHICH MESSAGE TO BE DISPLAY
;=========================================================================
COND0:
CJNE R0, #0, COND1
MOV DPTR, #MSG0
RET
COND1:
COND2:
COND3:
COND4:
COND5:
COND6:
;=========================================================================;
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
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... ", 0H
ORG 3870H
MSG3: DFB "C1 C2
", 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
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/professeurs/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