Raspberry Pi Drowsiness Detector Build
Budget: €30 – €250 EUR
I’m putting together a lightweight, always-on driver-drowsiness monitor that runs reliably on a Raspberry Pi Zero 2 W (it should also scale fine to a Pi 4). The system will watch two USB webcams—one on the driver, one on the road—and continuously score fatigue in real time.
Core workflow
• Capture synced frames from the driver-facing and road-facing cameras at a modest, configurable FPS.
• Detect eyes (and ideally mouth & basic head pitch) with whichever method performs fastest on the Zero 2 W—OpenCV Haar, MediaPipe-lite, or a hybrid is fine; I’m not tied to a specific library as long as it stays lean.
• Derive blinks per minute and PERCLOS over a 30–60 s sliding window, then combine them into a 0-100 Risk Score.
• When the score crosses the configurable threshold, pulse a GPIO-driven buzzer (my preferred alert) while enforcing an ~8 s cooldown. A physical mute button or simple keypress should pause alerts for 30 s.
• Overlay a minimalist HUD in one open window showing live PERCLOS, BPM, and score.
• Log every cycle to CSV: timestamp, blink/min, PERCLOS, score, alert flag.
• Pull all tunables—camera indices, FPS, thresholds, GPIO pin numbers, cooldowns—from an external JSON config so I can tweak without editing code.
Please keep the footprint small (Python 3 on Bullseye Lite, headless-friendly), avoid heavyweight GUI frameworks, and note any extra packages I’ll need. I’d like clear installation steps and a short test video or screenshots proving the buzzer fires on simulated drowsiness.
Deliverables
1. Well-commented source code and JSON template
2. Step-by-step setup guide for a fresh Pi Zero 2 W image
3. Sample CSV log and HUD proof-of-life capture
4. Confirmation that the buzzer alert, mute logic, and cooldown work as specced
If this sounds up your alley, let’s talk timing and any clarifications you need.
Core workflow
• Capture synced frames from the driver-facing and road-facing cameras at a modest, configurable FPS.
• Detect eyes (and ideally mouth & basic head pitch) with whichever method performs fastest on the Zero 2 W—OpenCV Haar, MediaPipe-lite, or a hybrid is fine; I’m not tied to a specific library as long as it stays lean.
• Derive blinks per minute and PERCLOS over a 30–60 s sliding window, then combine them into a 0-100 Risk Score.
• When the score crosses the configurable threshold, pulse a GPIO-driven buzzer (my preferred alert) while enforcing an ~8 s cooldown. A physical mute button or simple keypress should pause alerts for 30 s.
• Overlay a minimalist HUD in one open window showing live PERCLOS, BPM, and score.
• Log every cycle to CSV: timestamp, blink/min, PERCLOS, score, alert flag.
• Pull all tunables—camera indices, FPS, thresholds, GPIO pin numbers, cooldowns—from an external JSON config so I can tweak without editing code.
Please keep the footprint small (Python 3 on Bullseye Lite, headless-friendly), avoid heavyweight GUI frameworks, and note any extra packages I’ll need. I’d like clear installation steps and a short test video or screenshots proving the buzzer fires on simulated drowsiness.
Deliverables
1. Well-commented source code and JSON template
2. Step-by-step setup guide for a fresh Pi Zero 2 W image
3. Sample CSV log and HUD proof-of-life capture
4. Confirmation that the buzzer alert, mute logic, and cooldown work as specced
If this sounds up your alley, let’s talk timing and any clarifications you need.
Related categories:
C Programming
Python
C++ Programming
Arduino
Raspberry Pi
OpenCV
Embedded Systems
Computer Vision