I’m trying to calculate how long (hours) my battery would last with an arduino Uno. Considering the following example of an arduino connected to a 5000 mAh Lipo battery:
During day 1 and 2:
wakes up, collects temperature data (uses 18 mAh) during 2 seconds
records the data to an SD card (uses 25 mAh) during 3 seconds
goes to sleep (0.14 mAh) during 500 seconds
During 3 through 5, the arduino does the following:
collects temperature data (uses 18 mAh) during 2 seconds
saves data to memory (uses 20 mAh) during 2 seconds
goes to sleep (0.14 mAh) during 500 seconds
wakes up, collects temperature data (uses 18 mAh) during 2 seconds
records the data to an SD card (uses 25 mAh) during 3 seconds
goes to sleep (0.14 mAh) during 500 seconds
My question is: how can I estimate how long will my battery last using my arduino?
Batteries are rated in mAh (milliamp-hours). Work out how many milliamp-seconds are used by your system in each cycle, convert to mAh, multiply by how many cycles occur per hour and divide by the battery capacity - then you will have your answer.
Thanks MorganS... could you give me an example on how to approach this? I'm also confused on how to account for the changes taking place in the 2nd part of the arduino behavior (e.g.: days 11 through 20)...
If you plan to do this more than a few times you should assume that the actual battery capacity is significantly lower than the sticker claim - 50% would probably be safe.
You might add a small battery monitor in your sketch using a voltage divider 2x 1M -> analogRead() to see if/when the voltage drops.
the 2M resitors would give an additional current of 2.5 uA ~ 1.25 mAh in 20 days, quite neglectable
However the Arduino would run for an extra few milliseconds too