Stops the bike from starting if no helmet is worn or alcohol is detected.
Built and tested by Drisya K S · Industrial Robotics Institute

This smart helmet is a safety system designed to prevent accidents caused by drunk driving and riding without a helmet. An ESP32 reads an MQ-3 alcohol sensor and an IR helmet-detection sensor before allowing the bike to start. If unsafe conditions are detected, a relay keeps the ignition off, a buzzer alerts the rider and an alert can be sent to a mobile app.
| Component | Qty |
|---|---|
| ESP32 Microcontroller | 1 |
| Alcohol Sensor (MQ-3) | 1 |
| IR Sensor (helmet detection) | 1 |
| Relay Module (bike ignition control) | 1 |
| Buzzer / LED | 1 |
| Jumper Wires / Breadboard | As needed |
| 5V Power Supply or Battery | 1 |
| GSM Module (optional) | 1 |
| From | Connect to |
|---|---|
| MQ-3 VCC | 5V |
| MQ-3 GND | GND |
| MQ-3 AOUT | GPIO 34 |
| IR Sensor VCC | 3.3V |
| IR Sensor GND | GND |
| IR Sensor OUT | GPIO 5 |
| Buzzer + | GPIO 25 |
| Buzzer – | GND |
| Relay IN | GPIO 26 |
| Power Supply | 5V to ESP32 + all components |
Complete, tested Arduino C++ code for this project. Copy it into Arduino IDE and upload it to the ESP32.
#define alcoholPin 34
#define irPin 5
#define relayPin 26
#define buzzerPin 25
int alcoholThreshold = 400;
void setup() {
pinMode(irPin, INPUT);
pinMode(relayPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
Serial.begin(115200);
}
void loop() {
int alcoholValue = analogRead(alcoholPin);
int helmetStatus = digitalRead(irPin);
Serial.print("Alcohol: ");
Serial.println(alcoholValue);
if (helmetStatus == LOW || alcoholValue > alcoholThreshold) {
digitalWrite(relayPin, LOW); // Bike OFF
digitalWrite(buzzerPin, HIGH); // Alert
} else {
digitalWrite(relayPin, HIGH); // Bike ON
digitalWrite(buzzerPin, LOW);
}
delay(500);
}
This smart helmet is a safety system designed to prevent accidents caused by drunk driving and riding without a helmet. An ESP32 reads an MQ-3 alcohol sensor and an IR helmet-detection sensor before allowing the bike to start.
You need: ESP32 Microcontroller (1), Alcohol Sensor (MQ-3) (1), IR Sensor (helmet detection) (1), Relay Module (bike ignition control) (1), Buzzer / LED (1), Jumper Wires / Breadboard, 5V Power Supply or Battery (1), GSM Module (optional) (1). Software: Arduino IDE, Blynk, Blynk library.
It is rated intermediate and takes about 3–4 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-160). Message IRI on WhatsApp at +91 86060 82634 for the kit price and delivery details.