I've got some solar panels that charge a lead acid battery via a cheap solar charge controller. This battery then runs some low voltage items in the house, such as the router, a Pi based NAS and soon a few lights.
I've also got an emergency backup that cuts in if the battery voltage drops below 11.5 volts, to charge the lead acid battery by mains until it reaches 11.9 volts. This prevents battery damage by over-discharge and avoids things cutting out due to under voltage.
This is all done with cheap module circuits from ebay, and works well. Uptime is close to 100% even through winter. But I notice that the backup system is constantly switching on because the battery voltage is low.
As part of monitoring and diagnosis, I'd like to log the battery voltage over time.
Is there a module, or simple circuit I might build, that will reliably and safely measure the voltage of a lead acid battery (9 - 15 volt range in extremis) so that I might read the voltage in a simple bash or python script that might sample every 5, 10, 30 minutes etc?
A bonus would be if it could measure the current flowing into and out of the battery, but that may well over complicate what I want to know