Skip to content

VaishnavGK/Driver-Drowsiness-Detection-System-Using-Opencv-Arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Driver Drowsiness Detection System

A real-time drowsiness detection system using Python, OpenCV, and an Arduino to trigger physical alerts. This project monitors a driver's eyes and activates a buzzer if signs of sleepiness are detected and makes the motor stop.

How It Works

  1. Detection (Python): A Python(Opencv script) uses a webcam to capture video. It employs the MediaPipe library to detect facial landmarks and calculates the Eye Aspect Ratio (EAR) to determine if the eyes are closed.
  2. Logic: If the eyes remain closed for more than 1.5 seconds, the system classifies the driver as "Asleep".
  3. Alert (Arduino): The Python script sends a signal ('0' for asleep, '1' for awake) via serial communication to an Arduino. The Arduino then activates a buzze to alert the driver and makes the motor stop.

Hardware Required

  • Arduino Uno
  • Webcam
  • DC Motor
  • 5V Buzzer
  • L298N Motor Driver
  • 9V Battery
  • Breadboard and Jumper Wires

(See Circuit diagram.jpg for connection details)

Software & Libraries

  • **Python **
  • Arduino IDE
  • Python Libraries:
    • opencv-python
    • mediapipe
    • pyserial
    • numpy

Setup and Usage

  1. Hardware Setup: Assemble the circuit according to the Circuit diagram.jpg.
  2. Arduino: Upload the Arduino_code_DDDS_.ino sketch to your Arduino Uno.
  3. Python:
    • Install the required libraries: pip install opencv-python mediapipe pyserial numpy
    • In Main code(DDDS).py, make sure the ARDUINO_PORT is set to the correct COM port for your Arduino (e.g., 'COM4').
    • Run the script from your terminal: python "Main code(DDDS).py"

About

"A real-time drowsiness detection system using Python, OpenCV, and an Arduino to trigger alerts."

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors