Security Systems Waste a Lot of Power
Many DIY security projects follow the same pattern. An ESP32 connects to Wi-Fi, polls sensors, flashes status LEDs, and waits for something interesting to happen. It works, but the device spends most of its life burning power while doing essentially nothing.
GitHub user Naseem Shawarba took a different approach with ESP-Guard.
Built around an ESP32 DevKitC, ESP-Guard is a battery-powered alarm and notification system that spends nearly all of its time in deep sleep. Instead of continuously monitoring sensors, it relies on the ESP32's EXT1 wakeup logic to remain dormant until a door opens, a remote button is pressed, or a timer expires. Only then does the device wake up, perform its task, and return to sleep.
It's Time to Get Up!
The hardware is centered around a magnetic reed switch connected to a door or window. When armed, opening the door causes the ESP32 to wake and begin a short countdown period. During that window, the owner can disarm the system using a wireless remote. If no action is taken, the alarm sounds and a Telegram notification is sent over Wi-Fi.
The design also supports PIR sensors, IR beam-break sensors, and other trigger sources that can generate a logic-high signal. A 433 MHz keyfob remote provides arm, disarm, status, and configuration functions through a matching RF receiver.
Status information is displayed through a common-cathode RGB LED, while a passive piezo buzzer provides audible alerts. For users who prefer silent operation, a configurable Stealth Mode disables both visual and audio notifications.
Deep Sleep During the Waiting Game
The most interesting aspect of the project is how it handles long waiting periods.
Many alarm systems remain awake while counting down entry delays, cooldown timers, or temporary lockout periods. ESP-Guard records those states in RTC memory and immediately returns to deep sleep. When the deadline arrives, the ESP32 wakes using its RTC timer and continues where it left off.
That approach applies to the post-arming grace period, post-trigger cooldowns, and automatic reactivation after a temporary disable period. According to the documentation, the device remains in deep sleep for nearly all of these phases, waking only when necessary.
The project documentation describes deep-sleep current draw in the neighborhood of 10 µA, while Wi-Fi activity only occurs briefly when messages need to be transmitted or configuration changes are being made.
No Hardcoded Credentials
Configuration is handled through a built-in web portal rather than source-code edits.
On first boot, the device creates its own Wi-Fi access point and presents a captive portal where users can enter network credentials, Telegram information, alarm timings, and other settings. The same interface also supports over-the-air firmware updates, allowing the device to be maintained without connecting a USB cable.
This means precompiled firmware can be shared without requiring users to modify source files or recompile code simply to enter credentials.
Built for Real-World Deployment
ESP32 security projects are common, but many feel more like demonstrations than devices intended for everyday use. ESP-Guard puts significant attention into deployment details such as power consumption, wireless configuration, remote control, and OTA updates.
The hardware remains simple, relying on readily available modules and sensors, but the software architecture does much of the heavy lifting. For anyone looking to build a battery-powered door, mailbox, or window monitor that can operate for long periods without constant charging, ESP-Guard offers an interesting example of how far careful power management can go.