← All projects Munawar Kazmi
Embedded C++ · ESP32 · Commercial Prototype

A watchman that decides in-frame

Deterministic C++ firmware for an ESP32-CAM intrusion detector, built under contract for Muxtronics in 2025: the camera sees motion and decides on-device, with alerts carried by the client's proprietary LoRa mesh.

16×12
decision grid distilled from 800×600 grayscale frames
0
ML dependencies - no OpenCV, no TensorFlow Lite, fully deterministic
CI
compiles the firmware for the AI-Thinker board on every push

The constraint

No OpenCV, no TensorFlow Lite, no megabytes to spare. An ESP32-CAM has a camera, a modest processor, and very little memory, and the product had to run on exactly that, outdoors, for hours. The answer is a fully deterministic pipeline - the same frames always produce the same decision, which is what makes embedded firmware testable and trustworthy.

How it works

Pipeline diagram: ESP32-CAM frames are block-downsampled, a temporal difference makes the motion decision, and alerts travel over a LoRa mesh
800×600 frames collapse into 16×12 mean-luminance blocks; a frame-to-frame relative difference against a tuned threshold makes the call. The proprietary mesh firmware remains confidential to Muxtronics; the detection firmware is public, and the device reports only what it actually measures at runtime - frames, detections, loop rate, free heap.

A note on measurements, because this portfolio takes them seriously: earlier versions of this page quoted field-trial accuracy figures that the repository could not substantiate, and they have been retracted - the repository documents the retraction. What stands behind the project instead: the public firmware, a live demo video, and a signed academic reference from Dr. Patrick Holthaus of the University of Hertfordshire. If field numbers are published in the future, they will come with the raw logs and the ground-truth method that produced them.