IOT

Smart Electronic Voting Machine Using Arduino & LCD Display

As a democratic country, India is built on the foundations of the election. In our country, Voting is a very important thing to take care of and to make valuable decisions. Because a person has the right to vote which is a constitutional right that we are privileged to have.

This project’s fundamental goal is to build an electronic voting machine that will contribute to the eradication of vote fraud in manual systems and earlier iterations of electronic voting.

The system is given n switches, where n is the identifier of a political party. The voter will be given the opportunity to continue and select their chosen candidate from the panel of buttons here. The final vote is then shown to the voters on an LCD for their approval. By selecting the result button at the end, the outcome can be determined automatically.

Components Required

  • Arduino UNO R3 Development Board
  • JHD162A 16×2 LCD Display
  • Potentiometer-10K
  • Pushbutton
  • Connecting wire
  • Breadboard

Block Diagram

Block Diagram Electronic Voting Machine Using Arduino

In this project, four pushbuttons have been utilized with Arduino to represent the four distinct candidates running for office. As needed, we can expand the number of candidates. Each time a voter presses one of the four buttons, the corresponding voting value increases by one. The outcome can be seen by pressing the result button after the entire voting procedure.

Circuit Diagram

Circuit Diagram Electronic Voting Machine

Assemble the circuit as per the following diagram. Connect the Arduino’s digital pins 7, 6, 5, 4, and 3 to the 5 push buttons. Connect LCD pins 4, 6, 11, 12, 13, and 14 in a similar manner to Arduino pins 13, 12, 11, 10, and 8.

Working of the Project

  • The brain and heart of this system in this case is an Arduino. The entire voting process is managed by Arduino, including button reading, vote incrementation, result generation, and transmission to an LCD display.
  • Five new buttons have been added here, with one each for teams A, B, C, and D. The last button is for calculating or presenting results.
  • Here are a few images from this project that clearly illustrate the process of working on it.
1

Source Code/Program

#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.setCursor(5,1);
lcd.print(vote2);
lcd.setCursor(9,0);
lcd.print(“C”);
lcd.setCursor(9,1);
lcd.print(vote3);
lcd.setCursor(13,0);
lcd.print(“D”);
lcd.setCursor(13,1);
lcd.print(vote4);
if(digitalRead(S1)==0)
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
{
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();
}
vote1=0;vote2=0;vote3=0;vote4=0,vote=0;
lcd.clear();
}

}

Leave a Reply

Your email address will not be published.