The Core Trick
Devices rarely need to run all the time.
- ON for 5 - 30 minutes
- OFF for 30 - 120 minutes
- repeat
Idle draw disappears. Battery life multiplies.
A “30-minute UPS” can easily become 2+ hours on the same battery. Works for devices with their own local control logic or power buttons: solar nodes, field sensors, water pumps, gas boilers, freezers, mixers - or almost anything designed for human interaction.
Hardware: Minimal and Brutal
- ESP-01 / ESP8266
- 2× EL817B optocouplers
- one shorts the power button
- one senses ON/OFF via LED or state pin
- Voltage divider for battery monitoring
Nothing else. Safe. Cheap. Effective.
ESP-01 GPIO Hack (Yes, Five Signals from Two Pins)
ESP-01 officially has only two GPIOs. We need five. Solution:
- GPIO0, GPIO2
- UART pins (TX/RX)
- 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 for battery voltage
Dirty trick: cut the RST trace and jumper the RST pad directly to the ADC pin on the die. Reset is dead forever, but analogRead() works perfectly.
Photos & full hack: 👉 https://github.com/universalgeek56/esp01-adc-hack
Software (Arduino ESP8266 Core, MIT License)
- Modes: Continuous ON, Full OFF, Cycle (configurable)
- Single button:
- short press → change mode
- long press → toggle Wi-Fi
- LED status feedback
- Web UI (voltage, %, mode) + OTA updates
- Smart battery protection: low-voltage cutoff with hysteresis, accurate % for lead-acid
- Wi-Fi auto-off at critical voltage to reduce quiescent current
Scaling Up
ESP-01 proves the concept - small, minimal, but surprisingly capable.
Move to ESP-12 or ESP32 for:
- more GPIO
- grid / inverter logic detection (resistor + diode + capacitor + optocoupler)
- more sensors
- MQTT, Telegram, Alexa, Blynk, NTP, and more
Core logic does not change - modular by design. Even a minimal ESP-01, if handled right, can do surprisingly complex setups.
Final Thought
When power is unreliable, simplicity wins. If it has a button, you can control it.
The Arduino Blink sketch is still relevant - before and after people start calling things “AGI” or “Skynet”. If it’s weird - drop it in the issues.
UG56: minimal core, maximal survival.
universalgeek56
Dave
Stefan Wagner