How it works
Battery life dies in the wake-ups, not the sleep. Enter the sleep current in microamps, then the current the device draws while awake and transmitting, how long each wake lasts, and how often it happens per hour. The average current combines both, and capacity divided by average current is the honest lifetime, before temperature and battery aging take their share.
Formula
Life (hours) = capacity (mAh) / average current.
Example
Example in plain words. A 2000 mAh cell, 10 microamps in deep sleep, waking to 80 mA for 2 seconds, 6 times an hour.
Average current: 0.276667 mA.
Life: 7,228.915663 hours, that is 301.204819 days.
Frequently asked questions
Why is the real life shorter than this?
Batteries lose capacity in the cold, radio spikes exceed the average, and self-discharge takes a few percent a month. Treat this number as the ceiling and plan around 70 percent of it.
How do I make it longer?
Wake less often and transmit faster: the radio is the most expensive millisecond on the board. A wake-up budget usually beats a bigger battery.