I Built A Machine That Watches You Fall Asleep. For Under ₹2,000.
A real Raspberry Pi, a webcam, and a buzzer loud enough to save a life. Here’s what I built in college — and the statistic I found while writing this that genuinely shook me.Photo by Jainath Ponnala on UnsplashSomewhere in my college years, I got fixated on a specific, uncomfortable fact: the…
A real Raspberry Pi, a webcam, and a buzzer loud enough to save a life. Here’s what I built in college — and the statistic I found while writing this that genuinely shook me.Photo by Jainath Ponnala on UnsplashSomewhere in my college years, I got fixated on a specific, uncomfortable fact: the safety feature that could actually stop someone from dying at the wheel — a system that watches your eyes and screams at you the moment they close for too long — mostly exists only in cars that cost more than most Indian households will ever spend on a vehicle.So I built my own version. Raspberry Pi, a webcam, a buzzer, an LCD screen, some Python. Total cost, if you already own a Pi: under ₹2,000.Here’s the thing I didn’t expect going into this project: writing about it years later, I went looking for updated numbers on drowsy driving, and one statistic actually stopped me mid-sentence.Photo by Pouyan Nahed on UnsplashThe Number Nobody’s Prepared ForIn the US, drowsy driving gets officially blamed for around 1,500 deaths a year. That’s the number you’ll find in most government reports. A 2025 analysis by the Governors Highway Safety Association went back and actually dug into the real data behind that figure, and found something that should be a much bigger headline than it currently is: the real toll is likely closer to 6,300 deaths a year, nearly ten times higher than what gets officially recorded.Why the massive gap? Because unlike alcohol, fatigue doesn’t show up in a blood test. There’s no breathalyzer for “I haven’t slept properly in two days.” A drowsy-driving crash just quietly gets filed under “driver error,” and the actual cause disappears into the paperwork.That gap between what actually kills people and what gets counted is exactly the space a project like this one is trying to close.Why I Actually Built ThisThe idea was almost embarrassingly simple once I sat with it: most affordable cars have zero driver monitoring. It’s a feature reserved for cars most people can’t afford. Meanwhile, India’s own Road Transport Minister confirmed in 2025 that 66% of road accident fatalities in the country involve people aged 18 to 45, the exact demographic most likely to be driving a budget car with none of this safety tech built in.That’s not a coincidence I could ignore. So the actual project became: build the cheapest, most replicable version of driver monitoring that could theoretically end up in any car, not just expensive ones.Photo by Bedirhan Gül on UnsplashHow It Actually WorksThe core logic isn’t complicated, which is honestly part of the point. I wanted something a student with a modest budget could genuinely replicate, not something requiring a research lab.A webcam feeds real-time video into the Raspberry Pi. A library called dlib tracks facial landmarks: specifically, the eyes. OpenCV processes that feed and calculates whether the eyes are open or closed, continuously, dozens of times a second. If the eyes stay shut past a set threshold — the real early warning sign of someone dozing off — the system doesn’t wait around. A buzzer goes off immediately, an LED lights up, and an LCD screen flashes “Please Wake Up” in case the sound alone doesn’t do it.Total component cost beyond the Pi itself: somewhere between ₹1,500 and ₹2,800, depending on what you already have lying around. That number matters more than it sounds — it’s the difference between “safety feature for luxury cars” and “safety feature literally any student could build, and any driver could afford.”What Actually Happened When I Tested ItI ran it through VNC on my laptop first. Blinked normally; the screen said, “Active.” Held my eyes shut for a few seconds, deliberately faking drowsiness; the screen switched to “Sleeping,” and the buzzer went off immediately. Then I checked the actual hardware: same result, LCD and buzzer responding exactly in sync with what the software detected.It wasn’t flawless. Detection accuracy dropped noticeably with a low-quality camera or bad lighting, worth knowing if you’re planning to build your own version. A stable mount and decent lighting made a real difference. But in good conditions, the software and hardware matched every single time, which is really the whole point of a proof-of-concept like this.What This Project Actually Taught MeI didn’t build this thinking it would end drowsy driving single-handedly. I built it because the gap between “this technology exists” and “this technology is affordable” felt like a solvable problem, at least at a small scale, and college was the right time to actually try solving it instead of just noting the gap and moving on.The bigger lesson, looking back: a huge number of road safety problems aren’t unsolved because nobody’s figured out the technology. They’re unsolved because nobody made the technology cheap enough to actually reach the people who need it most. That’s a different, more interesting problem than “can this be built,” and it’s the one I’d genuinely recommend other students building safety-tech projects actually sit with.I write about IoT, AI, and the technology projects worth actually building, not just reading about; more breakdowns at TechByDevansh.com.This story is published under the Generative AI publication. Connect with us on LinkedIn and follow Zeniteq to stay in the loop with the latest AI stories. Let’s shape the future of AI together!I Built A Machine That Watches You Fall Asleep. For Under ₹2,000. was originally published in Generative AI on Medium, where people are continuing the conversation by highlighting and responding to this story.Source: Generative AI Pub — Published — Category: Image AI