I feel silly that I don't know this, but after quite a bit of Googling and searching the forum, I haven't been able to find the correct formula or steps needed to calculate the average current of a project.
I have a microcontroller which draws 4uA in Hibernate mode. It stays in this mode for almost the whole time. Every minute, it wakes up and measures a sensor, which takes about 100 milliseconds. During this time it draws about 5mA. Then it goes back into hibernation. Every 15 minutes, it wakes up, takes the past 15 measurements, and connects to the internet to upload them. During this stage, it draws about 180mA for about 3 seconds.
My question is, how do I calculate the average current? This project will be running off of a 1200mAh battery and I'm curious to do some calculations.
Is it as simple as adding up all the instantaneous currents and dividing by the number of minutes? That feels really wrong to me, it must be more complex than that.
Any and all help would be much appreciated! It could be as simple as I'm not Googling the correct search terms, but I've been trying to find "calculate average current" and "average current draw" but it usually directs me to RMS calculations, which are not what I'm looking for.
Edit: after a bit more searching... is it as simple as
4uA + ((12/3600) * 180mA) + ((6/3600) * 5mA)
Then take that result and divide by 1200mAh to figure out the time?