๐ Battery Life & Runtime Calculator
Estimate real-world battery runtime accounting for efficiency losses and discharge depth.
How Long Will Your Battery Actually Last? The Real Answer Is More Complex Than You Think
You buy a power bank rated at 20,000 mAh and expect it to charge your 4,000 mAh phone five times. In practice, you get three charges, maybe three and a half on a good day. The gap between the number printed on the battery label and what you experience in the real world is one of the most misunderstood topics in electronics. Let's close that gap by working through exactly how battery runtime is calculated โ and why the simple formula most people use falls short.
What Does mAh Actually Mean?
Milliamp-hours (mAh) is a unit of electrical charge. A 2,000 mAh battery can, in theory, supply 2,000 milliamps for exactly one hour, or 200 milliamps for ten hours, or 20 milliamps for a hundred hours. The relationship is linear at its core: Time = Capacity / Current. If you load a 1,000 mAh cell with a 500 mA draw, you'd expect two hours of runtime. This basic version of the calculation is what most online calculators give you, and it is consistently optimistic. Here's why.
Why Does Efficiency Matter and What Causes Losses?
No battery delivers 100% of its rated energy to your circuit. Several physical processes eat into that number before a single electron reaches your load.
Internal resistance is the primary culprit. Every battery cell has some resistance to current flow inside it. When current moves through this resistance, it generates heat โ and that heat is energy leaving the system as waste rather than powering your device. A lithium-ion cell in good condition might have 50โ150 milliohms of internal resistance. An aging or cold cell can exceed 500 milliohms. At a 1A draw, a 150 mฮฉ cell wastes 0.15 watts as heat โ that adds up over hours.
DC-DC converter losses compound this further. Most devices don't run directly from the battery terminal voltage. They use a voltage regulator or DC-DC converter (buck or boost) to step the voltage to the level the microcontroller or circuit needs. These converters are typically 80โ95% efficient. Every conversion costs you energy. A device running at 3.3 V powered by a 3.7 V lithium cell through an 85% efficient regulator loses 15% of the energy before it even does any useful work.
Temperature effects reduce available capacity significantly. A lithium-ion cell rated at 2,000 mAh at 25ยฐC may only deliver 1,600 mAh at 0ยฐC โ an 80% derating. In cold field environments, this is a critical factor. Conversely, operating at high temperatures accelerates capacity fade over time, permanently reducing what the battery can deliver in future cycles.
The efficiency percentage you enter in the calculator (commonly set at 85% as a reasonable real-world default) bundles all these losses together into one correction factor. If you know your converter's datasheet efficiency and you're operating under controlled conditions, use that number. If you don't know, 80โ88% is a safe conservative range for lithium-based systems.
What Is the Discharge Factor and Why Can't You Use 100% of a Battery?
The discharge factor (also called depth of discharge, or DoD) represents how deeply you actually drain the battery before recharging. This is distinct from efficiency โ it's a design decision about where you set the low-voltage cutoff.
Lithium-ion cells have a nominal voltage of 3.6โ3.7 V and are considered fully charged at 4.2 V per cell. At roughly 3.0 V, the cell is considered discharged. However, repeatedly draining a lithium cell to 3.0 V dramatically shortens its cycle life. A cell taken to 100% DoD every cycle might last 300โ400 cycles. The same cell taken to only 80% DoD routinely exceeds 800โ1,000 cycles. At 50% DoD it can exceed 2,000 cycles.
This is why quality battery management systems (BMS) build in a cutoff voltage higher than the absolute minimum. Your device shuts off or the BMS disconnects the cell before it's truly empty. The discharge factor of 0.80 in the calculator means you're using 80% of the available charge โ which is a realistic, battery-preserving default for most lithium systems. Lead-acid batteries are even more sensitive: discharging below 50% DoD (factor 0.5) significantly shortens their lifespan, which is why lead-acid backup systems are often oversized.
For a quick sense of what different DoD values mean in practice: IoT sensors on remote deployments often target 70โ75% DoD to maximize cell longevity over years of unattended operation. Consumer electronics target 80โ90% because the user recharges frequently. Emergency lighting systems using lead-acid may be set to 50% to guarantee multi-year service life without maintenance.
Putting It All Together: The Complete Formula
The correct formula that accounts for both efficiency and discharge factor is:
Runtime (hours) = [Capacity (mAh) ร (Efficiency / 100) ร Discharge Factor] / Load Current (mA)
Let's work a practical example. You're designing a wireless sensor node with these parameters: 3,000 mAh lithium cell, average current draw of 18 mA (including sleep cycles), 83% system efficiency, 0.80 discharge factor.
Step 1: Find usable mAh after efficiency loss โ 3,000 ร 0.83 = 2,490 mAh.
Step 2: Apply discharge factor โ 2,490 ร 0.80 = 1,992 mAh available to the load.
Step 3: Divide by current โ 1,992 / 18 = 110.7 hours, or roughly 4 days 14 hours.
The naive calculation (3,000 / 18 = 166.7 hours) would have led you to expect almost 7 days โ badly overestimating field life and potentially causing the device to fail in deployment because you under-specified the battery size.
What About Load That Isn't Constant?
Most real devices don't draw a steady current. A microcontroller might sleep at 10 ยตA but spike to 150 mA during radio transmission. The right approach is to calculate the average current weighted by time in each state. If your device transmits for 100 ms every 5 seconds at 120 mA and sleeps at 0.5 mA the rest of the time:
Active fraction = 0.1 s / 5 s = 0.02 (2%). Average current = (0.02 ร 120) + (0.98 ร 0.5) = 2.4 + 0.49 = 2.89 mA average. Use this 2.89 mA as your load current in the calculator. This averaged approach is accurate as long as the duty cycle is consistent.
Common Mistakes When Estimating Battery Life
The single most common mistake is ignoring quiescent current from voltage regulators, protection ICs, and always-on peripherals. These small but constant draws โ often in the 50โ500 ยตA range โ are frequently omitted from current estimates and can cut expected runtime by 30โ50% in low-power designs.
The second mistake is using the battery's rated capacity without accounting for age. A lithium cell loses roughly 20% of its capacity after 500 full cycles, and consumer-grade cells often start below their rated capacity. A conservative 10โ15% derating on the rated capacity is sensible for systems that need guaranteed minimum runtime.
The third is forgetting that capacity ratings are typically given at a specific discharge rate, called the C-rate. A cell rated at 2,000 mAh at 0.2C might only deliver 1,800 mAh at 1C (a higher discharge rate). At very high rates (2C or more), lithium cells can lose 20โ30% of their rated capacity due to internal resistance effects. For high-drain applications like motors or radio transmitters with peak currents, this matters.
Using this calculator correctly โ with honest efficiency and a conservative discharge factor โ will give you estimates that match field performance rather than lab ideal conditions. That's the difference between a product that ships and one that gets returned.