Battery Life Calculator
Estimate battery life for Arduino, ESP32, and IoT devices.
How the Battery Life Calculator works
The battery life calculator estimates the runtime of battery-powered electronics projects by dividing battery capacity (mAh) by average current consumption (mA). It supports common battery types (18650, LiPo, AA, AAA, coin cell) and device presets for Arduino, ESP32, nRF52840, and Raspberry Pi — a must-have tool for IoT product designers optimising power budgets and field-deployable sensor nodes.
The basic mAh ÷ mA formula
Runtime in hours = battery capacity (mAh) / average current (mA). A 2,000 mAh LiPo powering a 50 mA device lasts 40 hours. However, this is the theoretical maximum — real-world runtime is lower due to battery self-discharge, internal resistance losses at high currents, and the fact that most batteries cannot be discharged below a safe minimum voltage (typically 3.0 V for Li-ion).
Depth of discharge and practical capacity
Li-ion and LiPo cells should not be discharged below 80% of rated capacity in regular use to preserve cycle life — this is the depth of discharge (DoD) factor. A 2,000 mAh cell at 80% DoD delivers only 1,600 mAh practically. For lead-acid batteries, DoD is often limited to 50%. The calculator applies a DoD factor to the nominal capacity so the estimated runtime reflects real-world battery life rather than the theoretical maximum.
IoT deep-sleep optimisation
IoT devices on batteries achieve dramatically longer life through duty cycling. An ESP32 drawing 160 mA while active for 1 second, then 10 µA in deep sleep for 59 seconds, has an average current of only (160×1 + 0.01×59)/60 = 2.68 mA — running 750+ hours on a 2,000 mAh cell. The calculator's duty cycle mode accepts active and sleep current with on/off durations to compute the true average current for intermittent-operation devices.
Peukert effect for high-drain applications
At high discharge rates, batteries deliver less than their rated capacity due to the Peukert effect — a non-linear relationship between discharge rate and capacity. A battery rated at C/10 (10-hour discharge) may deliver only 70% of that capacity at C/1 (1-hour discharge). The Peukert exponent for lead-acid is 1.2–1.4; for Li-ion it is close to 1.0–1.05. The calculator applies this correction for high-current applications like motor drivers.
Frequently asked questions
- How is battery life calculated?
- Battery life = (Battery capacity × efficiency) ÷ average current draw. For example, a 2000mAh battery powering a 50mA device at 85% efficiency = 34 hours.
- Why does efficiency matter?
- Voltage regulators and DC-DC converters are not 100% efficient. A linear regulator stepping down from 5V to 3.3V wastes ~34% . DC-DC converters are typically 80–95% efficient. Always account for this when calculating battery life.
- How do I extend battery life?
- Use deep sleep modes (ESP32 deep sleep: 10µA vs 240mA active), reduce polling frequency, lower transmit power, use efficient regulators, and only power peripherals when needed.
Related tools
- Resistor Color Code Calculator
Decode resistor color bands. Supports 4-band and 5-band.
- Ohm's Law Calculator
Calculate voltage, current, resistance, or power using Ohm's Law.
- Voltage Divider Calculator
Calculate output voltage for a resistor voltage divider.
- 555 Timer Calculator
Calculate frequency, duty cycle, and timing for 555 timer circuits.
- CRC Calculator Online — CRC-8, CRC-16, CRC-32 & Modbus
Calculate CRC checksums online — CRC-8, CRC-16/MODBUS, CRC-16/CCITT, CRC-32, CRC-32C and more. Shows HEX, DEC and BIN. Supports text and hex input. Browser-only, no upload.