About Drowsiness Alarm

A free, browser-based service that detects eye closure in real time and alerts you before fatigue causes harm.

Why We Built This

Drowsiness while working, studying, or driving is a serious safety risk — yet most people don't realize they're falling asleep until it's too late. Existing drowsiness detection hardware is expensive and requires installation. We built Drowsiness Alarm to give everyone free, instant access to reliable fatigue detection using just the webcam already in their computer.

All processing happens in the browser. Your camera footage never leaves your device, making the service both safe and instantly usable.

The Risks of Drowsiness

20%
of serious road accidents involve driver fatigue (NHTSA)
33%
of adults report insufficient sleep (CDC)
17h
of wakefulness ≈ 0.05% BAC impairment level
50%
reduction in work performance after poor sleep

How the Technology Works

Google MediaPipe Face Mesh

MediaPipe Face Mesh is a lightweight machine learning pipeline that detects 468 facial landmarks in real time. It runs as WebAssembly directly in your browser, delivering near-native performance with no server round-trip. The model was trained on millions of diverse faces for robust detection across lighting conditions and appearances.

EAR — Eye Aspect Ratio

EAR measures the ratio of eyelid opening height to eye width using specific MediaPipe landmark points. When eyes are open, EAR is typically 0.25–0.40. When closed, it drops below 0.15. By sampling EAR 20+ times per second and comparing it to your personal threshold, the app distinguishes natural blinks (under 200 ms) from sustained closure caused by drowsiness.

Processing Pipeline

  1. Webcam frame captured (640×480 px, hidden video element)
  2. MediaPipe Face Mesh extracts 468 landmark coordinates
  3. EAR computed from 8 specific eyelid landmarks per eye
  4. Both eyes averaged; result compared to user threshold
  5. If EAR < threshold continuously for ≥ set seconds → alarm triggered
  6. Frame discarded — nothing is stored or transmitted

Drowsiness Prevention Tips

😴
Prioritize Sleep

Adults need 7–9 hours of sleep per night. Consistent sleep debt compounds and severely impairs cognitive performance.

☀️
Use Natural Light

Bright light suppresses melatonin and keeps you alert. Work near a window or use a full-spectrum desk lamp.

🚶
Take Regular Breaks

Short movement breaks every 25–50 minutes improve blood circulation and sustained attention. Try the Pomodoro technique.

💧
Stay Hydrated

Even mild dehydration impairs alertness. Drink water regularly throughout the day.

Strategic Caffeine

Caffeine is most effective when timed to your alertness dips (typically early afternoon). Avoid it within 6 hours of bedtime.

Who Is This For?

Remote Workers

Stay sharp during long video calls or screen work sessions

Students

Stay awake during late-night study sessions and online lectures

Night Shift Workers

Monitor fatigue during overnight shifts at a computer

Researchers

Study drowsiness patterns and EAR-based fatigue detection