ESP32 Field Camera Firmware
A custom camera for law-enforcement teams had to stream live video, notice motion on its own and accept updates in the field — all on a small, low-power chip, and fast enough to be useful in the moment.
Engineering record. Delivered by Jonathan Lam, Lamalo’s lead engineer, as an engineer and technical consultant at Lilypad Network, before the studio was founded. The client is not named for confidentiality.
- Latency
- < 150 ms
- Video
- 640×480
- Updates
- TLS-encrypted OTA
- Hardware
- 3 PCB spins
The challenge
Field equipment for law enforcement is unforgiving. The camera was built around an ESP32 — a capable but small microcontroller — and needed to do several demanding things at once: capture and stream video, decide on its own when something moved, and take software updates securely once units were already deployed. Every extra millisecond of delay made the live view less useful.
The architecture
- CaptureCamera sensor
640×480 frames from a custom ESP32 camera board.
- DetectOn-device
Frame-difference motion detection runs on the chip itself — no server needed.
- StreamLive video
FreeRTOS tasks tuned to keep latency under 150 ms.
- UpdateSecure OTA
TLS-encrypted over-the-air firmware updates for units in the field.
How it was done
- Firmware architecture in C/C++ on FreeRTOS, designed from the start around the camera’s real-time job.
- Task tuning until latency met the under-150 ms target — measured, not assumed.
- Motion detection on the device using frame differencing, so the camera reacts without a round trip to a server.
- Encrypted updates: over-the-air firmware delivered over TLS, so deployed units can be fixed without being collected.
- Hardware co-debugging through three PCB revisions alongside the hardware engineers — firmware and board evolving together.
What this means for your project
If you are building a connected device — a sensor, a camera, anything with a chip and a network — this is the discipline we bring: a latency budget set up front, updates that are secure from day one, and firmware and hardware debugged together rather than blamed on each other. Tell us about your device →