The Power Model

VBatPower models power consumption as a three-level tree — Battery →
Component →
State — 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.

Field What it is
Name The project’s display name (e.g. “Sensor Node v2”).
Description Optional free-text notes about the design.
Tags Optional 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.

Field Unit What it is
Name — A descriptive name (e.g. “Li-Po 3S 2200mAh”).
Type — Chemistry / form factor (e.g. “Li-Ion”, “LiFePO4”, “CR2032”).
Voltage V (µ…M) Nominal pack voltage.
Capacity A·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.

Field What it is
Name Hardware name (e.g. “ESP32”, “GPS Module”).
Type Category (e.g. “MCU”, “Sensor”, “Radio”).
Voltage Operating 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.

Field What it is
Name Descriptive name (e.g. “Deep Sleep”, “TX Mode”).
Current Current draw in this state. Setting it auto-calculates Resistance.
Resistance Equivalent resistance. Setting it auto-calculates Current (Ohm’s law, with the component voltage).
Always On Runs continuously with no interval (e.g. a quiescent sleep current).
Run Once Executes exactly once over the battery’s life (boot, calibration) — a fixed energy cost.
Interval How often the state repeats (e.g. every 60 s). Mutually exclusive with Times.
Times How many times it runs per second/minute/hour/day. Mutually exclusive with Interval.
Exec time Duration of a single execution (how long the state is active each time).
Measured Use 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