Can anyone suggest a way that I would be able to get a readout (perhaps with a 1-wire sensor) of the remaining power as a percentage of an 80Ah marine battery on my computer? I'd like to be able to monitor it using Girder. I plan on expanding the system to an array at some point and I would like to be able to trigger events when the power drops below a certain level.
Thanks for any inspiration!
Measuring remaining battery capacity isn't such an easy task. It is easiest when the current draw on the battery is consistent. You can monitor the battery voltage, and monitor that over time until whatever the device connected uses up enough of the capacity to not perform it's job (ie: a light is too dim for usage or a motor stops running at a normal speed).
There are issues of "surface charge" which means the battery doesn't have much capacity, but the voltage is still high.
The voltage should be taken under it's normal load for a more accurate determination. In car lingo, this would be "cranking voltage".
The other issue is that over time a battery looses capacity. Dependent on battery type, this can be caused due to sulfation of the cells. So your percentage indicator would have to compensate for this reality.
You could monitor both voltage AND current for best indication. This would be over time and with some math of the amperage times the voltage (over time), would give a better indication of how much battery is left, if the current draw isn't always consistent.
If the load isn't all the time (like a PC UPS that isn't on charge all the time), then the time sitting between charges depletes the available juice.
Will the battery be charged on a regular basis? Or just after it has been totally depleted? Yet another factor.