IoTAdvanced60 min
How to Run Your ESP8266 for Years on a Battery

Learn to maximize ESP8266 battery life by implementing deep sleep mode and hardware optimizations for multi-year operation on a single battery.
What you'll need
| Component | Qty | |
|---|---|---|
| SparkFun ESP8266 Thing | 1 | |
| 3.3V FTDI adapter | 1 | |
| Breadboard | 1 | |
| Jumper wires | Multiple | |
| Power supply (optional) | 1 | |
| Multimeter (optional) | 1 | |
| Arduino IDE with ESP8266 board definitions | 1 |
Step by step
1
Prepare Your Hardware
Gather all required components: SparkFun ESP8266 Thing, 3.3V FTDI adapter, breadboard, jumper wires, and optionally a power supply and multimeter. Ensure you have Arduino IDE installed with ESP8266 board definitions.
2
Configure the Hardware Connections
Connect the DTR pin to XPD pin to enable deep sleep wake functionality. If measuring power consumption, insert your multimeter in series with the power supply to monitor current draw during normal operation and sleep modes.
3
Program the Deep Sleep Code
Upload the provided sketch that connects to WiFi, sends data to Dweet.io, then enters deep sleep for a specified duration. Remember to modify WiFi credentials before uploading. During programming, temporarily disconnect the DTR-XPD jumper.
4
Monitor Power Consumption
Reconnect the DTR-XPD jumper and observe multimeter readings. You should see immediate 10x current reduction when the chip enters sleep mode. Record the sleeping current value for battery life calculations.
5
Optimize by Removing the LED
Disable or unsolder the PWR LED to reduce sleep current further (from ~800 µA to ~77 µA). This modification is crucial for achieving multi-year battery life. Use a trace cutter or soldering iron depending on your board version.
6
Calculate and Verify Battery Life
Use the measured sleep current to calculate expected battery life: (Battery mAh × 1000) / (Sleep Current in µA) = Hours of operation. Compare different sleep times and configurations to optimize for your specific application needs.
Wrapping up
By following these optimization techniques, you can achieve years of operation from a single battery on your ESP8266 project.