Page 1 of 1

Pi for battery monitor with low voltage switch

Posted: Tue Aug 23, 2016 10:20 pm
by Iantull
Hi, I have several model Pi's available to me to use and wish to look at using one of them as a 12v battery monitor/charger control.
What I want to do is to be able to monitor the battery voltage and when it drops to a predefined level have the Pi be able to turn on an external relay for a pre-defined period of time, but I also want to be able to log the event, containing time/date that the event occurred.

Some details for this project.
Currently I have an external intelligent charger, so 7 level charging down to float and monitoring that turns on 3 times a week using a time clock to charge the bank, but seeing as the equipment attached is not always on and drawing power it does not always need this amount of charging, it could possibly go for a couple of weeks without any charging, so I am trying to minimize the amount of grid power draw from the charger.

If anyone know of a project similar to this that has already been done I would appreciate any help to point me in the right direction.

Regards
Ian

Re: Pi for battery monitor with low voltage switch

Posted: Tue Aug 23, 2016 10:37 pm
by davidcoton
If you just want to start your existing charger when the battery needs it, it's not a difficult project. You will either need an A2D converter, or design a simple hardware voltage operated switch in hardware, to trigger a GPIO input. Use a GPIO output to control the relay. (If that is switching mains, get a ready-built module to minimise the amount of mains design and build you have to do.) Apart from the logging, you hardly need a Pi.

Along the way, consider the power used (unnecessarily) in your current setup, and compare the power used by running a Pi 24/7. You might not save much, if anything.

As a side note, early in my engineering career we were building a microprocessor-based project that needed battery backup. One of the cost reduction ideas was to remove the expensive linear charger, replacing it with a simple transistor switching element. Our processor (6800 series) had an A2D with a spare multiplexed input to monitor the battery, this controlled the power transistor via PWM. The power transistor was either on or off, so wasted little power as heat. The problem was that no-one -- including the battery manufacturers -- knew how the batteries would behave. So I had a 7-day mechanical timer switching the charger on and off, a battery, voltage logger, and a fixed load on my workbench for several weeks to see if it survived. IIRC I left before the results were conclusive.

Re: Pi for battery monitor with low voltage switch

Posted: Tue Aug 23, 2016 10:51 pm
by Iantull
Thanks for the reply, yes I should have said that the Pi would run from a separate battery bank that is currently solar charged and has a few micro's attached and has the capacity to run the micro's for several weeks without Sun. Yes I would be using the current charger and just switching it and have worked out the time to keep it on for to allow a full charge plus a bit extra and I already have a 5 volt relay controlled mains switch available. Again the only reason for using the Pi was really the logging and I have internet at the site so I can remotely get to the log, or just email out once week, but this would be something I can look at separately.

I suppose for me it will be the programming as I am not that comfortable with doing things from scratch, but again I may be able to find some code that will give me close to what I want and modify it.

Regards
Ian