TryChange Active time per cycle (s) and Sleep interval (s), then press Calculate.
ObserveCompare Without Sleep Mode, With Deep Sleep, and Average current draw after pressing Calculate.
ExplainExplain why weighting current by its share of the cycle changes battery life after pressing Calculate.
Technical boundaries. Battery life is battery capacity divided by average current draw. The model weights active and sleep currents by their shares of the cycle.
TipPutting Numbers to It
Average current depends on how long the device spends active and asleep, as well as the current in each state. Weight each current by its share of the cycle to estimate battery life. Context: ESP32 deep sleep with 5-minute timer wakeup for battery-powered sensor. Comparing active vs sleep power.
Formula: Battery life = Average current draw (mA)Battery capacity (mAh)
Worked example: 2,000 mAh battery. Without sleep: Active 100 mA continuously = 1002000=20 hours. With deep sleep: Active 100 mA for 10 s every 5 min (96.7% sleep at 10 µA). Average: (100 mA×30010)+(0.01 mA×300290)=3.33+0.0097≈3.34 mA. Battery life: 3.342000≈600 hours = 25 days (30× improvement).
viewof battery_capacity = Inputs.range([500,5000], {value:2000,step:100,label:"Battery capacity (mAh)"})viewof active_current = Inputs.range([10,200], {value:100,step:5,label:"Active current (mA)"})viewof active_time = Inputs.range([1,60], {value:10,step:1,label:"Active time per cycle (s)"})viewof sleep_interval = Inputs.range([60,3600], {value:300,step:60,label:"Sleep interval (s)"})viewof sleep_current = Inputs.range([0.001,1], {value:0.01,step:0.001,label:"Sleep current (mA)"})