ESP32-CAM MJPEG2SD Motion Security Camera - image 1
Build Guideintermediate

ESP32-CAM MJPEG2SD Motion Security Camera

A comprehensive motion-capture camera firmware for ESP32-S3 boards including the LILYGO T-Camera S3, recording MJPEG video to SD card, streaming to a browser, and sending Telegram/email alerts on PIR or camera-detected motion.

Boards:ESP32-S3
Firmware:Arduino
Use Cases:Security & SurveillanceHome Automation

Overview

ESP32-CAM_MJPEG2SD transforms the LILYGO T-Camera S3 (and other ESP32-S3 camera boards) into a fully featured security camera. The T-Camera S3's built-in OV2640 camera, PIR motion sensor, microphone, and 8 MB PSRAM make it a natural fit for this firmware.

Features

Recordings are saved to an SD card as AVI files with optional audio from the I2S microphone. The device streams live MJPEG video to any web browser on the local network, and also supports RTSP for use with IP camera software like Home Assistant's MotionEye integration. Motion detection works through two modes: passive using the T-Camera S3's hardware PIR sensor, or active using frame-difference analysis in the camera feed. On motion trigger, alerts are dispatched via Telegram bot or email. An MQTT integration allows Home Assistant to receive motion events and query the camera state.

Build Details

Written in Arduino C++ with 1.5k GitHub stars. The firmware is actively maintained by s60sc and supports the full range of ESP32/ESP32-S3 OV2640 camera boards. Configuration is handled through a web-based dashboard accessible after the first WiFi setup. Supports FTP and HTTPS for remote file access.

Resources