Battery readings?

Hi. I was wondering, could I read the charge of a battery using the Arduino without a shield?

Soapy29:
Hi. I was wondering, could I read the charge of a battery using the Arduino without a shield?

How you can do this depends on the specific battery voltage you are working with. If it's at or less then +5vdc then it can be wired directly to a analog input pin, if it's higher then +5vdc, you can read the voltage level of a battery by using a two series connected resistor voltage divider circuit and then wire the scaled down voltage at the junction of the two resistors to a arduino analog input pin, and then scale the readings value in your software program.

However depending on the type of battery being used, voltage is not always an accurate indication of charge state of the battery. Ni-cad and Nimh batteries maintain an almost constant terminal voltage until very near their end of charge state. Lead acid and Li-Po batteries have a voltage discharge rate such that better indicate the state of charge.

I meant measure how much power a battery has before it will die.

Soapy29:
I meant measure how much power a battery has before it will die.

There is no such simple measurement possible. One can only measure voltage and current at any specific point in time that the battery is supplying to the circuit. To keep track of charge remaining one needs to know how much charge capacity the battery started out with and measure current consumption over time to find the milliamp hours that have been consumed. This is not a trivial problem.

But again telling us what kind (type, voltage, mah rating) battery you will be using might help focus on what you may or may not be able to do.

Lefty

It's a Power Sonic model PS-1270 F1 12 volt 7 amp hour rechargeable battery. I think it is lead acid, but I'm not sure.

To get a true SOC reading by just reading the voltage on a lead acid battery you have to let it rest with no load for a long time, some even say 24 hours.

What most gadgets to is “coulomb counting”, where you integrate the current in with current out and multiply by a fudge factor (Peukert’s Law).


Rob

12volt batteries are fully charged at between 14-15v ,
standing voltage after fully charged is approx 13-13.5v .

12v batteries are designed to give you a minimum of 12v under load .

so read the voltage of the 12v battery while its under load , when the voltage
is 11.9 -12v the battery is effectively dead , you should not discharge the battery
the battery below 11.9-12v as you will damage the long term condition of the
battery .

so when choosing values of the resistors in your voltage divider
take into account maximum full charge of the battery to be 5v.

Hais.

read the voltage of the 12v battery while its under load

This begs the question "How much load?" I can pull my 24v bank down to 22v if I turn the microwave on (yes I know that's not good for the batteries :)) but that 22v is not very representative of the battery condition.

I have read that a 1% load is considered of no real difference to no load at all and that is OK.


Rob

This begs the question “How much load?” I can pull my 24v bank down to 22v if I turn the microwave on (yes I know that’s not good for the batteries ) but that 22v is not very representative of the battery condition.

I have read that a 1% load is considered of no real difference to no load at all and that is OK.

Hi Rob , Yes i agree , if using high loads for small periods of time this will put a lot of pressure
on the battery and in your case takes the battery level down to 22v .
This is an indication that you may need extra batteries , so your setup is able to provide a continuous 24v underload .

But I understand that this is expensive and your only using the microwave randomly and very little .

Therefore … when you read the voltage level into the arduino ,
insert into your sketch code to cope with the above scenario …

ie

if (BatteryVoltage =< LowVoltageLimit) {

delay (the max amount of time you may need to use microwave at any one time);

if (BatteryVoltage =< LowVoltageLimit) // if its still under your set limit even after the delay
//or when normal loads are on ie lights
(then do what ever );

}

Im just a beginner , im definately sure someone with good knowledge in programming
will know what code to put .

Maybe you can do something like

if BatteryVoltage is =< LowBatteryLimit for x amount of time

then do this

:slight_smile:

Hais.
im still learning myself , im still a beginner and wish i had more time to practise with the
arduino .

I'm just designing the hardware for my monitoring system now so won't be into the coding for some time.

I will however be able to read the current so should be able to make decisions based on that as well which will help.

Yes more batteries would be nice, but I only have room for 10 and as you say the microwave doesn't get used much. Also my current shunt is located about 2.5 metres from the actual batteries, the wires are thick but with a 70A draw I may be losing Vs in them or in the connections. Something I should test one day.


Rob