How to Build a Vehicle Driver Alcohol Detection and Engine Locking System Using Arduino

Design and Evaluation of an Arduino-Based Driver Alcohol Detection and Ignition Interlock Prototype.

GitHub - sreeparnaray/Automatic_Car_Locking_System_through_Alcohol_Detection: This project presents the design and implementation of an Alcohol Detection and Engine Locking System for cars and other vehicles using an Arduino Nano as the MCU (Master Control Unit) and a MQ3 Sensor as the detection device for alcohol. The system continuously monitors the alcohol level in its affinity using the MQ3 sensor, and as soon as the concentration of alcohol goes beyond the threshold level, the engine gets locked and a buzzer starts to beep/buzz to give indication to the nearby vehicles that the particular vehicle’s driver is drunk and it is not safe to drive nearby the vehicle, and is a threat to other people on the road.
Alcohol Detection Engine Locking for Drivers | Arduino‑Based Alcohol S
 – Harish Projects

Engine Locking System at Sharon Soliz blog

8

A Vehicle Driver Alcohol Detection and Engine Locking System is a road-safety engineering project designed to detect alcohol in a driver’s breath before a vehicle is started. If the sensor detects alcohol above a preset threshold, the system prevents the engine-start command and activates an alarm.

The project can be developed as a STEM innovation, science fair entry, or Kenya Science and Engineering Fair (KSEF) project using an Arduino, an MQ-3 alcohol sensor, a display, a buzzer and a relay-based demonstration circuit.

The recommended prototype uses a low-voltage simulated ignition system, rather than directly interrupting a real vehicle’s wiring. This makes it safer to build, test and demonstrate while preserving the main engineering principle.

1. How the system works

1. Driver breath sample

Alcohol vapour enters the sensor area.

2. MQ-3 alcohol sensor

Produces an electrical signal that changes with alcohol vapour concentration.

3. Arduino Uno

Reads the sensor and compares the reading with a calibrated threshold.

Below threshold

Green LED; simulated start permitted.

At or above threshold

Red LED and buzzer; simulated start blocked.

Important: The MQ-3 is a low-cost demonstration sensor, not a certified evidential breathalyser. Its readings are affected by calibration, temperature, humidity, warm-up time and other vapours. A prototype reading must not be treated as proof that a person is legally fit or unfit to drive.

2. Materials and components required

ARDUINO® Uno Rev3

        – Robot Pi Shop
DIYables MQ3 Alcohol Gas Sensor Module for Ethanol Vapor Detection, High Sensitivity Analog and Digital Output for Arduino ESP32 Raspberry Pi DIY Projects, 2 Pack for Arduino, ESP32, ESP8266, Raspberry Pi

LCD Displays - The Pi Hut

6

The following components are suitable for a school-level prototype.

ComponentQuantityPurpose
Arduino Uno1Processes sensor readings
MQ-3 alcohol sensor module1Detects alcohol vapour
16×2 LCD with I2C interface1Displays system status
5 V relay module1Controls a simulated ignition circuit
Active buzzer1Provides an audible warning
Red LED1Indicates a detected-alcohol condition
Green LED1Indicates a permitted simulated start
220 Ω resistors2Limit LED current
Push button1Simulates the engine-start request
5 V USB power supply1Powers the prototype
Breadboard and jumper wires1 setMakes electrical connections
Low-voltage lamp or LED load1Demonstrates the simulated ignition output

An MQ-3 module typically provides an analogue output and may also provide a digital threshold output. Its heater requires a suitable supply, and the sensor can become hot during operation. Check the specific module’s pin labels and specifications before connecting it.

UNIVERSAL-SOLDER Electronics

+1

3. System circuit diagram

The following is the logical wiring layout for the educational prototype. The relay switches only a low-voltage demonstration load.

MQ-3 alcohol sensor

VCC → 5 V · GND → GND · AO → A0

Arduino Uno

A0: sensor · D2: start button · D3: relay · D4: buzzer

D5: red LED · D6: green LED · A4/A5: I2C display

LCD display

Shows sensor reading and system status.

Alarm and LEDs

Provide audible and visual warnings.

Relay → low-voltage simulated ignition

Permits or blocks power to a lamp or other safe demonstration load.

4. Pin connection table

Component pinArduino connection
MQ-3 VCC5 V
MQ-3 GNDGND
MQ-3 AOA0
Relay IND3
Relay VCC and GNDAppropriate supply and common ground, as specified by the module
Buzzer positiveD4, if compatible with the pin’s current rating
Buzzer negativeGND
Red LED anodeD5 through a 220 Ω resistor
Green LED anodeD6 through a 220 Ω resistor
LED cathodesGND
Start buttonD2 and GND
LCD SDAA4
LCD SCLA5
LCD VCC and GNDSupply and GND according to the display module

Relay safety: Verify whether your relay module is active-high or active-low before testing. Some modules energise the relay when the control pin is LOW. The demonstration circuit must be wired so a reset, disconnected sensor or unpowered Arduino cannot accidentally indicate that a vehicle is safe to start.

For a real vehicle, do not connect this hobby circuit directly to the starter, ignition, fuel pump or vehicle control unit. A production interlock requires automotive-rated hardware, a fail-safe design and qualified installation.

5. How to assemble the system

Alkoholsensor MQ-3 für Arduino

Step 1: Connect the alcohol sensor

Connect VCC to 5 V, GND to GND and AO to analogue input A0. Allow the sensor to warm up and stabilise according to its datasheet before collecting readings.

How to Use I2C LCD Module with Arduino - DFRobot Maker Community

Step 2: Install the display

Connect SDA to A4 and SCL to A5 on the Uno. The display will show the sensor reading and whether the simulated start is permitted or blocked.

Arduino grafisch programmieren

Step 3: Connect the warning indicators

Connect the red and green LEDs through current-limiting resistors. Connect a suitable buzzer and relay module to the assigned pins.

Control a Bulb using Relay Module and Touch Sensor
 – REES52

Step 4: Build the simulated ignition

Use the relay to control a low-voltage lamp or LED load. Add the push button to represent a driver’s request to start the vehicle.

6. Arduino program

The program below implements the basic decision logic. The threshold is an illustrative sensor reading, not a blood-alcohol concentration or legal driving limit. Determine the appropriate value experimentally for the demonstration hardware.

This version uses the Arduino’s built-in LiquidCrystal library only if you use a parallel LCD; for the I2C LCD configuration described above, install a compatible LiquidCrystal_I2C library in the Arduino IDE.


#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

// Pin assignments
const int alcoholPin = A0;
const int startButton = 2;
const int relayPin = 3;
const int buzzerPin = 4;
const int redLED = 5;
const int greenLED = 6;

// Illustrative only: calibrate for the specific sensor.
const int alcoholThreshold = 400;

// Set according to the relay module's behaviour.
const int RELAY_ON = LOW;
const int RELAY_OFF = HIGH;

bool startPermitted = false;

void setup() {
  pinMode(startButton, INPUT_PULLUP);
  pinMode(relayPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  pinMode(redLED, OUTPUT);
  pinMode(greenLED, OUTPUT);

  // Begin in the safe, blocked state.
  digitalWrite(relayPin, RELAY_OFF);
  digitalWrite(buzzerPin, LOW);
  digitalWrite(redLED, LOW);
  digitalWrite(greenLED, LOW);

  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Alcohol Interlock");
  lcd.setCursor(0, 1);
  lcd.print("Sensor warming");
  delay(2000);
}

void loop() {
  int reading = analogRead(alcoholPin);

  // A high reading is treated as a warning for
  // this prototype; verify direction during calibration.
  bool alcoholDetected = reading >= alcoholThreshold;
  bool buttonPressed = digitalRead(startButton) == LOW;

  // Fail-safe for this demonstration:
  // do not permit start when alcohol is detected.
  startPermitted = !alcoholDetected && buttonPressed;

  if (alcoholDetected) {
    digitalWrite(relayPin, RELAY_OFF);
    digitalWrite(redLED, HIGH);
    digitalWrite(greenLED, LOW);
    digitalWrite(buzzerPin, HIGH);
  } else {
    digitalWrite(redLED, LOW);
    digitalWrite(buzzerPin, LOW);

    if (buttonPressed) {
      digitalWrite(relayPin, RELAY_ON);
      digitalWrite(greenLED, HIGH);
    } else {
      digitalWrite(relayPin, RELAY_OFF);
      digitalWrite(greenLED, LOW);
    }
  }

  lcd.setCursor(0, 0);
  lcd.print("Sensor: ");
  lcd.print(reading);
  lcd.print("    ");

  lcd.setCursor(0, 1);
  if (alcoholDetected) {
    lcd.print("START BLOCKED   ");
  } else if (buttonPressed) {
    lcd.print("START PERMITTED ");
  } else {
    lcd.print("Press START     ");
  }

  delay(200);
}

Before uploading: Check the I2C LCD address, which is commonly 0x27 or 0x3F, and verify your relay’s trigger polarity. This example assumes that a higher analogue reading corresponds to greater alcohol response; some modules and circuit configurations may behave differently.

The code is for a bench prototype, not a safety-certified vehicle interlock. It also does not independently verify that a valid breath sample was supplied, distinguish alcohol from interfering substances, or provide tamper resistance.

7. Testing and evaluation

Test the prototype using controlled, repeatable conditions. Do not use alcohol consumption as a test method involving a driver who may operate a vehicle.

TestExpected resultPass criterion
Power onSystem initialisesDisplay operates
Clean-air baselineReading is recordedStable baseline after warm-up
Sensor response testReading changes when safely exposed to a controlled test vapourSensor response is measurable
Start button pressed below the demonstration thresholdRelay permits the simulated startLamp turns on
Start button pressed above the thresholdRelay blocks the simulated startLamp remains off
Alcohol warning conditionRed LED and buzzer activateBoth indicators operate
Arduino reset or power lossSystem returns to a blocked stateSimulated start remains disabled
Sensor disconnectedSystem identifies a fault or remains blockedNo false permission to start

The sensor’s response and recovery times vary by module and operating conditions. MQ-3 devices require warm-up and calibration, so record the baseline and repeated readings rather than assuming that a single reading proves accurate alcohol measurement.

Seeed Studio Wiki

+1

8. How to Fix Common Arduino Upload Errors

ErrorPossible causeSolution
avrdude: ser_open()Incorrect port or unavailable serial portSelect the correct COM port and close other programs using it
avrdude: stk500_recv()Board or bootloader communication problemCheck the USB cable, board selection and connection
LiquidCrystal_I2C.h: No such fileMissing display libraryInstall a compatible I2C LCD library
LCD lights up but shows no textIncorrect I2C address or contrastCheck the address and adjust the contrast
Sensor readings remain constantWiring, sensor warm-up or faulty moduleCheck AO-to-A0 wiring and inspect the sensor response
Relay works in reverseActive-low relay logicAdjust RELAY_ON and RELAY_OFF
Relay activates during resetModule input behaviour or unsafe default stateRework the driver circuit and verify the default blocked condition

9. Improving the project for KSEF

Alcohol Detection and Engine Immobilization System for Drunk Driving Prevention” | The Student Projec 1
A Smart Vehicle Safety-Security System for the Prevention of Drunk Driving and Theft Based on Arduino and the Internet of Things | MDPI

Alcohol Detection Vehicle Control System | Devpost

9

To improve the project’s scientific value, consider these extensions:

  • Sensor calibration: Compare repeated sensor readings against a suitable calibrated reference instrument in a supervised laboratory.
  • Data logging: Record sensor readings, response times, false alarms and successful start-blocking tests.
  • Fault detection: Add sensor-disconnection detection, startup self-tests and a fail-safe state.
  • Driver verification: Investigate methods of ensuring that the person providing the sample is the driver, without compromising privacy.
  • Post-start monitoring: Research the requirements for safe repeat testing without abruptly disabling a moving vehicle.
  • Improved sensing: Investigate fuel-cell-based breath alcohol measurement technology, which is used in professional interlock devices. NHTSA+1

For a KSEF report, measure the system’s detection response, false-positive rate, false-negative rate and reliability over repeated trials. State the limitations of the sensor honestly and distinguish experimental sensor readings from actual breath-alcohol concentration.

10. Estimated project budget in Kenya

These are preliminary planning allowances, not verified current supplier quotations.

ItemEstimated cost (KES)
Arduino Uno-compatible board800–1,500
MQ-3 alcohol sensor250–600
I2C LCD350–700
Relay module150–350
LEDs, resistors, buzzer and button150–350
Breadboard and jumper wires300–600
USB power supply and cable300–600
Enclosure and demonstration load300–800
Estimated total2,600–5,500

The final cost depends on the components already available in the school laboratory and the quality of the enclosure and power supply.

11. Conclusion

The Vehicle Driver Alcohol Detection and Engine Locking System demonstrates how gas sensing, microcontroller programming, electronic switching and warning indicators can be combined to address road safety. A successful school prototype should detect a sensor response, display its status, activate an alarm and block a simulated engine-start request when the preset demonstration threshold is reached.

A real vehicle installation is a separate engineering task. Certified alcohol interlocks have requirements beyond basic sensor detection, including breath-sample validation, reliable operation and safe integration with the vehicle.

Total Views: 3
  • mbeva

    Dominic Mbeva is a science teacher, experienced researcher, innovator, and creative technologist with expertise in STEM education, digital media, and scientific research. As a Kenya Science and Engineering Fair (KSEF) advisor and projects manager, he mentors young scientists, guiding them in developing award-winning innovations. He is also an IC Technorat, leading advancements in science and technology. Beyond education, Dominic is a skilled photographer and video editor, using visual storytelling to make science more engaging. His philosophy, “If you take care of minutes, hours will take care of themselves,” reflects his belief in consistent effort, strategic thinking, and innovation to drive success in both research and creativity.

    Related Posts

    How to Build an Automated Green Environmental Monitoring System for Greenhouses

    Meta description: Learn how to build an automated greenhouse monitoring system using Arduino or ESP32 to measure temperature, humidity, soil moisture, light, and CO₂, with sensor wiring, code, costs, and…

    Read more

    How to Build an Automated Chicken Coop Door Using Light Sensors and Arduino

    An automatic chicken coop door can save time, simplify poultry management, and help protect chickens by closing the entrance after dark. In this project, an Arduino Uno reads a light-dependent…

    Read more

    Leave a Reply

    Your email address will not be published. Required fields are marked *