ESP32 & ESP8266 Connectivity · Intermediate · Low power
ESP32 Deep-Sleep Battery Node
A node that wakes, reports and sleeps, and can run for weeks on one cell.
Firmware status: Generated from this project's own pin map and compiled with arduino-cli for esp32:esp32:esp32 before publication; bench validation on your hardware is still required..
Hardware scope
Timer wake, RTC-retained counter, battery divider, radio on only during the report. Pins assigned by the generator: sense → GPIO34, status led → GPIO4.
Components
- ESP32 board
- Analog sensor
- 18650 cell and holder (or a 3.7 V LiPo)
- 10 kΩ + 10 kΩ divider for the battery sense
- USB cable
Tools
- USB programming cable
- Multimeter
- Current-limited bench supply (for anything that switches a load)
- Small screwdriver and wire cutters
Build steps
- Build the 1:2 divider across the cell and take it to a pin that can read it.
- Set WAKE_SECONDS, flash, and read the boot counter and voltage in the log.
- Watch the awake time — it should be a few seconds, not a minute; that number is the battery cost.
- Confirm the counter increments on each wake, which proves the RTC memory survives sleep.
Test and expected result
The board wakes on schedule, the boot counter survives every sleep, and the awake time is a small fraction of the cycle.
Acceptance checks
timer wake works, counter persists, awake time under five seconds, voltage reported
Safety and limits
A lithium cell needs a protection board and the right charger. Measure the divider on the bench before connecting a cell to a 3.3 V pin.
Guide source: Generated from this project's own pin map and compiled with arduino-cli for esp32:esp32:esp32 before publication; bench validation on your hardware is still required.
Download connection diagram SVG
Related projects
- ESP32 Captive Portal Wi-Fi Manager — Boot the ESP32 with no credentials and configure its network from a phone, with the portal saved to flash.
- ESP8266 Config Portal — The same idea on the cheapest board that can do it: an ESP8266 that configures itself from a browser.
- ESP8266 Sensor Portal Logger — A battery-minded sensor node you configure in the field, with the reading shown on its own setup page.
