How to monitor 12 Battery with microcontroller?

Thread Starter

french_guy

Joined Apr 16, 2009
42
How can I simply monitor battery voltage (12V deep cycle battery) with a microcontroller that has 0-5V only ADC?
Well, actually I want to use the microcontroller to monitor the battery voltage and prevent a sump pump to run if the voltage is too low (I don’t want to damage the battery with a too deep discharge….)
Kind of a low-voltage battery cut-off.......
 

absf

Joined Dec 29, 2010
1,968
I would use a LM393 voltage comparator to compare the battery voltage with a reference voltage from TL431. Output from comparator would operate a relay to cut off the battery from the load.

But if you like to use a micro, I'll pick 12F675 which has an ADC built-in.

Allen
 

Brownout

Joined Jan 10, 2012
2,390
A 12V battery can put out almost 14V when fully charged. Therefore, use a 3:1 or 4:1 divider to make sure you have the voltage down below 5V. You can use a 10K and 3.3K resistro divider, for example. After converting the voltage, multiply the result by 4 to convert it back to the correct voltage.

I have the exact same project in the works. I want to use a UC to monitor a battery and cut off the load when the battery gets low. But I'm using a 3.3V uC so I need more voltage division. I'm also monitoring the current and calculating the amp-hours. Anyway, you're going in the right direction.
 

ErnieM

Joined Apr 24, 2011
8,377
One thing to realize before it bites you is the battery voltage WILL rise as soon as you turn the pump off... so you need a different, larger voltage to turn it back on.

Generally it's called hysteresis, which means you want the comparator (or program reading the D2A) to be hysterical.
 

Thread Starter

french_guy

Joined Apr 16, 2009
42
One thing to realize before it bites you is the battery voltage WILL rise as soon as you turn the pump off... so you need a different, larger voltage to turn it back on.

Generally it's called hysteresis, which means you want the comparator (or program reading the D2A) to be hysterical.
In that case, the monitoring of the battery should be done when the pump is ON, and not when it's OFF. Thus I will have real voltage measure of the battery under load
 
Top