I trying to track power usage on different circuits. I walk into things not seeing how complicated it gets.
I'm measuring current and voltage so I can get the power by V * I / Time. Then accumulate the power and time.
I'd like to be able to view this data in a chart over an hourly period, 24 hour and weekly.
There is the complicated part.
How do I do the data logging?
- How fast should the power readings be to have acceptable accuracy? (500ms? 2 sec?)
- It's on an esp32. I multiply the float value current and voltage by 1000 so integer maths can be used. Do I need to be concerned about the accumulated values overflowing a 64bit int?
- I could use a high power raspberry pi with influxdb to dump the times series data in but it's on a boat so I want to limit power consumption. I believe a pi zero is pretty weak for the influxdb task. No cloud connection either.
- Do I keep a bunch of arrays the different time intervals? (60 floats for one hour, 48/day) Updating becomes messy.