Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Measuring Voltage of a Lead Acid Battery...

Status
Not open for further replies.

hawk1943

Member level 3
Joined
Jun 14, 2010
Messages
62
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
United Kingdom
Activity points
1,859
Hi There,

Can anyone offer us some words of advice...

Basically I'm working on a project that needs to be run off a 12V car battery as standard AA batteries might not last long enough...

But I wish to use the AA batteries as a back up supply in case the Lead Acid Battery runs out half way through the experiment...

So what I am looking for is some advice on how to measure the actual voltage of the Lead Acid Battery, as the PIC 16F877 that I am using cannot safely measure that sort of input voltage...

So can I use a potential divider on RA0 which is the A/D side of the PIC to work out what voltage level I am at or is there a better method?

Also what would I use for a reference voltage...
 

A potential divider will be fine as long as you ensure the PIC will never receive too much voltage.

I don't know what is inside the PIC for a voltage reference but I think a lot of them just use the power supply. If that comes from a regulator, then that will probably be accurate enough for you purpose.

Keith
 

Thanks for that...

Could I use a Shunt Resistor in Series with the Battery and load (circuit) and measure the voltage across it...

Need an accurate way of measuring from 12.5v to 11.0v as I beleive this is the max and min range of the battery... well 11.35v I think is the actual cut off point for the battery...
 

the answer depends on your precision / complexity requirement.

the simplest would be to adc the battery voltage, through a divider while using the Vdd (known) as reference. This assumes that your voltage regulator can maintain Vdd at the lowest possible battery voltage. That typically is a good assumption since your battery wouldn't go much lower than 9v, and your Vdd is likely <5v. and 99.99% of the reglators can work with 4v+ of voltage differential.

you may or may not need a Vref, especially if your Vdd is regulated. Vref can be of many forms. the simplest would be a forward biased diode. It is not terribly stable thermally but that may work to your advantage.

or you can use things like a transistor (an amplified diode), a regulator voltage regulator (tl431 for example), or dedicated precision voltage reference (bandgap voltage references for example can provide very stable voltage output), etc.

Added after 1 minutes:

Need an accurate way of measuring from 12.5v to 11.0v as I beleive this is the max and min range of the battery... well 11.35v I think is the actual cut off point for the battery...

your pic has a 10bit adc. so if you step the battery voltage down 3:1, the minimum resolution would be routinely 3*5mv=15mv. that should be far more precise than you need it to be, assuming that Vref=5v.
 

Hi Hawk,
If your goal is precise to measure in the range of 12.5v to 11.0v; I would say, design it between 10 & 15V for some flexibility & after an attenuating shift it so (by using an OpAmp) that your input range of 0-5V at PIC will = with Ubattery 10...15V! :)
These gives you a 3x higher resolution with same 8-Bit (or so) ADC... I would take a dedicated external reference too for the PIC conversion.
K.
 

So how do you propose I do that...

Should I use a Potential Divider circuit or is there a better method that I could use that is more accurate, such as perhaps using a LM398 comparator or other such device...
 

Until my editing is the idea from Millwood coming, than can you combine with my idea, to end you will have, through 10-Bit ADC, a 5mV resolution :)...
Do you need a so high resolution for battery voltage?
Do you desired to measure a battery temperature too pls?
K.
 

karesz said:
Hi Hawk,
If your goal is precise to measure in the range of 12.5v to 11.0v; I would say, design it between 10 & 15V for some flexibility & after an attenuating shift it so (by using an OpAmp) that your input range of 0-5V at PIC will = with Ubattery 10...15V! :)
These gives you a 3x higher resolution with same 8-Bit (or so) ADC... I would take a dedicated external reference too for the PIC conversion.
K.

Hi karesz, just spotted your addition to the thread...

Where would you take the dedicated ex-ref from...
 

Hi, because your step-down regulator isnt the most precise ("Other features include a guaranteed ±4% tolerance on output voltage within specified input voltages and output load conditions"), I think you need really an external reference :-(...
You can have it from lot of producers, question is; what is your need for precision.
In the UK, I would say, check out Farnells offerings :)
As producer are NI,Zetex,ADI,LT,TI, Semi..._all OK
If Im correct has Microchip self too some reference types?
K.
Sorry, its better if you take a real Schottky "symbol" for D1 in you schema_later can be a problem if CAD-symbol is not the right one...
 

No... I don't need to measure battery temperature or current...

Just need to see what the actual voltage is and when it reaches a certain voltage issue a warning on the LCD or illuminate a LED and switch to the battery back up allowing me time to re-charge the battery and plug it back in...
 

OK,
Than is a simple resistor attenuator into 0-5V input range of the PIC is right, but with some bypass C on the attenuated voltage pls :)...
Apropos; the temp sensors need as best EMC protection all their own 100nFs _with the I2C memories & LCD too.
K.

Added after 3 minutes:

Is it not simpler to select an "under voltage detector", called voltage supervisor too, i.e. from TI pls?
You need nothing to programming on PIC, it is to buy in enough voltage ranges...

Added after 2 minutes:

I see yet: you are missing by X1 both capacitances (18...27pF) :-(..
 

Not sure what options are available to me, hence the reason I am asking for your help and advice...
 

I see never a battery of 12V on your schema_is it a 3th one pls?
K.
 

Not added it yet...

At the moment I am still running off a bench power supply as I need to sort this side of things...

So It will be running off a 12V Lead Acid Battery... with 8off AA batteries acting as a back up power supplu...

Added after 2 minutes:

This is the actual power supply for the project...
 

OK,
Do you know pls, that their are position sensitive?
You can select lead acids from Panasonic (maybe other brands too), their has gel inside & dont need some service & arent position sensitive. Mostly are in alarm systems used...
K.
 

I would be surprised if your entire system consumes much more than 10ma - if it did, you did something seriously wrong.

at 24hrs * 10 days, you are talking about roughly 2ah, vs. a 55ah battery.

obviously, you need to make some room for low temperature but that's seriously over engineering.

a 3:1 divider would be good. two 10K resistors, in serial, from the battery to the adc pin, and then 10k resistor + 0.1uf capacitor from the adc pin to ground.

another suggestion for you: if your peripherals are not consuming much power, you can use one of the mcu's pin to power them - pick a pin that can do 20ma or so current.

that way, when the mcu is sleeping, your peripherals are consuming no power.

this will cut your idle power during sleep to <1ua.
 

Hi,
Good ideas!
I would place one of these 10Kohms direct in/on the battery connector _otherwise will be a PCB/cable short some dangerous..
K.
 

I took a look at your schematic. you are using a non-gated smps as the voltage regulator. smps has very low efficiency under low load conditions - most of the time here.

I would use a linear voltage regulator (the good old 317 or 7805 for example), or I would use a gated smps (3406x for example). with a gate oscillator, once the output has reached the desired voltage, the oscillator stops and the smps draws little current.

LT has quite a few of them and you may want to check into if you are using the same power supply to power high current load.
 

Looks like I have a couple of decent options to try...

I like to over engineer rather than under engineer just in case there is ever a problem, I know the design should with stand it...

Also the Lead Acid Battery is Second Hand, so not sure how much life is in it, but it has taken a 6 hour charge @ 8amps ok...
 

Hi

I don't think you need to measure too frequently the voltage of the battery. Probably once per 10-60s is more than enough - it's obviously that within 10-60s you can't expect some dramatic changes in the values. During the "no measuring" period of time there is no sense to sink current from the battery. You can diconnect the divider during the "no measuring" time. Also if the PIC is using stand by mode you can decrease the average power consumptions below 50uA (if using Atmel uP you can go even further to 5-10uA).

My point is - if you only want to measure and monitor the voltage of the battery the task will occupy quite short time and also you don't need to sink current all the time from the battery which can save a lot of power.

Also if you google "oversampling" you can find a method how to increase the precision of the ADC - you can get 12 or even 16 bit resolution from the standard 10 bit ADC (when using the internal precise voltage reference).
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top