Question about 3v3 pin and Deep Sleep

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
ARTaylor
Posts: 29
Joined: Fri Mar 23, 2018 4:04 pm
Contact:

Question about 3v3 pin and Deep Sleep

Post by ARTaylor » Thu Mar 29, 2018 9:47 pm

EDIT: I see this thread is on the same subject and further along in the discussion from mine, so I will continue over there: viewtopic.php?f=18&t=4546&p=26517#p26517

Hello - I've been playing with an ESP32 for a little project, it gets data from an LDR and DHT11 and sends it to ThingSpeak with MQTT

I'm using a Lolin32 Lite and a 1000mAh LiPo battery - the first version of my code didn't use deep sleep at all and on a full charge the program would run for about 10 hours, which isn't bad, but I wanted more.

So 2nd version uses the deepsleep module in machine. Now the ESP32 is put into deep sleep for 15minutes between each reading, which is complete in about 10 seconds. I get about 3 days battery life now, so a small increase - I was expecting a lot more because I thought the ultra low power core of the ESP32 really puts power consumption into the µ-amps.

I'm wondering if the DHT11 tied to the 3v3 rail is still consuming some current when the ESP32 is in deep sleep - actually I just looked at the lolin32 lite data sheet and it looks like it would... but according to Adafruit the DHT11 only consumes 2.5mA when data is requested, so this shouldn't be taking as dramatic effect (though would be good to find a better way - maybe a GPIO pin can provide enough power?)

And now I feel like a chump - the lolin32 lite has an external flash memory chip which is of course also hooked to the 3v3 rail, even though the silkscreen points it out I didn't spot it until I looked at the schematic :lol: I can see from the DC tech spec of the chip found in here that the Flash Chip has a standby mode which drops current requirement to the µAmps range - but when does the chip enter standby mode? I don't know enough about the chip. Is the flash memory the program memory for this ESP32 version? The lolin32 "Pro" does not have an external flash chip.

The CH340 also is connected to 3v3

I am writing an essay as usual -here is my code- any tips on improving battery life further?
Grow something!

Capstan
Posts: 117
Joined: Sun Jan 29, 2017 4:03 pm
Location: Texas, USA

Re: Question about 3v3 pin and Deep Sleep

Post by Capstan » Fri Mar 30, 2018 12:12 am

One thing I noticed in my experiments is that the ESP32 seems to enter a different form of "sleep" depending upon what was running when machine.deepsleep() is called. Unexpected. I don't know what causes this, but I can control-c out of a running program and then manually invoke deepsleep() from the command line, and the ESP32 will draw 1-2 mA. Invoking deepsleep() straight from a fresh reset puts it into the really low "micro-amps" power mode.

Also I noticed that if I have a voltage regulator in the circuit it will draw some current on the output pin even if it is not powered up.

ARTaylor
Posts: 29
Joined: Fri Mar 23, 2018 4:04 pm
Contact:

Re: Question about 3v3 pin and Deep Sleep

Post by ARTaylor » Fri Mar 30, 2018 7:47 am

I have had the ENOMEM error a couple of times using MQTT - it happen's occasionally when the board only has a soft reset and then I try running the code again, and seems to get triggered by a particular line in the MQTT module.

It's a bit too deep for my level of understanding but from looking at some of the issue reporting it looks like a soft-reset doesn't give you a clean slate to work with as such - I pulled hair out over it for a bit because having a battery connected prevented a hard-reset happening :lol:
Grow something!

Capstan
Posts: 117
Joined: Sun Jan 29, 2017 4:03 pm
Location: Texas, USA

Re: Question about 3v3 pin and Deep Sleep

Post by Capstan » Fri Mar 30, 2018 2:50 pm

ARTaylor wrote:
Fri Mar 30, 2018 7:47 am
It's a bit too deep for my level of understanding but from looking at some of the issue reporting it looks like a soft-reset doesn't give you a clean slate to work with as such - I pulled hair out over it for a bit because having a battery connected prevented a hard-reset happening :lol:
I've been seeing some signs of that too. I guess one way to address it would be to attach a GPIO pin to the chip enable line (pin 3) and have code that pulls it low to force a hard reset?

ARTaylor
Posts: 29
Joined: Fri Mar 23, 2018 4:04 pm
Contact:

Re: Question about 3v3 pin and Deep Sleep

Post by ARTaylor » Fri Mar 30, 2018 3:28 pm

Capstan wrote:
Fri Mar 30, 2018 2:50 pm

I've been seeing some signs of that too. I guess one way to address it would be to attach a GPIO pin to the chip enable line (pin 3) and have code that pulls it low to force a hard reset?
I guess in the circumstances it happens I could just as easily do that with a jumper wire :D
Grow something!

Post Reply