Welcome to Laser Pointer Forums - discuss green laser pointers, blue laser pointers, and all types of lasers

LPF Donation via Stripe | LPF Donation - Other Methods

Links below open in new window

ArcticMyst Security by Avery

"Smart" Battery tester using an Arduino Uno

Joined
Jul 4, 2008
Messages
2,499
Points
113
I have been recently playing around with several Arduino sketches that have to do with the monitoring of charging and health of new Li-ion cells.
If you happen to live in a part of the world that is unable to access professional level smart chargers then this project might be for you!

The following sketches are quite useful in creating your own battery health monitor.

It should be noted however that you need to externally power your arduino with a wall wart to get this to be at all accurate. I also suggest a proper DMM such as a fluke, Hioki or other high accuracy dmm. (makes it possible to test the ref voltage on the board with accuracy)

Arduinos suffer from a voltage sag when powered from a USB connector and this throws out the ref. voltage.
This could be extremely hazardous when making a charger circuit. Use these sketches with caution.

---> How the battery tester circuit works. When simply testing the mAh of a given battery the battery's positive and negative terminals are given a known
resistive load directly across them. Vbat/Ohm = mA. This is then monitored over 7200Seconds to give mAh rating.
The data is collected via the Arduino terminal.


Also, these sketches do not only give the mAh of a given battery but are also able to calculate the internal resistance at the same time. This is extremely useful for monitoring a battery's longevity/health. High internal resistance = poor performance.

The most basic sketch applies the formula Vbat-Vload div value of the resistor
= internal resistance in mOhms to find the internal resistance of a given cell.

see link below...
How to Measure Internal Resistance ? Battery University

273x281xdischarger.png.pagespeed.ic.HxR0m_Vvob.png


Links to the various arduino projects are below. I can verify that this project does work as intended. You do however need to be careful NOT to over discharge your batteries. I've have personally seen a few of these cylindrical cells become hot and rupture explosively from mishandling them.

Please, please , please .... observe all safety precautions when using and charging Li-ion cells and Li-poly cells.


This is especially problematic if you are using non-protected cells. To get around this problem you'll need to add a Solid state relay to your sketch to cut the discharge off at 3.2v.

Again, these sketches and projects require a little tweaking but the proof of concept is there. I can verify these both work as they're intended to.



Enjoy.



Arduino True Battery Capacity Tester (Li-Ion/NiMH/NiCD/Pb)

Very simple Arduino Lithium-ion battery capacity tester/discharge monitor | electronicsblog.net
 
Last edited:





Joined
Sep 12, 2007
Messages
9,399
Points
113
I built one a couple years back that used a constant current discharge instead, which is the standard for testing these things. This can easily be disabled and used in place of a relay/resistor. Something like this should work:

33932d1312900879-ttl-capable-driver-based-2-lm317-2-ddl-drivers-possible-modulatable-constant-current-1c.jpg


Just get rid of the diodes and place the battery from V+ to V-
 
Last edited:
Joined
Jul 4, 2008
Messages
2,499
Points
113
I built one a couple years back that used a constant current discharge instead, which is the standard for testing these things. This can easily be disabled and used in place of a relay/resistor. Something like this should work:

33932d1312900879-ttl-capable-driver-based-2-lm317-2-ddl-drivers-possible-modulatable-constant-current-1c.jpg


Just get rid of the diodes and place the battery from V+ to V-

I see that his circuit employs a square wave from the transistors. The load is the LD?

So, this circuit could then be adapted into the Arduino Analog 0 and gnd pins to get a plot of the discharge ?

thanx for this diagram, btw.. .:thanks:
 
Joined
Sep 12, 2007
Messages
9,399
Points
113
You put whatever you want into the 4.7k. Could be 5V to keep it on constantly, could be 0V to disable the circuit, could be square wave... think of it as a TTL input.

You could set up the circuit for 1A constant current, and then send PWM from the micro to get different (average) loads. 50% for 0.5A and so on.

No, the LED is not the load. I said you get rid of the diodes. The load is transistor 1 and the resistor on the bottom right. The resistor drops 0.7V, and the transistor drops whatever else is needed to keep the current constant.
 
Last edited:
Joined
Jul 4, 2008
Messages
2,499
Points
113
You put whatever you want into the 4.7k. Could be 5V to keep it on constantly, could be 0V to disable the circuit, could be square wave... think of it as a TTL input.

You could set up the circuit for 1A constant current, and then send PWM from the micro to get different (average) loads. 50% for 0.5A and so on.

No, the LED is not the load. I said you get rid of the diodes. The load is transistor 1 and the resistor on the bottom right. The resistor drops 0.7V, and the transistor drops whatever else is needed to keep the current constant.

Alright.. I didn't completely understand what the circuit was doing vs what the ardunio sketch was doing using a known resistance to test the Vdrop across the
resistor to get the internal battery resistance.

This is a selectable load circuit for simulating loads....
 
Joined
Sep 12, 2007
Messages
9,399
Points
113
...calculate the internal resistance at the same time. This is extremely useful for monitoring a battery's longevity/health.

The page you linked says quite the opposite: "Resistance does not reveal the state-of-health of a battery. The internal resistance often stays flat with use and aging."

The most basic sketch applies the formula Vbat-Vload div value of the resistor

Vbat is the same as Vload. Do you mean open-circuit voltage of the battery? Because it's not the open-circuit voltage if you have a load on it.

The constant current method is easier, simpler, and more accurate. You just record the start time, then when the voltage gets down to 3.2V, you disable discharge, and multiply the current set-point by the duration of the test. It's like 10 lines of code tops. A resistor + solid state relay might be fewer components, but it's a lot more expensive than two transistors and three resistors. There's also some voltage drop across the relay you would need to account for with another voltage sense pin.
 
Last edited:
Joined
Jul 4, 2008
Messages
2,499
Points
113
The page you linked says quite the opposite: "Resistance does not reveal the state-of-health of a battery. The internal resistance often stays flat with use and aging."



Vbat is the same as Vload. Do you mean open-circuit voltage of the battery? Because it's not the open-circuit voltage if you have a load on it.

The constant current method is easier, simpler, and more accurate. You just record the start time, then when the voltage gets down to 3.2V, you disable discharge, and multiply the current set-point by the duration of the test. It's like 10 lines of code tops. A resistor + solid state relay might be fewer components, but it's a lot more expensive than two transistors and three resistors. There's also some voltage drop across the relay you would need to account for with another voltage sense pin.

Had a brain blip while typing this,
I've had severe bronchitis/Asthma for a few days, so this is my post on low O2...

Yes, you're correct, I used the wrong terms. Thanks for correcting. I am indeed referring to the open circuit bat voltage not the load voltage.
These 2 sketches seemed like an interesting way to create an open source battery tester of sorts.
We have already open source drivers, test loads but we don't have our own
universal charger / battery health/ mAh/ Voltage tester yet.
(idea?)

Maybe an Arduino uno isn't going to be able to handle all the info at one.
I don't know... It does have a limited number of analog input pins.

I think I should clear up what this sketch was trying to accomplish and there are 2 sketches here,

1) Show Voltage, and mAh of the battery
2) Show internal resistance in mOhm

If possible a probably more of a pipe dream would be to create a selectable charger circuit that could output a digitally selectable voltage from 3.6-4.35v at
a number of different current settings. 400mA - 1A.

The below is a 2 cell min charger that can charge large lipoly and gell cells up with 3A output charging.
Does 4.2max. This circuit extremely similar to a smaller charger available through adafruit. It also uses Max ic..
Integrating this with an arduino would make it possible to plot charging voltages, currents etc...

3036.gif



Thank you again for setting the records straight Cyparagon.
:thanks:

I'm going to keep doing a little more digging around to see if I can't find more information on LiFePo/Li-ion smart charger circuits...
theres got to be something we could do...
 
Last edited:
Joined
Jul 4, 2008
Messages
2,499
Points
113
The page you linked says quite the opposite: "Resistance does not reveal the state-of-health of a battery. The internal resistance often stays flat with use and aging."



Vbat is the same as Vload. Do you mean open-circuit voltage of the battery? Because it's not the open-circuit voltage if you have a load on it.

The constant current method is easier, simpler, and more accurate. You just record the start time, then when the voltage gets down to 3.2V, you disable discharge, and multiply the current set-point by the duration of the test. It's like 10 lines of code tops. A resistor + solid state relay might be fewer components, but it's a lot more expensive than two transistors and three resistors. There's also some voltage drop across the relay you would need to account for with another voltage sense pin.

Had a brain blip while typing this,
I've had severe bronchitis/Asthma for a few days, so this is my post on low O2...

Yes, you're correct, I used the wrong terms. Thanks for correcting. I am indeed referring to the open circuit bat voltage not the load voltage.
These 2 sketches seemed like an interesting way to create an open source battery tester of sorts.
We have already open source drivers, test loads but we don't have our own
universal charger / battery health/ mAh/ Voltage tester yet.
(idea?)

Maybe an Arduino uno isn't going to be able to handle all the info at one.
I don't know... It does have a limited number of analog input pins.

I think I should clear up what this sketch was trying to accomplish and there are 2 sketches here,

1) Show Voltage, and mAh of the battery
2) Show internal resistance in mOhm

If possible a probably more of a pipe dream would be to create a selectable charger circuit that could output a digitally selectable voltage from 3.6-4.35v at
a number of different current settings. 400mA - 1A.


the charger circuit could be based off the mcp73861 ... like the one on the adafruit site

mcp73861.png


Thank you again for setting the records straight Cyparagon.
:thanks:
 
Last edited:





Top