Real-time Driver Drowsiness Detection System with Embedded Feedback Interface
![]() Left: Real-time facial tracking and attentiveness scoring |
![]() Right: ESP8266 hardware interface |
The system combines:
- Computer Vision (MediaPipe / OpenCV) for facial feature extraction
- Machine Learning / Heuristics for drowsiness classification
- Embedded System (ESP8266) for real-time display and user interaction
It is designed as a prototype for a deployable driver safety product in fleets/personal use.
-
Real-time face tracking and feature extraction
-
Driver attentiveness scoring (%)
-
Drowsiness detection based on:
- eye closure patterns
- yawning detection
- attentiveness %
-
OLED display output:
- status (ALERT / WARNING / DROWSY)
-
LED indicators:
- 🟢 ALERT → solid green
- 🟡 WARNING → blinking yellow
- 🔴 DROWSY → fast blinking red
-
Physical buttons:
- Reset baseline (user-specific calibration)
- Reset stats (data stored over-time)
- Python 3
- OpenCV
- MediaPipe
- TensorFlow (optional for model extensions)
- PySerial
- ESP8266 (NodeMCU)
- SSD1306 OLED (I2C, 128x64)
- Push buttons (x2)
- LEDs (red, yellow, green)
- Resistors (3x 330 ohms)
DashSentinel/
├── run_dashsentinel.py # main entrypoint for execution
│
├── src/ # core application logic
│ ├── app.py # main app orchestration
│ ├── features.py # feature extraction (ear, yawning, etc.)
│ ├── model.py # scoring / detection logic
│ └── serial.py # esp8266 communication layer
│
├── DisplayModule/ # esp8266 firmware (platformio project)
│ └── src/
│ └── main.cpp # oled, leds, buttons logic
│
├── nodemcu_carrier_pcb/ # hardware design (KiCad)
|
├── schematic/ # schematic for all connections
│
├── data/ # runtime-generated data
│ └── driver_profile.json # user-specific baseline + stats
|
├── media/ # Images showing the system in operation
│
├── requirements.txt # python dependencies
└── README.md # project documentation
pip install -r requirements.txtpython3 run_dashsentinel.py --show-ui --draw-landmarks --enable-esp-serial --esp-port /dev/ttyUSB0python3 run_dashsentinel.py --headless --log-csv --enable-esp-serial --esp-port /dev/ttyUSB0python3 run_dashsentinel.py --show-ui --draw-landmarks --refine-landmarksAt startup:
- system learns user-specific facial metrics
- establishes baseline EAR and behavior
- Hardware button → reset baseline
- CLI flag → rebuild baseline at launch
python3 run_dashsentinel.py --show-ui --mirror --rebuild-baseline-on-start- Replace heuristic model with trained ML model
- Mobile app integration
- Full standalone embedded unit (dashcam form factor)

