Netzwächter
A small LTE device that raises the alarm by SMS when the power goes out, with my own firmware and my own Android app.
- Context
- Personal project
- Time
- Autumn 2026, one week at about 2 hours a day
- Status
- SMS alarm and app work (app v1.5.0)
- Tools
- C++ (Arduino IDE), Flutter, GitHub Actions, with AI as support
Why I built it
While my grandparents were on holiday, their freezer stopped running. Nobody noticed, and by the time they came home everything in it had to be thrown away. A simple message at the right moment would have been enough to save it.
So I built a device that watches the power and sends an SMS as soon as it's gone, and again when it's back. SMS works without Wi-Fi or internet, which is exactly what fails in a power cut.
The hardware, the wiring and the testing are my part. Firmware and app I wrote with AI, since I'm not an application developer: I described what the device has to do, tested every version on the real hardware and fed the problems back until it worked.
How it works
Hardware
- BoardLilyGO T-A7670G, an ESP32 with an LTE modem
- Mobile networkPrepaid SIM
- Battery18650 cell on the board, takes over during a power cut
- Power detection5 V power supply on the board's solar input, measured by the firmware
Firmware
- Detects power loss and return with hysteresis and debouncing, so short flickers don't cause false alarms.
- Sends an alarm, an all-clear and a low-battery warning to up to 5 numbers. The texts can contain placeholders such as battery level and outage duration.
- The modem runs in its own task on one of the two CPU cores, so the Bluetooth connection to the app never freezes.
- Settings are stored in flash memory and survive a restart.
Remote control by SMS
More than 20 commands let me check and change the device from anywhere. Only saved numbers get an answer, and a fixed admin number always works, so I can't lock myself out.
/status/alarm 3m/pause 2h/akku 20/nummer neu/testAndroid app
The app connects over Bluetooth and shows live data every 1.5 seconds: battery, power supply voltage, modem and SMS status. All settings can be changed in the app, and a diagnostics view helps with troubleshooting. GitHub Actions builds the APK automatically.

Read the diagram as text
In normal operation the power supply feeds the LilyGO board. When the power goes out, the 18650 battery takes over and the board sends an alarm SMS to a phone through its LTE modem and prepaid SIM. When the power returns, it sends an all-clear. The Android app connects to the board over Bluetooth.
Challenges and solutions
Detecting the power cut
My first idea was to power the board over USB-C and detect when that power disappears. On this board, that didn't work reliably.
Solution: The 5 V power supply now goes into the board's solar input. Its voltage can be measured directly, and the firmware reacts when it drops.
When is the power really gone?
A short flicker shouldn't wake anyone up, but a real outage has to be reported quickly.
Solution: Two thresholds with a gap between them (hysteresis) and a short waiting time before a change counts. On top, the delay before the alarm SMS can be set per SMS command or in the app.
Reliable SMS
Sending SMS through the LTE modem didn't work reliably at first.
Solution: The firmware checks the provider's SMS centre and sets it if needed, waits for the modem's confirmation, and retries after a minute if sending fails. The SIM PIN is only sent when configured, so failed attempts can't lock the SIM.
What I learned
- How a modem worksUnderstanding how an LTE modem is controlled with AT commands and what its answers mean.
- A complete productHardware, firmware and an app that fit together, from a real problem to a working solution.
- Building with AIDescribing requirements precisely, testing on real hardware and giving clear feedback until the result works.
- Clean repositoriesKeeping personal data like phone numbers and the SIM PIN out of the public code, and building releases automatically.
My part
I wrote the firmware and the app with AI. The hardware, the wiring and the testing are my own work. One decision of mine: two thresholds with a gap between them for detecting a power cut, so a short flicker doesn't wake anyone up.
What I'd do differently
I would test the power detection on a simple bench setup first, before building the firmware around it. My first idea, using USB, didn't work.
Code
Firmware, app and the list of all SMS commands are on GitHub: esp32