Lab method

Measuring current from deep sleep to Wi-Fi transmit

How we record µA-to-hundreds-of-mA current traces on the ESP32-C5-DevKitC-1, where the supply goes in, and how sleep and active averages are computed and reported.

InstrumentPower profiler with µA-to-A range (see ops/BENCH.md)
Updated28 November 2026

This page is the procedure behind every current figure in our Lab results for Espressif boards. It is written so that you can repeat it on your own bench and compare your numbers with ours. It covers the instrument, where the supply is applied on the ESP32-C5-DevKitC-1, the firmware, how averages are computed and how we report them. Results pages link back here and wait for the owner’s bench runs.

What we measure

We measure the current a board draws while running a fixed firmware cycle: an active phase with the CPU busy and the radio off, then a timed deep sleep. From one trace we compute four numbers for each unit and supply configuration:

  • the deep-sleep average current, in µA
  • the active-phase average current, in mA
  • the charge per cycle, in µC, and the energy per cycle, in µJ
  • the average current over a whole number of cycles, in µA

Radio activity has its own method: wake-to-publish latency and energy.

The range the instrument must cover

The ESP32-C5 datasheet (v1.5, Table 5-12) gives a typical deep-sleep current of 0.012 mA for the chip with the RTC timer and LP memory powered. The same datasheet (Tables 5-7 and 5-8, 3.3 V supply, 25 °C, transmit at 100 % duty cycle) gives a peak of 320 mA for 802.11b at 1 Mbps and 20 dBm on 2.4 GHz, and 408 mA for 802.11a at 6 Mbps and 18 dBm on 5 GHz. These are chip figures. The devkit adds its own loads, described below.

So the instrument has to resolve currents around 10 µA and carry more than 400 mA in the same trace, without a manual range change. For averages over seconds, the instrument’s stated accuracy of the average matters most. For the energy of a single burst, the sample rate and bandwidth matter as well: the burst has to span many samples. We have not yet measured the length of the C5’s transmit bursts on our bench, so the first results page will report it, and that tells you whether a slower instrument is enough for your purpose.

Instruments, compared on criteria

Any instrument that meets the range above can run this method. The table compares three common bench instruments on the figures their makers publish. It is not a ranking, and the bench may use a different instrument (see ops/BENCH.md). Each result states which instrument was used.

Criterion Nordic Power Profiler Kit II (PPK2) Joulescope JS220 Qoitech Otii Arc Pro
Current range 200 nA to 1 A on the product page; the user guide introduction says 500 nA to 1 A ±3 A continuous Stated as nA to 5 A; ranges ±19 mA, ±2.7 A, ±5 A
Sample rate 100 ksps 2 Msps, 16-bit, current and voltage together 4 ksps in the ±19 mA range, 1 ksps in the higher ranges
Bandwidth Not stated in the pages we read 300 kHz 400 Hz (3 dB)
Accuracy (maker’s figure) Typical, on the average readout: ±10 % from 100 nA to 50 mA, ±15 % from 50 mA to 1 A ±0.25 % ±30 nA in the 18 µA range; ±0.25 % ±150 µA in the 180 mA range ±(0.1 % + 50 nA) up to 19 mA, ±(0.1 % + 150 µA) above; averaged over more than 1 s after 15 minutes of warm-up and a calibration
Resolution 0.2 µA in the lowest range to 1 mA in the highest 1.5 nA in the 18 µA range 5 nA (product page)
Ranging Five ranges, switched automatically Shunt switching in 0.8 µs typical, no measurement gap after a switch Auto range
Voltage drop in series Not stated in the pages we read 25 mV typical, 35 mV maximum at 1 A Not stated in the specification we read
Supplies the board Yes, 0.8 to 5 V (Source Meter mode); 1 A needs two USB cables No supply output is listed; used in series with your own supply Yes, 0.5 to 3.75 V on USB power, 0.5 to 4.55 V with an external supply (auto range)
Digital inputs in the same time base 8 4 inputs, 2 outputs, sampled at 2 MSPS GPI1/2 and GPO1/2 on the expansion port

Two practical consequences follow. A 400 Hz bandwidth will not show the shape of a short burst, but its charge still counts in an average over many seconds. A ±10 % accuracy is wider than the unit-to-unit spread you may want to see, so compare units on one instrument and quote its accuracy next to every number.

Where the supply goes in

The board has three ways in for power, and Espressif’s user guide says they are mutually exclusive: the USB-C ports, the 5V and GND pins, or the 3V3 and GND pins. Never connect USB while you feed the 3V3 pin.

We traced the supply rails on the v1.2 schematic (SCH_ESP32-C5-DevkitC-1_V1.2_20250211). The header pin labelled 3V3 (J1 pin 1) sits on the module side, net ESP_3V3. Jumper J5 joins that net to VCC_3V3, the output of the SY8088AAC DC/DC converter. The USB-to-UART bridge (a CP2102N by default) takes its supply from VBUSA, the 5 V of the UART USB-C port. The red power LED D5, with a 5.1 kΩ resistor, sits on VCC_3V3. The WS2812B RGB LED sits on VCC_5V.

USB-C (UART)CP2102N bridgeVBUSADC/DC SY8088VCC_5VWS2812B RGB LEDJ5VCC_3V3Red LED D5ESP32-C5WROOM-1 moduleESP_3V3J1 pin 1 (3V3)TX0/RX0 (still connected when the bridge is unpowered)BU: meter in series with VBUSJ: meter across J5M and B3: 3.3 V in here
Supply paths on the ESP32-C5-DevKitC-1 v1.2 and where the meter goes in each configuration. Redrawn from Espressif's schematic SCH_ESP32-C5-DevkitC-1_V1.2_20250211, sheet 2. Only parts that matter for current measurement are shown.

That gives four configurations. Each result names the one it used.

Code Supply J5 USB What the number includes
M 3.300 V from the instrument into J1 pin 1 (3V3) Removed Both cables unplugged The module and anything else on ESP_3V3. The USB-to-UART bridge is unpowered.
J Board on the UART USB-C port; meter across J5 (Espressif’s documented method) Removed, meter in its place UART port connected The module, fed by the board’s DC/DC converter, with the bridge powered
B3 3.300 V from the instrument into J1 pin 1 Fitted Both cables unplugged The module plus the VCC_3V3 side: the red LED and its resistor, and the converter’s output stage
BU 5 V USB, meter in series with VBUS of the UART port Fitted UART port through a pass-through breakout The whole board: bridge, converter, both LEDs and the module, at 5 V

M is the configuration we use for “module” figures. BU is what a maker sees when the board runs from a USB power bank. Because BU runs at 5 V and the others at 3.3 V, compare BU with the rest by power and energy, never by current alone.

Firmware

The firmware is the example lab-sleep-cycle in examples/lab-sleep-cycle/, built with ESP-IDF v6.1.1 in the Docker image espressif/idf:v6.1.1. Each cycle runs an active phase of active_ms with the CPU busy and the radio off, prints one line LAB cycle=<n> active_ms=<a> sleep_ms=<s>, and enters deep sleep with a timer wake after sleep_ms. The cycle counter lives in RTC memory, so the log shows that every wake came from deep sleep and not from a reset. The firmware commit is recorded with every run by the bench runner.

The printed line is for the functional check over USB. During configurations M and B3 no USB cable is connected, so nothing is captured over serial. The instrument trace is the record.

Procedure

Run the commands from the repository root with the iotfieldguide Python environment. Replace <port> with the UART port of the board and <run-id> with the id printed by the capture step.

  1. Flash and check the firmware over USB. The capture fails unless at least five cycles appear.
python tools/bench/bench.py flash --port <port> --example lab-sleep-cycle --target esp32c5
python tools/bench/bench.py capture --port <port> --seconds 60 --reset \
  --expect tools/bench/expect/lab-sleep-cycle.txt --board-rev "ESP32-C5-DevKitC-1 v1.2" \
  --test current-measurement --example lab-sleep-cycle --unit u1
  1. Unplug USB. Set up configuration M: remove J5, set the instrument to 3.300 V, connect its output to J1 pin 1 and its ground to a GND pin. Keep the leads short and route them away from the antenna end of the module.
  2. Let the board run for at least three cycles before recording, then record at least ten whole cycles. Note the room temperature at the start and the end.
  3. Export the trace and save it as content-data/measurements/<run-id>/current-M.csv in the format below.
  4. Repeat steps 2 to 4 for J, B3 and BU, saving current-J.csv, current-B3.csv and current-BU.csv.
  5. Repeat the whole procedure for every unit (u2, u3, …). We test at least three units of a kit when the bench has them, and say so when it does not.
  6. Compute the averages and record the run:
python tools/calc/energy_per_message.py content-data/measurements/<run-id>/current-M.csv \
  --threshold 0.001 --min-gap 0.05 --pad 0.002 --json > content-data/measurements/<run-id>/energy-M.json
python tools/bench/bench.py record --run <run-id> --test current-measurement --device esp32-c5-devkitc-1 \
  --units 1 --instrument "<model> (see ops/BENCH.md)" \
  --settings "lab-sleep-cycle; M, J, B3, BU; 3.300 V; <sample rate>" --summary "<medians, see energy-*.json>"

How the averages are computed

All integrals use the trapezoidal rule in tools/calc/energy_per_message.py, with the window edges interpolated. Charge is the integral of current over time. Energy is the integral of voltage times current, using the instrument’s voltage column where it has one and the set supply voltage otherwise.

  • Active phase. The script finds every stretch above 1 mA (--threshold 0.001), merges stretches less than 50 ms apart and widens each by 2 ms on both sides. Each stretch is one active phase. Its average current is its charge divided by its duration.
  • Deep sleep. The window starts 100 ms after the current falls below the threshold and ends 100 ms before the next rise. The margin keeps the entry and wake transients out of the sleep figure. The average is the window’s charge divided by its duration (--start and --end).
  • Whole cycle. The window runs from one wake edge to the wake edge a whole number of cycles later. This is the figure a battery-life calculation uses.

The thresholds are part of the method. If a result uses different values, it says so.

Raw data

Everything for one run goes in content-data/measurements/<run-id>/:

File Content
serial.log The functional-check log, with MAC addresses and other identifiers masked by the runner
run.json Date (UTC), firmware commit, ESP-IDF version, board and chip revision, unit label, pass or fail
current-<config>.csv Header t_s,current_a,voltage_v; time in seconds, current in amperes, voltage in volts. Convert the instrument’s export to these units.
energy-<config>.json Output of energy_per_message.py

No instrument serial numbers, user names or file paths go into these files. Check an instrument’s own export for such fields before converting it.

Known sources of error

  • Instrument accuracy. The maker’s figures in the table above are the floor. Quote them with each result.
  • Voltage drop. A series meter and its leads drop voltage, so the module sees less than the set value during bursts. A source-mode instrument regulates at its own terminals, not at the pin. Where the instrument has a separate voltage input, sense at J1 pin 1.
  • Range changes. An autoranging meter switches shunts as the current moves between µA and hundreds of mA. Makers describe this differently, and the PPK2 pages we read do not describe switching behaviour. Compare the deep-sleep average with a long window on a fixed range if your instrument allows it.
  • RF pickup. The JS220 datasheet reports up to 10 µA of induced current (observed, not guaranteed) under a 3 V/m field test. A Wi-Fi board next to the leads is such a field. Keep the antenna away from the leads, and check the sleep figure with firmware that never starts the radio.
  • The unpowered bridge. In configuration M the module’s TX0 and RX0 still connect to the unpowered CP2102N. We do not know how much current flows through those pins. The difference between M and J bounds it.
  • Temperature. Datasheet figures are at 25 °C. We record the room temperature and do not correct for it.
  • Unit-to-unit spread. One unit says little about the next. We test several.

How results are reported

Each results page gives, per configuration: the median, minimum and maximum across units for each of the four numbers, the number of units, the instrument and its stated accuracy, the supply voltage and where it was applied, the firmware commit, the ESP-IDF version, the board and chip revisions, and the room temperature. We never report only the lowest unit. Charts are drawn by a script from the committed CSV files. Where a datasheet figure appears beside ours, it is labelled as a chip figure with its conditions.

For makers

Start with configuration J and the instrument you have. Remove J5, put the meter across it and leave the board on USB. That gives the module’s current with the least wiring. Then measure BU with a USB pass-through meter, and compare the two by power. The difference is what the devkit’s own parts cost you on a battery.

For product teams

On your own board, the M and J split tells you how much your USB bridge and regulator cost in sleep. Production numbers need more units, a temperature sweep and an instrument with a calibration record. Keep the raw traces with the firmware commit, so a change in a later SDK release can be traced to code and not to the bench.