Giulia Guglielmi logoGiulia Guglielmi
all posts

Updated 5 min

The Tools I Used to Measure What the Wemos Consumes

How I used a USB power meter and a multimeter to check the Wemos voltages, its active cycle, its daily consumption, and its deep sleep.

In this short guide I go through the tools I used before choosing the components for my soil-moisture sensor.

I started from this idea: the energy used by one active cycle depends on two things, the current drawn, measured in milliamps, and how long the Wemos stays awake, measured in seconds.

The multimeter

I bought a multimeter that measures voltage, resistance, and direct current up to 10 A. How do you use it? The black probe goes in the COM socket, while for voltage and resistance the red probe goes in the VΩmA socket.

Lexman digital multimeter next to its box and the red and black probes.
The digital multimeter I used to check the voltages in the circuit.

To learn how to use it I wanted to measure how flat the battery in my television remote was. It is a AAA cell and, with the red probe on the positive end and the black one on the negative end, the multimeter read about 1.4 V, a plausible value for a battery that has been in use for a while.

Multimeter with the red probe on the positive end and the black probe on the negative end of a AAA battery, display reading about 1.4 V.
The probes on the two ends of the AAA battery: about 1.4 V, a battery close to flat.

Checking the Wemos voltages

Now that I understood how it works, I moved on to the voltage supplied by the Wemos regulator, with the red probe on the 3V3 pin and the black one on GND. The multimeter showed 3.30 V, the value printed on the board.

Voltage is a potential difference, so when I measure the supply voltage of the Wemos I compare the pin I care about, 3V3 in this case, with the ground, that is GND.

I then measured the power bank voltage with the black probe on GND and the red one on VIN, the USB power input. I read about 4.80 V, close to the 5 V printed on the power bank.

Multimeter probes on the 3V3 and GND pins of the Wemos inside its weatherproof box, display showing 3.30 V.
The probes on 3V3 and GND: the multimeter reads 3.30 V.
Multimeter probes on the VIN and GND pins of the Wemos powered by the power bank, with the voltage reading on the display.
The same measurement repeated on VIN, the input fed by the power bank.

These results did confirm what the devices claim, but they also let me get to know the instruments I would need for the next step, measuring the active cycle.

Measuring the active cycle

At this point, as I said, we move on to measuring the active cycle, and therefore the firmware.

To measure the consumption more precisely I needed a USB power meter.

USB power meter with a translucent blue case, a male USB connector on one side and a micro-USB socket on the other.
The USB power meter I used to read current and voltage during the active cycle.

As you can see it has the shape of a memory stick, but it carries a display that shows the current drawn and the voltage.

This step took me two rounds:

  1. meter between the power bank and the Wemos;
  2. meter between the laptop and the Wemos.

In the first round, as soon as the parts were connected and the firmware started, the current and the voltage were 70 mA and 5.09 V. During deep sleep, though, everything switched off. My hypothesis is that the Wemos draws so little that either the power bank cannot keep feeding it or the meter cannot detect it.

Power bank connected to the USB power meter and to the Wemos in its weatherproof box, with the meter display lit and showing voltage and current.
Power bank, meter, and Wemos in series: during the active cycle the display shows voltage and the current drawn.
The same chain of power bank, USB meter and Wemos, but with the meter display dark and the board LED off.
The same setup during deep sleep: the display goes dark and shows nothing at all.

The second round gave me the same results, with one difference: this time the meter did not switch off, it simply showed a current of zero.

The Wemos in its weatherproof box connected to the laptop through the USB power meter, with the capacitive soil-moisture sensor lying next to it.
With the meter between laptop and Wemos the display stays on, but in deep sleep it reads zero.

Finally, by adding some logging to the firmware, I recorded about 4334 ms for the Wi-Fi connection, 125 ms for the HTTP connection, and 4575 ms for the whole cycle. I then rounded everything to 5 seconds of active cycle, that is the duration of the entire firmware run.

Working out the daily consumption

Five seconds are about 0.00139 hours. One cycle therefore uses:

0.07 A × 0.00139 h = 0.000097 Ah
                         = 0.097 mAh

With two cycles per day:

0.097 mAh × 2 = 0.194 mAh per day

In deep sleep the meter could not read the current, so I used a value found online, about 0.15 mA:

0.15 mA × 24 h = 3.6 mAh per day

The total comes to about 3.8 mAh per day.

Written by
Notes on electronics, IoT, and software.