Smart Electronic Voting Machine Using Arduino
This project is all about Simple & Smart Electronic Voting Machine Using Arduino. The basic idea of this project is to create an electronic voting machine that will help to eradicate defrauding of the manual voting systems and prior versions of electronic voting.
The system is provided with n number of the switch where n is the number of a political party. Here the voter will be allowed to proceed for choosing their preferred candidate from the panel of buttons. The final vote is then displayed onto an LCD for the satisfaction of voters. In the end, the result can be automatically calculated by pressing the result button.
Bill of Materials
S.N. | Components Name | Quantity | Purchase Links |
---|---|---|---|
1 | Arduino UNO Board | 1 | Amazon | AliExpress |
2 | 16x2 LCD Display | 1 | Amazon | AliExpress |
3 | Potentiometer 10K | 1 | Amazon | AliExpress |
4 | Push Button Switch | 4 | Amazon | AliExpress |
5 | Connecting Wires | 20 | Amazon | AliExpress |
6 | Breadboard | 1 | Amazon | AliExpress |
Block Diagram
In this project, i.e Smart Electronic Voting Machine Using Arduino, we have used four pushbuttons for four different candidates who are taking part in the election. We can increase the number of the candidate as per requirement. When any voter press any of four buttons then respecting voting value will increment by one each time. After the whole voting process, the result button can be pressed to display the result.
Circuit Diagram
Assemble the circuit as shown in the figure above. Connect the 5 push buttons to digital pin 7,6,5,4,3 of Arduino. Similarly connect pin 4,6, 11, 12, 13, 14 of LCD to digital pin 13, 12, 11, 10, 9, 8 of Arduino.
Working of the Project
Here Arduino is the heart and brain of this system. Arduino controls the complete voting processes like reading button, incrementing vote value, generating a result, and sending vote and result in LCD Display.
Here we have added five buttons that are assigned for team A, team B, team C, team D, and the last button is used for calculating or displaying results.
Below are some of the pictures for this project that tells a clear story about working on this project.
Source Code/Program
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
#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(); } } |
}
2 Comments
Good afternoon
I need help on th i project and its important
Anyone willing to help me?
I need help on voting project