I built an AI baby monitor in one night (and learned a lot about 3am product design)
I don't have a newborn. But I have a startup obsession with high-willingness-to-pay markets, and there's no demographic more willing to pay than exhausted parents.
Here's the thing about baby sleep tools: the bar is embarrassingly low. The "smart" monitors on the market are $300 hardware devices with clunky apps that still just show you a live feed and beep when they detect noise. Every noise. Including the dishwasher.
So I asked: what if you built the monitoring layer purely in the browser, used the Web Audio API to listen continuously, and classified sounds with a real AI model? No hardware. No app store. Just open the website and point your phone at the crib.
Here's how I built it in one night.
The Core Problem
Parents don't need to hear every sound. They need to know: is my baby crying, or just shuffling around?
That distinction — cry vs. non-cry — is actually really hard. Commercial baby monitors solve it with hardware DSP chips. I solved it with frequency analysis and amplitude thresholds in JavaScript.
The Web Audio API gives you an AnalyserNode that produces FFT data at up to 25 times per second. A baby cry peaks in the 300Hz–3kHz range with high amplitude variance. Silence and white noise have flat, low-amplitude signatures. Fussing sits somewhere in between — more erratic than silence, less peaked than crying.
Here's the simplified classification loop:
function classifyAudioFrame(freqData, rms) {
const midFreqEnergy =
freqData.slice(10, 80).reduce((a, b) => a + b, 0) / 70;
const variance = computeVariance(freqData.slice(10, 80));
if (rms < 15) return 'silence';
if (rms > 80 && midFreqEnergy > 120 && variance > 400)
return 'crying';
if (rms > 40 && variance > 200) return 'fussing';
if (rms > 60) return 'coughing'; // short high-amp burst
return 'silence';
}It's not perfect — no JS classifier running on device will be. But it's good enough to distinguish "baby screaming at 3am" from "baby sighing" with high confidence.
The Sleep Score
The nightly score (0–100) was the insight that made the product feel real. Raw event logs are noise; a single number is actionable.
The formula:
- Base score: 100
- Deduct 5 per cry event (up to 40 points off)
- Deduct 2 per fussing period
- Deduct 3 per cough cluster
- Bonus: +5 if the last 2 hours had zero events (peaceful wake window)
This gives you something you can track over weeks and actually improve. Night 88 vs. Night 62 tells a story that "11 cry events" doesn't.
Designing for 3am
The biggest design constraint was the user: a parent who's been awake for 23 hours, checking their phone in the dark, holding a baby, trying not to wake their partner.
Every UI decision came from that constraint:
- Dark mode only — no blinding white screens
- One-number score above the fold — scannable in 0.5 seconds
- Color-coded timeline — green = silence, pink = fussing, red = crying, amber = cough
- No settings page — it just works, no configuration needed
The empty state was important too. Most apps show you a blank table with "No data yet." I wanted it to feel like the app was ready, not empty.
What Surprised Me
The Web Audio API is genuinely powerful. What surprised me more was how much the scorechanged how I thought about the app. Once you have a score, you have a graph. Once you have a graph, you have a story. Suddenly this wasn't a monitor — it was a sleep journal that wrote itself.
What I'd Do Next
- Real ML model — train a tiny ONNX model on labeled baby audio and run it via WebAssembly
- Push notifications — alert the parent's phone even when the screen is off
- Trend insights — "Your best nights were after walks in the park 🌳"
- Multi-device — phone as monitor, tablet/laptop as the viewer dashboard
Try It
The app is live at baby-sleep-monitor.limed.tech. It works on any phone or tablet with a microphone. No account, no download, no $300 hardware.
If you're a tired parent and this helps you get one more hour of sleep — that's the whole point.