Accurate measuring of car battery (10v - 15V)

Hey guys,

I was looking around for the best way of measuring 12v from car battery (actually, an onboard caravan battery) for a monitoring box I'm working on.
The majority of the advice out there is a voltage divider. Acknowledging it's the easiest and cheapest way to do it, I don't like it due to few reasons:

  • Resistors, even 1%, are not very accurate, meaning the reading is not very accurate.
  • The reading will change due to different temps inside the caravan
  • The battery will be in the range of 10v to 15V (actually the range is narrower, but I'm going crazy here), so why wasting huge range of low reading which will never be used?

So, my idea is to build a subtraction circuit taking the 12V, subtract 10V with zener and push the output to Arduino.
I just wanted to run my idea with you guys and see if I'm missing anything.

By using LM324 (op amp) in in the following setup:

Where R3 and R1 are the same (so no amplifying), and V2 is 10v zener between 12v and 0v, will allow me to get a 0v to 5v when V2 is 10v - 15v.

Sounds right?

(credit to this article: http://www.electronics-tutorials.ws/opamp/opamp_5.html)

Assuming the Arduino will be doing the actual measuring, you haven't considered its accuracy, which is quite poor unless used with a precision voltage reference.

Your subtraction idea is OK, but you would need precision resistors and again a precision Zener (or other) voltage reference.

^ what jremington said about accuracy/stability.

A 10volt zener can be avoided.

Connect V1 to Arduino's 5volt pin.
R1=5k, R3=10k (or that ratio).

Connect V2 to +battery.
R2=10k, R4=5k (or that ratio).

If you use a non-rail2rail opamp, then the opamp supply has to be >= ~8volt. LM358 is ok.
You also need a 10k current limiting resistor between opamp output and analogue pin to prevent phantom powering. And a 100n cap from analogue pin to ground for stable readings.

You could use a voltage divider at the output of the opamp to drop 0-5volt to 0-1.1volt.
And use Arduino's stable internal Aref.
Leo..

You might try using 14 diodes that have .7v voltage drop each, in series, connected between the battery and the arduino. If the battery is at 15v, then the voltage at the arduino would be ~5.2v due to ~9.8v drop across the diodes. When the battery drops to 9.8v, the voltage would be ~0v. Something simple you might try.

Two ~5.1volt zeners in series would be better because of the ~zero temp coefficient.
Remember zeners need a minimal current to work.
Leo..

Two ~5.1volt zeners in series would be better because of the ~zero temp coefficient.

From my tinkering and from what I've read afterward, zeners need a couple of ma current going thru them to stabilize at 5.1v operation. You might have to put a dummy load at the arduino analog input pin.

I agree with what everyone else said about the AVR A/D.

Think of it like this: you could buy this op amp and components and get a 6x improvement in your battery voltage measurement resolution, or you could spend your $5 on a 16bit A/D and get a 64x improvement in your battery voltage measurement resolution.

That said, you can usually get by on a battery voltage measurement using a calibrated 10bit reading. What are you going to do with this battery voltage measurement? Are you just looking for it to be > and < some limits, or are you going to do some complicated math with it?

Resistors, even 1%, are not very accurate, meaning the reading is not very accurate.

How much accuracy do you need?

With 15V and 10-bits, you can get ~15mV resolution without any "tricks" or additional circuitry, which may be enough.

Resistors are very stable, and the 5V output from the Arduino's regulator should be fairly stable too, as long as the load is constant. Or, you can use the 1.1V reference, which is more reliably stable (although not necessarily more accurate).

Once you have stable-repeatable readings, you can calibrate for absolute accuracy (in software) if necessary. Any good multimeter is calibrated (usually with a pot)... It's not made accurate simply by using precision resistors. Where I work we have some DAC and ADC products that are calibrated in software.

But realistically, in your application you probably don't need absolute accuracy... You probably just need enough resolution to know if the voltage goes up or down by some amount.

With 1.1volt Aref, and a bit of oversampling, you can get a stable readout of the battery voltage with two decimal places. You can calibrate accuracy in software to 0.0x volt. Plenty enough for a lead/acid battery.
Leo..

Hey guys,

Thanx for the great replies.

I actually don't really need a great accuracy, as Leo mentioned, for lead-acid battery, it's not really a big deal if you have 0.xv reading.

I actually was a bit surprised at what DVDdoug said about 15mV without any tricks... I thought I did the math before and it wasn't that good.
Having said that, it is more of a "can I do it" then vital part of the project.
The whole project is going to be a box that has few functions (water flow meter to show water tanks usage, current meter for the battery and solar to show SOC of the battery and help position the solar panels in the best angle to the Sun, X-Y leveller with wireless remote unit in the car to help level the caravan on a portble ramp, a clock with real time clock unit).

So it'll be quite a busy box and voltage is just one measurement I wanna do, just because I have the ability. It's not really important if it's 0.x accurate...

I'm happy though I got the op amp solution. it's good to know one can make biased reading and not only from 0v and up.

Thanx again you all!

This is able to do 12-bits voltage and current (more current if you add an external shunt).
Do not remove the onboard shunt resistor as they tell you on that page. Just add another external one. e.g. a 0.1ohm external resistor doubles the current capability.
Or simply connect the current inputs across a length of +battery wiring.
Then you don't need an expensive shunt.
Leo..

Wawa:
This is able to do 12-bits voltage and current (more current if you add an external shunt).
Leo..

That's very interesting...
I'll look into it.

Thanx!