Introduction
An Electronic Voting Machine (EVM) is an electronic system designed to record votes using push buttons instead of traditional paper ballots.
In this project, we will build a miniature educational voting machine using Arduino. The system allows users to select a candidate by pressing a corresponding push button. The Arduino records the vote and displays the result on an LCD.
How the Electronic Voting Machine Works
The basic working process is:
Push Button → Arduino → Vote Counter → LCD Display
When a voter presses a candidate button:
- Arduino detects the button press.
- The corresponding candidate's vote count increases by one.
- The LCD displays confirmation.
- The system waits for the next vote.
- An administrator can use a separate result button to display the vote count.
Block Diagram
┌───────────────────┐
│ Push Buttons │
│ Candidate A │
│ Candidate B │
│ Candidate C │
│ Candidate D │
└─────────┬─────────┘
│
▼
┌───────────────────┐
│ Arduino │
│ Vote Processing │
└─────────┬─────────┘
│
┌────────┴────────┐
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Vote Memory │ │ LCD │
│ Counters │ │ Display │
└─────────────┘ └─────────────┘
Hardware Requirements
| Component | Quantity |
|---|---|
| Arduino Uno | 1 |
| 16×2 LCD Display | 1 |
| Push Buttons | 5 |
| 10kΩ Resistors | 5 |
| Breadboard | 1 |
| Jumper Wires | As required |
| 5V Power Supply/USB | 1 |
Circuit Diagram
+----------------+
| Arduino UNO |
| |
Candidate A -------| D2 |
Candidate B -------| D3 |
Candidate C -------| D4 |
Candidate D -------| D5 |
Result Button -----| D6 |
| |
LCD RS ------------| D7 |
LCD EN ------------| D8 |
LCD D4 ------------| D9 |
LCD D5 ------------| D10 |
LCD D6 ------------| D11 |
LCD D7 ------------| D12 |
+----------------+
Arduino Code
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
const int candidateA = 2;
const int candidateB = 3;
const int candidateC = 4;
const int candidateD = 5;
const int resultButton = 6;
int votesA = 0;
int votesB = 0;
int votesC = 0;
int votesD = 0;
void setup() {
pinMode(candidateA, INPUT_PULLUP);
pinMode(candidateB, INPUT_PULLUP);
pinMode(candidateC, INPUT_PULLUP);
pinMode(candidateD, INPUT_PULLUP);
pinMode(resultButton, INPUT_PULLUP);
lcd.begin(16, 2);
lcd.print("Electronic");
lcd.setCursor(0, 1);
lcd.print("Voting Machine");
delay(2000);
lcd.clear();
lcd.print("Press Vote");
}
void loop() {
if (digitalRead(candidateA) == LOW) {
votesA++;
showVote("Candidate A");
}
if (digitalRead(candidateB) == LOW) {
votesB++;
showVote("Candidate B");
}
if (digitalRead(candidateC) == LOW) {
votesC++;
showVote("Candidate C");
}
if (digitalRead(candidateD) == LOW) {
votesD++;
showVote("Candidate D");
}
if (digitalRead(resultButton) == LOW) {
showResults();
}
}
void showVote(String candidate) {
lcd.clear();
lcd.print("Vote Recorded");
lcd.setCursor(0, 1);
lcd.print(candidate);
delay(1000);
while (digitalRead(candidateA) == LOW ||
digitalRead(candidateB) == LOW ||
digitalRead(candidateC) == LOW ||
digitalRead(candidateD) == LOW) {
}
lcd.clear();
lcd.print("Press Vote");
}
void showResults() {
lcd.clear();
lcd.print("A:");
lcd.print(votesA);
lcd.print(" B:");
lcd.print(votesB);
delay(2000);
lcd.clear();
lcd.print("C:");
lcd.print(votesC);
lcd.print(" D:");
lcd.print(votesD);
delay(2000);
lcd.clear();
lcd.print("Press Vote");
}
Advantages
- Simple to build
- Easy to understand
- Low-cost educational project
- Demonstrates digital input handling
- Demonstrates LCD interfacing
- Demonstrates counters and conditional logic
- Useful for Arduino and embedded-systems learning
Conclusion
The Arduino-based Electronic Voting Machine is a useful project for understanding push-button input, digital logic, vote counting and LCD interfacing.
By combining an Arduino Uno, push buttons and an LCD, you can create a simple demonstration system that records and displays votes electronically.
For your Electro Robo Store blog, I recommend adding product links naturally throughout the article—for example, linking the words Arduino Uno, 16×2 LCD Display, Push Button, Breadboard, and Jumper Wires directly to the corresponding products on your website. This helps both SEO and product discovery without making the article look like an advertisement.