Translate

Arduino Driver Drowsiness Detection System using IR Sensor with Alarm

 1. Introduction

Driver fatigue is one of the major causes of road accidents, especially during long-distance and night driving. To improve road safety, it is important to detect drowsiness at an early stage and alert the driver immediately.

This project presents a simple and effective Arduino-based Driver Drowsiness Detection System using an IR sensor. The system monitors the driver’s eye activity and detects if the eyes remain closed for a prolonged period.

When drowsiness is detected, the system triggers a buzzer alarm and LED indication to alert the driver in real time. This helps in preventing accidents and ensures safer driving conditions.

This project is easy to build, cost-effective, and serves as a great introduction to smart safety systems using Arduino.


2. Components Required

  • Arduino UNO
  • IR Sensor Module
  • Buzzer
  • LED
  • 220Ω Resistor
  • Breadboard
  • Jumper Wires

3. Circuit Diagram / Connections

Pinout Diagram of Arduino Uno R3
Pinout Diagram of IR Sensor Module

Pinout Diagram Buzzer

🔌 IR Sensor:

  • VCC → 5V
  • GND → GND
  • OUT → Pin 2

🔔 Buzzer:

  • Positive → Pin 8
  • Negative → GND

💡 LED:

  • Anode → Pin 7 (via resistor)
  • Cathode → GND

4. Circuit Working

The IR sensor is placed near the driver's eye area.

  • When the eye is open, IR reflection is detected
  • When the eye is closed, reflection changes

Logic:

  • If eye closed for a short time → normal blink
  • If eye closed for longer duration → drowsiness detected

Arduino processes this and triggers:

  • Buzzer alarm
  • LED indication

5. Code

int irSensor = 2;
int buzzer = 8;
int led = 7;

unsigned long eyeClosedTime = 0;
int thresholdTime = 2000; // 2 seconds

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

void loop() {
int eyeState = digitalRead(irSensor);

if (eyeState == LOW) { // Eye closed
if (eyeClosedTime == 0) {
eyeClosedTime = millis();
}

if (millis() - eyeClosedTime > thresholdTime) {
digitalWrite(buzzer, HIGH);
digitalWrite(led, HIGH);
}
} else { // Eye open
eyeClosedTime = 0;
digitalWrite(buzzer, LOW);
digitalWrite(led, LOW);
}

delay(100);
}

6. Code Explanation

  • digitalRead(irSensor) reads eye status
  • millis() tracks how long the eye is closed
  • If closed > 2 seconds:
    • Buzzer ON
    • LED ON
  • If eye opens:
    • Timer resets
    • Alarm OFF

7. Output

✅ Normal Condition:

  • Eye blinking normally
  • No alarm

⚠️ Drowsiness Detected:

  • Eye closed for long
  • Buzzer sounds
  • LED glows

8. Applications

  • Driver safety systems
  • Smart vehicles
  • Industrial machine operators
  • Security monitoring

9. Advantages

  • Simple and low cost
  • Easy to implement
  • Real-time detection
  • Portable system

10. Disadvantages

  • Not 100% accurate
  • Sensitive to placement
  • IR sensor limitations

11. Future Scope / Improvements

  • Use camera with AI (face/eye detection)
  • Add GSM alert system
  • Integrate with vehicle control system
  • Use wearable sensor for better accuracy

12. Conclusion

The Arduino-based Driver Drowsiness Detection System is a simple yet effective safety solution designed to reduce accidents caused by driver fatigue. By continuously monitoring eye closure using an IR sensor, the system can quickly detect drowsiness and alert the driver through a buzzer and LED indication.

This project demonstrates how basic sensors and microcontrollers can be used to solve real-world problems. Although it is a beginner-level implementation, it can be further enhanced with advanced technologies like AI-based vision systems and IoT integration for improved accuracy and reliability.

Overall, this system serves as a great learning project for students and a foundational step toward developing smart and intelligent vehicle safety systems.


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

Empowering students in Kerala with hands-on technical skills.