Hardwired Motion-Sensing Doorbell with Local LAN Backup
A hardwired doorbell camera prototype that detects motion, records video/events to local microSD, backs up data to a LAN server, and plays a doorbell chime through a speaker when the button is pressed.
Advanced Project
— This is advanced because it combines camera capture, Ethernet networking, local file storage, audio output, and always-on embedded reliability, and the camera interface in particular can be difficult to integrate cleanly on a small MCU-based prototype.
Assumptions:
- The camera is expected to capture stills or compressed video clips rather than continuous high-bitrate recording.
- Motion detection can be done in firmware from the camera stream or with a dedicated motion sensor; I assumed camera-based motion detection is acceptable for the prototype.
- The local network backup target is reachable over Ethernet and can accept files via SMB/NFS/HTTP/FTP or a simple custom upload protocol.
- Night vision/IR illumination was not explicitly requested, so I did not add an IR LED block.
- The doorbell button itself is an external input and not a separate electronic subsystem beyond the MCU GPIO and debounce circuitry.
Bill of Materials
Compatibility Notes
- The recommended STM32F107VCT6 is a 3.3 V MCU, so the camera, microSD interface, PIR sensor, and Ethernet controller should all be selected or interfaced for 3.3 V logic.
- ESP32-DevKitC-32U uses SPI, which is compatible with the STM32F107VCT6, but you must budget an SPI bus for both Ethernet and microSD or use separate chip-select lines and careful bus arbitration.
- The MAX98357AETE+T expects ESP32-DevKitC-32U digital audio, so verify the chosen MCU firmware can spare an ESP32-DevKitC-32U peripheral or emulate the required timing.
- The ESP32-DevKitC-32U camera modules are much easier to integrate with a Linux SBC than with a small MCU-only design; if you stay with the STM32F107VCT6, you may need a camera bridge or a different host architecture for full video capture.
- The Mean Well IRM-10-5 provides a 5 V rail, but the MCU, Ethernet controller, PIR sensor, and microSD breakout will likely need 3.3 V regulation or onboard regulation depending on the breakout boards used.
You'll Also Need
- Doorbell button input hardware and debounce components are not explicitly listed as a separate block; you will still need the button, pull-up/pull-down resistor, and possibly ESD protection.
- A camera interface bridge or a more camera-capable host may be needed if you want full video capture rather than still images or very low-rate snapshots.
- Enclosure, weather sealing, mounting hardware, cable glands, and thermal management are required for a real doorbell installation.
- Level shifting, pull-ups, decoupling capacitors, and any required 3.3 V regulator are not included as separate BOM items.
- If you want night vision, you will need IR LEDs and current-limiting circuitry, which were not requested explicitly.
Estimated BOM Cost: $55-65 (based on live distributor pricing)
Design Considerations
Camera Architecture
The biggest architectural decision is whether the system records stills, short clips, or continuous video. A small MCU like the STM32F107VCT6 is fine for control, storage, and network upload, but full camera capture and encoding usually push you toward a camera-capable host or a dedicated image pipeline. If you want real video, validate the camera interface early because the ESP32-DevKitC-32U modules are much easier on Linux-class hosts than on a bare MCU.
Motion Trigger Strategy
For a doorbell camera, PIR motion sensing is usually more reliable and lower power than trying to do always-on video motion detection in firmware. Use the PIR to wake or arm the camera, then confirm with image-based motion logic if needed to reduce false triggers from sunlight, shadows, or passing cars. This hybrid approach is much more robust than relying on one sensor alone.
Ethernet Throughput
If you plan to back up recordings regularly, 10BASE-T can become a bottleneck once you start moving image sequences or clips. The ESP32-DevKitC-32U gives you 10/100 Ethernet, which is a better match for periodic uploads and future expansion. Keep the network protocol simple at first, such as HTTP POST or SMB/NFS file copy from a local service.
Power and Thermal Budget
A permanently powered doorbell camera should be designed around continuous operation, not battery life. The PIR sensor can keep standby current low, but the camera and Ethernet controller will dominate power when active, so size the supply with margin and expect the enclosure to warm up. A 5 V, 1 A class supply is a reasonable starting point for a prototype, with extra headroom if the camera or speaker amplifier draws more current.
Audio Reliability
Doorbell chimes are short but must be dependable, so keep the audio path simple. The MAX98357AETE+T is attractive because it removes the need for an analog DAC and lets the MCU generate a clean digital audio stream or tone sequence. Test speaker loudness in the actual enclosure, because small enclosures can dramatically change perceived volume and frequency response.
Firmware Resilience
Use a state machine with separate states for idle, motion-detected, recording, upload-pending, and upload-in-progress. Add a watchdog timer and a local queue on microSD so network outages do not lose events; the system should record locally first and treat server backup as best-effort with retries. This is especially important for a doorbell camera because LAN connectivity and storage writes can fail independently.
Want to customize this project or build something different?
Try the Project Advisor


