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.
| Name | Unit | Range | Default | Description |
|---|---|---|---|---|
| capacitynumber | mAh | 1 … 100000 | 2000 | Battery Capacity |
| avgCurrentnumber | mA | 0.001 … 10000 | 100 | Average current drawn by the device during active operation |
| dutyCyclenumber | % | 0.001 … 100 | 100 | Percentage of time the device is active and drawing current. 100% = continuous operation. |
| selfDischargenumber | %/month | 0 … 30 | 2 | Monthly self-discharge rate of the battery. LiPo: ~2%, NiMH: ~15%, Alkaline: ~1% |
| cutoffSocnumber | % | 0 … 80 | 20 | Minimum state of charge at which the device stops operating. 20% = device shuts off with 20% capacity remaining. |
| numLoadsnumber | none | 0 … 7 | 0 | Loads on the battery beside the device, each with its own current and duty cycle (0–7) |
| load1Currentnumber | mA | 0 … 10000 | 10 | Current additional load 1 draws while it is on |
| load1Dutynumber | % | 0 … 100 | 10 | Share of the time additional load 1 is on |
| load2Currentnumber | mA | 0 … 10000 | 10 | Current additional load 2 draws while it is on |
| load2Dutynumber | % | 0 … 100 | 10 | Share of the time additional load 2 is on |
| load3Currentnumber | mA | 0 … 10000 | 10 | Current additional load 3 draws while it is on |
| load3Dutynumber | % | 0 … 100 | 10 | Share of the time additional load 3 is on |
| load4Currentnumber | mA | 0 … 10000 | 10 | Current additional load 4 draws while it is on |
| load4Dutynumber | % | 0 … 100 | 10 | Share of the time additional load 4 is on |
| load5Currentnumber | mA | 0 … 10000 | 10 | Current additional load 5 draws while it is on |
| load5Dutynumber | % | 0 … 100 | 10 | Share of the time additional load 5 is on |
| load6Currentnumber | mA | 0 … 10000 | 10 | Current additional load 6 draws while it is on |
| load6Dutynumber | % | 0 … 100 | 10 | Share of the time additional load 6 is on |
| load7Currentnumber | mA | 0 … 10000 | 10 | Current additional load 7 draws while it is on |
| load7Dutynumber | % | 0 … 100 | 10 | Share of the time additional load 7 is on |
Outputs
Returned in values, by key. A value that is unbounded or undefined is null.
| Field | Unit | Description |
|---|---|---|
| runtimeHoursheadline | h | Estimated battery runtime in hours |
| runtimeDays | days | Estimated battery runtime in days |
| effectiveCurrent | mA | Average current after applying duty cycles: the device plus every additional load, before self-discharge |
| usableCapacityMAh | mAh | Capacity available after accounting for the cutoff state of charge |
| selfDischargeCurrent | mA | The 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.