Skip to main content
Integrate energy and charge over time, or compute current/voltage/power statistics, from an energy-analyzer net. Requires the energy-analyzer net type.

Import

Methods

Method Reference

Net.get(name, type=NetType.EnergyAnalyzer)

Get an energy analyzer net by name.
Parameters: Returns: Energy analyzer Net instance

read_energy(duration)

Integrate current and power over duration seconds.
Parameters: Returns: dict with keys:

read_stats(duration)

Compute mean, minimum, maximum, and standard deviation for current, voltage, and power over duration seconds.
Parameters: Returns: dict with keys: Each statistics sub-dict contains:

Examples

Energy Budget Check

Sleep Current Verification

Battery Life Estimation

Startup Energy Capture

Current Spike Analysis

Supported Hardware

For instantaneous power readings (also available on Yocto-Watt), see Watt Meter.

Notes

  • The Joulescope JS220 samples at high frequency; longer durations yield more accurate statistics
  • The Nordic PPK2 operates in source mode (supplies a configurable voltage 0.8–5V and measures current); voltage readings reflect the configured value
  • read_energy() and read_stats() block for the full duration before returning
  • The same physical JS220 device is shared between WattMeter and EnergyAnalyzer net roles — opening both net types for the same device is safe
  • Use lager instruments --box <box> to verify the JS220 is detected before running scripts