After reading many post of people getting months of ESP8266 running time off batteries I decided to set up my own to see why my battery life was terrible:
Parts: Node MCU ESP8266 (CH349G Serial Chip, AMS1117 Voltage Regulator) LiPo Battery: 2S 850mAh (7.4V) ADS1115 ADC (to measure voltage, 500K Voltage divider)
Test setup: Two ESP8266 setups were completed, one ESP was standard and the other had the LED and Serial Chip disconnected to conserve Battery.
Test Program: ESP Wake every 20 seconds (with radio disabled) Take voltage reading and store in RTC memory Deep Sleep …………………………………………………………….. Every 5 minutes (15 wake cycles) Take voltage reading Connect to network and transmit all data to Influx Database. Disconnect from network Deep Sleep
Results: You can see from the below screenshot the battery voltage over the duration of the test:
Unmodified ESP8266: Time from 8.36V to 7.28V (97% to 7% of Li-Po capacity) was 87hrs and 20mins (3.6 Days)
Modified ESP8266: (No LED or Serial Chip) Time from 8.36V to 7.28V (97% to 7% of Li-Po capacity) was 101hrs and 16mins (4.2 Days)
Conclusion: Months of usage seem far from achievable with a minimal setup and all precautions taken. Actually the ESP seems pretty unusable on a battery for anything more than a measurement every few hours.
Further Improvements: The stock voltage regulator is a known power drain, an alternative is recommended but I did not get around to that yet.
Backup names start with the date it was generated but it can get messy after a few weeks so long term its better to run a backup script to put backups in individual directories and catch errors etc., create a python file for this and use the below example, update crontab -e instead to: