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 depends on two key factors: the battery’s capacity (usually given in ampere‑hours, Ah) and the current drawn by the load. The fundamental relation is:

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

If you know the load power (W) and the battery voltage (V), you can first find the current using I = P / V and then calculate the runtime.

Key Concepts

  • Capacity (Ah): The total charge a battery can deliver at a given discharge rate. Common units: Ah (ampere‑hours) or mAh (milliampere‑hours).
  • Load Current (A): The steady current drawn by the circuit.
  • Load Power (W): The rate of energy consumption. For DC circuits, P = V × I.
  • Energy (Wh): The total energy stored in the battery, calculated as Capacity (Ah) × Voltage (V).

How to Use the Battery Runtime Calculator

  1. Select mode: Choose whether you know the load current or the load power.
  2. Enter battery capacity in ampere‑hours (Ah).
  3. Enter the load value (current in amperes or power in watts).
  4. Enter the battery voltage (required for power mode, optional for current mode – defaults to 12V).
  5. The calculator instantly shows runtime, current, power, and energy.

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.