Press a button to vote; counts update live in a mobile app.
Built and tested by Drisya K S · Industrial Robotics Institute
Arduino IDE, Blynk IoT app
An electronic voting machine for school, college or club elections. Each candidate has a push button; pressing it adds a vote, gives a confirmation beep, and updates that candidate’s live total in the Blynk app so results are counted instantly without paper.
| Component | Qty |
|---|---|
| ESP32 Dev Board | 1 |
| Push Buttons x3 (one per candidate) | 1 |
| OLED / LCD Display (optional) | 1 |
| Buzzer | 1 |
| LED Indicators (optional) | 1 |
| RFID Module (optional, for voter ID) | 1 |
| Jumper Wires / Breadboard | As needed |
| 5V Power Supply | 1 |
| From | Connect to |
|---|---|
| Button 1 | GPIO 12 and GND |
| Button 2 | GPIO 13 and GND |
| Button 3 | GPIO 14 and GND |
| Buzzer + | GPIO 26 |
| Buzzer − | GND |
| (Optional) OLED SDA / SCL | GPIO 21 / 22 |
Complete, tested Arduino C++ code for this project. Copy it into Arduino IDE and upload it to the ESP32.
#define BLYNK_TEMPLATE_ID "YourTemplateID"
#define BLYNK_TEMPLATE_NAME "Smart Voting"
#define BLYNK_AUTH_TOKEN "YourAuthToken"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <BlynkSimpleEsp32.h>
char ssid[] = "Your_WiFi_Name";
char pass[] = "Your_WiFi_Password";
#define btn1 12
#define btn2 13
#define btn3 14
#define buzzer 26
int vote1 = 0, vote2 = 0, vote3 = 0;
void voteConfirm() {
digitalWrite(buzzer, HIGH);
delay(300);
digitalWrite(buzzer, LOW);
}
void setup() {
Serial.begin(115200);
pinMode(btn1, INPUT_PULLUP);
pinMode(btn2, INPUT_PULLUP);
pinMode(btn3, INPUT_PULLUP);
pinMode(buzzer, OUTPUT);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
}
void loop() {
Blynk.run();
if (digitalRead(btn1) == LOW) {
vote1++;
voteConfirm();
Blynk.virtualWrite(V1, vote1);
delay(500);
}
if (digitalRead(btn2) == LOW) {
vote2++;
voteConfirm();
Blynk.virtualWrite(V2, vote2);
delay(500);
}
if (digitalRead(btn3) == LOW) {
vote3++;
voteConfirm();
Blynk.virtualWrite(V3, vote3);
delay(500);
}
}An electronic voting machine for school, college or club elections. Each candidate has a push button; pressing it adds a vote, gives a confirmation beep, and updates that candidate’s live total in the Blynk app so results are counted instantly without paper.
You need: ESP32 Dev Board (1), Push Buttons x3 (one per candidate) (1), OLED / LCD Display (optional) (1), Buzzer (1), LED Indicators (optional) (1), RFID Module (optional, for voter ID) (1), Jumper Wires / Breadboard, 5V Power Supply (1). Software: Arduino IDE, Blynk IoT app.
Yes. It is rated beginner and takes about 1–2 hours to build, using the ESP32. The guide on this page explains every connection and step.
The complete, tested Arduino C++ code is free on this page. Copy it into Arduino IDE and upload it to the board.
Yes. IRI sells a kit with the parts for this project (PRJ-169). Message IRI on WhatsApp at +91 86060 82634 for the kit price and delivery details.