DrowsyGuard
A USD 27 retrofit device that watches a driver's eyes, mouth and head on the ESP32‑S3 itself, and speaks a warning — with no cloud anywhere in the alert path.
A USD 27 retrofit device that watches a driver's eyes, mouth and head on the ESP32‑S3 itself, and speaks a warning — with no cloud anywhere in the alert path.
Why one frame is not enough
Normal blinking, looking down at the gear stick, glasses glare and a moment of lost face all read as “eyes closed” to a per-frame classifier.
Our own whole-face network scored 0.81 in validation but 0.57 on drivers it had never seen — it had learned who the driver was, not whether their eyes were shut. It was removed.
Driver monitoring ships only in new vehicles. A USD 27 retrofit that runs offline is the only version of this that reaches an existing car.
Four signs, each with its own clock
Share of the last three seconds with the eyes closed. The best-established fatigue measure, so it carries most of the weight.
weight 0.55Slower than a blink, shorter than a microsleep. Blink speed drops before a driver knows they are tired.
weight 0.20Mouth corners drop and pull inward. Anything faster is speech, not a yawn.
weight 0.15Down and back. Two independent pitch channels must agree, so an open mouth cannot fake it.
weight 0.10From four numbers to one spoken word
risk = 0.55 PERCLOS + 0.20 blink + 0.15 yawn + 0.10 nod. The three minor cues corroborate; none of them can raise an alarm alone.
Risk must stay above 0.55 for 0.55 s. A single noisy frame decrements the streak instead of resetting it, so one dropout inside a real closure cannot end it.
“Drowsy”, “Microsleep”, “Yawning”, “HeadNod” — a named warning is actionable in a way a chime is not. Three announcements per episode, then quiet.
The alert path never touches the network. A dropped dashboard costs diagnostics, never safety.
One safety path, two support paths
Bill of materials — all bought locally
ESP32‑S3‑WROOM‑1 + OV5640
N16R8 · 8 MB PSRAM
Camera, on-device inference and Wi-Fi in one board. $7.50
MAX98357A amplifier
I2S · class D · filterless
Turns the spoken clip into something audible. $2.00
Speaker
4 Ω / 3 W · 40 × 22 mm
The only thing the driver actually perceives. $0.75
Breadboard MB102
830 point · solderless
Keeps the wiring repeatable between test sessions. $1.50
Jumper wires & headers
Dupont · 1 set
Seven connections: power, ground and three I2S lines. $2.00
USB‑C cable
data-capable · 5 V
Flashing and bench power. Charge-only cables will not do. $1.50
5 V USB supply
regulated adapter
Prototype power; an automotive supply comes at pilot stage. $2.00
Inline USB power meter
measurement instrument
Turns “power draw” from a claim into a number. $5.00
Enclosure & mount
prototype materials
Same camera distance and angle every session, or the data is not comparable. $5.00
Laptop and phone are excluded — the team uses existing devices. No display, by decision: a 1.8” panel cost five GPIOs, 150 KB of PSRAM and a per-frame blit to show 8-pixel text to one person. The phone browser shows strictly more, and makes the same numbers scriptable for the acceptance tests.
Measured on the bench, not estimated
What running it on hardware taught us: the sensor is mounted upside down, so every frame arrives mirrored. That reversed the eye pair and flipped the sign of every vertical measurement — jaw drop read −1.2 instead of +1.2 and fell as the mouth opened, so the yawn cue had never once been able to fire. No amount of desk testing would have found it.
Where the remaining effort goes
Our focus from here is training the lightweight on-device model — 11,250 parameters, 46 KB — on visible-light eye-state data, split by subject, so it reads eyelids instead of faces.
Infrared-trained, it does not transfer to 45 px visible-light eye crops: AUC 0.62. Grayscale, CLAHE, inversion and four patch scales did not recover it. The fix is labelled data in our own domain.
Subject-independent splits only. The 0.81-to-0.57 collapse is the standard any replacement has to clear.
Every period on slide 3 is literature-informed and tested on synthetic traces. Labelled yawn and nod footage turns them from defaults into measurements.
Why not a large model: the most accurate public drowsiness networks are 70–343 MB at 224×224 and cannot run on an ESP32‑S3 at any frame rate. The eye-closure route is the one that fits. Research prototype only — not a certified safety device.