A Leader of Lithium Lifepo4 Battery in China Since 2006

measure li-ion cell capacity with an arduino

by:GSL ENERGY     2020-06-14
I like to use lithium-ion batteries because they have more power than \"normal\" rechargeable batteries and can be harvested cheaply or free from discarded laptop batteries.
They are very convenient for flashlights and various items.
The problem is, when li-
Ion cells from different sources, you may want to know the capacity of the cells you harvest, especially if you will use them in series.
This project is designed to do this: measure the capacity of the battery using a real load until the battery dies.
This instructable was originally released in 2014, but it has been restarted since I wanted to test another batch of batteries. I re-
The circuit was assembled, but I added some features, namely the LCD screen and the battery resistance check.
I will distinguish between \"battery\" and \"battery\" before I proceed \".
\"A cell is a single unit that stores electrical energy with chemicals.
The battery is a collection of batteries.
So, a, D, C, AA, AAA, and a 18650 are all cells.
Car batteries, laptop batteries, or 9 Volt batteries are all batteries because they contain multiple batteries.
The whole step is theoretical, so if you just want it to run, jump straight to the circuit.
The capacity of cells is usually in milliamperes (mAh).
Milliamperes are units of current, and hours are units of time, and when we multiply them, we get the charge. I*t=Q.
So, actually, the capacity of the battery is given with Q, how many \"available charges\" are in their bodies, or, really, the number of electrons the battery can pass through itself in a single discharge cycle.
If we have a constant current, we can run the current until the battery is below the minimum voltage and multiply it by the current time, we can roughly approximate the capacity (Q=I*T).
This is a simple and reliable technique, but it can only give a rough value, not a reliable exact value.
When we realize that the current is unlikely to remain constant, it starts at a high level, and then the current drops sharply as the battery voltage drops.
The solution to this problem is to use calculus.
If we integrate current over time, we can find the exact capacity (Q= ∫ I dt)
Because if we chart the current
Time, the area under the curve will represent the capacity (
Milliamperage hours to milliamperage hours).
The problem is that I don\'t want to do \"proper\" integration, so I think I should take a shortcut;
I used something called the Riemann Sum for a simple integral.
In short, we can look at a graph, break it down into a bunch of thin rectangles, and calculate the area of each rectangle (
Width multiplied by height)
And then add all the small areas together.
In terms of capacity, we use short intervals (Width of rectangle)
And put each of them with the current (
Rectangular height)
Find a small amount of capacity within that time interval.
We just need to summarize all the small capacity to find the large capacity.
In the Riemann and the graph (
All vertical lines)
Sometimes q is a little big, sometimes a little small.
The idea of Riemann and is that the positive error offsets the negative error and it all gets very close.
Perform this Riemann sum before the battery voltage falls below the threshold and then stop because this is all the available charges the battery has (
Drain the battery without exceeding the recommended safety limit).
By the way, if we are interested in the total energy contained in the battery, we need to look at the electrical energy consumed in the test (
This is not the same as the cost).
We can definitely measure this using the same device by multiplying the voltage by a small q and adding the resulting small e (
Energy expenditure at intervals)
Run total E, total battery power.
I decided not to do this in the code for this project, but it is not difficult to implement if you are interested.
Otherwise, you can roughly estimate the battery energy capacity by adopting the mAh rating and multiplying it with the nominal battery voltage 3. 7. (
For example, if we have a battery of 1000, multiply it by 3.
7 v get 3700mWh)
The main reason for the two loads is the ability to measure the battery resistance.
Assuming the unit is a linear voltage source, all I need to measure the unit resistance is two data points: voltage and current for a given load, voltage and current for different loads (
More or Less current).
Then I can see how the voltage changes for a given current change, and the quotient of these two changes gives me the resistance. (
Remember, one ohm per ampere is one volt). Ohms = -
The method used to measure the battery resistance is to collect many data points after placing the battery in a random load state of four possible states (
After collecting data points for many voltages and currents, the program calculates and records resistors using other data points where each data point does not match the voltage and current.
A bit like a handshake problem in math.
Based on my short test, this gives the resistance value that can change about 10% in the same battery.
So it\'s not very good, but it will give you a rough idea.
The picture of this step shows how to assemble the battery tester.
This paper discusses the theoretical problems in circuit design.
You can find a fritzing file at the bottom of this page.
If you have read this instructable before, you will remember that in order to read the data from the test, you used to need to connect the arduino to the computer.
This is definitely not ideal, so when I rebuilt this tester I added an LCD and asked why I didn\'t do it for the first time.
You can buy a 16x2 character LCD on ebay for around $5, including shipping costs.
The actual test circuit contains two loads and two mosfet switches to facilitate the measurement of battery resistance.
If you are not interested in battery resistors, of course you can build the circuit with only one mosfet and load (
Code won\'t mind).
This test circuit uses N.
Channel mosfet for switching current.
The best power I have found for a large power mosfet is a computer power supply (
Easy to find: they are on large radiators).
Before running this test, read the mosfet\'s data sheet and make sure they can handle at least 1A or so unless a lower current load is used.
Also, make sure the \"door-
The source threshold voltage \"is less than 5 v.
This is the voltage that the mosfet needs to be turned on and we can only give it 5 v using arduino.
Finally, you might want to put the mosfet on the radiator.
The method we use to measure the current is to use a shunt resistor.
To calculate the current, we measure the voltage on both sides of the resistance.
Ohm\'s law indicates V = I * R, or I = V/R (
The current through the resistor is the voltage difference at both ends of it divided by the value of the resistor).
The value of the shunt resistor should be anywhere below 4 ohms, but ~ 1A load, a good rule of thumb is that the rated power of the shunt resistor should be about four times the current, or a minimum of 4 w resistance.
This is to keep the resistance cool.
As Domints pointed out in the comments, if the resistance becomes very hot, its value changes and your capacity reading is no longer accurate.
The load I use in this circuit is the car brake bulb (
I use two filaments as two loads).
Between this and the shunt resistor, about one amplifier was pulled during the test, which is correct for what I want to do.
The Peukert effect discusses the effect of different current loads on battery capacity.
Note: the analog input is required to connect A and B.
If you connect them to the digital pins, you will short-circuit the current lithium-ion battery directly through the arduino. Bad times.
Schematic diagram and breadboard layout can be found in the fritzing file (fzz).
Download the code here.
The code in this project goes through 10 possible states, always starts after the state 0 reset, measures the battery voltage in state 0, and according to the voltage, the project will enter one of three possible next states.
When the voltage is below 1 v, State 1 appears, and the program assumes that the battery holder is empty.
It will prompt for a new battery and reset it.
Once the battery voltage exceeds 1 v, the program goes to state 2.
When the tester starts without a cell, but now the cell is installed, status 2 appears.
The program displays the battery voltage and prompts for reset.
When the program starts testing at the battery voltage between 1 and the minimum voltage, State 3 appears, in other words, a weak battery.
The battery voltage is displayed together with the suggestion of the weak battery.
When the program starts, status 4 appears and the battery voltage is high enough to start the test.
In this state, the load is on until the voltage is below the threshold to check the resistance.
Status 5 is the state of the check resistor.
Measure the current and voltage, then turn off one load and turn it back on after recording the two voltage/current values.
The resistance is calculated based on the values of these two different load currents.
Status 6 appears immediately after status 5 completes the resistance check and continues to run the capacity check until the battery voltage is below the minimum battery voltage.
Status 7 appears when the capacity check is complete and the cell is still in place.
It shows the test results and the time spent on the test.
Status 8 occurs when the battery is removed from the tester after the test runs.
The capacity and resistance are still shown, but the time is not shown.
Status 9 appears after inserting a new cell.
Capacity is still displayed before reset.
So how should you edit this code to make it work for your particular circuit?
The only thing you need to change is the pin number and the resistor value.
They are in the following constants: define SHUNTRES 0.
62 define VIN a1 define splitter 04 define GATE1 0 define GATE2 1 what some of you have commented on is an inaccurate reference voltage.
If your 5 v pin measures 4. 6 volts?
There is also a constant to deal with this problem.
Measure the 5 v reference pin with a multimeter and then input the voltage into the constant below: define the voltage 4.
6 If you supply the arduino from the USB port of the computer, the voltage should be 5 v (
There is no need to check it unless you are a suspicious type).
If you use the power supply in the Arduino voltage regulator (barrel plug)
You may need to check it, but it should be consistent.
If you use a USB charger to power it, you should check the voltage of each of the different chargers you are going to use, as they can change a lot.
So, the project is good, but suppose you just want to know the capacity of your cells without building things.
Well, I \'ve started a battery list that can be identified by color and model, and you can check it here.
If you have established the tolerance scale and would like to contribute to this list, please leave me a message and I will add you as an editor.
OK, so once you build your circuit and throw your code on the arduino, you should be happy to go!
The battery should be fully charged before starting the test so you can know what their full capacity is.
Connect a unit and then press the arduino reset button or power the arduino to start the test.
After the test is completed, the screen will display \"complete\" and the time, battery resistance and capacity.
I made a diagram of the voltage and time of the test period, which has some very interesting functions.
The voltage drops sharply at the beginning, but before it drops down to about 3300 mV, the voltage drops are almost linear.
At this point, it began to get steeper and steeper.
This shows why the discharge
Ion batteries below 2.
9 v really won\'t give you more of the capabilities available.
The battery is strong and strong. . . then it\'s done.
This test device can be used on different cells, not just li-ion.
Of course, you need to adjust the voltage constant, and you need to make sure that you supply no more than 5 v to the analog pin, as this is the maximum it can read.
Voltage divider is a possible way to measure the applied voltage of higher voltage (
For example, a 12 v lead-acid battery).
So far, I have observed something about my cells: they seem to be mostly made into about 1000 or 2000 mAH.
I have a mobile phone up to 3400 mAH, which is impressive for just 18650.
In addition, most batteries with very cheap LED flashlights tend to have a lot of capacity.
But it\'s not surprising.
Custom message
Chat Online 编辑模式下无法使用
Chat Online inputting...
Dear Sir, Thanks for your interest in GSL products. Please send your enquiry to Mr. Jim Deng at jimdeng@gsl-energy.com. If you need urgently reply, add whats app account : 0086 13923720280