ES-116IntermediatePremium
ESP32 Power Outage Alert: A Telegram Message to Your Phone When the Power Goes Out (Voltage Divider + OLED + Power Bank)
When the power goes out at home, a Telegram message reaches your phone with the time, and when it comes back you get the outage length. The 5 V of an adapter in the wall socket is read by the ESP32 through a voltage divider; the ESP32 runs from a power bank, so it keeps working during the outage. The OLED shows the state, voltage and duration, and a buzzer beeps. There is no connection to the 230 V mains, only the 5 V side of the adapter is measured.
0.0(0)

If you wonder whether the freezer or the aquarium lost power while you are on holiday, this device tells your pocket. A few seconds after the power goes out a message arrives, and when it comes back it says how long the outage lasted; if the adapter voltage drops, it warns you too. The idea is simple: an adapter in the wall socket gives 5 V while there is power and goes silent in an outage. The ESP32 reads this 5 V safely through a three resistor divider and runs from a power bank itself. For the message to go out at once, the router must keep working during the outage too; if it goes down, the messages wait in line and go out with the right times once the internet is back. You learn voltage dividers, analog reading, filtering short flickers with a confirm time, NTP time and a message queue. Mains voltage is never touched: do not open the socket or the adapter cable, use only a ready made, isolated adapter.
Source Code
Premium Content
The source code, block version and FAQ of this project are open to Premium members.
- All Project Code
- Block version
- Frequently Asked Questions
