⛔ High riskMains 220–230 V can kill. Work with the power off, use certified isolated modules in an enclosure, fuse the line, and ask a qualified electrician if you are not sure.
Turn complaints into a dataset
"The power goes off all the time" is hard to argue with. A table with the start, the end and the duration of every outage is easy to argue with, and it helps with your own decisions too: the longest outage of the last three months tells you how big the battery or the generator should be.
What to record and how
A mains detector with an optocoupler drives one GPIO, and a small battery keeps the C3 alive. Store only a start time and a duration per event, a few bytes each, and a year fits easily in flash. Take the time from NTP when Wi-Fi returns, and count the seconds in RTC memory in between.
- Separate a blip of a couple of seconds from a real outage, and count them in different columns; blips damage electronics too.
- Compute the uptime percent per week and the longest outage, and send them as a summary once a week.
- If you also have the published schedule, compare it: hours promised against hours delivered is a useful number.
- Keep the journal as a file you can download. Your own record is worth more than a memory.
Components
- ESP32-C3 SuperMini
- AC 220V optocoupler detection module
- TP4056 USB-C Li-ion charger with protection
- 18650 Li-ion cell + holder
- Plastic project enclosure
Comments
No comments yet. Share your experience or ask a question.