Docsity

Electronic voting machine, Assignments of Microprocessors

Toggle sidebar
bg1
Electronic Voting Machine Using
Arduino & LCD Display
Electronic Voting Machine Using Arduino & LCD Display
Today we will make a smart electronic voting machine using Arduino. The basic idea behind this
project is to build an electronic voting machine that will help to eliminate the manipulation of the
manual voting system and remove previous versions of electronic voting. This Digital voting system
is simple portable, cheap, and very effective.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Electronic voting machine and more Assignments Microprocessors in PDF only on Docsity!

Electronic Voting Machine Using

Arduino & LCD Display

Electronic Voting Machine Using Arduino & LCD Display

Today we will make a smart electronic voting machine using Arduino. The basic idea behind this

project is to build an electronic voting machine that will help to eliminate the manipulation of the

manual voting system and remove previous versions of electronic voting. This Digital voting system

is simple portable, cheap, and very effective.

Electronic Voting Machine Using Arduino

 Video Demonstration

 Components Required for Electronic Voting Machine

 Digital Voting Machine Block Diagram with Arduino

 Features of Arduino based Electronic Voting Machine

 Schematic Diagram

 Digital Voting Machine Demonstration

 Program Code Explaination

 Final Program Sketch

 Wrapping Up

The system is provided with an “N” number of buttons where “N” is the number of a political

party/Candidate. Here, voters will be allowed to proceed to choose their preferred candidate from

the panel of buttons. We have an LCD to display the voting for the satisfaction of the voters. Finally,

the results can be calculated automatically simply by pressing the result button.

Digital Voting Machine Block Diagram with Arduino

Block Diagram of Electronic Voting Maching Using Arduino & LCD

In this smart electronic voting machine project, for the demonstration we have used four push

Buttons for four different candidates taking part in the election. However, you can increase the

number of candidates as per your requirements. Actually, when a voter presses any four buttons,

the value of the vote will increase each time. After completing the entire voting process, the result

button can be pressed to display the result in an LCD Screen.

Features of Arduino based Electronic Voting Machine

 Allow voters to vote for their favorite candidates by pressing a button.

 Display Real-Time data on LCD Screen.

 After completing the entire voting process, display the final result by pressing the result

button.

Schematic Diagram

The circuit diagram of the digital voting machine using Arduino LCD and buttons is very simple and

easy to understand. You can assemble the circuit diagram as below figure. However the following

table will help you to connect and interface all the components to the Arduino.

Here Arduino UNO is the heart and brain of an electronic voting system. Arduino controls the entire

voting process, such as reading buttons, increasing the vote value, generating results, and sending

votes and results to an LCD display.

Here we have added five buttons that are assigned to Party/Candidate

A, Party/Candidate B, Party/Candidate C, Party/Candidate D, and the final button is used to

calculate or display the results.

Below images shows clearly shows the story of working on this project.

Program Code Explaination Program Code Explaination

First of all, I included LCD header library file and define pins for LCD and Buttons.

#include<LiquidCrystal.h> LiquidCrystal lcd(13, 12, 11, 10, 9, 8); #Define S1 7 #Define S2 6 #Define S3 5 #Define S4 4 #Define S5 3

Initialize some variables and pin for taking candidate’s voting input from buttons.

int vote1 = 0;

int vote2 = 0; int vote3 = 0; int vote4 = 0;

We initialize the LCD and give direction to input-output pins

lcd.begin(16, 2); lcd.print ("Electronic "); lcd. set Cursor (0, 1); lcd.print(" Voting Machine ");

With the delay of 4 seconds make pullup in the input pin by software.

delay (4000); pinMode (S1, INPUT); pinMode (S2, INPUT); pinMode (S3, INPUT); pinMode (S4, INPUT); pinMode (S5, INPUT);

In code below we have used digital read function to read the button pressed.

digitalWrite (S1, HIGH); digitalWrite (S2, HIGH);

vote1++; while (digitalRead(S1) == 0); if (digitalRead(S2) == 0) vote2++; while (digitalRead(S2) == 0); if (digitalRead(S3) == 0) vote3++; while (digitalRead(S3) == 0); if (digitalRead(S4) == 0) vote4++; while (digitalRead(S4) == 0); if (digitalRead(S5) == 0) { int vote = vote1 + vote2 + vote3 + vote4; if (vote) { if ((vote1 > vote2 && vote1 > vote3 && vote1 > vote4)) { lcd.clear(); lcd.print("A is Winner"); delay(3000); lcd.clear(); } else if ((vote2 > vote1 && vote2 > vote3 && vote2 > vote4)) { lcd.clear(); lcd.print("B is Winner"); delay(3000);

lcd.clear(); } else if ((vote3 > vote1 && vote3 > vote2 && vote3 > vote4)) { lcd.clear(); lcd.print("C is Winner"); delay(3000); lcd.clear(); } else if (vote4 > vote1 && vote4 > vote2 && vote4 > vote3) { lcd.setCursor(0, 0); lcd.clear(); lcd.print("D is Winner"); delay(3000); lcd.clear(); } else if (vote4 > vote1 && vote4 > vote2 && vote4 > vote3) { lcd.setCursor(0, 0); lcd.clear(); lcd.print("D is Winner"); delay(3000); lcd.clear(); } else

 Connect RFID to PHP & MySQL Database with NodeMcu ESP

Final Program Sketch #include<LiquidCrystal.h> LiquidCrystal lcd(13, 12, 11, 10, 9, 8); #define S1 7 #define S2 6 #define S3 5 #define S4 4 #define S5 3 int vote1 = 0; int vote2 = 0; int vote3 = 0; int vote4 = 0; void setup() { pinMode(S1, INPUT); pinMode(S2, INPUT); pinMode(S3, INPUT); pinMode(S4, INPUT); pinMode(S5, INPUT);

lcd.begin(16, 2); lcd.print("Electronic "); lcd.setCursor(0, 1); lcd.print(" Voting Machine "); delay(4000); digitalWrite(S1, HIGH); digitalWrite(S2, HIGH); digitalWrite(S3, HIGH); digitalWrite(S4, HIGH); digitalWrite(S5, HIGH); lcd.clear(); lcd.setCursor(1, 0); lcd.print("A"); lcd.setCursor(5, 0); lcd.print("B"); lcd.setCursor(9, 0); lcd.print("C"); lcd.setCursor(13, 0); lcd.print("D"); } void loop() { lcd.setCursor(1, 0); lcd.print("A"); lcd.setCursor(1, 1); lcd.print(vote1); lcd.setCursor(5, 0); lcd.print("B");

lcd.clear(); lcd.print("A is Winner"); delay(3000); lcd.clear(); } else if ((vote2 > vote1 && vote2 > vote3 && vote2 > vote4)) { lcd.clear(); lcd.print("B is Winner"); delay(3000); lcd.clear(); } else if ((vote3 > vote1 && vote3 > vote2 && vote3 > vote4)) { lcd.clear(); lcd.print("C is Winner"); delay(3000); lcd.clear(); } else if (vote4 > vote1 && vote4 > vote2 && vote4 > vote3) { lcd.setCursor(0, 0); lcd.clear(); lcd.print("D is Winner"); delay(3000); lcd.clear(); }

else if (vote4 > vote1 && vote4 > vote2 && vote4 > vote3) { lcd.setCursor(0, 0); lcd.clear(); lcd.print("D is Winner"); delay(3000); lcd.clear(); } else { lcd.clear(); lcd.print(" Tie Up Or "); lcd.setCursor(0, 1); lcd.print(" No Result "); delay(3000); lcd.clear(); } } else { lcd.clear(); lcd.print("No Voting...."); delay(3000); lcd.clear(); }