By Giulia Guglielmi5 min
Measuring Wemos Power Consumption and Debugging Deep Sleep
How I measured a Wemos D1 mini sensor's active cycle and deep-sleep current with a USB power meter and multimeter, then traced a power-bank shutdown problem.
On this page
Before choosing the battery and solar panel for my soil-moisture sensor, I needed to measure how much energy the Wemos really uses. The result depends on two things: the current drawn while the board is active and how long each active cycle lasts.
The firmware wakes up, reads the sensor, connects to Wi-Fi, sends an HTTP request to ThingSpeak, and returns to deep sleep. From the serial timings, the Wi-Fi connection took about 4334 ms, the HTTP request about 125 ms, and the complete active period about 4575 ms.
Starting with a USB power meter
My first measurement setup was simple. I connected a USB power meter between the power bank and the Wemos:
power bank → USB power meter → micro-USB cable → Wemos
The meter displayed about 5.09 V. When the connection started, the current
rose to approximately 0.07 A, or 70 mA. At very low current a basic USB
meter may show 0.00 A, so that display alone does not prove that the Wemos has
stopped consuming power.
Checking the voltage with a multimeter
I then used a digital multimeter to check the board rails. For voltage, the
black probe goes in COM and touches GND; the red probe goes in the voltage
socket and touches the rail being measured.
- Between
3V3andGND, I expected approximately 3.3 V. - Between
5VandGND, with the board powered by USB, I expected approximately 5 V. My reading was around 4.67 V in one test.
Voltage is a potential difference, so the meter is connected across the two
points. Current is different. To measure current, the circuit must be opened and
the meter inserted in series so all load current passes through it. The
correct current socket and range must be selected before powering the circuit.
Putting a meter configured for current directly across 5V and GND creates a
short circuit.
I first tested the voltage mode on an AAA battery. Red went to the positive end, black to the negative end, and the meter showed about 1.4 V. This was a useful low-risk check that the probes and mode were correct before touching the Wemos.
Calculating one measurement cycle
Using the rounded measurement of 70 mA for 5 seconds:
charge per cycle = 70 mA × 5 s / 3600
= 0.097 mAh
The energy at the 5 V input is:
energy per cycle = 5 V × 0.070 A × 5 s / 3600
= 0.000486 Wh
The first version of my notes contained 0.00139 Wh; repeating the conversion
from seconds to hours showed that the correct result is 0.000486 Wh. Using
the measured 4.575-second duration instead of the rounded 5 seconds gives about
0.089 mAh and 0.000445 Wh per cycle.
With two measurements per day, the rounded active contribution is:
0.097 mAh × 2 = 0.194 mAh per day
Deep sleep dominates the day
I measured approximately 0.15 mA while the complete Wemos board was in deep sleep. This is higher than the ESP8266 chip's datasheet value because the D1 mini also contains a voltage regulator, USB-to-serial circuitry, LEDs, and other components. The whole board is what the battery has to power, so the board-level measurement is the useful one for this project.
The approximate daily charge at the 5 V input is:
deep sleep: 0.15 mA × 24 h = 3.6 mAh
active: 0.097 mAh × 2 = 0.194 mAh
total: 3.794 mAh per day
This estimate slightly double-counts the ten active seconds, but the difference is negligible at this resolution. It also leaves out the moisture sensor and the power converter's idle current if they were not present during the test. The next measurement should integrate the current of the complete final assembly for at least 24 hours.
Why the power bank switched off
During the test I noticed another problem. The Wemos ran normally from the laptop, but a power bank switched its output off after the board entered deep sleep. My working hypothesis is that the power bank interprets the very small load as “nothing connected” and activates its automatic shutdown.
Removing deep sleep kept the load high and avoided the symptom, but that would
waste most of the battery. The correct deep-sleep wake connection also matters:
on the ESP8266, GPIO16, labelled D0 on the D1 mini, must be connected to
RST so the RTC can wake the chip by resetting it.
For the final solar version I do not need a consumer power bank. A protected cell, the correct charger, and a low-quiescent-current regulator can supply the board continuously without an automatic USB shutdown threshold.
The most useful lesson from this experiment was not the final number. It was the method: measure the real board, separate the short active phase from the long sleep phase, keep voltage and current units on the same side of the converter, and then repeat the test on the complete system.