Measure car battery

Hello

I'm trying to measure the voltage of a large battery (optima 55ah) that powers a small 240v invertor (to charge my motorbike battery).

I tried it already with a voltage divider, a voltage regulator but didn't get a stable reading. It has to be correct on 0.01 V.

Are there other ways to measure the voltage with an 0.01V accurancy with arduino?

If the battery is 12V lead acid, a voltage divider will work fine. Use a 3:1 divider to reduce the battery voltage to the 0-5V range for a 5V Arduino. Add a capacitor (say 100 nF to 10 uF) across the voltage divider output to reduce external electrical noise.

If you use the Arduino with its on board 5V regulator as the voltage reference, that should be stable and will give you a resolution of 0.005V. Average several readings for best stability.

You will have to calibrate the final result, using an accurate DVM.

15volt with a resolution of 0.01volt requires a minimum of 1500 A/D values. The Arduino has only 1024.

An INA219 breakout board (Adafruit/ebay) with inbuild 12-bit voltage AND current A/D might be a better solution.
Leo..

Hi,

Welcome to the Forum

Can you post a circuit diagram of how you connected the Arduino to the battery please, in CAD or a picture of a hand drawn circuit in jpg, png?

What model Arduino are you using?

Thanks.. Tom... :slight_smile:

Absolute 0.01V accuracy ontop of 12V needs serious professional kit that is regularly calibrated.
Do you mean resolution rather than accuracy?

TomGeorge:
What model Arduino are you using?

Arduino Uno

MarkT:
Absolute 0.01V accuracy ontop of 12V needs serious professional kit that is regularly calibrated.
Do you mean resolution rather than accuracy?

There is less than 1v difference between a full battery and an empty one. That's why I want it to be accuracy on 0.01V.

I was already looking for an external way that can measure the voltage like Wawa told. If there are others that are cheaper?

Calypoter:
If there are others that are cheaper?

~US$2.00 including worldwide shipping is too expensive?

This sketch might be the best a bare Arduino can do.
Leo..

/*
  0 - ~17volt voltmeter
  works with 3.3volt and 5volt Arduinos
  uses the stable internal 1.1volt reference
  10k resistor from A0 to ground, and 150k resistor from A0 to +batt
  (1k8:27k or 2k2:33k are also valid 1:15 ratios)
  100n capacitor from A0 to ground for stable readings
*/

unsigned int total; // holds readings
float voltage; // converted to volt

void setup() {
  analogReference(INTERNAL); // use the internal ~1.1volt reference | change (INTERNAL) to (INTERNAL1V1) for a Mega
  Serial.begin(9600); // ---set serial monitor to this value---
}

void loop() {
  total = 0; // reset
  analogRead(A0); // one unused reading to clear any ghost charge
  for (int x = 0; x < 64; x++) { // 64 analogue readings for averaging
    total = total + analogRead(A0); // add each value
  }
  voltage = total * 0.0002567; // convert readings to volt | ---calibrate by changing the last three digits---

  Serial.print("The battery is ");
  Serial.print(voltage); // change to (voltage, 3) for three decimal places
  Serial.println(" volt");
  delay(1000); // readout delay
}

Calypoter:
Hello

I'm trying to measure the voltage of a large battery (optima 55ah) that powers a small 240v invertor (to charge my motorbike battery).

Which battery are you trying to measure? Is this while the invertor is operating? I'm guessing you have a charger connected to the invertor?

Could you draw the WHOLE system you are trying to use?? What tolerance resistors are you using? If you want as accurate as can be, you need to be very specific in what you have

Tolerance of the resistors is irrelevant, since you have to calibrate anyway.
Long term stability and temp coeficient is.
Common 1/4watt metalfilm resistors might be ok for this.
Not sure what the temp drift of Arduino's 1.1volt Aref is either.
Leo..

Wawa:
~US$2.00 including worldwide shipping is too expensive?

The price I saw was $10 without shipping. Maybe there is other hardware that can measure voltage.

tinman13kup:
Which battery are you trying to measure? Is this while the invertor is operating? I'm guessing you have a charger connected to the invertor?

The battery is http://nl.optimabatteries.com/nl-nl/products/yellowtop/detail/yt-s-42/ .
The invertor is not operating.

The reason I want to know the voltage is because I don't have power in my garage and when the battery is getting low I would like to receive a sms.

Calypoter:

No, that's not going to work well as the impedance is an order of magnitude too high. You need a 100nF
capacitor in parallel with the 100k resistor to fix this. (a low leakage type) Are you using star-grounding?

Arduino Uno

There is less than 1v difference between a full battery and an empty one. That's why I want it to be accuracy on 0.01V.

I can understand wanting that precision, but 0.05V accuracy is plenty for a lead-acid 12V battery.

I got the INA219 breakout board today in the post and tried it. It gives me the result I want. Thanks for helping me.