Electronic Voting Machine using 8051, as the idea suggests today we will be working on developing EVM using micro-controller 8051. We will try to keep this project as simple as possible, so that most of you can construct it right from scratch.
Components used for Electronic Voting Machine using 8051:
- 8051, SST89E51RD preferably
- Crystal (11.0592 or 12 MHz)
- 16 x 2 LCD Display
- Push Button Switches
- Discrete components(Resistor, Capacitor)
Circuit Diagram for Electronic Voting Machine using 8051:
Above image shows circuit diagram of Electronic Voting Machine(EVM), as it appears it is very simple and easy to build one. We interface a 16 x 2 LCD in 4 bit mode with micro-controller 8051.
This pin is used by operator to activate the circuit and making it available to accept vote. Upon pressing this switch the EVM will accept one and only one vote. After accepting one vote circuit will again wait for operator to activate it.
Upon pressing this pin, the number of votes accepted by the circuit will be displayed. The votes will be displayed party/candidate wise individually.
Using this button compete circuit will be reset all the votes data will be erased, making it available for new election.
Connections to LCD are as follows:
P2.0 – RS pin of LCD
P2.1 – R/W pin of LCD
P2.2 – E (Enable) pin of LCD
P2.3 – No connection/Open
P2.4 – DB4/D4 of LCD
P2.5 – DB5/D5 of LCD
P2.6 – DB6/D6 of LCD
P2.7 – DB7/D7 of LCD
Note: Contrast pin of 16 x 2 LCD must be connected to ground, if you are not using a potentio-meter to control its contrast.
Interfacing Push Button Switches:
Push button switches of NO type are used in this circuit, NO as it suggest Normally Open switches. The poles of these switches make contact when switch is pressed. We connect one pole to port pin of micro-controller 8051, and another to ground.
Connections of Push Button Switches are as follows:
P1.0 – Control Pin
P1.1 – Reset Pin
P1.2 – Count Pin
P1.3 – Candidate 1 Pin
P1.4 – Candidate 2 Pin
P1.5 – Candidate 3 Pin
P1.6 – Candidate 4 Pin
Programming Logic for Electronic Voting Machine using 8051:
In order to program a micro-controller we first need to understand the working of an application. This project works as follows, we select and define all the push-buttons using sbit command and define run time variables (int) for counting votes of candidates. Initialize LCD in 4 bit mode and display a welcome message. After displaying message we make all the port pins used for push-buttons high. And start while(1) ie. forever loop. Micro-controller will be executing this loop till the time its reset. Inside this we check if any of the push-button was pressed, it is done by checking if the port pin went low. If any button was pressed inside its if loop call a function, you defined for it. For eg: if control was pressed and its corresponding action is to activate circuit, call the function activate(). Note: activate() is user defined function and you can define any function name you wish to, it should be containing all the action commands. Like in this project it must contain command for displaying “Now you can vote” message and make the control pin high and should allow user to cast only one vote. Similarly write commands and functions for all the actions.
To get C Source file we used in this project, mail us at firstname.lastname@example.org. Link for hex (burnable file) mentioned below.
Applications of Electronic Voting Machine using 8051:
This project can be programmed correctly and can be used in various elections held in colleges,schools, universities and workplaces where there is no professional set-up to conduct elections. Moreover, this devices saves paper time and dummy voting which are major drawbacks of traditional elections conducted using paper ballot.
Screen Shots of Outputs:
Above figure shows the circuit after start and displaying welcome message, it is waitong to be activated by the operator
Once the circuit is activated it allows user to cast one vote, after vote is cast it again waits for activation by operator.
When count button is pressed, the circuit displays votes of individual candidates as shown in screen above.
After pressing reset, all the votes are cleared which can be seen in above image.