Smart Baby Monitor

GitHub
Baby Monitor Asleep

Why build a smart baby monitor?

I’ve always had a strong interest in the smart home space. My home is brimming with Google Home Hubs and Minis, Phillips Hue lights, Nest Cams, and Chromecasts. What it lacked is a Baby Monitor that would help me track my son's sleep.

Babies need to sleep a certain amount of hours today, split between overnight sleep and naps. My son has a habit of rolling around before falling asleep, as well as waking up in the middle of the night and playing, sometimes for as long as 45 minutes. Despite having a Google Nest Cam and Eufy Baby Monitor in the room, I could not conveniently determine when he fell asleep and if he stayed asleep.

Rather than rewind the Nest Cam to try to calculate his time spent asleep overnight, I decided to build a smart baby monitor to inform me when the baby woke up and went back to bed. It’s also detects how quickly he falls asleep after putting him to bed, which means that I no longer need to keep an eye on the monitor.

What technology does it use?

How does the image detection work?

The camera sends video at 30 fps. I’d like to see if the baby moves once per second, so I grab every 30th frame and compare the baby’s position to a frame 29 frames later. If the baby’s position is identical, he did not move. If the position is not identical, I store that the baby has moved at least once. If the baby moves 10 times in one minute, he is considered awake. This does lead to the occasional false positive; however, at higher thresholds, I encountered too many false negatives.

Interested in trying it for yourself? Click the GitHub button below.

GitHub