Single cell charger / discharger
Posted: 04 Sep 2018, 14:03
You may not be interested in building yet another charger, but this project might give you some ideas on other uses for the INA219 module, or I2C LCD, or 3D printing design using Fusion 360 (an excellent CAD program, free for hobby use).
This charger works to a resolution of 0.1 mA, 0.1 mAh and 0.01 V. It's particularly suited to charging the very small capacity cells, typically used on indoor models - there are lots of simple chargers available for these, but they don't usually give you the option to accurately control the charge rate or measure the capacity of the cells.
The principle is very simple. A 5V source is used to charge the cell through a relay contact and a current-limiting resistor. The current-limiting resistor is on the outside of the charger, mounted in spring contacts - so it's easy to change the resistor to give the desired charge rate. There is a separate resistor for discharge operations.
The heart of the system is an INA219 module. This is a small, cheap, I2C device that measures voltage and current. With the standard shunt resistor that is supplied on the module, it can work with up to 3.2 A and up to 26V. It has 12-bit resolution and switchable ranges to give more accuracy when working on the lower ranges.
Only other bits required are an Arduino, a 4x20 LCD with I2C adapter, and a standard relay board.
If you're going to use a regulated power supply - such as a phone charger or USB power bank, then a 5V Arduino would be the best solution. But I wanted to use a 4-cell Nickel battery as a power supply - and I found that the LCD contrast required constant adjustment depending on the state of charge of the Nickel battery. So I used a 3.3V Arduino - a Pro Mini Strong - this has an onboard 1A low dropout 3.3V regulator, so I could run the display from the Arduino's regulated 3.3 volts and so avoid the changing contrast problem. The relays have coils that are specified to work over the voltage range 3.75V up to 6V: they do actually work from 3.3V, but they are operating outside their specification. Luckily the standard cheap relay boards have opto-isolators that work fine at 3.3V and then the option to use a separate power supply for the coils - by connecting the coil supply straight to the power source (which must be at least 4.2 V if you want to charge standard LiPo cells) the design is fine for input voltages up to 6V.
Here's a photo of the components used.
Beware that the relay boards come in at least two different sizes. It would be easy to design a case to suit one size, but then solder up the connections on a different board that doesn't fit the case. Ask me how I know!
Here's the case design.
And here are all the gubbins wired up. Note that I hid some of the wiring underneath the boards, so as to make the tangle of wires look slightly less disgusting!
Here's a circuit diagram. Click on any photo to see a bigger version.
Note that the GND connection into the INA219 module is taken from the negative terminal of the battery being charged - and that GND wire then doesn't continue to the Arduino or anywhere else - all the other GND connections are taken from a separate GND wire from the GND input terminal. Although the two GND wires are connected to each other up at the terminals, this separates the 'analogue ground' in which virtually no current flows, from the 'digital ground' which carries more current and more electrical noise. It's best to wire it this way as the INA219 is then able to more accurately measure the voltage of the cell on charge.
This charger works to a resolution of 0.1 mA, 0.1 mAh and 0.01 V. It's particularly suited to charging the very small capacity cells, typically used on indoor models - there are lots of simple chargers available for these, but they don't usually give you the option to accurately control the charge rate or measure the capacity of the cells.
The principle is very simple. A 5V source is used to charge the cell through a relay contact and a current-limiting resistor. The current-limiting resistor is on the outside of the charger, mounted in spring contacts - so it's easy to change the resistor to give the desired charge rate. There is a separate resistor for discharge operations.
The heart of the system is an INA219 module. This is a small, cheap, I2C device that measures voltage and current. With the standard shunt resistor that is supplied on the module, it can work with up to 3.2 A and up to 26V. It has 12-bit resolution and switchable ranges to give more accuracy when working on the lower ranges.
Only other bits required are an Arduino, a 4x20 LCD with I2C adapter, and a standard relay board.
If you're going to use a regulated power supply - such as a phone charger or USB power bank, then a 5V Arduino would be the best solution. But I wanted to use a 4-cell Nickel battery as a power supply - and I found that the LCD contrast required constant adjustment depending on the state of charge of the Nickel battery. So I used a 3.3V Arduino - a Pro Mini Strong - this has an onboard 1A low dropout 3.3V regulator, so I could run the display from the Arduino's regulated 3.3 volts and so avoid the changing contrast problem. The relays have coils that are specified to work over the voltage range 3.75V up to 6V: they do actually work from 3.3V, but they are operating outside their specification. Luckily the standard cheap relay boards have opto-isolators that work fine at 3.3V and then the option to use a separate power supply for the coils - by connecting the coil supply straight to the power source (which must be at least 4.2 V if you want to charge standard LiPo cells) the design is fine for input voltages up to 6V.
Here's a photo of the components used.
Beware that the relay boards come in at least two different sizes. It would be easy to design a case to suit one size, but then solder up the connections on a different board that doesn't fit the case. Ask me how I know!
Here's the case design.
And here are all the gubbins wired up. Note that I hid some of the wiring underneath the boards, so as to make the tangle of wires look slightly less disgusting!
Here's a circuit diagram. Click on any photo to see a bigger version.
Note that the GND connection into the INA219 module is taken from the negative terminal of the battery being charged - and that GND wire then doesn't continue to the Arduino or anywhere else - all the other GND connections are taken from a separate GND wire from the GND input terminal. Although the two GND wires are connected to each other up at the terminals, this separates the 'analogue ground' in which virtually no current flows, from the 'digital ground' which carries more current and more electrical noise. It's best to wire it this way as the INA219 is then able to more accurately measure the voltage of the cell on charge.