Power consumption - especially if not everything is working smooth

obod0002
Posts: 15
Joined: Sat Apr 13, 2019 2:34 pm

Power consumption - especially if not everything is working smooth

Postby obod0002 » Wed Jun 12, 2019 3:02 pm

I'm using several ESP's (01 / 12 / 32) to measure temperature, humidity, rain and similar.
The self-build sensors measure every 15 to 20 minutes and connect to my router and upload the data to the internet.
Inbetween the ESP's are in deep sleep.

As we all know, ESP's are power hungry when activating WiFi.

When coming back from a short holiday I was pretty astonished regarding two facts:

1) the power consumption was way higher than during my weeks of testing
2) looks like ESP's can kill LiFePO4 rechargable batteries directly attached

Ad 1)
main reason was that 'we' weren't at home. Or to be a little more precise: our WiFi attached devices weren't at home, so the router cut off the WiFi AND the ESP's weren't able to wake up my router's WiFi AND some of my codings didn't restrict time to connect to the WiFi.
Nothing brand new, but maybe still interesting in this combination 8-)

Ad 2)
One ESP-12 uploaded a final battery voltage of 2.22V. Yes we know, the ADC isn't that accurate, but my charger showed a matching value far below 2.5V. Charging this battery let to just 200mAh of charge. Nominal capacity: 1.500mAh. Lasts few charges allowed >>1.000mAh of charge.
As I charged the battery just two days after the ESP went out of operation and leakage wasn't visible during weeks of regular operation, I assume my ESP runs with less than 2.5V. How come'? The only sensor attached, a BME280, is powered by one of the GPIO's of the ESP itself and even if still connected shouldn't drain the battery that much.

Any idea why this can happen and how to avoid it? I have no problems when the ESP simply stops operation. And, yes, I'd like to stick to LiFePO4's due to safety and complexity reasons.

I know it's a mixture of different kinds of ESP's. If I should rather move my questions could you please be as kind as to propose which section would fit best?

ESP_Sprite
Posts: 2679
Joined: Thu Nov 26, 2015 4:08 am

Re: Power consumption - especially if not everything is working smooth

Postby ESP_Sprite » Thu Jun 13, 2019 2:31 am

Effectively, what happens when an ESP32/ESP8266 does when its power is too low is undetermined: as the logic is not working within its normal parameters, anything can happen, including high current drain. You probably want to have a chip that keeps the ESP in reset when the power is too low; chips like this are commonly called 'microcontroller supervisor' chips. FWIW: we are aware that it's irritating to need an extra chip for that; the ESP32-S2 has functionality included that will likely make an extra chip not needed in most circumstances.

JoeSensoric
Posts: 4
Joined: Fri Mar 03, 2017 10:31 am

Re: Power consumption - especially if not everything is working smooth

Postby JoeSensoric » Thu Jun 13, 2019 10:01 am

I have almost the same scenario with battery-driven sensors sleeping for ten minutes and sending the data via WiFi to a server. I also power my sensors with GPIO pins. I have several configurations running and try to find the best solution.

I have no clear answers to your questions, but some experiences:

When the server was once not available for several hours, the battery was empty after 5-6 hours because the WiFi was activated and my software didn't stopped the request.
When the access point is not available, the ESP32 goes to deep sleep immediately.

I lost some 1100 mAh NiMH rechargeable batteries. I think the high peak current killed them even it was within the specifications of the battery. I'm using a battery pack of four AAA batteries.

I also had ESP32 working with a voltage of 2.8 V. The DHT22 temperature and humidly sensor stops much earlier at about 3.2 V, so this is not the right sensor for this scenario.

obod0002
Posts: 15
Joined: Sat Apr 13, 2019 2:34 pm

Re: Power consumption - especially if not everything is working smooth

Postby obod0002 » Thu Jun 13, 2019 10:28 am

ESP_Sprite wrote:
Thu Jun 13, 2019 2:31 am
we are aware that it's irritating to need an extra chip for that; the ESP32-S2 has functionality included that will likely make an extra chip not needed in most circumstances.
thanks for the details and good to know further chips are being created.
At the moment it's not a big issue to live with the restrictions as I've still so many improvements to do.

obod0002
Posts: 15
Joined: Sat Apr 13, 2019 2:34 pm

Re: Power consumption - especially if not everything is working smooth

Postby obod0002 » Mon Jun 17, 2019 5:32 pm

I'd like to add how massive a loss in voltage could be:
voltage-drain.jpg
voltage-drain.jpg (137.08 KiB) Viewed 118 times
in the picture you can see that the battery was charged twice.
The first runs contains several drops before, starting at about 3.1V, it is emptied within just one week (attached was only a BME280, measuring interval was 15minutes).
First discharging the LiFePO4 with 1,600mAh, lasted less than two weeks, not even 12 days in fact.

Second charge is running the ESP since five days.

Changes, maybe sorted from most to least important:
  • no WiFi connection within 5 seconds => deep sleep for 5 minutes
  • I don't use #include <ThingSpeak.h> in the Arduino IDE anymore. Uploading three values at once until the one okay was received took 6 seconds - with WiFi on :evil:
    I'm now using JSON POST http requests which take less than half a second :mrgreen:
  • measuring interval from 15 to 20 minutes
  • do NOT deactivate DHCP,
    yes I know, but my router establishes connection WITH DHCP within 0.3 seconds and WITHOUT it takes 3seconds - no typo on this

obod0002
Posts: 15
Joined: Sat Apr 13, 2019 2:34 pm

Re: Power consumption - especially if not everything is working smooth

Postby obod0002 » Mon Jun 17, 2019 5:50 pm

the effect on not handling a missing WiFi correctly for a battery powered device is shown in this picture:
vd2.jpg
vd2.jpg (134.13 KiB) Viewed 112 times
Charging the battery twice is visible in the right part and is identical to the graph above.
You can imagine that with all the other gaps in my coding still online, just the varying WiFi conditions (no one at home, hence WiFi in standby mode during night plus ESP's not making the WiFi awake) draw about four times the power.

Who is online

Users browsing this forum: Google [Bot] and 2 guests