Read this on “Reddit”:
“Cheap solution: diode and resistor in parallel between your device and battery; then measure the voltage across the resistor.”
“In high current situation (during startup) current flows through the diode (lower voltage drop than the resistor), the once the device is in sleep state, current flows through the resistor and voltage across said resistor can be measured (resistor now has lower voltage drop than the diode).”
Advantage: No need to short out resistor to prevent resetting (Brownout) of ESP32 on start up.
Others say you need ~ $100 investment for an instrument to measure such small currents.
Using the diode and resistor method; calculated 321.921 nanoamps deep sleep current for a HiLetGo, Node32s –off the shelf board, in sketch –WIFI , Bluetooth, ADC are disabled, and a BME280 –in deep sleep mode.
Used a HoldPeak HP-770D, 40,000 count meter. Measured 327.62 mV across diode and 1.0177 megohm resistor in parallel.
Deep sleep current measurement
Cut the 5 Volt USB wire; then inserted the paralleled –diode and resistor, so diode was forward biased.
Anyone else tried this method? Experiences?
I used a USB tester from Amazon at about £12.00
Using an ESP32 Feather, 0.042A processing, 0.115A using wifi, 0.012A deepsleep.
Good Morning David,
Converting 0.012 Amps to nanoamps equals 12000000 nanoamps; your deep sleep current should be much lower; believe the USB tester has too low of an impedance . Lower the impedance. higher the current. Multimeters have higher input impedance.
Good Morning Sara,
I believe it to be close to the deep sleep current; being it is not a “bare” ESP32; with an active LED, active voltage regulator, active USB to UART, and an active BME280, I can “accept” the reading as being in the ballpark. WIFI, Bluetooth, and Adc were turned off prior to deep sleep.
Do you believe this is an acceptable reading?
Repeated measurement using resistor and diode in parallel, method; this time with no USB and no BME280. WIFI, Bluetooth, and Adc were turned off. Same resistor and diode; as used in first deep sleep, current measurement. Node32s was powered by a Robotdyn, Breadboard power supply.
Deep sleep current measurement
This was a reduction of 9.39% in current usage; with no USB and no BME280, same HiLetGo, NodeMCU 32s was used for measurement of deep sleep current.
312 nA through a 1Mohm resistor is 0.312 v. What is the current through the diode when there is 0.312 v across it? … not zero. Are you measuring the sum of 2 currents in the setup? Disconnecting the diode when in sleep mode would be a definitive test, I think.
Thank you for your observation; I will disconnect the diode once in sleep mode and measure voltage just across the resistor.
I found no information about this method; other than the reply quoted from “Reddit.” This is why I posted here; looking for additional input about this method. Appreciate the reply Joe, thank you.
Current in a parallel circuit equals the sum of the currents.
Separated one end of the resistor from the diode; started deep sleep with free end of resistor connected to free end of diode, then removed connection that was connect to free end of diode. Resulting deep sleep current measurement was much lower ( 9.26 nanoamps ).
Deep Sleep current measurement
Does 9.26 nanoamps sound unrealistic for a HiLetgo, Node32s; WIFI, Bluetooth, and ADC turned off during deep sleep? Looking at chip model name; it is ESP-WROOM-32D. Spec for RTC + RTC memories, in deep sleep is 10 uA. Why is my deep sleep current measurement so much lower?
That measurement doesn’t seem right.
With a full-featured development board, you can’t get current in the uA range. At least from my experience.
I could only get consumption in that range when using a bare ESP8266 chip.
Something within the range David mentioned is what’s realistic for a full-featured development board.
To be clear: you booted up the device with the diode (D) in series with the Power Supply. Then, the code you had uploaded waited a while, then went into deep sleep. When you were convinced it was in deep sleep, while keeping the diode connected, you put the 1 Meg resistor (R) across the D, thus both in parallel and in series with the PS. Could you state what the voltage was that you measure at that point (i.e. both R || D in series with the PS). Then without disconnecting the R, disconnect the D and state what voltage you now measure. I suspect you are measuring such a low current because somehow the circuit was interrupted when you moved things around, and in fact the ESP is not active. 9 nA is probably just a leakage current. Measure voltages, and let us know what you get. Thanks for exploring this!
… actually what is most likely happening is that once the diode is removed, and the ESP needs microamps (not nanoamps) to keep going in sleep mode, the drop across the resistor is so high (1 uA x 1 Meg – 1 Volt) that the operating voltage applied to the ESP is low enough that it drops out, and just a leakage current is being measured – the ESP can’t restart with such a low voltage. You can try doing the experiment with 1 K resistor instead (try a 100 ohm, and a 10K also if you want to really see the differences).
Good Afternoon Sara and Joe,
I suspected the measurement result was wrong. Appreciate the forum and the opportunity to follow-up on things of interest. Today I have appointments that will take me away from further testing for now. I will continue to investigate this method of deep sleep, current measurement.
Like you thoughts on what to try next, Joe. The first two, deep sleep current measurement links show voltages read across the resistor and diode in parallel. Third link shows voltage across just the resistor.
Sorry I do not have time to go into more detail at the moment.
Cleaned up the breadboard wiring; verified all connections; repeated measurements. Measured power supply, read 4.41 volts. Next, measured the voltage across the diode and resistor; voltage read 4.247 volts. Subtracted the voltage drop across the diode and resistor from the power supply voltage; which calculated to be 0.163 volts, diode is in cut-off; “if it would be less than 0.7V, then the diode is not conducting (cut off).” Cathode end of diode is connect to the power supply. Inserted uA meter between ESP32, 5V pin and the anode end of the diode; measured 4.99 uA. Measurements were on a HiLetGo ESP32 with no other connections other than power supply; running ESP32, Deep Sleep example sketch –with a long sleep duration to enable measurements.
Schematic –Deep Sleep voltage measurement setup
Hi William … I’m not clear why you have the diode in backwards? Also, even though common “talk” is that a diode with a voltage less than the cutoff voltage is “off”, that doesn’t mean, for the purpose of measuring tiny currents, that it is not conducting some current. Look at a data sheet for your diode, and look what the current is at 0.4 volts, for example (supposedly below the “off” region). Given all this, if you put the uA meter in series with the supply, and measure ~5uA sleep, this may be a more reasonable current. The way to prove that the device, however, is still “alive” would be to have it wake up from sleep and turn an LED on. While watching the uA meter, you should see the current jump up to several mA. Good luck.
William, I think your exploring “‘where the electrons go” is a good way to understand hardware, and I encourage you to continue 🙂 However, if you are trying to figure out the all-important question of “how long will my battery last?”, take a look at this post – an excellent in-depth study of power usage in the ESP32/8266.
Good Afternoon Joe,
Taking the diode out of the circuit entirely; results in a voltage drop across the resistor of 4.425 volts, calculates to a deep sleep current of 4.29 uA. Appreciate all your input and discussion of measuring issues. Thank you for the link; plan to run a ESP-NOW, ESP32 transmitter –powered with solar and battery backup. I understand the higher “active” current demands of WiFi.
Resistor only deep sleep measurement
… it’s the academic in me, so apology in advance 🙂 When referring to a voltage drop across a device (e.g. a resistor), that is the voltage measured with one probe of the voltmeter on one side of the device, and the other probe on the other side. So, when you state “voltage drop across the resistor is 4.425”, that means that the ESP has next to no voltage across it because all the voltage is being dropped across the resistor. You meant to say that the voltage of the resister at the ESP32, relative to ground was 4.425. 🙂
No worries; thank you for the correction.
Looking for lower value resistor to try next; thanks for the suggestion.
Added an LED; that turns on at boot and off prior to deep sleep, works perfectly with USB cable plugged in to ESP32. Does not work with my imported breadboard power supply, diode and resistor in or out of circuit.
Any way to use an USB to TTL converter to avoid using USB for Serial Monitor? Did some brief attempts with a USB to TTL converter; have no experience with this device, other than ESP32-Cam, no success for the moment.
William… another point: be careful of how low a voltage you apply to the board. Typical specs are V > 4.5 … you will have problems if it’s lower. Also, if you are measuring sleep currents, you should apply as high a voltage as possible, otherwise you really aren’t doing yourself a service down the road. Also, measuring very low currents is not that easy – you should have a 4 digit Voltmeter and it should have a very low noise input amp (i.e. the one feeding the internal A/D converter).
My apologies to readers of this discussion; I should have done more reading and had a better understanding of deep sleep before posting. Discussion is good learning experience; thank you Joe Margevicius.
Adding another article and video to discussion:
ESP32 Active Mode and Deep Sleep Mode Power Consumption Comparison
Could not get diode and resistor method to work; instead I used a low value resistance, in this case a Dupont jumper wire measured with a resistance of 1.19 ohms. Next, measured the voltage (millivolt range) between ends of the Dupont jumper wire. One end of the Dupont jumper wire was connected to 5 volt supply the other end going to the 5 volt, Vin pin of the ESP32.
Active mode: ~ 72 mA (BME280 and WiFi active ADC and Bluetooth turned off).
Deep Sleep mode: ~ 2.6 mA (BME280 in sleep mode, ADC, WiFi, and Bluetooth turned off).
Measurements were accomplished using a HiLetGo ESP32 development board; plus an external LED was used to determine active or deep sleep mode.
HiLetGo ESP32, available from Amazon
Project code used in current measurement.
Project code is ESP32, ESP-Now based Asyncwebserver from earlier “CameraRainGauge.ino” project; also includes RandomNerd’s ESP-Now Dashboard.
ESP32: Tips to increase battery life
Those seem reasonable values.
I really liked that article about the tips to reduce consumption. Thanks for sharing.
Good morning, Sara,
Calculations based on Andreas Spiess “YouTube” video # 383.
Based on calculations; looks like I need to learn to work with a bare ESP32 module, to lower the yearly current consumption, before using battery backed up solar power!
Adding an article that goes into great detail comparing different ESP32 boards and charting measurement results in the various modes of operation:
Guide to Reduce the ESP32 Power Consumption by 95%
That’s a great in-depth article about reducing power consumption.
Thanks for sharing 😀
Found a video on using a cheap meter to measure deep sleep current; plan to build once I recover from eye surgery.
Measure sleep current uA/nA of battery equipment using a cheap meter.
Will follow up…
Just wound a diy shunt 22 Gauge wire folded in half; wound on a xacto knife handle, measured .40 ohms. Voltage source to BPI PicoW-S3 was a LDO 3.3 Volt regulator. Circuit was on breadboard with an LED only active in awake mode. Initially shunt was “cold” pruduced reading of 14 uA. Shunt after being in circuit awhile produced 17 uA. Both uA reading are from the BPI-PicoW-S3 in deep sleep ; WiFi and Bluetooth turned off. No USB connection. 3.3 Volts applied at +3V3 regulator pin. Also in the circuit CH340 USB to Serial device.