D

DIY Electronics

— Building circuits, programming microcontrollers, and making things blink
49 members Created Jun 2026

Lipo battery charging with TP4056 — common mistakes

ESP32-S3 Camera Motion Detector

Built a wildlife camera that only saves images when motion is detected, to avoid filling an SD card with hours of nothing. The hardware is an ESP32-S3 with an OV2640 camera module and a PIR sensor as the primary trigger.

The software flow: the PIR interrupt wakes the ESP32-S3 from light sleep, the camera warms up (100ms settle time required for AEC), captures a JPEG at 640x480, and writes it to SD with a timestamp filename. If the SD write fails it logs an error but doesn't halt — missed frames are acceptable, lockups are not.

I added a simple frame difference algorithm as a secondary software motion filter to reject false PIR triggers from foliage movement. It compares the luminance channel of sequential frames — if less than 2% of pixels changed by more than 30 levels, the image is discarded. This cut false saves by about 70%.

0

Report thread

Why are you reporting this thread?

Restore the redacted content?

This will make it visible to everyone again. The clear action is logged in the mod log.