ESP8266: Long Term Data Logger Test with Batteries

Do you like this post? Writing posts, developing libraries and programming online font creators is actually hard work. I order most of my electronics from a Chinese website called Banggood. It is save and the items usually arrive in good quality. With every order you do there by following this link you are supporting the blog. Thank you!

Today I started a (hopefully) long term battery test with the ESP8266 board I reviewed here. The conditions are:

  • powered by 3 AA batteries (serial)
  • every 10 minutes update temperature and humidity retrieved from a DHT11 to thingspeak
  • go the deep sleep between the posts
The test board comes with a light resistor and several LEDs of which one is a RGB led. For some reason I couldn’t turn them off completely so I just chopped them off. Before the surgical change the board consumed 1.3mA in deep sleep mode. After only 130µA. This is still almost factor two away of the 67µA I read somewhere in the web, but not bad for starters. With this the board could theoretically survive more than two years in permanent deep sleep. This experiment will show how much the wake-ups costs and if theory es even close to reality. 



Code

The Test Setup: all LEDs removed
from the board to save energy

Posted by squix78

17 comments

  1. Hi Catalin. Since I'm using this yellowish ESP8266 test board I had to remove all the onboard LEDs which reduced the power consumption a lot. I just added a picture of the board for illustration…

  2. Ok, It's clear now. I am estimating between 170 and 175 days on batteries, but having the converter from 4.5 V to 3.3 V, It will be maximum 100 days, maybe less than that.

  3. Very interesting!
    One problem though. The link to Thingspeak says:
    "ESP8266 has been running for NaN hours (NaN day(s))
    Last updated 5 minutes ago."

    • Thank you for the hint. It was a bug in the thingspeak plugin which did not appear in Chrome, but in the other browsers… It should be fixed now…

  4. Have you considered using the ADC input to monitor cell voltage or total input voltage. This may give some interesting info about the battery life.

    • Yes, actually I'm using the readVCC function, but it always returns 65k as value. I assume that this is due to the voltage regulator that sits between the batteries and the ESP8266. Or the readVCC function is not implemented properly. I didn't want to use the ADC because I was afraid the required voltage diveder would consume too much energy and falsify the picture…

  5. Have you tried to measure the battery voltage(with at multimeter) recently? It could be interesting to see how low it is

  6. Hey
    Good work, but I have a problem
    Always after end my deep sleep my software reboot, and start to begain
    is it normal?
    What I can do ?

    • Hi Tugao
      This is completely normal and intended. When going to deep sleep the ESP basically turns everything off except the timer that you might have programmed to wake it up again…

      Cheers,
      Dani

  7. Very interesting. I was reading migth be some problems, due the voltaje of the pins 3.3v to feed the sensor. Have you noticed alike?

    The graphs at least on the cellphone appear in white . have the bateries died?

    Kind regards
    -Alex

  8. This is still almost factor two away of the 67µA I read somewhere in the web, but not bad for starters. With this the board could theoretically survive more than two years in permanent deep sleep. This experiment will show how much the wake-ups costs and if theory es even close to reality. 8x batteries

  9. I'm wondering what is your exact version of ESP8266 because when i use deep sleep mode i have a remaining consumption of 3mA instead of 70uA (50 times more…).

  10. Daniel,

    Before I used ESP Easy on the AI-Thinker board.
    Now I am trying to reduce battery consumption by using youre .ino.
    While compiling i’m getting the following erros.
    Can you help with this subject??
    Error:
    thingspeak-data-logger:15: error: ‘DHT11’ was not declared in this scope
    #define DHTTYPE DHT11 // DHT 11
    ^
    C:\Users\Arjen\Downloads\esp8266-projects-master\esp8266-projects-master\arduino-ide\thingspeak-data-logger\thingspeak-data-logger.ino:19:17: note: in expansion of macro ‘DHTTYPE’
    DHT dht(DHTPIN, DHTTYPE, 15);
    ^
    C:\Users\Arjen\Downloads\esp8266-projects-master\esp8266-projects-master\arduino-ide\thingspeak-data-logger\thingspeak-data-logger.ino: In function ‘void setup()’:
    thingspeak-data-logger:46: error: ‘class DHT’ has no member named ‘begin’
    dht.begin();
    ^
    C:\Users\Arjen\Downloads\esp8266-projects-master\esp8266-projects-master\arduino-ide\thingspeak-data-logger\thingspeak-data-logger.ino: In function ‘void loop()’:

    thingspeak-data-logger:87: error: ‘class DHT’ has no member named ‘readTemperature’
    String temp = String(dht.readTemperature());
    ^
    thingspeak-data-logger:88: error: ‘class DHT’ has no member named ‘readHumidity’
    String humidity = String(dht.readHumidity());
    ^
    exit status 1
    ‘DHT11’ was not declared in this scope

    Thanks for reading and replies.

    With regards.
    Arjen

Leave a Reply