Current consumption of ESP8266 in deep sleep

443 views
Skip to first unread message

sergey

unread,
Mar 16, 2020, 7:01:42 AM3/16/20
to MppDevices
Hi !
I'm struggling with current consumption in different kind of ESP8266. I've done whatever i could but still no success. ..
Could anybody share their figures of ESP consumption in deep sleep mode ? Just what i've got -- ESP 8266 (ESP12EX) with "white board" (GPIO15 = Low, GPIO0 = High with pull-up and down resistors 10K and shorted RST and GPIO16) drains about 88ua -250ua, in average about 120ua. Tested on MppSleeper. After sending WIFI transmission with 74ma it falls to deep sleep and drains about from 80 to 150ua (high volatile). I was trying manipulate with capacitor over feeding chain but no succesess.I tried several chips - basically the same result. I tried change feeding source from 3V to 3.7V - no changes .
Someone mentioned about Wemos D1 with unsoldered CH340 , i tried this - pretty the same result.Detaching of LDO also doesn't bring sensible results.
Changing the multimeter also pointless (i tied this). 
What is the secret of 20ua in deep sleep for ESP ? 

Mike P 4 MPP

unread,
Mar 16, 2020, 12:08:21 PM3/16/20
to MppDevices
Using an ESP01 hooked as an MppSleeper with the LED removed I measure 28-30uA in deep sleep, powered with 3V from my USB connector.
I've found these devices are very finicky about noise when sleeping - they will often come awake in a weird state and need to be power cycled to get back to normal sleep.  30uA is tiny - it doesn't take much wire noise to mess it up - the wires need to be short and tight to get a decent measurement - very hard to do with my cheap chinese jumper wires.

sergey

unread,
Mar 16, 2020, 3:46:49 PM3/16/20
to MppDevices
I've never tested ESP01. Does it mean that only ESP01 eats about 30ua , but others don't ?  I've unsoldered LED from my ESP 12 , but it doesn't help at all. 
Do we need to pull up or down some GPIO maybe ? 

Mike P 4 MPP

unread,
Mar 16, 2020, 5:02:21 PM3/16/20
to MppDevices
I'm not sure whether the ESP01 use more or less than others - just mentioning for completeness...  but the ESP01 and ESP12 are both pretty bare bones so I'd expect about the same.
If removing the LED and made no difference I'd double check how I was measuring - the total current should have been reduced by V/R through the LED - 100ua to 1ma in a typical case.
Voltage bridges or anything low impedance connected to ADC may draw current too.
GPIO0 needs to be high to keep the device out of programming mode on a restart.
CH_PD and RST must be high as well - I connect CH_PD to VCC and RST with a pullup high with a button to ground, or to GPIO16 on my analog reporters.  I think GPIO2 needs to be high to prevent "load from SD" mode and some show GPIO15 through 10k to ground too but I didn't bother on my ESP12 boards.
When my board gets into a weird state it starts pulling variable amounts of current in the 100uA and up range.

Curtis E

unread,
Mar 16, 2020, 8:11:51 PM3/16/20
to MppDevices
a bare bones ESP8285 set up for a PIR uses 14-20uA while asleep.  Awakes to around 60mA then back to sleep. 

sergey

unread,
Mar 17, 2020, 2:47:03 AM3/17/20
to MppDevices
Thanks Curtis, i've ordered them but have to try yet. What Is the power source have you been using ? 

sergey

unread,
Mar 17, 2020, 2:59:29 AM3/17/20
to MppDevices
Thanks Mike, there is one big difference between ESP01 and ESP 12 - the last one has covered by metal case and i have no idea what is inside. Where is the resistors or capacitors ??? - only prepositions.
For instance - why i see the voltage about 2.8V on A0 , despite the fact i didn't connect it to anything?
Thanks again will try your circuit , but i'm afraid that all of my boards falls into the same "weird" state as you described. Because the consumption current flows from 80ua to 150ua in the best way...
I'm still waiting my MCP1700 , because people writes that it has to be with ESP12(with capacitors 100mf+100nf) for stable feeding, in case of using 3.7V battery. 
My measuring process is simple - i connect my multitester in open circuit ...

Mike P 4 MPP

unread,
Mar 17, 2020, 8:30:08 AM3/17/20
to MppDevices
I don't think there's anything under the shield, it's just to block RF interference.  On my ESP12's there's LED is for indicating wifi, it's not a power LED so removing it wasn't necessary.
The white board has resisters for CH_PD and GPIO2 (and maybe GPIO0 - I didn't add one and it works fine).  You can see them here: https://www.esp8266.com/viewtopic.php?f=13&t=6505.
As I said, on my white board all I've added is a jumper from D16 to RST and a voltage divider for the moisture sensor into ADC.
Driven off of a pair of AAA batteries, no capacitors needed, good down below 2.4V.
The measurement problem happens when trying to insert a meter into the circuit - if the wires aren't very secure with very little resistance, the ESP8266 won't go into sleep properly and you'll get odd readings.  If the wires are fixed up again the device needs to be power cycled - which can cause the problem to reoccur if you do it by removing a power lead... very frustrating.  It doesn't happen when my devices are in place and working, only when trying to add a meter into the circuit.
And as I said, if you didn't see a change in power consumption when you removed a power LED there's something wrong with your measurement procedure - either the loose wire problem or an inaccurate measurement.
If A0 is floating there's no sensible way to figure out what the voltage there should be - if it's any concern temporarily add a jumper to gnd.

sergey

unread,
Mar 17, 2020, 9:22:30 AM3/17/20
to MppDevices


The measurement problem happens when trying to insert a meter into the circuit -
How do you know what happens in the circuit w\o any meter ? 

And as I said, if you didn't see a change in power consumption when you removed a power LED there's something wrong with your measurement procedure
 There was only wifi led.
If A0 is floating there's no sensible way to figure out what the voltage there should be - if it's any concern temporarily add a jumper to gnd.
I concerning about it because getvoltage function in ADC_VCC mode shows me 4.2V by 3V of source....
Maybe i need to add devider to A0?
 

sergey

unread,
Mar 17, 2020, 9:44:14 AM3/17/20
to MppDevices
Ok, there is some breakthrough in consumption area...
I have figured out that my experiment with battery power source wasn't as clear as it has to be.I've used not the alkaline battery but ZR6 battery with 1.65V output (1.7V by fact). When i changed it on two conventional alkaline battery(LR6) everything became fine.
By the power source voltage that not exceed the 3.3V the ESP falls into deep sleep with normal 18-20ua consumption, but if only you tries to use 3.4-3.5V it immediately switches to the fuss state with floating consumption from 80 to 150 ua.
The same happens with 18650 battery even by it discharged below 3.3V.

Mike P 4 MPP

unread,
Mar 17, 2020, 10:05:37 AM3/17/20
to MppDevices
When I'm not using the meter I can calculate current consumption by how long the batteries last till they need to be recharged - if it was 5-10x faster than the expected value I'd probably notice :).
I misspoke - on my ESP12's it's not a wifi LED, it's connected to TX from what I can see.
Specs on the ESP8266 say 3V to 3.6V.  Under voltage seems to work based on experience so far.  I did find a report that under 2.5V causes wifi noise problems and I have noticed when playing with the current consumption measurement my router will sometimes restart the 2.4GHz band - that might be why.  I expect at < 2.5V the battery is close to dead anyway...
Going over 3.6V worries me because you can get breakdown current which can cause problems - extra heat at least - maybe that's the case here?
No idea why your VCC measurement through A0 would be odd - unless you left an external voltage divider in place?  To  measure VCC they say that A0 must not be connected (I believe it's because there's an internal voltage divider and external input would mess it up).

sergey

unread,
Mar 17, 2020, 10:44:50 AM3/17/20
to MppDevices

When I'm not using the meter I can calculate current consumption by how long the batteries last till they need to be recharged - if it was 5-10x faster than the expected value I'd probably notice :).
I'm hesitating to ask how long does it typically takes ?))))))

Going over 3.6V worries me because you can get breakdown current which can cause problems - extra heat at least - maybe that's the case here?
People writes that ESP 12 is tolerant for 3.7V , but may be there is some devil in the details.... Maybe overheat leads to fuss state...

No idea why your VCC measurement through A0 would be odd - unless you left an external voltage divider in place?  To  measure VCC they say that A0 must not be connected (I believe it's because there's an internal voltage divider and external input would mess it up).
No any external divider . What i have is only ESP 12 soldered on white board - that's all. By checking voltage on A0 pin i see strange value in 2.8V.  Did you remember i wrote you about the issue with my soil humidity sensor that returns different values of voltage in different places of code by the same function. I suspect the same roots of it . Eventually i was able to use only the call of "getbatteryvoltage" at the end of loop in   if (noSleep) block. All others attempts returned different and not true figures.

Mike P 4 MPP

unread,
Mar 17, 2020, 11:45:25 AM3/17/20
to MppDevices
I've got a sleeper that I'm not sure I've ever recharged the batteries in - many, many months if not more than a year.  Amazon rechargeable AAs, running at about 1.3V each,   Good enough for my purposes :).

Maybe test VCC by powering it with a known/proven 3V3 source (like a USB adapter) instead of a battery?  'Cause I've never seen a problem with it and I test a lot using USB and batteries.  I haven't heard of any other issues either.  It must be specific to your environment.  If you swap out the ESP and it still happens, it's your board or battery, otherwise you'll know the original chip is broken.  Honestly I'm a bit surprised you could get a value over 3.6, I would have expected the internal voltage divider / ADC to max out at 3.6 - an internal count of 1024.

sergey

unread,
Mar 17, 2020, 2:31:17 PM3/17/20
to MppDevices
It was the same value as i wrote you about - 4.36V (as i undersand 4464 DAC). For two of bare ESP12(white board)  , and doesn't matter what power source it was. I have tested it with either USB source or battery. Wemos D1 returns normal voltage either on USB or on battery... The same board in ESP8266 programmer device all shows normal value.. Suspecting the broken board ? But why they both worked in programmer device ? It seems to me something goes wrong with pull-up\pull-down resistors. BTW soldering of the divider resistors to AO didn't bring any benefit.
But there is one more important thing - as i understand we can use the  ESP.getVcc() function only in RF mode , when RF is shutting down  ESP.getVcc() might return anything but not true voltage.
Therefore i can't use getbatteryvoltage anywhere i want in the loop code ,but only in reporting part when RF is on? And what happens if i try to get voltage when RF shutted down ? Which value  will it return ? Not the value 4.36 ? 

Mike P 4 MPP

unread,
Mar 17, 2020, 3:49:07 PM3/17/20
to MppDevices
Sorry, I don't know how to explain it...  all I can do is offer suggestions on how to isolate what's causing the problem.  If it were pervasive there would be tonnes of complaints at espressif or the forums, and I haven't seen anything like that.  NodeMCUs use ESP12 and they're reporting fine for me, I just installed MppSleeper on my analog reporter and it reports 2.6V too.  My other MppSleepers, MppContact, all report 2.6 to 2.7V when on battery (though near the need for a recharge they can drop to 2.4).  At least until you eliminate everything else my assumption would to be a wiring or logic problem...

One way to eliminate it to install MppSleeper.bin or MppAnalogReporter.bin on the device and compare to what it reads - this could validate the hardware and direct the investigation to the firmware or maybe RF mode.

Do you have a reference on the need to be in RF mode?  I do all of my vcc measurements in RF mode since there's really no value in reading when it's not (since I always want to send the values back to AM), but I suppose it's possible they would have that restriction.  Though I'm at a loss to explain why that would be the case...  I do read A0 for MppAnalogReporter before I enable RF mode to conserve battery and I don't see any problem there (and it'd be weird to have it work properly externally but not internally with RF disabled).

I'm still not sure what vcc will read if the ESP8266 is powered over voltage - possible the internal divider was damaged?  Or maybe it needs a calibration factor - there's no doubt that different ESP8266 devices will read slightly differently.

sergey

unread,
Mar 18, 2020, 5:05:05 AM3/18/20
to MppDevices
Any way Mike big thanks for your support!  It was my fault when i tried to read the VCC in modem sleep mode and it turns to be different to real value of voltage. 

Do you have a reference on the need to be in RF mode?  

First of all this link. It says about old version of esp8266 witch i suppose we are using. As i understood from forums the issue about possibility  reading vcc in RF mode only was resolved in last version of ESP8266 libray.

But nevertheless they mentioned about this problem in esp refernce guide. The file attached , you can see the point at page 27 . "The return value of system_get_vdd33 may be different in different Wi-Fi modes, for example, in Modem-sleep mode or in normal Wi-Fi working mode."

I'm still not sure what vcc will read if the ESP8266 is powered over voltage
It is possible outcame... but i tried two boards with the same result.  Maybe all my ESP are broken...
2c-esp8266_non_os_sdk_api_reference_en.pdf

Mike P 4 MPP

unread,
Mar 18, 2020, 8:39:07 AM3/18/20
to MppDevices
Page 13 in the ref it says the value is only useful between 18 and 36 for 1.8V to 3.6V.  That would suggest to me anything outside of that range is indeterminate.
Page 16 says that VDD33 value is calibrated at RF initialization, without the calibration I would expect the value can't be trusted.

It would be unusual for something to break just a bit of a chip - out of spec values usually fries the entire thing from my experience :).  I'd definitely try powering with USB and running something like MppSleeper to check the VDD value before abandoning them.

Can you change your code to read VDD only when you're sending an update over the network?

It does seem like you will need a regulator and there is a spot for it on the back of those white ESP12 boards - surface mount but it looks relatively easy.


sergey

unread,
Mar 18, 2020, 10:55:07 AM3/18/20
to MppDevices

Page 13 in the ref it says the value is only useful between 18 and 36 for 1.8V to 3.6V.  That would suggest to me anything outside of that range is indeterminate.
Page 13 says about wired A0 to the divider.. I've got  unwired A0 and it never been wired.  
Can you change your code

20200318_172326.jpg


Yep , i have changed the code , i decided to use RTC memory for storing previous value of the voltage and produce the measurement after transmission. but  it helps only partially. In the programmer, like this (on picture)
ESP works good and return right value of voltage, but being soldered on white board and battery feeded (3V)  it always returns 4.36V (also in your MppSleeper).
It does seem like you will need a regulator 
Yep, i'm going to use regulator in case of 18650 using, but for battery there is no reason for that...
Recapitulation of mine  puzzle is:  white board+bare ESP+18650 - works nice , sends corrected voltage, but drain a lot during deep sleep, white board+bare ESP+battery - works nice ,20ua in deep sleep, but  sends incorrect voltage.
Maybe the version of ESP libray would help?

Mike P 4 MPP

unread,
Mar 18, 2020, 11:57:09 AM3/18/20
to MppDevices
This part on page 13:
"The range of operating voltage of ESP8266 is 1.8V ~ 3.6V, the unit of
vdd33_const is 0.1V, so effective value range of vdd33_const is [18, 36]. If
vdd33_const is an ineffective value in the range of (0, 18) or (36, 255),
ESP8266 RF calibration will be 3.3V by default."

What's the advantage of persisting VDD in RTC rather than reading and sending only when the device is awake and ready to transmit?  I read the ADC while RF is off in MppAnalogReporter to save battery during the "settling" phase of the sensor when the device wakes, and I only did that because I was thinking settling might take a lot longer than the 2s it actually took...  If the sensors respond quickly I'd just read everything once the device was fully awake.  I don't bother reading VDD early at all in any of my devices.  

I use deep sleep with RF off to allow for multiple wake cycles without enabling RF.  There's a limit to the length of deep sleep (usually about 226 minutes), so to transmitting only once per day needs multiple wake/sleep cycles - avoiding RF activation till then saves a lot of power.  There's no advantage when reading sensors if you're sending with a shorter period.

I wonder if it's a wiring problem on the white board if MppSleeper doens't work?  Like it never goes properly to sleep so the VDD measurement never needs to be calibrated? What happens if you drive it from a USB adapter instead of a battery?  What about feeding in VDD (or any other value) to A0/ADC with a voltage divider, does the value read correctly?  But this is just back to basics - figure out what's causing the bad reading by eliminating unknowns.

I don't use a regulator for 2x1.5V battery power, but if I tried to use 3x1.5 batteries or any other supply over 3.6V I'd definitely use one.

Mike P 4 MPP

unread,
Mar 18, 2020, 6:26:01 PM3/18/20
to MppDevices
A bit more thinking about this - that VDD calibration section seems to be about calibrating the wifi TX power setting - it may not be applicable to the ADC VDD measurement.  Usually an ADC would compare against an internal reference voltage and wouldn't need a separate setting by the firmware.  It is a bit confusing...  I would test a bit more before giving up on it (though I'm still puzzled why you'd want to read it while wifi is disabled).

Curtis E

unread,
Mar 18, 2020, 9:17:28 PM3/18/20
to MppDevices
I use LiFePo 14500 batteries for all my battery powered devices.  I typically use 2, in order to extend the lifetime between charges,  They are 3.2V and hold that voltage quite a while, then a steep decline.
Message has been deleted

sergey

unread,
Mar 20, 2020, 11:42:25 AM3/20/20
to MppDevices


On Friday, March 20, 2020 at 6:41:22 PM UTC+3, sergey wrote:
Suspect that all of my ESP might be broken. I purchased them in one place ,maybe fake variant... I'm gonna buy one or two  ESP12 at weekend in local shop and check how it works.
Too much weird behaviour from them.... Fellow who is experienced in ESP told me that the presence of voltage on unsoldered A0 - is bad trait.
What i don't understand completely - why it works in programmer but doesn't works on white board....

sergey

unread,
Mar 20, 2020, 11:44:51 AM3/20/20
to MppDevices
Do you happen to share your circuit of connection  for ESP8285? Which GPIO are pull up\down?

Mike P 4 MPP

unread,
Mar 20, 2020, 12:16:47 PM3/20/20
to MppDevices
I'm not sure what this means: "voltage on unsoldered A0 - is bad trait".  It's an input pin and will likely float if unconnected - so could be any voltage, probably VDD but influenced by the impedance of your voltmeter.

"why it works in programmer but doesn't works on white board"  
Voltage leakage between pins by solder or on the printed board itself?  

Change your code to print out VDD every loop in configuration mode (that is, stay awake), and load it into a wemos.  You'll know the code is correct when it shows a steady 3 or 3V3.
Then hook your white board up to a USB adapter, flash with that same code (I solder headers on mine so I can drive it from the ESP01 adapters).  
If it shows USB voltage you'll know the chip and board is good.  
Disconnect the +V wire from the USB, and power from battery (+ and gnd) while still using GND and TX/RX through the USB.  Then you'll know whether the battery affects it.

You could validate the external ADC the same way with a voltage divider and MppAnalog.

Only if USB VDD isn't steady on the whiteboard while the device awake and powered by USB would you need to risk Covid 19 for a trip to a local shop :).  
It's possible but it seems unlikely that everything else would work for a device except the internal VDD measurement...   
If it works properly in the programmer that suggests the chip is fine, the problem the white board, battery, or code.  You just need to figure out a way to eliminate each till you find the one that's causing it.

sergey

unread,
Mar 21, 2020, 2:58:46 AM3/21/20
to MppDevices
I'm not sure what this means: "voltage on unsoldered A0 - is bad trait".
I'm just only at the beginning of tests but on the new ESP unconnected A0 shows 0.8V, whereas on my old ESP shows 2.8V . I think typical multimeter has quite high input impedance... As i understand there is no chance to be greater than 0-1V on A0.
Voltage leakage between pins by solder or on the printed board itself? 
According to current situation everything has cleaned by ethanol!) I doubt that it might be leakage ,but i'll test the ESP w\o white board.
Change your code to print out VDD every loop
I'm using your standart Sleeper, with addition of printf  voltage in all major places. It shows typically 3.34V on the new board and always 4.36V on ill board.
Yep i did it exactly as you said except only validation from external voltage for A0.
At least nobody will want to hug me and shake my hand in a shop, versus hockey team where i can't stop my team players from doing that!)))

sergey

unread,
Mar 21, 2020, 5:07:52 PM3/21/20
to MppDevices
Eventually. I can't explain what had been happend with all my purchased ESP and white board, but newly purchased ESP and white board works nice, deep sleep consumption is about 20ua, quite stable, fall a sleep w\o disturbance.
Voltage measured by VDD shows figures that close to reality. WTF !,chinese quality.... Unless twice expensive i wouldn't buy anything on EBAY or ALI....((
Really i can't understand what might be bad with white board, they seems too simple, GPIO15 to low and and EN to high over 10K resistors.

Mike P 4 MPP

unread,
Mar 22, 2020, 10:41:22 AM3/22/20
to MppDevices
Sounds like good progress.
Everything, including our hockey, is cancelled here until further notice :(.

sergey

unread,
Mar 22, 2020, 4:47:20 PM3/22/20
to MppDevices
You know... it's a huge headacke - from one side it's better to have one seller because sending every small things with tracking number quite expensive , but without it almost means you'll never recieve it, from other this lead to situation when seller sends you all of bullshit that they have. Afterall you spending a weeks in attempts to figure out what's going on. Good harware works as promised.... 18-20ua in deep sleep.
 
Everything, including our hockey, is cancelled here until further notice :(.
We're waiting that it is about to happen, but still playing with restriction up to 20 person in a court , doctors checking control and sanitizing ))
Reply all
Reply to author
Forward
0 new messages