Smart Minimalist ESP8266 Controller: Boost Battery Runtime 2–5× by Cycling Power On/Off for Devices with a Power Button
Author: universalgeek56Source Code:GitHub - UG56 Smart UPSLive Web Interface Demo (no hardware needed):Smart UPS Demo
The Problem It SolvesMany UPS units, inverters, and generators waste more energy on self-consumption than the devices they power — fans, electronics, idle circuits — especially when the load is low or off for extended periods. During long outages, this drains the battery instead of powering useful devices.
UG56 Smart UPS solves this efficiently and affordably:
- Emulates pressing the device's existing power button using two optocouplers (optically isolated, silent, and wear-free)
- Cycles the load ON/OFF on a configurable schedule
- Protects the battery from deep discharge with configurable thresholds
- Supports remote monitoring and control via Wi-Fi from any browser
- Result: significantly extended runtime (often 2–5× longer autonomy) without larger batteries or complex modifications.
Ideal for intermittent-use 220V/110V devices such as:
- Heaters, air conditioners, fans in greenhouses, garages, or animal shelters
- Pumps, aerators for aquariums/ponds, mixers
- Humidifiers, dehumidifiers, timed lighting
- Boilers or periodic appliances where constant power is unnecessary
Optional: smart-home integration (NTP, DST, MQTT, Home Assistant, Telegram, Alexa/Siri), but the system works fully independently.
Key Features- Modes: OFF / Always ON / Cycle (configurable ON time + OFF time)
- Control: Single local button + clean web UI
- Battery Protection: Low-voltage cutoff, restart threshold, pre-shutdown warning
- State of Charge (SoC) Estimation: % battery level with separate charge/discharge curves optimized for lead-acid batteries
- Offline-First Design: Fully functional without Wi-Fi
- Power Saving: Wi-Fi turns off at critical battery level; deep sleep support
- Indicators: LED for mode, OTA progress.
- Persistent Settings: Stored in EEPROM
- Compatibility: Works with any device that has a physical power button (UPS, inverter, relay power strip, generator controller, etc.)
- Feedback Required: Needs a signal from power LED, logic output, or optocoupler tap to detect actual ON/OFF state
No need to flash or hack the target device — no proprietary protocols involved.
How It Works- Detects actual device state via feedback line
- Cycles the device power ON/OFF based on user-defined timings
- Protects battery from deep discharge (configurable, e.g., prevents draining below 11.5 V)
- Provides status via LED and optional web UI
- Minimizes ESP8266 own consumption through deep sleep and adaptive Wi-Fi
Thanks to this cyclical approach, the UG56 Smart UPS significantly increases autonomy for devices that don’t need constant power, while optionally adding extra battery protection if the UPS or inverter tends to drain it completely.
CompatibilitySupports any ESP8266/8285 module, including the tiny ESP-01.
- ESP-01 requires a small hardware hack to access the ADC (ESP01 ADC Hack)
- Other boards (ESP-02 to ESP-12) already include an ADC, no hacks needed
- On some boards, connecting pin 16 (wake-up) to RST enables ultra-low-power deep sleep with timed wake-ups
Final assembled inverter, with web interface shown on phone/PC
2️⃣ Soldered boardTwo optocouplers visible, neat wiring, ready for installation inside a device
3️⃣ Web InterfaceDashboard showing battery voltage, SoC %, current mode, and cycle timers
Try the web interface simulation directly in your browser:Smart UPS Demo
4️⃣ Breadboard PrototypeEvolution from prototype to final soldered build
More images are available in the repo’s img/ folder: GitHub - img/
- Currently voltage-only monitoring (no current/power measurement)
- Requires feedback signal to detect device state
- ESP8266 is solid, but future ESP32 port could allow more features
- Optional: current sensing (INA219/ACS712), full power cut for ultra-low consumption
- ESP8266 module (ESP-01, NodeMCU, Wemos D1 Mini)
- 2× optocouplers for button emulation and feedback
- Voltage divider for battery sensing
- Local button for mode switching
- LED indicators
- Built & flashed using Arduino IDE
- ESP-01 ADC HackReliable analog input on ESP-01GitHub - ESP01 ADC Hack







Comments