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

 by moris_zen
Contest WinnerFeatured
 If anyone saw my last instructable "Simple Li-Ion Battery Power Tester" they can now upgrade to a computerized hi-tech version that is capable of measuring almost any type of rechargeable or none rechargeable batteries (but it will drain one charge from them in the process).
It can even connect to a PC and give you a full "Data-sheet" graph of the discharge and total capacity.
Note that this is my first Arduino project (I am not counting my "blink LED").
 
Remove these adsRemove these ads by Signing Up

Step 1: This is what you can get at the end...(just to get you interested)

This is the graph you can get from the text file sent to the PC during drain cycle.
1-40 of 58Next »
mausi_mick says: Mar 9, 2013. 10:16 PM
here is the schematic for the current sink / source (source not realized at this time).
For the discharge current I need A0 of the UNO. The OPamp is TLC2262 (Rail-to-Rail), the N-Fet is a Low-Level with small Ron.
ConstCurrentSourceSink.jpgConstCurrentSourceSink.jpg
mausi_mick says: Mar 7, 2013. 3:59 AM
some pictures from the 4 cells:
Akku_Entlader_4_Stromsenken.JPGAkku_Entlader_4_896mA_298+194min.JPGAkku_Entlader_4_896mA_262min.JPGAkku_Entlader_4_Testaufbau.JPG
mausi_mick says: Mar 7, 2013. 3:54 AM
hi wasteinc,

i have changed the device, now it's possible to discharge 1 to 4 batteries and the discharge current is adjustable from 10 mA to about 1A withe a potentiometer .
wasteinc says: Mar 4, 2013. 12:27 PM
nice work mausi_mick. Can you post the schematics and the arduino pde? Im building a 2 bat discharge circuit and im facing some difficulties :)
mausi_mick says: Feb 10, 2013. 8:39 PM
here some pictures
AkkuEnt_S65_Testaufbau_01.JPGAkkuEnt_S65_Shield_auf_UNO.JPGAkkuEnt_S65_EntlKurve_2x2700mAh_212min.JPGAkkuEnt_S65_EntlKurve_2x2700mAh_294min.JPGAkkuEnt_S65_EntlKurve_2x2700mAh_332min.JPG
mausi_mick says: Feb 10, 2013. 8:29 PM
hi,

I changed the device:

- it's possible to discharge 1 to 4 (5max) batteries parallel
- it's possible to discharge NiMH/NiCd or Lion batteries
- the discharge current is adjustable between about 10mA to about 1A
- it has a 132x164 ? cheap Color GLCD (Siemens S65) to display the discharge voltage over time (max 300min) and in text form the battery voltage and the discharged energy (mWh).
- it used the ATMega328P with Arduino Libs (S65) (runtime board or Arduino UNO / Duemilanove)

mausi_mick
mausi_mick says: Feb 2, 2013. 11:19 PM
Very nice and easy to rebuild.

A0 is going to the + of the Akkumulator/Battery, A2 to the Drain of the N-Fet, different from the schema. Normally Power FET's have Drain on Pin2 (in the mid).

I try to rebuild it with a Color GLCD-Display , perhaps from the Simens S65 Phone.
kcarring says: Nov 22, 2012. 12:04 PM
Would this be applicable for a large deep cycle battery 12V if the right dummy load was used? This exports data to a computer file, in comma delimited txt? Looks great!
msuzuki777 in reply to kcarringDec 9, 2012. 2:13 PM
The standard Arduino is only able to measure up to 5V. To use this with a 12V battery, you would need to use a voltage divider and adjust the software to compensate but it should work.

LOG
vadim.vadimuh says: Oct 23, 2012. 4:06 AM

Hello gentlemens!
theme - Super Joule Ringer 2.0 in overdrive! http://www.youtube.com/watch?v=homZvbKZHlU&feature=relmfu
how to purchase (ICH) OP45224-KIT I understood - http://www.surplussales.com/Inductors/FerPotC/FerPotC-2.html
please indicate me - where can I buy two devices to it black and blue color? what kind of devices and their specifications? give me a link ... please! vadim.vadimuh@gmail.com
Batdragon says: Jun 24, 2012. 2:19 PM
I have a question or two. Say I have none of the components, how much would it cost to get them all to make this tester? And I do mean everything (Also I am in the UK so a cost in GBP would be nice :) )

Would it be possible to alter the load to be a variable resistance that it say also programmable with the kit, if not what is the lowest resistance value that could be used on that particular circuit?

I am asking this as I have a collection of batteries from China that have huge power claims, but in reality they are not anywhere near that claim. the reason being is the way they are tested. If they are tested on a small load (high resistance) then the response curve provides a far better result than if used on a low resistance load.

What I want to do is to make somethig that will give me a good graph of the battery characteristics under real usage loads. I am talking from the 0.8 Ohm to a 3.5Ohm load on them.
Kinnishian in reply to BatdragonJul 16, 2012. 2:06 PM
You should look into either

1) purchasing an icharger, they're a nice middle ground of graphing and capable chargers, but not being too expensive. You have have them discharge at high loads by discharging into the power source, which you have be a big lead acid battery.

2) Look into "celllog halogen light discharger" or "watt meter halogen discharger." You can make a good dischargre using halogen lights.

3) You can modify this project to open gates to more resistors in parallel. I am not a huge fan of this method. I think the cost will be similar to either of the above, with out benefit.

4) If you bought a bunch of 18650 from ebay, or any shady aliba-style site, you're screwed. Most 18650 sold from cheap sellers is shit, and you still have to be worried about higher priced but inscrupable sellers (like tenergy). If we're talking LiPo, thats a different story, and there are both legit and bad sellers from low-cost chinese suppliers.
moris_zen (author) in reply to KinnishianJul 17, 2012. 12:22 PM
Kinnishian ,
A friend is just about to develop a custom battery with Tenergy - they look like a decent company .
Do you have bad experience with them ?
Pls send me any info you have about them .. he is about to send them many K$ very soon.....
Thanks

Kinnishian in reply to moris_zenJul 17, 2012. 3:25 PM
Oh, hey, yes. I have had poor experience with Tenergy. Back in the NiMH days they were very notoriously overrating their batteries. Not as bad as the cheapy ebay resellers, but far worse than suitable for a name-brand. I got 1300mAh-1700mAh from my "2600mAh" tenergy cells. They're not the company I'd got for any big purchase. I have seen peers at my university use them for some projects because they're sold at more visible places like allbattery, but it's a terrible idea.

That said, ***I have not had first-hand experience with their lithium batteries***.
However, they're not anything cutting edge in the realm of lithium, which is dominated by really big players, and they seem to have fallen out.

Even though I'm not a battery expert, I have a bit of knowledge, and I could probably make some recommendations for your friend if you give me more details about the application and scale. Not to clutter the thread, or just to keep it public domain, you can either PM me or just reply to this comment.

There are several lithium chemistries, and exactly the choice you'd make depends on several variables. My experience comes from electric bikes, and the folks at endless-sphere.com, but luckily electric bikes kind of run the gamut of applications, from low power 1C rates to high power 20C rates. A generalalized summary:
LiFePO4, the traditional "safe" chemistry. If you're using a low power system (discharging over 1-2 hours, but not faster), you can buy from a suitable chinese seller, like Ping-batteries. They typically use BMS. The high power brand is "A123" whose batteries have very recently been showing up on the gray market at a low price. I'd choose these guys if you're making a less volume sensitive large pack (LiFePO4 is gravimetrically reasonably dense, but volumetrically noticeably less dense than the other chemistries). They have 20Ah pouchs, better than tiny 2ah cells, a great product, and recently a very sweet pricepoint.

LiPo: LiPo (Lithum Polymer) is a variant method of constructing LiCo (lithium cobalt). They're designed for extremely high rate discharge, often used in the RC toy world. Not a great cycle life, but if treated right, a good price point for a very lightweight semi-short range Ebike. You have to know how to use them though, because their danger is substantially higher than other chemistry.

LiCo, 18650. These are designed for the Laptop world. Low Power, but very dense energy. Leave them in the Laptop world. They're poorly suited for other applications, unless you really are scavenging and know what you're doing and make a massive pack.

LiMn: These are slightly older, well known as being sourced from Konion LiMn tool packs, but also available elsewhere. They for a long time were a nice middle ground between LiFePO4 and LiCo in terms of performance and density and safety. With the likes of A123 high power LiFePO4 and advancements in LiPo and NMC, they've largely fallen out of favor. It might also do with the fact I don't think there have been manufacturers producing this chemistry on a large scale recently. A nice plus is they effectively self-balance, no BMS needed.

LiNMC: This is the newest chemistry, at least in quality form now. There are sellers of crappy version of this chemistry (like Allcell), but thats because they're repacking the ones in 18650 format designed for laptops (the largest lithium market). For most non-laptop applications you want to be looking at the beautiful cells from EIG, Dow Kokam, or Lg Chem. They're pretty hard to find though, because they don't really sell to hobbyists. You can buy the Dow Kokam guys (sweet cells, but EIG and Lg Chem are a bit better) from FFRTrikes, a random bike company (they made a bulk order and resell batteries since they also do electric bikes.) These are about twice to thrice the cost of A123 on the graymarket, though, in part because they're newer and in part because A123 has very recently plummeted in cost on the gray market.


Hey! I apologize! I just went off on a semi-useless battery rant. But as this might be useful fodder, I'll leave it up.
Kinnishian in reply to KinnishianJul 17, 2012. 3:28 PM
To clarify why I went off talking about lithium:

I cannot name any use these days for NiMh, unless you're recovering from an old Prius pack or otherwise have a unique source for it (or you're dealing with an old system and MUST use NiMh). Basically there's a lithium chemistry for any application of NiMh, and the costs are comparable or lower, because Lithium dominates the economy of scale.
pro2xy says: Jun 2, 2012. 11:12 PM
hey how do you get the graphs?? I can send data to the serial port, but what is the format for it? How do you make these graphs?
moris_zen (author) in reply to pro2xyJun 3, 2012. 2:31 PM
I just placed the info in microsoft excel .....
pro2xy says: Jun 2, 2012. 11:11 PM
hey how do you get the graphs?? I can send data to the serial port, but what is the format for it? How do you make these graphs?
loopingz says: Mar 30, 2012. 5:24 PM
It sounds interesting as this the kind of thing I was thinking building.
But I would gain hours to get these curves for four batteries at the same time. Do you think it is possible to modify it this way?
paulryanmini says: Mar 10, 2011. 1:16 PM
hi all
fixed the code after a long night. i can get the setup to start up and the lcd turns on. it will then pick up what type of battery is connected and will measure the voltage and current of the battery, but the led wont illuminate which leads me to believe the mosfet is not switching on. im using a irf540a with a rds on of .052 ohms. any ideas?

Ive been using a 1.3v 1200mah AA rechargeable battery nimh.

any ideas?
thanks
monbeamdistilleries in reply to paulryanminiAug 2, 2011. 2:43 AM
Im having the same problem with the same part. Also trying to reduce the required display size from a 24x2 to a 16x2. Great circuit as I have tons of recycled/scavanged Li-ion cells to test before I use them making a new E-Bike battery pack.
paulryanmini says: Mar 9, 2011. 11:31 AM
hi
i copied the code above directly into ardunio 0022 program. i have the duemilanove clone.

it comes up with the following errors:

dunkbat.cpp:3:10: error: #include expects "FILENAME" or
dunkbat:3: error: 'LiquidCrystal' does not name a type
dunkbat.cpp: In function 'void CL2()':
dunkbat:23: error: 'lcd' was not declared in this scope
dunkbat.cpp: In function 'void setup()':
dunkbat:31: error: 'lcd' was not declared in this scope
dunkbat.cpp: In function 'void loop()':
dunkbat:76: error: 'lcd' was not declared in this scope
dunkbat:99: error: 'lcd' was not declared in this scope


any ideas im a complete noob
thanks
paul
abosebkk in reply to paulryanminiJun 30, 2011. 4:18 AM
Dear paul

This is because the include file is not mentioned at the start. if you do: Sketch> Import Library>liquidcrystal , it will add the necessary header file to the sketch and compile correctly.

slvr00gt says: Jan 9, 2011. 2:10 PM
Here is more detailed diagram of the same thing
BatteryDischargeTester.jpg
m_boby_k in reply to slvr00gtJun 22, 2011. 2:07 AM
Hi slvr00gt, I' have seen your diagram but that's something I don't understand.
The FET voltage terminal is seems don't have connection to the drain circuit, how it's can give analog input (FET voltage) to arduino?
slvr00gt in reply to slvr00gtMar 2, 2011. 6:47 AM
Adding better quality diagram
paulryanmini in reply to slvr00gtMar 2, 2011. 4:35 AM
hi
its a fantastic circuit and ive started to build it. have you by any chance got a higher resolution of the diagram above i cant zoom in enough? thanks
moris_zen (author) in reply to paulryanminiMar 2, 2011. 10:50 AM
I see some one made a diagram - great work
slvr00gt in reply to paulryanminiMar 2, 2011. 6:49 AM
Just added powerpoint file above.... My diagram jpeg was originally high quality, but this forum compressed it into nothing. So I added original ppt file
techwiz says: Mar 20, 2011. 7:42 PM
Less word more little picture comments!

Isn't that the power of Instructables?
blast09 says: Mar 16, 2011. 10:53 AM
Sorry but I miss something...It seems to me there's a typo in PPT diagram.
Pin "fetVoltage[plus]" on discharge circuit is left floating around. Could you confirm this? Thanks for great work anyway.
paulryanmini says: Mar 2, 2011. 10:30 AM
thanks very much. im building it as part of a assignment for power electronics.

i will then alter it to work with 36v 14ah lithium polymer batteries somehow :-) if you have any ideas that would be great
arnefl says: Feb 25, 2011. 7:43 AM
Sure I do :-)
slvr00gt says: Jan 9, 2011. 2:13 PM
Here is my change to the code. Change adjusts the voltage when the test stops. It also prints out capacity over time to the serial port. and changes input pin numbers to what I end up using


$ diff my.cpp orig.cpp
7,8c8,9
< int ledPin = 8; // select the pin for the LED
< int SPKPin = 9;
---
> int ledPin = 13; // select the pin for the LED
> int SPKPin = 6;
18c19
< int FetVoltage = 0;
---
> int FetVoltage = 5000;
66,67d66
< Serial.print("\t");
< Serial.print("Capacity[mAH]");
75c74
< if ( (BatVoltage-FetVoltage) > SelectedMinThreshold && !done) {
---
> if (BatVoltage > SelectedMinThreshold && !done) {
86c85
< TotalCurrent=TotalCurrent+MillisPassed/1000*(BatVoltage-FetVoltage)/10/3.6;
---
> TotalCurrent=TotalCurrent+MillisPassed/1000*(BatVoltage-FetVoltage)/2.2/3.6;
98,99d96
< Serial.print("\t"); // prints a tab
< Serial.print(TotalCurrent/1000);
slvr00gt says: Jan 6, 2011. 11:58 PM
In the code you have following if-statement, where you check whether or not battery has reached the minimum., but in the check, you don't factor FetVoltage.

Should this statement:
"if (BatVoltage > SelectedMinThreshold && !done) {"
be replaced with this:
"if ( (BatVoltage-FetVoltage) > SelectedMinThreshold && !done) {"

Thanks for the great instructable. I just finished building your design!
2011-01-07 00.43.05.jpg
moris_zen (author) in reply to slvr00gtJan 7, 2011. 8:27 AM
It makes me happy people do actually use my designs .
It has been a while a go and I dont remember exactly but as far as I do I connected two points on the battery as the voltage on the Bat is the difference between them (or was that over the resistor) .
Pls check if the voltage is not clearly just over the battery - If I got it wrong then there may have been a mistake yet the voltage drop over a good FET (< 40mohm) could be neglected- o that may be the reason .

moris_zen (author) in reply to moris_zenJan 7, 2011. 8:31 AM
OK .. correction - the voltage on the top of the resistor is the battery voltage - it is correct .
slvr00gt in reply to moris_zenJan 7, 2011. 9:44 AM
Yes, the voltage drop over FET is negligible ( roughly 0.03V), but in your design it is measured and used in calculation:
TotalCurrent=TotalCurrent+MillisPassed/1000*(BatVoltage-FetVoltage)/2.2/3.6;
slvr00gt says: Jan 7, 2011. 7:26 AM
My second question is how do you get drain data from microcontroller board to PC?
moris_zen (author) in reply to slvr00gtJan 7, 2011. 8:30 AM
I sent the info over RS232 . if you connect your PC (same channel I use to program it) ad open a terminal in the correct baud rate - you should see the information just coming in .
Copy paste into excel and make a graph for it .
1-40 of 58Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!