Arduino Alcohol Engine Lock

Model Picture
1. Introduction

Driving under the influence of alcohol is a major cause of road accidents. This project presents a smart safety system using Arduino and MQ3 alcohol sensor that detects alcohol from breath and prevents the vehicle engine from starting.

If alcohol is detected beyond a safe level, the system locks the engine using a relay, activates a buzzer alarm, and provides visual indication using LED.


2. Components

  • Arduino Uno / Nano
  • MQ3 Alcohol Sensor
  • Relay Module (5V)
  • Buzzer
  • LED
  • Resistor (220Ω)
  • Breadboard
  • Jumper Wires
  • Power Supply

3. Circuit and Connections

Pinout Diagram of Arduino Uno R3
Pinout Diagram of Arduino Uno
Pinout Diagram MQ3 Sensor
Pinout Diagram MQ3 Sensor

Pinout Diagram of Single Channel Relay Module
Pinout Diagram of Single Channel Relay Module

Pinout Diagram of Buzzer
Pinout Diagram of Buzzer

🔌 Connections:

MQ3 Sensor

  • VCC → 5V
  • GND → GND
  • Analog Output  → A0

Relay Module

  • IN → Pin 8
  • VCC → 5V
  • GND → GND

Buzzer

  • Positive → Pin 9
  • Negative → GND

LED

  • Positive → Pin 7 (via resistor)
  • Negative → GND

4. Detailed Step By Step Circuit Working

  1. MQ3 sensor continuously senses alcohol concentration in air.
  2. Sensor outputs an analog voltage based on alcohol level.
  3. Arduino reads this value through analog pin A0.
  4. If value exceeds predefined threshold:
    • Relay is turned OFF → Engine stops
    • Buzzer turns ON → Warning alert
    • LED glows → Visual indication
  5. If alcohol is not detected:
    • Relay stays ON → Engine runs normally
    • Buzzer OFF
    • LED OFF

5. Libraries to be included

No external libraries are required for this project.
Arduino built-in functions are sufficient.


6. Code

#define mq3 A0
#define relay 8
#define buzzer 9
#define led 7

int threshold = 300;

void setup() {
pinMode(relay, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(led, OUTPUT);
Serial.begin(9600);
}

void loop() {
int alcoholValue = analogRead(mq3);
Serial.println(alcoholValue);

if (alcoholValue > threshold) {
digitalWrite(relay, LOW); // Engine OFF
digitalWrite(buzzer, HIGH);
digitalWrite(led, HIGH);
} else {
digitalWrite(relay, HIGH); // Engine ON
digitalWrite(buzzer, LOW);
digitalWrite(led, LOW);
}

delay(500);
}

7. Detailed Step By Step Code Working

  1. Define pins for MQ3 sensor, relay, buzzer, and LED.
  2. Set threshold value (adjust based on calibration).
  3. In setup():
    • Configure pins as OUTPUT
    • Start Serial Monitor
  4. In loop():
    • Read analog value from MQ3 sensor
    • Print value for monitoring
  5. If value > threshold:
    • Relay OFF → Engine locked
    • Buzzer ON
    • LED ON
  6. Else:
    • Relay ON → Engine allowed
    • Buzzer OFF
    • LED OFF
  7. Delay added for stability

8. Tips

  • Calibrate MQ3 sensor before use
  • Avoid testing near perfumes or smoke
  • Use proper power supply for relay
  • Adjust threshold based on real testing
  • Use enclosure for real-world application

9. Uses

  • Vehicle safety systems
  • Anti-drunk driving systems
  • Engineering projects
  • Industrial safety monitoring
  • Awareness demonstrations

10. Conclusion

This project demonstrates how a simple Arduino-based system can help improve road safety by preventing drunk driving. It is easy to build, cost-effective, and highly useful for real-world applications.

തുടക്കക്കാർക്കായി ഇലക്ട്രോണിക്സ് ലളിതമായി പഠിക്കാം.

Empowering students in Kerala with hands-on technical skills.