The Power Model

VBatPower models power consumption as a three-level tree — BatteryComponentState — then collapses it into an average current draw and an estimated runtime. This page documents every entity and every field, and the maths each one feeds.

Projects

A project is one design under analysis — typically one device and its battery (or several). It holds your batteries and any imported telemetry, and renders the analysis panels.

FieldWhat it is
NameThe project's display name (e.g. "Sensor Node v2").
DescriptionOptional free-text notes about the design.
TagsOptional labels used for search/filter in the project library.

Batteries

Each battery is a power source. Set both its voltage and its capacity (entered as a current rating) to compute the available energy in watt-hours.

FieldUnitWhat it is
NameA descriptive name (e.g. "Li-Po 3S 2200mAh").
TypeChemistry / form factor (e.g. "Li-Ion", "LiFePO4", "CR2032").
VoltageV (µ…M)Nominal pack voltage.
CapacityA·h (mAh…)Rated capacity, entered as current (e.g. 2000 mAh = 2 Ah).

energy = voltage × capacity → Wh (3.7 V × 2 Ah = 7.4 Wh)

Components

A component is a physical part drawing power from a battery — an MCU, radio, sensor, LED. Its voltage is used to convert between current and resistance for its states.

FieldWhat it is
NameHardware name (e.g. "ESP32", "GPS Module").
TypeCategory (e.g. "MCU", "Sensor", "Radio").
VoltageOperating voltage; links current ↔ resistance via Ohm's law.

States

A state is an operating mode of a component — active, deep sleep, TX — each with its own current and timing. States are where the real modelling happens.

FieldWhat it is
NameDescriptive name (e.g. "Deep Sleep", "TX Mode").
CurrentCurrent draw in this state. Setting it auto-calculates Resistance.
ResistanceEquivalent resistance. Setting it auto-calculates Current (Ohm's law, with the component voltage).
Always OnRuns continuously with no interval (e.g. a quiescent sleep current).
Run OnceExecutes exactly once over the battery's life (boot, calibration) — a fixed energy cost.
IntervalHow often the state repeats (e.g. every 60 s). Mutually exclusive with Times.
TimesHow many times it runs per second/minute/hour/day. Mutually exclusive with Interval.
Exec timeDuration of a single execution (how long the state is active each time).
MeasuredUse imported telemetry for this state instead of the theoretical current (see Telemetry).

Every numeric field has its own unit selector (µA / mA / A, ms / s / min / h, …) so you enter values in whatever's natural; the engine carries them to SI internally.

IDs & addressing

Entities are addressed with dot notation, which is also how telemetry rows target them:

0        first battery
0.0      first component of that battery
0.0.0    first state of that component

How runtime is computed

Each state contributes an average current weighted by its duty cycle. Always-on states contribute their full current; run-once states subtract a one-time energy from the battery instead.

// per periodic state
duty   = exec_time / interval            (or × times/period)
I_state = current × duty

// system
I_avg   = Σ I_state  +  Σ always_on_current
runtime = capacity / I_avg               (minus run-once energy)

Analysis panels

The project page shows three views of the result:

  • System Analysis — computed purely from your state definitions (theoretical).
  • Recorded Data — computed from imported telemetry measurements.
  • Predicted — a blend of the theoretical model with the real data.

Each reports estimated lifespan, average current draw, total power, battery capacity (Wh), and cycles per year. The Graphs page visualizes consumption, measured timelines, and the discharge prediction.

Next