This Smart UPS Controller Cycles Button-Operated Devices to Boost Runtime, with a Neat ADC Hack Too

An Espressif ESP-01 is expanded from two to five GPIO pins in order to serve as the driving force behind this UPS runtime booster.

Pseudonymous maker "universalgeek56," hereafter simply "UG56," has designed a gadget that aims to deliver improved runtime for uninterruptible power supplies (UPSes) — by cutting "vampiric power" and running connected devices only part of the time, with a side-order of a clever hack to get access to the otherwise-hidden analog to digital converter (ADC) on an Espressif ESP-01 module.

"Power cuts? Remote locations? Antarctica. Sahara. Garage. Summer house. Pluto? Or anywhere closer, where every amp-hour actually matters," UG56 writes of the project. "This is a simple, brutal hack: make any button-operated device — pumps, heaters, boilers, freezers, humidifiers, aerators, generators — run in smart cycles instead of nonstop, dramatically extending runtime autonomously. Just an [Espressif] ESP8266 pressing buttons and watching battery voltage — quietly keeping things alive longer."

While UG56's smart UPS controller is obviously ill-suited to devices connected to a UPS for preservation of uptime, like servers, it targets hardware that don't need five-nines in order to achieve their goal. Its operation is simple: it triggers the power button on target devices in cycles, running them for 5-30 minutes at a time before putting them to sleep for 30-120 minutes and then repeating.

The hardware chosen for the project is Espressif's low-cost ESP8266, in the form of the compact through-hole ESP-01 module — but with a modification. "ESP-01 officially has only two GPIOs [General Purpose Inputs/Outputs]. We need five," UG56 explains. "Solution: GPIO0, GPIO2; UART pins (TX/RX), [as] serial is useless once you are wireless, TX (GPIO1) often has a built-in LED, RX (GPIO3) is the only pin allowed to be LOW at boot. Rules are rules… for other pins; ADC [Analog to Digital Converter] for battery voltage [monitoring]. "Dirty trick: cut the RST [Reset] trace and jumper the RST pad directly to the ADC pin on the [chip]. Reset is dead forever, but analogRead() works perfectly."

More details are available on Hackaday.io, with source code on GitHub under the permissive MIT license. A separate repository details the Espressif ESP-01 ADC modification.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles