babycamly a spare phone, watching over ✦

How motion and sound detection work

monitor notes · 03 · 6 jul 2026

=what moved lights up
fig — subtract two frames and only the movement remains.

"Detection" sounds like it needs clever AI. For motion and sound, it genuinely doesn't — both are one small measurement compared against a line you set.

Motion = frame difference

A video is just a fast series of still frames. To sense movement, you compare this frame with the last one, pixel by pixel, and add up how much they differ. A still room: the two frames are nearly identical, so the difference is tiny. Someone walks in: a patch of pixels changes a lot, and the total difference jumps. That single number — average change per pixel — is the "motion level." Set a threshold and anything above it is "movement." To keep it cheap, the tool shrinks each frame to a thumbnail first; you don't need full resolution to know something moved.

Sound = microphone level

Sound is even simpler. The microphone gives a stream of samples; the loudness right now is basically how far those samples swing from silence (the RMS, if you want the term). Quiet room, small number; a cry or a bark, big number. Again you pick a threshold, and crossing it counts as "sound." The only craft is setting the two thresholds just above the resting level of a quiet, still room — high enough to ignore the fridge hum and passing headlights, low enough to catch what matters. That's the whole engine behind the monitor: two honest measurements, two lines, a flash and a log when either is crossed. No model, no cloud, no guesswork.