Skip to content
Documentation sections

Battery Life Calculator

POSThttps://rftools.io/api/py/v1/calculate

Slug battery-life. Estimate battery runtime for IoT and portable devices given average current draw, duty cycle, self-discharge rate, and depth-of-discharge cutoff. Suitable for LiPo, alkaline, NiMH, and coin-cell batteries.

Inputs

Send every one of these in inputs, in the units shown. Most are required: a call without one is refused (400) and costs nothing; one the calculator can do without takes the default shown. An input outside its range is still computed and flagged in the provenance.

Inputs of battery-life
NameUnitRangeDefaultDescription
capacitynumbermAh1 … 1000002000Battery Capacity
avgCurrentnumbermA0.001 … 10000100Average current drawn by the device during active operation
dutyCyclenumber%0.001 … 100100Percentage of time the device is active and drawing current. 100% = continuous operation.
selfDischargenumber%/month0 … 302Monthly self-discharge rate of the battery. LiPo: ~2%, NiMH: ~15%, Alkaline: ~1%
cutoffSocnumber%0 … 8020Minimum state of charge at which the device stops operating. 20% = device shuts off with 20% capacity remaining.
numLoadsnumbernone0 … 70Loads on the battery beside the device, each with its own current and duty cycle (0–7)
load1CurrentnumbermA0 … 1000010Current additional load 1 draws while it is on
load1Dutynumber%0 … 10010Share of the time additional load 1 is on
load2CurrentnumbermA0 … 1000010Current additional load 2 draws while it is on
load2Dutynumber%0 … 10010Share of the time additional load 2 is on
load3CurrentnumbermA0 … 1000010Current additional load 3 draws while it is on
load3Dutynumber%0 … 10010Share of the time additional load 3 is on
load4CurrentnumbermA0 … 1000010Current additional load 4 draws while it is on
load4Dutynumber%0 … 10010Share of the time additional load 4 is on
load5CurrentnumbermA0 … 1000010Current additional load 5 draws while it is on
load5Dutynumber%0 … 10010Share of the time additional load 5 is on
load6CurrentnumbermA0 … 1000010Current additional load 6 draws while it is on
load6Dutynumber%0 … 10010Share of the time additional load 6 is on
load7CurrentnumbermA0 … 1000010Current additional load 7 draws while it is on
load7Dutynumber%0 … 10010Share of the time additional load 7 is on

Outputs

Returned in values, by key. A value that is unbounded or undefined is null.

Outputs of battery-life
FieldUnitDescription
runtimeHoursheadlinehEstimated battery runtime in hours
runtimeDaysdaysEstimated battery runtime in days
effectiveCurrentmAAverage current after applying duty cycles: the device plus every additional load, before self-discharge
usableCapacityMAhmAhCapacity available after accounting for the cutoff state of charge
selfDischargeCurrentmAThe battery’s self-discharge as an equivalent current: capacity × rate per month / 720 h

Calling it

  • Calculate: one call, the request and response in full, and its errors.
  • Batch: this calculator with others, or a sweep, in one request.
  • Solve for a target: the value of one input that brings an output to a target.