Arduino as battery capacity tester

GHA

Well-Known Member
Joined
26 Jun 2013
Messages
12,552
Location
Hopefully somewhere warm
Visit site
Moving on from a few interesting battery threads recently, how about using an arduino to test how much capacity your batteries actually have?
(as I have one in a locker :) )

Briefly, arduino make relatively cheap processing boards used much by diyers with easy ways to connect multiple devices with the outside world.
http://www.arduino.cc
Also very cheap are sensors for measuring current, temp etc and all easy way to log data to a micro sd card of onto the Web.

So, with a little programming and some bits it should be easy to connect a c/20 load to a battery and log current, temp and voltage over time down to 10.5v.

Or even cleverer, have a load connected through a power Transistor controlled by the arduino so the current remains constant as the voltage drops.

Away from the boat so haven't started playing yet, most looks fairly straightforward though not so sure about control of a Transistor. Or cheap loads, maybe 6v motorcycle lamps? Will allow testing of both 6v & 12v batteries.

Any thoughts/suggestions anyone?

Does anyone ever actually do an accurate capacity test?
 
I made one using a Picaxe - same principle as an Arduino but uses Basic programming. It's described here http://www.picaxeforum.co.uk/showthread.php?9546-Boat-project-3-electric-consumption-meter
I think you must register/sign in to download the description & program.

The predecessor project which monitors current and calculates Ah in a cable is here http://www.picaxeforum.co.uk/showthread.php?9547-Boat-project-4-Battery-load-tester

Derek
Ta for that. How accurate do you think the hall effect amp sensor is?
Could be very interesting for logging power out from solar against power in to the batteries etc, lots tinkering :)
 
I had plans to do exactly this with an Arduino. My thought was to control the C/20 current by driving a FET using PWM so that the average current would stay constant as voltage falls, and stop at the 50% point to reduce the risk of knackering the battery.

Might have known that someone else would have got there first!
 
Haven't got anywhere yet! :)
But getting excited, especially with the data logging capabilities. I was thinking the same about a FET transister controlled by a PWM pin, but don't know much about them, would 0-5v PWM control one OK? New to find data about converting the discharge time into actual capacity as well,, or how accurate doing that would be, plus factor in temperature... Lots to learn. :cool:


And also thinking about just discharging down to 50%, or maybe one full discharge to get a datum time then a 50% after that for a reference. Thanks to a dodgy solar panel when the boat was left for 3 months I have 4 knackered us battery 2200's to play around with.

A very quick Google looks like temp and current sensors should be accurate enough, and cheap!


I'd be very interested to log amps out of the charger against amps into the battery to see what the charger thinks it's doing against what's really happening with power getting fed to the fridge etc, I don't really trust factory charing algorithms very much so seeing what's happening would be great.
Then log power out of the solars against a light level sensor, fridge on time against internal temp, such fun could be had :)
 
How accurate do you think the hall effect amp sensor is?
Best I got is +/-0.1 A for the smallest 25A nominal model (incidentally it's actually good for 60A). The biggest challenge is the output range is 0-5V, and the measurement range is -60 to +60A so 0A is at 2.5V. That makes it difficult to measure small currents accurately.

Derek
 
Best I got is +/-0.1 A for the smallest 25A nominal model (incidentally it's actually good for 60A). The biggest challenge is the output range is 0-5V, and the measurement range is -60 to +60A so 0A is at 2.5V. That makes it difficult to measure small currents accurately.

Derek
Thanks, plenty accurate enough for a boat :)
 
A very simple battery capacity meter can be cobbled from an LM317 set up as a current regulator to a lamp or resistor. A comparator is set up to turn it off when the low voltage point is reached. I use an old analogue battery clock. I feed it with output from the comparator. Set the clock hands to 12 hrs then note how many hours when it stops.
for Nicad cells i simply feed the clock with the power from the Nicad NiMh cell and add a load ressitor ie 12 ohm. This gives me a pretty good indication of cell capacity at 100ma discharge rate. olewill
 
First time I've had a chance for a play, initially looks very interesting. About half an hour fiddling and it's working just to record voltage.
Attached is a 75 second plot as I turn on and off various bits and the solar panels.....

EBay order in for several temperature sensors and a couple of current sensors plus a 2 line display. Let the fun begin :cool:

firstgraph.jpg
 
Surely a more useful gadget would be one that told you the capacity without discharging it? It would need to monitor current in and out, voltage etc, then do some calculations involving the Peukert constant. My commercial device does all this, and after calibrating if fairly accurate.
Everything I've come across says it just isn't possible with any degree of accuracy to measure the actual Ah capacity of battery bank without doing a discharge test.

For instance...
http://batteryuniversity.com/learn/article/how_to_measure_capacity

What device are you using and how have you confirmed it's accuracy?
 
More lovely beautiful interesting data :cool:

Think my charger's a bit confused. should be ramping up in bulk to 14.2v then staying there for a while in abortion before going back down to float about 13.5v or thereabouts. Unless it's set wrong.
(Just checked, wonder how log ago that switch got set to gel :o )
The spike near the end was when i turned it off and on again, then off about 20 minutes later.
Voltage was checked against a fluke so should be close. Will be much more exciting when some temp & current sensors turn up :cool:

overnight_1.jpg
 
Top