How to Calculate Battery Life

Last Updated: April 22, 2026

The Ultimate Engineering Guide to Estimating Device Runtime

Battery life is one of the most critical factors when designing electronics, whether it's a simple IoT sensor or a complex industrial control system. Understanding how to accurately estimate runtime ensures that your project meets its requirements without unexpected power failures.

Step-by-Step Calculation Guide

Calculating battery life requires more than just dividing capacity by current. You must account for the different power states of your hardware.

  • Define Battery Parameters

    Capacity (mAh): The total energy stored in the battery. Common values range from 200mAh for coin cells to 20,000mAh for power banks.

    Depth of Discharge (DoD): Batteries should rarely be drained to 0%. For example, setting a 20% DoD means you only use 80% of the capacity to prolong battery health.

  • Analyze Power Modes

    Most modern systems toggle between two main states:

    Active Mode: When the device is processing data or transmitting (high current).

    Sleep Mode: When the device is waiting for an interrupt or timer (ultra-low current).

  • Determine Duty Cycle

    Enter the duration of each mode in seconds. The total cycle is the sum of Active and Sleep durations.

The Mathematical Formula

Our calculator uses the weighted average current consumption formula to provide accurate results:

Average Current (mA) = ((Iactive × Tactive) + (Isleep × Tsleep)) / Ttotal
Battery Life (Hours) = (Capacity × (1 - DoD/100)) / Average Current

Practical Examples

IoT Weather Sensor

An ESP32 sensor wakes up for 2 seconds (80mA) to send data and sleeps for 58 seconds (100µA). On a 2500mAh Li-ion battery with 10% DoD, this device would last for over a year.

Always-On Display

A low-power display pulls a constant 5mA. On a 1000mAh battery with 20% DoD, it will run for 160 hours (roughly 6.6 days).

Understanding Real-World Factors

Estimating the battery life of IoT (Internet of Things) devices, embedded systems, and consumer electronics requires precision. While formulas provide a solid baseline, real-world factors like temperature, self-discharge rates, and component aging can influence actual results.

Equally critical is the Depth of Discharge (DoD). Batteries rarely yield 100% of their label's rated capacity practically due to voltage cutoffs or chemical thresholds where system regulators can no longer function. By incorporating a configurable Depth of Discharge percentage, you effectively limit the 'useable' capacity—ensuring a far more reliable real-world estimation.

Recommended Tools

For precision voltage and current measurements, I use the FLUKE 17B.

Explore Other Engineering Tools