Sunteți pe pagina 1din 22

instructables

16 Channel 18650 Lithium Capacity Tester

by picposter

Hello, my name is Cedric and today im introducing you to my Arduino-based capacity tester.
I had a lot of 18650 cells lying around from old laptop batteries. I wanted to test each cell to find out its capacity.
So I tried to find a way to test many cells simultaneously. My first instructable was born.
This lithium tester can test 1-16 cells at the same time. It uses resistance wire with circa 20ohm / meter as load,
mosfets as switches and an arduino mega as a calculator ;). It is able to display the data on a 1602 or a 2004 LCD
Display or via the serial monitor on your computer. The displayed data are "volt" "time" and "capacity". It would be
possible to display the current as well, but i don´t need it. I used the internal pull up resistors to have defined
levels. Because of this you will see "5000mV" in the Display if no battery is connected. You can use external pull-
down resistors (20-50kohm) if you want to get "0mV" displayed if no battery is connected. In this case you have to
rewrite the code.
I build mine as a 10 channel tester because I only had 10 mosfets lying around (I destroyed two of them while
building-as you can see there are only 8 Mosfets on my PCB). I hope you enjoy my first instructable. If you got any
questions, just write a comment. I hope it is easy to understand. Have fun !

16 Channel 18650 Lithium Capacity Tester: Page 1


Step 1: How to measure capacity - some basics

The main thing to calculate the capacity is the ohm's law. The formula is U = R * I. If you want to measure the
capacity, first you have to calculate the current "I". Then divide the mAh through 3600 (1hour has 3600 seconds)
and you have mah per second. Now calculate this value with the past time in seconds and you have the capacity
in the past time :).
The calculating code:
totalcurrent[c] = totalcurrent[c] + (((valbat[c] - fetoffset[c]) * 5000 / offset) / load[c] / 3600 * ((premillis[c] -
millispassed[c]) / 1000.0));
The simplified formula: Capacity in mAh= (Cell voltage - Mosfet Voltage drop) / load / 3600 * past time in seconds.

Step 2: Tools and Parts

Tools you will need:

16 Channel 18650 Lithium Capacity Tester: Page 2


soldering iron
solder
hand saw or circular saw (http://jo.de)
screwdriver/allen wrench(hexagon)
side cutter
stripping plier
Ferrule crimping plier

Parts you will need:


Electronics:
1x arduino mega
1x 1602 (http://www.ebay.com/sch/i.html?
_odkw=lcd+shield&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR11.TRC1.A0.H0.Xlcd
+1602.TRS0&_nkw=lcd+1602&_sacat=0)or 2004 (http://www.ebay.com/sch/i.html?
_odkw=lcd+1602&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR12.TRC2.A0.H0.Xlcd
+2004.TRS0&_nkw=lcd+2004&_sacat=0)LCD or LCDshield (http://www.ebay.com/sch/i.html?
_odkw=2004+lcd+shield&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR10.TRC1.A0.H
0.Xlcd+shield.TRS0&_nkw=lcd+shield&_sacat=0)
1x I2C Display adapter (http://www.ebay.com/sch/i.html?
_odkw=i2c+adapter&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xi2c+di
splay+adapt.TRS0&_nkw=i2c+display+adapter&_sacat=0) and 4-pole female header for the I2C
(not necessary, but makes the wiring much easier)
16x IRL540 (5V mosfets with RDS(on) 0.077ohm) ( one for each channel)
universal pcb with strip grid (https://www.google.de/search?
q=circular+saw&rlz=1C1MSIM_enDE718DE718&espv=2&biw=1920&bih=950&source=lnms&tbm=
isch&sa=X&ved=0ahUKEwiA8dSi6LzRAhVhBcAKHZ0zA8UQ_AUIBygC#tbm=isch&q=strip+grid+
pcb)
a fan (http://www.ebay.com/sch/i.html?
_odkw=fan&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR7.TRC1.A0.H0.X80x80+fan.
TRS0&_nkw=80x80+fan&_sacat=0)(a old Computer fan will work - its for cooling the hot wire)
zip ties
2m resistor wire (http://www.ebay.com/sch/i.html?
_odkw=kanthal+wire+0.3&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR10.TRC0.A0.
H0.Xresitor+wir.TRS0&_nkw=resitor+wire&_sacat=0) with 0.3 mm and 20ohm per meter (circa
11cm for each channel)
0.5mm² ferrule (http://www.ebay.com/sch/i.html?
_from=R40&_trksid=p2050601.m570.l1313.TR0.TRC0.H0.Xferrule.TRS0&_nkw=ferrule&_sacat=0)
16x resistors 1/8watt (200-600) as gate resistor
at least 40-50male headers (http://www.ebay.com/sch/i.html?
_odkw=acs712&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR10.TRC0.A0.H0.Xmale
+header.TRS0&_nkw=male+header&_sacat=0) to connect the inputs and outputs to the arduino
some 25 AWG (circa 0.25mm²) single wire for the inputs and outputs or an old IDE cable from a
computer
some 13 AWG (circa 2.5mm²) single wire for connecting the cell with the load

Battery holder for a 10 channel holder (not needed if you already have any kind of battery holders)
16 Channel 18650 Lithium Capacity Tester: Page 3
6x 5x40 wood screws
10x cylinder screw M8x80mm (only 20mm of thread) ( i used countersunk srews, but i think cylinder
srews are better for pulling )
10x self-locking nut M8
8mm drill bit
10x 1x10x40 springs (http://www.ebay.com/sch/i.html?
_odkw=spring+1x10x40&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xc
ompression+spring.TRS0&_nkw=compression+spring&_sacat=0)
Wood plates: 1x 220x180x20mm 2x 220x30x20mm
some 1.5mm² (15 AWG) rigid wire for "+"-pole

Batter holder for a 16 channel holder (not needed if you already have any kind of battery holders)
6x 5x40 wood screws
10x cylinder screw M8x80mm (only 20mm of thread)
10x self-locking nut M8
8mm drill bit
10x 1x10x40 springs (http://www.ebay.com/sch/i.html?
_odkw=spring+1x10x40&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xc
ompression+spring.TRS0&_nkw=compression+spring&_sacat=0)
Wood plates: 1x 450x180x20mm 2x 450x30x20mm
some 1.5mm² (15 AWG) rigid wire for the "+"-pole

Step 3: How to build the Battery holder (skip this step if you already have Battery holders)

I forgot to make pictures during the building process of the project, so i have to explain it with the pictures of the
finished project.
First cut down the wood to the following dimensions:
10 channel holder : 1x 220x180x20mm 2x 220x30x20mm
16 channel holder : 1x 450x180x20mm 2x 450x30x20mm
Then assemble the smaller strips to the ground plate as shown in the pictures. Drill 8mm holes at a distance of
25mm from center to center at a height of 10mm in one of the small strips as shown in the pictures (here are the
M8x80 screws inserted). Drill two 2mm holes per cell close together on the opposite side in the other small strip.
Now cut 70mm 1.5mm² rigid wire pieces. Put them through the small holes and solder the 2 ends together. This
will be your "+"-pole. Now insert de M8x80 srews in the holes and slide the springs onto the screws. Screw self-
locking nuts onto the threads and solder the thread ends a bit. You can also sand the thread ends half-round
instead. I have also built a plexiglas plate under the battery holder to attach the electronics.
Now you have a flexible Battery holder which is also compatible with other battery types. Great !

16 Channel 18650 Lithium Capacity Tester: Page 4


1.
Drill
3
holes
to
clamp
down
the
2
smalles
strips
to
the
big
plate
2.
Drill
the
holes
between
2
battery
connectors

16 Channel 18650 Lithium Capacity Tester: Page 5


Step 4: How to build the electronic board

Before you begin building the board, think about the resistor value of your load. If you want a current of 2 ampere
at 4V you have to use 2ohm as load (I = U/R --> 2 = 4/2). I used "1.6ohm" loads for my board. The resistance wire
you bought has an "ohm per meter" value. Mine had 19.5ohm/m with a 0.3mm diameter, so i cut down 9 cm strips
and crimped ferrules at the ends of the 9cm wire strips. This is because you can´t solder the resistance wire, so
you have to crimp ferrules on it, then you can solder it. The holes in the PCBmust be drilled to 1.5mm where the
ends of the load are pushed through. The resistance wire is a "PTC" which means that the resistance increases as
the temperature rises. Your 2ohm load will be about 2.2-2.4 ohm when it´s glowing red. It is important to cool the
resistance wire, otherwise the value of your load will fluctuate and you won´t get accurate results. Unfortunately, I
have no picture of the fan in action, since i added it later.
I took a 39x8 holes stripgrid PCB and assembled the components as shown. It is important that you connect the "-"
of all Cells to "gnd" of your Arduino, otherwise your Arduino will measure not the correct value ! Solder the
0.25mm² cables to the gates of the mosfets and the measure points for measuring the voltage. Solder the other
ends to the male headers.

16 Channel 18650 Lithium Capacity Tester: Page 6


16 Channel 18650 Lithium Capacity Tester: Page 7
16 Channel 18650 Lithium Capacity Tester: Page 8
16 Channel 18650 Lithium Capacity Tester: Page 9
16 Channel 18650 Lithium Capacity Tester: Page 10
Step 5: Combine the parts

Now solder 2.5mm² wire to each "+" and "-" pole of the battery holder and connect it to the electronic board like
shown in the pictures. Connect the male headers and the additional ground connection to the Arduino board.
Connect the Display to the Arduino.

16 Channel 18650 Lithium Capacity Tester: Page 11


16 Channel 18650 Lithium Capacity Tester: Page 12
16 Channel 18650 Lithium Capacity Tester: Page 13
16 Channel 18650 Lithium Capacity Tester: Page 14
16 Channel 18650 Lithium Capacity Tester: Page 15
16 Channel 18650 Lithium Capacity Tester: Page 16
16 Channel 18650 Lithium Capacity Tester: Page 17
16 Channel 18650 Lithium Capacity Tester: Page 18
16 Channel 18650 Lithium Capacity Tester: Page 19
http://www.instructables.com/ORIG/FRJ/DAM2/IXQG2M7W/FRJDAM2IXQG2M7W.fzz

(/ORIG/FRJ/DAM2/IXQG2M7W/FRJDAM2IXQG2M7W.fzz)

http://www.instructables.com/ORIG/F30/D47I/IXQG2M7U/F30D47IIXQG2M7U.fzz

(/ORIG/F30/D47I/IXQG2M7U/F30D47IIXQG2M7U.fzz)

Step 6: The Code

Some explanations:
float batnumber = 16; change the value from 1-16 -- Only the desired cells are displayed on the display
int intervaldisp = 1000; display changing time
int interval = 1000; time between the next calulation process of each battery. Don´t set to low if yo want to hav a
smooth running program ;)
int intervalserial = 1500; time between each serial.print command
int disp = 0; here you can choose your Display type : 0 = 16x2 Display 1 = 20x4 Display
int fetoffset[17] = {16,... these values are the voltage drops at the mosfets in mV. Measure the value while
discharging between "Drain" and "Source" - should be 16mv at a current of 2A. You can also calculate tat value.
The resistance of the IRL540 is 0.077ohm when 5v are present at the gate. So use U = R*I and calculate it ;). For
example 1.5A --> U = 0.077*1.5 -> U = 0.1155V. For example 3A --> U = 0.077*3 -> U = 0.231V.
int bat[17] = {A0,... these are the Analog input pins. Normally no changes have to be made here
float load[17] = {1.6,... these are the resistance values of your load. you can set individual values for each cell if
you want. My values were 1.6ohm
float offset = 5013; this value is important! Measure the 5V pin and set the value in mV. In my case 5,013V. I will
explain this in the next step.
float cutoffmin = 3000; the value in mV at which the measurement is stopped
float cutoffmax = 4300; the maximum voltage of the cell. If the voltage is higher, the code wont recognize a cell.
There are 2 sort of .ino files. One is for an I2C Display and the other one is for a default connected LCD.
If you use the I2C Display you will need the correct library. I found a good explanation and Library here:
https://arduino-info.wikispaces.com/LCD-Blue-I2C (https://arduino-info.wikispaces.com/LCD-Blue-I2C). Download
and install the newest library. There is also the code you need to find out the I2C adress called "I2C Address
scanner for Arduino". In my case the address was "0x27".

16 Channel 18650 Lithium Capacity Tester: Page 20


http://www.instructables.com/ORIG/F8C/39HZ/IXUS8H7P/F8C39HZIXUS8H7P.ino

(/ORIG/F8C/39HZ/IXUS8H7P/F8C39HZIXUS8H7P.ino)

http://www.instructables.com/ORIG/FNF/RDT9/IXUS8H7U/FNFRDT9IXUS8H7U.txt

(/ORIG/FNF/RDT9/IXUS8H7U/FNFRDT9IXUS8H7U.txt)

http://www.instructables.com/ORIG/F9L/O7YB/IXUS8H7Z/F9LO7YBIXUS8H7Z.ino

(/ORIG/F9L/O7YB/IXUS8H7Z/F9LO7YBIXUS8H7Z.ino)

http://www.instructables.com/ORIG/FPN/LC1T/IXUS8H81/FPNLC1TIXUS8H81.txt

(/ORIG/FPN/LC1T/IXUS8H81/FPNLC1TIXUS8H81.txt)

16 Channel 18650 Lithium Capacity Tester: Page 21


Step 7: Arduino power supply

Some facts:
The ADC of the Arduino Mega has 10bit which are 1023 steps (0 is counted as a step --> 1024)
The default reference voltage is 5V
The Arduino "reads" 1023 when 5V is connected to an analog input pin
the internal reference depends on the exact value of the Arduino 5V pin

Example:
You use an usb-port of your computer to power the Arduino. The USB Volt-value is maybe only 4,8V. You connect
the 5V pin of the Arduino to A0 and let the Arduino read A0 and then do "serial.print" to the serial monitor. The
serial monitor will display 1023. It´s because the 4.8V at the 5V pin are the default reference of the Arduino . The
Arduino now interprets the value 4.8V as 1023. If you connect a cell with 3,7V to A0 and to the same now, the
serial monitor will display only 3.552V (3,7/5)*4,8. And since the capacitance measurement is based only on an
assumed value of the load (1.6ohm) and the measured voltage, it is important to integrate the reference value with
the calculation.
To solve this problem, it is advisable to use the Vin pin instead. Connect a external power supply to the Vin pin
with 7-10V. Now the onboard available 7805 voltage regulator produces a relatively constant voltage which won
´tbe exact 5V. Therefore, there is the offset value in the code to make sure calculating is correct. So measure the
value o the 5V pin and write this value into "float offset = 5013;".
Now its time to start your Arduino and test some cells ;)

Step 8: Future goals

I want to make a 8 cell capacity tester, which uses two analog inputs per cell. This will result in a
higher accuracy. It will measure the battery voltage and the voltage drop at the load resistor (the
load resistor is used as a shunt). (Vbat Vshunt) / R * Time.
rewrite the code to fit in an Arduino nano.
rewrite the code to be able to set the current per channel by a pwm output.
visualize the data in The Computer screen with the tool called " processing"
adding a buzzer

16 Channel 18650 Lithium Capacity Tester: Page 22

S-ar putea să vă placă și