# DIY Li-ion Capacity Tester !

19,586

279

29

When it comes to building the battery packs, Li-ion cells are one of the best choices without the doubt. But if you get them from old laptop batteries then you might want to do a capacity test before building the battery pack.

So today I will show you how to make a Li-ion capacity tester using an Arduino.

So let's get Started!

## Step 1: Watch the Video !

If you don't want to read all the stuff you can watch my video!

## Step 3: What Is Capacity !

Before building the capacity tester we must know what is capacity. Unit for capacity is mAh or Ah. If you take a look at any Li-ion cell they will mention its capacity on it as one shown mentions 2600 mAh on it. Basically what this means is that, if we connect a load across it which draws 2.6A then this battery would last for an hour. Similarly, if I have a 1000 mAh battery and load draws 2A then it would last for 30 min, And this is what an Ah or mAh means.

## Step 4: Practically Not Possible

But calculating in this way is practically not possible because we all know V=IR. Initially, our battery voltage will be 4.2V if we keep the resistance constant there will be some current flowing through the load. But over the time battery voltage will decrease and so does our current. This will make our calculations much difficult than expected because we will need to measure the current and the time for every instance.

Now to perform all calculations it is not practically possible so here we will use an Arduino which will measure the current time and the voltage, process the information and in the end give us the capacity.

## Step 5: Schematic, Code & Gerber Files

Note!

I had an SPI OLED lying around so converted it to I2C and used it. If you want to learn how to convert SPI to OLED look at my previous tutorial -https://www.instructables.com/id/OLED-Tutorial-Con...

Here is the link to my Project if you want to make changes to PCB and Schematic

## Step 6: Working !

And here is how this circuit works, first Arduino measures the voltage drop created by the 10 ohm resistor if it is higher than 4.3v then it will turn off the MOSFET display high voltage, if it is less than 2.9v it will display low voltage and turn off MOSFET and if it is between 4.3v and 2.9v it will turn on the MOSFET and the battery will start discharging through the resistor and measure the current using ohms law. And it also uses the millis function to measure the time and product of current and time gives us the capacity.

## Step 7: Soldering !

Then I started the soldering process on the PCBs which I ordered online. I recommend using Female headers as if you want to remove OLED or Arduino for another project later on.

After the soldering when I connect the power sometimes it does not work as expected. Maybe because I forgot to add Pull Up resistors at I2C BUS interface so went back to the code and used Arduinos Built-in Pull Up resistors. After which it works perfectly

## Step 8: Thank You !

It works! If you like my work

Feel free to check out my YouTube channel for more awesome stuff:

https://www.instagram.com/nematic_yt/

Check out JLCPCB
\$2 PCB Prototype (10pcs,10*10cm): https://jlcpcb.com

## Recommendations

• ### Invention Class

9,800 Enrolled

## 29 Discussions

I like the project alot! However there are quite a few mistakes that make this project unusable as it is. First of all, use a low value shunt resistor in series with the load resistor to calculate the voltage drop. The 10 ohm resistor heats up alot and a chunk of the power is "lost" as the resistor's actual value changes. A0 and A1 should defenitely be normal inputs - not input pullups. These inputs are leaking over 2V and makes defining the open battery voltage difficult.

I would add a resistor between mosfet gate, D2 and ground to avoid potential voltage rising and power leakage. Adding 100nF capacitors in parallel to R2 and R3 wouldn't do any harm either.

Cheers

wy burning wire? and no screen in oled display :(

About 25 years ago I was involved in competitive 1/10 scale RC dirt oval racing and I developed A PC based system for creating packs of ni-cads where the 6 or 7 cells were matched based on runtime under a constant current load. There are specification sheets you can get on how the factory tests individual cells. A quick check for a 2600 mah lion shows they test with .52A load. The idea when building high performance packs is to have cells that can all discharge at the same rate and duration. Damage to individual cells occurs when they discharge early and the remaining cells then basically expend energy beating the weak cell up. Your project caught my eye and I naturally found it quite interesting. I have not messed with packs much since then and am not familiar with lion but the same principles should apply. Sub-c ni-cads were rated to be tested at 5A so that naturally created heat on the .1 ohm load resistors. We eventually ended up testing at 30A constant load to better match what the packs endured in a 4 minute race. When our packs were discharged it was almost like a switch turning off. Great project, just wanted to share past experience with cell testing and creating matched packs.

Thanks for giving us a bit of history. i designed a capacity tester for 1 Amp. the current does not change during the test. so for a 2.6A-H battery it will take 2.6 hours to discharge. waaaaaa.. i dont like that and then i read ur post that mentioned that they test the batteries at very high currents. i was under the impression that capacity testing is done at 0.5C. so maybe testing a high currents can speed things up but it still does not seem technically correct. at high currents (52 Amps) the battery voltage will sag dues to its internal resistance (not to mention the sharp increase in Temp) so it does not seem correct. what did they actually test at 52 Amps? and what did you test at 30 Amps?

also the power dissipated in a 0.1 Ohm resistor at 5 Amps is only 2.5 W

- What is the point when measuring the voltage on the node between transistor and resistor? The Rds-on of the MOS is around 30mOhm, and with a current of roughly 0.5A this means a 15mV drop. Or a 0.3% of precision loss. Totally negligible

- What is the purpose of the resistive dividers (R1-R3 and R2-R4) to measure the voltage? Your max voltage is 4.3V, and you are not usign the internal voltage reference, so the max voltage you can measure is 5V. Why are you dividing it in half?

- Speaking of voltage references, are you sure that the 5V are stable? Even with the OLED? Personally I'd use the internal reference (and then you really need the R1-R3 voltage divider, but the resistors values should change)

- You shouldn't drive a MOSFET that way; you should add a resistor in series (e.g. 220 Ohm) to limit the current peak at power on/off

- Are you sure you can power the buzzer directly? (I couldn't find the data; what is the current it should get at 5V?)

Thank you for sharing anyway :)

It's like you're reading my mind! I just built my first 21700 lithium cell small pack today, testing the cells for the eventual 4kwh pack for my electric scooter here in Thailand. What I really want is something close to this, a bottom-balancing board that will take multiple cells in the pack down to 2.9V. I had in mind all of your major components, this gives me a great headstart on the final design. Thanks!

Read my post showing how to modify this design so it will work with higher voltage and higher current packs.

How you can measure the current using ohms law? If you turn on the mos Q1 hou have a very lov voltage on measure point. V=IxR where R is RDS(on) of mos around 17mOhm.

you are not measuring the voltage across the MOSFET. you are measuring the voltage across R1 and R3 which is the battery voltage.

Hi. This is a cool project and i want to build it. But i haven't a 10 ohm resistor. Can i use a 3 ohm resistor when i change the variable Res_Value in the ino file? Greets.

yes of course it will work. however capacity tests are made at about C/5 = 2.6/5 = 0.52 Amps, so with 1.4 Amps you will be exceeding this value and may not get the correct capacity. Resistor power is V^2/R so using the highest value of voltage at the start with a fully charged battery, 4.2^2/3 = 5.88 Watts. so make sure you use at least a 10 Watt, 3 Ohm resistor. or you can use 3 x 3 Ohms in series which will make it 9 Ohms and closer to the design value and then change the value in the code

A 3 ohm resistor would let more current passing through it. It would result in a faster discharge and a hot resistor. Assure that it is anyways at least 5watts and change the resistor value in the code.

That will let too much current flow through the resistor and damage it, may also damage your battery if it can't handle the current 4.2/3 = 1.4Amps

yes it will work, just make sure you are using right wattage resistor

To what voltage and current does it work? Or was it only intended for single cells? I ride e-bikes and my present one is 36 volt at 10 amps....

Great project though, many thanks,

Andy