BysMax
Menu

Battery Life Calculator

Estimate how many hours a battery will last based on capacity (mAh) and current load. Free online battery runtime calculator.

Battery Life Calculator

Estimate how many hours a battery will last based on capacity (mAh) and current load. Free online battery runtime calculator.

This battery life calculator estimates how many hours, days, or weeks your device will run on a given battery capacity. Useful for Arduino, ESP32, IoT sensors, and any portable electronics project.


How to Calculate Battery Life

Battery capacity is measured in milliampere-hours (mAh) or ampere-hours (Ah). A 2000 mAh battery can theoretically deliver:

  • 2000 mA for 1 hour, or
  • 1000 mA for 2 hours, or
  • 100 mA for 20 hours

In practice, batteries lose capacity due to internal resistance, temperature, and discharge rate effects. A real-world efficiency factor accounts for this.


Battery Life Formula

Battery life (h)=Capacity (mAh)Current draw (mA)×η\text{Battery life (h)} = \frac{\text{Capacity (mAh)}}{\text{Current draw (mA)}} \times \eta

Where:

  • Capacity — rated battery capacity in mAh
  • Current draw — average current consumed by the device in mA
  • η (efficiency factor):
    • 0.70 — alkaline batteries (conservative, recommended for design)
    • 0.80–0.85 — Li-ion / LiPo cells at room temperature
    • 0.90+ — high-quality LiPo cells with good BMS

Step-by-Step Example

Project: IoT temperature sensor (Arduino + ESP32 in light sleep), powered by an 18650 Li-ion cell (2600 mAh). Average current draw: 45 mA. Efficiency factor: 0.80.

Battery life=260045×0.80=57.78×0.8046.2hours\text{Battery life} = \frac{2600}{45} \times 0.80 = 57.78 \times 0.80 \approx 46.2\,\text{hours}

46.2h÷241.9days46.2\,\text{h} \div 24 \approx 1.9\,\text{days}

The sensor runs for about 1.9 days before recharging.


Current Draw Reference for Common Devices

Device / ModeTypical Current
Arduino Uno (active)40–50 mA
Arduino Uno (sleep)~6 mA
ESP32 (WiFi active)80–240 mA
ESP32 (light sleep)~0.8 mA
ESP32 (deep sleep)~10 µA
Raspberry Pi Zero 2W100–350 mA
HC-SR04 ultrasonic~15 mA
DHT11 sensor~2.5 mA
SG90 servo (idle)~6 mA
LED (standard)10–20 mA
4G/LTE module (transmit)500–2000 mA

How to Extend Battery Life

The biggest gains come from reducing average current draw, not from using larger batteries:

  1. Deep sleep — ESP32 drops from 80 mA to 10 µA in deep sleep. With a 5-minute wake cycle, average current ≈ 0.03 mA → battery life from hours to months.
  2. Duty cycling — Power sensors only when measuring. A DHT11 measuring once per minute uses 0.004 mA average vs. 2.5 mA continuous.
  3. Lower clock speed — Halving CPU frequency roughly halves dynamic power consumption.
  4. Switch regulators — LDO regulators (like LM7805) waste input-output voltage as heat. Buck converters (like LM2596) are 85–95% efficient.
  5. Remove LEDs — Indicator LEDs draw 10–20 mA constantly. For field devices, disable them.

Battery Types Comparison

TypeEnergy DensityRechargeableBest For
Alkaline AA~2500–3000 mAhLow-drain devices, disposable
NiMH AA~2000–2800 mAhMedium drain, rechargeable
18650 Li-ion~2500–3500 mAhHigh drain, compact projects
LiPo (flat)~100–10000 mAhDrones, wearables, slim devices
LiFePO4~1500–3000 mAhLong cycle life, safer chemistry
9V alkaline~565 mAhLow-power only (misleading "big" appearance)

9V batteries are often a poor choice for Arduino projects. Their actual mAh is low (~565 mAh), the LDO on the Arduino wastes voltage as heat, and effective runtime is much shorter than a single AA battery.


Frequently Asked Questions

How do I measure the actual current draw of my device?

Use a multimeter in series with the power supply — set it to mA or µA range. For accurate average current on duty-cycled devices, use a Nordic PPK2 (Power Profiler Kit) or a μCurrent adapter with a scope.

What is the Peukert effect?

At high discharge rates, batteries deliver less total energy than their rated capacity suggests. A battery rated at 2000 mAh at a 0.2C rate (400 mA) may only deliver 1700 mAh at a 1C rate (2000 mA). The efficiency factor η in the formula partially accounts for this.

Does cold temperature affect battery life?

Yes significantly. Li-ion capacity can drop 20–40% at 0°C and 50%+ at −20°C. Alkaline batteries are worse — they can lose 75% capacity at freezing temperatures. For cold environments, insulate the battery or use LiFePO4 chemistry, which is more temperature-stable.

How many mAh does an 18650 cell actually have?

Quality cells (Samsung, LG, Panasonic/Sanyo) deliver 2500–3500 mAh. Cheap unbranded cells claiming 9800 mAh are counterfeit — typically contain 800–1200 mAh actual capacity. Stick to name-brand cells from reputable suppliers.

Plan Project Autonomy

Useful for IoT projects, remote sensors, and portable battery-operated devices.

Frequently Asked Questions

How do I calculate battery life?
Battery life can be estimated by dividing the battery's capacity by the average current load. The formula is: Battery Life (hours) = Capacity (mAh) / Current (mA).
What is battery capacity (mAh)?
Capacity, measured in milliampere-hours (mAh) or ampere-hours (Ah), indicates how much electrical charge a battery can store. For example, a 2000mAh battery can provide 2000mA for one hour, or 1000mA for two hours.
Why doesn't the battery last exactly as calculated?
Real-world battery life is affected by factors like temperature, battery age, discharge rate (Peukert's Law), and the efficiency of the device's voltage regulator. It's recommended to multiply the result by a 0.7 efficiency factor.

Related Tools & Links

Click to load comments