Battery & Power Calculator

Battery Runtime Calculator

Estimate how long a battery will last under a given load. Enter battery capacity and either load current or load power to get runtime, current, power, and total energy.

DC Circuit with Battery and Load

V+BatteryRLoadIP = V×I

Known Parameters

Ah

Total charge capacity of the battery

A

Input known load current value

V

Optional (default 12V)

Engineering Tip

Battery capacity is often specified at a 20‑hour discharge rate. At higher currents, the usable capacity decreases due to internal resistance – this is known as Peukert's effect.

Battery & Load Parameters

Runtime

20.00 h

Current

5.00 A

Power

60.00 W

Energy

1,200.00 Wh

Governing Formula

Runtime = C / I
CAh

Capacity

IA

Current

Governing Formula

Energy = C × V
CAh

Capacity

VV

Voltage

Engineering Code

Python
def battery_runtime(mode, capacity_Ah, second_val, voltage_V=None):
    if capacity_Ah <= 0 or second_val <= 0:
        raise ValueError('Inputs must be strictly positive.')
    if mode == 'CI':
        current_A = second_val
        voltage = voltage_V if voltage_V and voltage_V > 0 else 12.0
    else:  # CP
        if not voltage_V or voltage_V <= 0:
            raise ValueError('Voltage required for Power mode.')
        voltage = voltage_V
        current_A = second_val / voltage
    runtime_h = capacity_Ah / current_A
    power_W = voltage * current_A
    energy_Wh = capacity_Ah * voltage
    return {'runtime_h': runtime_h, 'current_A': current_A,
            'power_W': power_W, 'energy_Wh': energy_Wh}

res = battery_runtime('CI', 100, 5, 12)
print(f"Runtime: {res['runtime_h']:.2f} h")
print(f"Current: {res['current_A']:.2f} A")
print(f"Power: {res['power_W']:.2f} W")
print(f"Energy: {res['energy_Wh']:.2f} Wh")

Technical Explanation: Battery Runtime and Energy

Battery runtime estimation is a fundamental task in electrical system design, backup power planning, portable electronics sizing, and renewable energy storage analysis. The core relationship is straightforward: runtime equals available charge divided by discharge current. However, accurate predictions require understanding battery capacity ratings, load characteristics, energy versus power, and real-world derating factors such as the Peukert effect, temperature dependence, and conversion losses. This calculator provides deterministic estimates for DC systems based on idealized assumptions, with clear guidance on practical adjustments.

Governing Formulas: Charge, Current, and Energy

For a constant-current DC load, the theoretical runtime (t) in hours is:

t (h) = Capacity (Ah) / Load Current (A)

Battery capacity is typically specified in ampere-hours (Ah) or milliampere-hours (mAh), where 1 Ah = 1,000 mAh. This represents the total electric charge the battery can deliver under defined test conditions (often a 20-hour discharge rate for lead-acid, or C/5 to C/20 for lithium-ion).

When the load is specified in power (P, watts) rather than current, the discharge current is obtained from the DC power relationship:

I (A) = P (W) / V (V)

Substituting into the runtime equation:

t (h) = Capacity (Ah) × V (V) / P (W) = Energy (Wh) / Power (W)

The total energy stored in the battery (E) in watt-hours is:

E (Wh) = Capacity (Ah) × Nominal Voltage (V)

For example, a 12 V, 100 Ah lead-acid battery stores approximately 1,200 Wh (1.2 kWh) of energy. At a constant 100 W load, the idealized runtime is 1,200 Wh / 100 W = 12 hours.

Input Parameters and Physical Meaning

Each input to this calculator corresponds to a measurable electrical property:

  • Battery capacity (Ah): The rated charge capacity at a specified discharge rate. Common values: 1.5–3 Ah for 18650 Li-ion cells, 50–200 Ah for automotive or deep-cycle lead-acid batteries.
  • Battery voltage (V): Nominal terminal voltage (e.g., 3.7 V for Li-ion, 12 V for lead-acid, 48 V for telecom/UPS systems). Required for power-mode calculations and energy estimation.
  • Load current (A): The steady DC current drawn by the load. Typical values: 0.5–2 A for LED lighting, 5–15 A for automotive accessories, 10–100+ A for inverters or motor drives.
  • Load power (W): The rate of energy consumption. For resistive DC loads, P = V × I. For inverter-fed AC loads, include inverter efficiency (typically 85–95%).

Common mistakes include confusing mAh with Ah (divide mAh by 1,000), using peak power instead of average power for intermittent loads, or neglecting inverter losses when sizing batteries for AC appliances.

Engineering Interpretation of Results

The computed quantities serve distinct roles in system design and verification:

  • Runtime (h): Estimated operating duration before the battery reaches its cutoff voltage. Used for backup time sizing (e.g., UPS, emergency lighting, telecom standby).
  • Load current (A): Determines conductor sizing, fuse/breaker selection, and connector ratings per ampacity tables (e.g., NEC, IEC 60364).
  • Load power (W): Total energy consumption rate. Combined with runtime, yields total energy demand (Wh) for generator or solar array sizing.
  • Energy (Wh): Total stored energy. Useful for comparing batteries of different voltages and capacities on an equal energy basis.

Note that this calculator assumes constant current or power discharge. Real loads may be intermittent, variable, or pulsed (e.g., motor startups, radio transmit/receive cycles), requiring time-weighted average current or energy integration for accurate runtime prediction.

Units and Unit Conversion

This calculator operates in standard SI-derived electrical units:

  • Capacity: ampere-hours (Ah); 1 Ah = 1,000 mAh
  • Voltage: volts (V)
  • Current: amperes (A); 1 A = 1,000 mA
  • Power: watts (W); 1 kW = 1,000 W
  • Energy: watt-hours (Wh); 1 kWh = 1,000 Wh
  • Runtime: hours (h); convert to minutes by multiplying by 60

Key conversions: 1 Wh = 3,600 joules (J); 1 Ah at 1 V = 3,600 C (coulombs). For battery packs, series connections increase voltage (Vtotal = n × Vcell), while parallel connections increase capacity (Ahtotal = m × Ahcell).

Assumptions and Limitations

The theoretical runtime produced by this tool relies on several explicit assumptions:

  • Constant discharge: Load current or power is steady over time. Intermittent or pulsed loads require duty-cycle averaging.
  • Ideal capacity: Battery delivers its full rated Ah at the specified discharge rate. Real capacity decreases at higher currents (Peukert effect).
  • Constant voltage: Terminal voltage remains at nominal value throughout discharge. Actual voltage declines with state of charge and load current.
  • No efficiency losses: DC-DC converters, inverters, wiring resistance, and battery internal resistance are neglected. Typical system efficiency: 85–95% for inverters, 90–98% for DC-DC converters.
  • Standard temperature: Capacity ratings assume 20–25°C. Cold temperatures (e.g., 0°C) can reduce lead-acid capacity by 20–40%; lithium-ion is less affected but still derated.
  • Healthy battery: Assumes new or well-maintained cells. Aged batteries with increased internal resistance or sulfation (lead-acid) deliver reduced capacity.

For critical applications (medical devices, emergency systems, off-grid power), apply a safety margin of 20–30% to the calculated runtime or consult manufacturer discharge curves.

Peukert's Effect and High-Rate Discharge

Lead-acid and some other battery chemistries exhibit capacity reduction at high discharge currents, described empirically by Peukert's law:

t = C / In

where C is the rated capacity at a reference current, I is the actual discharge current, and n is the Peukert exponent (typically 1.1–1.3 for lead-acid, close to 1.0 for lithium-ion). For example, a 100 Ah battery rated at 5 A (20-hour rate) with n = 1.25 will deliver only about 74 Ah at 20 A discharge, reducing runtime from the idealized 5 hours to approximately 3.7 hours.

This calculator does not apply Peukert correction. For lead-acid batteries at discharge rates significantly above the C/20 rating, reduce the effective capacity by 10–30% or use manufacturer-provided discharge tables.

Practical Engineering Applications

Typical applications of this battery runtime calculator include:

  • Uninterruptible power supplies (UPS): Sizing battery banks to provide specified backup time for servers, networking equipment, or critical loads.
  • Portable electronics: Estimating operating time for handheld devices, drones, robotics, and field instruments powered by Li-ion or NiMH packs.
  • Automotive and marine: Evaluating accessory loads (lights, pumps, inverters) against alternator charging and battery capacity to prevent deep discharge.
  • Renewable energy: Sizing off-grid battery storage for solar or wind systems based on daily energy consumption and desired autonomy days.
  • Emergency systems: Verifying runtime for exit lighting, fire alarm panels, and communication equipment per code requirements (e.g., NFPA 110, 72).

Real-World Engineering Cases

Car Battery with Headlights

A 60 Ah, 12V car battery powers two headlights that draw 5 A each (total 10 A). The expected runtime is 60 Ah / 10 A = 6 hours. However, if the alternator fails, the battery may only last 5‑6 hours with all lights on, but the driver might not notice until the engine won't start.

Engineering Lesson

Always account for the total current draw of all loads. A battery's actual capacity can be lower at high discharge rates (Peukert effect).

Power Bank Charging a Smartphone

A 10,000 mAh (10 Ah) power bank with a 5V output charges a phone that consumes 5W. The current is 5W / 5V = 1A. The theoretical runtime is 10Ah / 1A = 10 hours. In practice, conversion losses reduce it to about 8‑9 hours.

Engineering Lesson

Include efficiency losses when calculating real‑world runtime. Use a safety margin of 10‑20%.

Frequently Asked Questions

How is battery runtime calculated?

Runtime (in hours) is calculated by dividing the battery capacity (in ampere‑hours) by the load current (in amperes). If you only know the load power, you first compute the current using I = P / V, then divide the capacity by that current.

What is the difference between Ah and Wh?

Ah (ampere‑hour) measures electric charge, while Wh (watt‑hour) measures energy. The relationship is: Wh = Ah × Voltage. For example, a 12V, 100Ah battery stores 1200Wh of energy.

Why does actual runtime differ from calculated?

Real‑world factors include: Peukert's effect (capacity decreases at high discharge rates), temperature, battery age, and conversion losses in power electronics. Always add a safety margin of 20‑30% for critical applications.