walterwitt
New member
- Joined
- May 26, 2020
- Messages
- 6
Hello Everyone, This is my first post to this forum, So I hope there aren't any issues with this post, But as you can probably gather from the title, I'm working on something that I'm quiteexcited to share.
Also, sorry for anybad spelling, crappy handwriting, and otherwise unclear info. I'm a native English speaker, but that doesn't stop be from being shit at it.
Basically this is what my hopes are for this project. An 18650 Cell Tester that:
Now, here's how This thing is supposed to work, I'll have a power supply, and stable precise 1A DC load creating a 1A circuit that will use relays, to insert, remove, and reverse cells into the circuit. The voltage and current of each cell will be monitored by the Arduino, which will log all the measurements to an SD card, and control the charging and discharging of each cell, via the relays.
Now, to explain the challenges faced with this design, and how exactly I'm dealing with them, here is the circuit diagram for 1 cell channel.
Now, I know this looks like allot for each individual channel, but here's all that built onto a PCB that will have 4 of these channels on it. All of the above diagram is contained almost entirely within the width of the relays.
So, lets start with how the relays are done.Each cell is connected to 2 relays(bottom left of the diagram, top right of the picture) which are controlled by the Arduino using a high powershift register. The first isa SPDT relay at the bottom, which controls whether or not the cell is connected to the 1A circuit, or bypassed. The second relay switches the direction the cell is connected, to ether be charged, or discharged.
By having all cells connect themselves in series, I only have to have 1 accuratecurrent control, and each cell is being given and loaded with the exact same current keeping everything consistent between all the channels.
Now, the first issue to deal with is how do I do the CV portion of charging, if the cell is in a fixed 1A circuit. The solution I'm using is a TL431 Shunt regulator used in conjunction with a PNP power transistor to act as a voltage limiter. You can see this portion around the top middle of the diagram with a circle around it. When the 2nd relay is set to discharge (Un-powered) This portion of the circuit is bypassed, with only the resistor divider pulling any current. When the Relay is switched to charge, then theTL431 (Looks like a zener diode with a 3rd terminal) receives power via the 470 ohm resistor, and if it has more than 2.5V on it's Reference pin, it will pull down on the PNP's base causing extra current to start flowing through it, rather than the cell. The resistor divider on the reference pin has a 10K ohm trim pot so the Voltage limit can be set precisely. I've already tested this portion of the circuit on it's own and when the battery is below the set voltage, the hole circuit only draws 0.25mA, but when the cell voltage passed 4.188V (4.200V set point) it started pulling all the extra current just as expected until it reached it's set point right around 0.5A witch it maintained all the way until the 0.1A cut off at which point the Arduino would disconnect the cell with relay 1, and put the cell into the default discharge state with relay 2.
This results in an extremely accurate and repeatable charge profile for each cell. Much better than what a TP4056 or even more expensive dedicated chargers can achieve. And you need accurate and repeatable charging in order to have accurate and repeatable discharging.
The 2nd issue is how do you have a micro controller accurately measure the voltage and current of an arbitrarily large number of cells, that are being held at different voltage potentials throughout the circuit. This solution has a few different parts to it. The first thing I'm doing is having the 1A circuit powered from a different isolated supply than the one that powers all of the control and measurement. The two are connected via a normal diode from the control side ground to each channel, witch causes the control side ground to always be no higher than 0.7V above the lowest cell voltage potential.
The 1A supply circuit is pretty simple, here's a block diagram of how it works:
It starts with an isolated DC supply of witch the voltage determines the maximum number of cells that can be charged at the same time with no cells being discharged, which the Arduino will know and keep track of. This DC supply is then fed into a cheap switch-mode DC-DC converter, witch will have it's feedback pin connected to the positive input of the 1A DC load. The positive output of the regulator is connected through the series of battery cells to the positive input of the load. This setup will ensure that so long as the Arduino ensures that the total series voltage doesn't go beyond the maximum range of ether the load or the supply, then the 1A circuit will be maintained. If more cells are being discharged and energy needs to be dumped, then the voltage across the load will go beyond the feedback threshold (typically 1.25V) and the converter will reduce it's output voltage until it shuts down. At which point current can still pass through because of the diode all switch-mode buck converters have. If more cells are being charged, and energy needs to be supplied, then the converter will keep it's voltage output high enough to maintain the minimum operating voltage for the DC load (in my case, 1.25V is enough) until it reaches the supply voltage. At which point it will just stay on, and not be able to go any higher. This state of-course would be one that the Arduino would do what it can to prevent from happening.
As for actually measuring the cell voltages, I'll be using 2 OP-Amps arranged as differential amplifiers to bring the voltages withing the 5V range of the ADC, then all the outputs will be connected to a 16 channel multiplexer which will then be connected to a 16-bit external ADC which finally is connected to the Arduino via the I2c bus. The differential amplifiers are shown on the top right of the diagram. A differential amplifier is another really cool circuit that basically subtracts 2 voltages from each other, and amplifies the difference by a gain set by the resistors. The only special thing that's required for them, is the ratio between the 2 resistor pairs has to be the same, otherwise the gain will change and you won't get accurate readings. What I did for this is I measured a hole bunch (50)of my 10K, 100K, and 56K resistors with my 4 1/2 digit multi-meter, and by doing that I was able to arrange a bunch of matching pairs together (Typically I find at least 15 PAIRS within 0.02% of each-other for 1% resistors on the same strip) and use 2 of them to get approximately the gain I need for each amplifier.
Alright, it's getting late, and I need to sleep, It's almost 3AM where I live, but hopefully that explains enough about what I'm working on for now. I'll probably post some ore info, and maybe answer any questions I might get about this thing tomorrow. Right now, I'm going to mention that there are other safety mechanisms such as cell temperature monitoring, that I will be incorporating, and going over later.
For now, good night, sorry if it's a bit of a mess. like I said, 3AM. I'll probably clean it up more tomorrow.
-Chris
Also, sorry for anybad spelling, crappy handwriting, and otherwise unclear info. I'm a native English speaker, but that doesn't stop be from being shit at it.
Basically this is what my hopes are for this project. An 18650 Cell Tester that:
- Is cheap to make, using mostlycomponents that cost less than a dolar, and manyonly a few cents.
- Is accurate to within a single mAH and can measureand maintainCurrent to within 1mA and Voltage to within 5mV, on each cell.
- Uses energy from cells being discharged to charge other cells in preparation for testing.
Now, here's how This thing is supposed to work, I'll have a power supply, and stable precise 1A DC load creating a 1A circuit that will use relays, to insert, remove, and reverse cells into the circuit. The voltage and current of each cell will be monitored by the Arduino, which will log all the measurements to an SD card, and control the charging and discharging of each cell, via the relays.
Now, to explain the challenges faced with this design, and how exactly I'm dealing with them, here is the circuit diagram for 1 cell channel.
Now, I know this looks like allot for each individual channel, but here's all that built onto a PCB that will have 4 of these channels on it. All of the above diagram is contained almost entirely within the width of the relays.
So, lets start with how the relays are done.Each cell is connected to 2 relays(bottom left of the diagram, top right of the picture) which are controlled by the Arduino using a high powershift register. The first isa SPDT relay at the bottom, which controls whether or not the cell is connected to the 1A circuit, or bypassed. The second relay switches the direction the cell is connected, to ether be charged, or discharged.
By having all cells connect themselves in series, I only have to have 1 accuratecurrent control, and each cell is being given and loaded with the exact same current keeping everything consistent between all the channels.
Now, the first issue to deal with is how do I do the CV portion of charging, if the cell is in a fixed 1A circuit. The solution I'm using is a TL431 Shunt regulator used in conjunction with a PNP power transistor to act as a voltage limiter. You can see this portion around the top middle of the diagram with a circle around it. When the 2nd relay is set to discharge (Un-powered) This portion of the circuit is bypassed, with only the resistor divider pulling any current. When the Relay is switched to charge, then theTL431 (Looks like a zener diode with a 3rd terminal) receives power via the 470 ohm resistor, and if it has more than 2.5V on it's Reference pin, it will pull down on the PNP's base causing extra current to start flowing through it, rather than the cell. The resistor divider on the reference pin has a 10K ohm trim pot so the Voltage limit can be set precisely. I've already tested this portion of the circuit on it's own and when the battery is below the set voltage, the hole circuit only draws 0.25mA, but when the cell voltage passed 4.188V (4.200V set point) it started pulling all the extra current just as expected until it reached it's set point right around 0.5A witch it maintained all the way until the 0.1A cut off at which point the Arduino would disconnect the cell with relay 1, and put the cell into the default discharge state with relay 2.
This results in an extremely accurate and repeatable charge profile for each cell. Much better than what a TP4056 or even more expensive dedicated chargers can achieve. And you need accurate and repeatable charging in order to have accurate and repeatable discharging.
The 2nd issue is how do you have a micro controller accurately measure the voltage and current of an arbitrarily large number of cells, that are being held at different voltage potentials throughout the circuit. This solution has a few different parts to it. The first thing I'm doing is having the 1A circuit powered from a different isolated supply than the one that powers all of the control and measurement. The two are connected via a normal diode from the control side ground to each channel, witch causes the control side ground to always be no higher than 0.7V above the lowest cell voltage potential.
The 1A supply circuit is pretty simple, here's a block diagram of how it works:
It starts with an isolated DC supply of witch the voltage determines the maximum number of cells that can be charged at the same time with no cells being discharged, which the Arduino will know and keep track of. This DC supply is then fed into a cheap switch-mode DC-DC converter, witch will have it's feedback pin connected to the positive input of the 1A DC load. The positive output of the regulator is connected through the series of battery cells to the positive input of the load. This setup will ensure that so long as the Arduino ensures that the total series voltage doesn't go beyond the maximum range of ether the load or the supply, then the 1A circuit will be maintained. If more cells are being discharged and energy needs to be dumped, then the voltage across the load will go beyond the feedback threshold (typically 1.25V) and the converter will reduce it's output voltage until it shuts down. At which point current can still pass through because of the diode all switch-mode buck converters have. If more cells are being charged, and energy needs to be supplied, then the converter will keep it's voltage output high enough to maintain the minimum operating voltage for the DC load (in my case, 1.25V is enough) until it reaches the supply voltage. At which point it will just stay on, and not be able to go any higher. This state of-course would be one that the Arduino would do what it can to prevent from happening.
As for actually measuring the cell voltages, I'll be using 2 OP-Amps arranged as differential amplifiers to bring the voltages withing the 5V range of the ADC, then all the outputs will be connected to a 16 channel multiplexer which will then be connected to a 16-bit external ADC which finally is connected to the Arduino via the I2c bus. The differential amplifiers are shown on the top right of the diagram. A differential amplifier is another really cool circuit that basically subtracts 2 voltages from each other, and amplifies the difference by a gain set by the resistors. The only special thing that's required for them, is the ratio between the 2 resistor pairs has to be the same, otherwise the gain will change and you won't get accurate readings. What I did for this is I measured a hole bunch (50)of my 10K, 100K, and 56K resistors with my 4 1/2 digit multi-meter, and by doing that I was able to arrange a bunch of matching pairs together (Typically I find at least 15 PAIRS within 0.02% of each-other for 1% resistors on the same strip) and use 2 of them to get approximately the gain I need for each amplifier.
Alright, it's getting late, and I need to sleep, It's almost 3AM where I live, but hopefully that explains enough about what I'm working on for now. I'll probably post some ore info, and maybe answer any questions I might get about this thing tomorrow. Right now, I'm going to mention that there are other safety mechanisms such as cell temperature monitoring, that I will be incorporating, and going over later.
For now, good night, sorry if it's a bit of a mess. like I said, 3AM. I'll probably clean it up more tomorrow.
-Chris