ESP8266: Wifi data logger already running for more than 2 months on batteries!

More than 1440 hours or in other words 60 days ago I put 3 AA batteries from IKEA in the battery box of the ESP8266 test board and started a program that would send temperature and humidity every 10 minutes to Thingspeak through its Wifi interface.
I removed all unnecessary power consumers from the board such as LEDs and light resistor but there would have been more potential to improve longevity of the batteries. By setting a fixed IP to the module I could have saved a little bit of online time.

Austerity Engineering

While I could measure the energy consumption during the deep sleep phase quite well it was rather hard to guess the consumption during the awake phase. My pessimistic estimation was that the batteries would last 30 days. And now the setup just passed the magic 1440 hours mark!
That means that with a little bit austerity engineering (sorry, not politically motivated) one could have this running for a long time. Depending on your application you could wake up the device only into a non-wifi mode, check the periphery and go back to sleep if nothing requires you to connect to the internet. Since Wifi is the real burner here that should save you a lot of your battery reserves.
I take bets for how much longer the setup will run.

Current voltage of the batteries

30 days ago when I posted the last update I was asked to measure the voltage of the batteries. I chickened out until now because I was afraid to influence the experiment. But curiosity won over fear once again and I measured the voltage of one cell: 1.323V after 60 days, compared to 1.623V of a battery of the same batch. This means that there are only about 4V fed into the voltage regulator and the difference to the 3.3V of the ESP8266 is only 0.7V….

Voltage of one of the three AA cells after 60 days.
An unused battery of the same batch has 1.623V


Posted by Daniel Eichhorn

Daniel Eichhorn is a software engineer and an enthusiastic maker. He loves working on projects related to the Internet of Things, electronics, and embedded software. He owns two 3D printers: a Creality Ender 3 V2 and an Elegoo Mars 3. In 2018, he co-founded ThingPulse along with Marcel Stör. Together, they develop IoT hardware and distribute it to various locations around the world.


  1. Hi – can you provide and details on the code you used on this deep sleep project?

  2. Again a very interesting post. Looking at the datasheet, the dropout voltage for the reg. is below 100mV. Looking at discharge curves in general(for AA alkaline), I would say that it is roughly ½ way. /LCL

  3. Hi. Thanks a lot. Looks very good.
    Can you provide the code to see how you did it?

  4. Thanks very much for the blog post – I've got everything up and working a great source for these low power sensor projects thanks! A trip up point was me not attaching GPIO 16 to the rest pin. It would be useful for new users to put a note at the top of the code for all connections required.

    I have a question about Field 3 in the code which is named as voltage….


    String temp = String(dht.readTemperature());
    String humidity = String(dht.readHumidity());
    String voltage = String(system_get_free_heap_size());
    String url = "/update?key=";
    url += thingspeak_key;
    url += "&field1=";
    url += temp;
    url += "&field2=";
    url += humidity;
    url += "&field3=";
    url += voltage;


    Is this the voltage on the ESP8266 chip? I thought that expression was related to the free memory on the ESP83266…. is this a check to see if the heap is changing over time (for debug)?

    Anyway thanks again for the great work with this SoC!

Leave a Reply