Project tutorial
Smart Voting Machine

Smart Voting Machine © GPL3+

This is a class voting machine.

  • 499 views
  • 0 comments
  • 5 respects

Components and supplies

Apps and online services

About this project

Hey guys...

Here is my another project named "Smart Voting Machine."

This project can be used as a class voting machine to choose the class representative or monitor.

This project can also be used as a office voting machine.

This project has many applications.

Watch the whole video and "Subscribe my YouTube channel."

"Electronics is Fun"

Let's make this project.......

Steps:

1. Gather all the components as shown below.

2. Place all 5 push buttons on breadboard.

3. Connect small pins (jumpers) from button to GND as shown.

4. Connect Jumper wires from push button as shown.

5. Take another Breadboard and place 10K potentiometer, LCD display and 330 ohm resistor.

6. Connections from LCD to Arduino Uno:

Vss to GND

Vdd to +5v

Vo to middle pin of 10k pot

Rs to 3

Rw to GND

E to 4

D4 to 5

D5 to 6

D6 to 7

D7 to 8

A to 330 resistor one end and that end to +5v

K to GND

7. Connections:

Push Buttons to Arduino

S1 (JON) to 9

S2(LIY) to 10

S3(BOB) to 11

S4(MIA) to 12

S5(RESULTS) to 13

8. After connections it will shown like this.

9. Now check all connections once again and upload the code.

After uploading the code press the push buttons to give votes to the candidates.

Subscribe my YouTube channel for sure.

"And help me to achieve my dream to make the channel one amongst the popular channel of Electronics"

Thanks!

Code

CodeC/C++
//www.YouTube.com/Electronics is Fun//
//https://www.youtube.com/channel/UCaXI2PcsTlH5g0et67kdD6g//
//MOHD SOHAIL//
//published on 20-June-2019//

#include<LiquidCrystal.h>
LiquidCrystal lcd(3, 4, 5, 6, 7, 8);

int S1= 9;
int S2 =10;
int S3= 11;
int S4= 12;
int S5= 13;

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(" Class ");
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("Jon");
lcd.setCursor(5,0);
lcd.print("Liy");
lcd.setCursor(9,0);
lcd.print("Bob");
lcd.setCursor(13,0);
lcd.print("Mia");
}
void loop()
{
lcd.setCursor(1,0);
lcd.print("Jon");
lcd.setCursor(1,1);
lcd.print(vote1);
lcd.setCursor(5,0);
lcd.print("Liy");
lcd.setCursor(5,1);
lcd.print(vote2);
lcd.setCursor(9,0);
lcd.print("Bob");
lcd.setCursor(9,1);
lcd.print(vote3);
lcd.setCursor(13,0);
lcd.print("Mia");
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("Jon is Winner");
delay(3000);
lcd.clear();
}
else if((vote2 > vote1 && vote2 > vote3 && vote2 > vote4))
{
lcd.clear();
lcd.print("Liy is Winner");
delay(3000);
lcd.clear();
}
else if((vote3 > vote1 && vote3 > vote2 && vote3 > vote4))
{
lcd.clear();
lcd.print("Bob is Winner");
delay(3000);
lcd.clear();
}
else if(vote4 > vote1 && vote4 > vote2 && vote4 > vote3)
{
lcd.setCursor(0,0);
lcd.clear();
lcd.print("Mia is Winner");
delay(3000);
lcd.clear();
}

else if(vote4 > vote1 && vote4 > vote2 && vote4 > vote3)
{
lcd.setCursor(0,0);
lcd.clear();
lcd.print("Mia 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();
}

}

Schematics

circuit diagram
Smart wdwcai8cbj

Comments

Similar projects you might like

RF BASED SMART HOME AUTOMATION SYSTEM

by Dennis Mwanza

  • 31,818 views
  • 4 comments
  • 48 respects

LCD Gaming

Project tutorial by msr048

  • 4,882 views
  • 2 comments
  • 22 respects

Smart Dice of Ludo

Project tutorial by msr048

  • 3,468 views
  • 3 comments
  • 11 respects

Alexa Smart Mailbox

Project tutorial by Team CodersCafe

  • 1,931 views
  • 3 comments
  • 13 respects

Display Board

Project tutorial by msr048

  • 1,780 views
  • 0 comments
  • 4 respects

Smart Door with Face Unlock

Project tutorial by Divins Mathew

  • 4,539 views
  • 2 comments
  • 12 respects
Add projectSign up / Login