▒█▀▀█ █▀▀ █░░█ ▒█▀▀█ █░░█ ░▀░ █▀▀█
▒█▄▄█ ▀▀█ █▄▄█ ▒█░░░ █▀▀█ ▀█▀ █░░█
▒█░░░ ▀▀▀ ▄▄▄█ ▒█▄▄█ ▀░░▀ ▀▀▀ █▀▀▀
few months ago my 4yrs old ups died due to water exposure while working at balcony. it was very functional thing, can handle 2kva load which powering electronics of whole home, provides detailed measurements about AC line and battery status etc. even you can sense the whole district's power load by observing the ac line graph.
Tried to buy same device but no luck, even manufacturer company not exists anymore. so i purchased an used ups with $15 and upgraded it to handle more capacity. details available in this instructables entry.
Requirement
It's working fine but my software customizations become obsolete with this ancient hardware. decided to measure electricity myself by using third party arduino modules but none of them simply telling is electricity exists or not. i was about to connect 5v cellphone charger output to arduino's analog pin then got the idea while testing it by using my screwdriver.
Solution
Most screwdrivers got NE-2 neon lamps to test mains voltage which beaming a barely visible light when connected to AC voltage. i removed the lamp, attached a photoresistor (aka LDR) and wrapped them with black tape to prevent any external light source.
tada! i have a AC measurement module with analog output. connected it to my sensor box and did minor modifications on software stack. now my home automation software can detect power interruptions and take actions such as turn off appliances to save battery or go hibernate to prevent data loss.
current setup not measuring remanining battery but it's fixed, current capacity is exact one hour, i configured the instructions to automatically take action after 30 minutes.
Total cost
+ 1x screwdriver with test feature
+ 1x photoresistor
+ tape and bunch of cables
+ male electrical plug
+ 1 business day of software development.