This project dedicated to charging NiMh AA batteries.
Disclaimer. This is a work in progress, and the software is still in alpha phase. I believe, the hardware part of the project is stable enough and should work properly. You should use the charger carefully and should not leave it alone at least till software release.
You can buy some battery charger in the near supermarket, but for sure it is better to create your very own charger and have fun.
This charger can be used to slow and fast charge the batteries and also is allowing to restore your old batteries. The charger is based on Arduino micro controller, atmega328p-pu and displays whole usable information to the LCD character screen 16x2 or 20x4 one. It allows to charge up to two batteries independently. You can charge only one battery or charge two different capacity batteries or two similar batteries simultaneously. Before charging you batteries, you have to setup the battery capacity, charging speed and loop counts for each battery slot then you insert your battery to the slot and the process begins.
The charger supports three charging modes:
- Fast charging. The battery should completely charged in 5 hours. The charging current depends on battery capacity and equal to 0.2C;
- Slow charging. The battery should completely charged in 10 hours. The charging current equal to 0.1C.
- Restore charging. The charging current in this mode is limited to 40mA. The restoration time depends on battery capacity. This mode can be used to restore the battery capacity and to charge old batteries that cannot be charged by other chargers.
Charging process consists of several phases:
- Discharging phase. The battery discharged through internal resistor to 0.9 v.
- Pre-charge phase. The battery charged by small current, about 30mA until the battery voltage become 1.0v.
- Main charging phase. The battery charged by the calculated current depending on battery capacity and charging mode (fast, slow restore). The battery charging phase finish if the voltage drop detected, or battery become too hot or the upper voltage limit will be reached.
- Post-charge phase. The battery charged by the small current until another voltage drop or the upper voltage limit.
- Complete phase. The battery is charged by short pulse of current till you remove it from the charger.
The charging process runs through whole phases if you setup no loop before charging your battery. If you selected to run several charging loops, the charger will restart discharging process right after main charging phase complete until loops count will be reached. You can use several loops charging to restore you battery capacity.
The charger has three temperature sensors: one for each battery slot and another one to control the temperature of the internal heat sink installed over power transistors. To chill-down internal heat sink a small fan installed inside the charger. The fan automatically switched on when the heat sink temperature reaches the maximum limit. And the fan will be turned off when the heat sink become colder.
The charger schematics is shown on the pictures below. To simplify the schematics readings, it is spitted on three parts: the controller part and two channels. Both charging channels are very similar the only difference are the output and input signals and components numbers.
The controller part of the charger
As you can see on the picture above, to increase battery voltage measurements, external voltage reference source implemented, AD680JTZ. Its accuracy is 0.4% and the controller can check the battery voltage up to 0.001 volt. You can replace the atmega328p-pu IC by Arduino board (uno, nano, pro mini) running at 8 MHz.
Here is the socket explanation:
- J1 to program the micro controller via UART port like a Arduino pro mini.
- J2 to connect the battery temperature sensors DS18b20
- X2 12volt power connector
- U3 to connect i2c LCD display. The brightness pin required to change the display brightness smoothly
- U4 to connect the rotary encoder.
- U5 to connect 12v 40x40x10mm fan installed on the heat sink.
The channel 'A' schematics
The channel 'B' schematics
Here you can find the complete schematics and PCB board of the project.
Let me explain how the charger works. The battery channels "A" and "B" are very similar, so, let's take the channel 'B' for example. Transistors Q9 and Q10 are Darlington pair supplying the charging current to the battery connected to the socket J4. The Arduino controller supplies the PWM signal via the PWR_B port to the Q13 transistor. The more is the PWM duty cycle, the more current created on the Q9 collector.
Q11 mosfet used to enable or disable charging current to the battery. Q12 mosfet used to discharge the battery through R26 resistor.
To measure the charging current the controller checks the voltage drop on the R31 resistor.
To supply required current to the battery the PID algorithm used in the charger.
Both power transistors, Q9 and Q3 has isolated case and can be attached to the single heat sink. I used the south-gate heat sink from old motherboard with 40x40 mm fan running 12volts. Place the Q1 thermo-sensor to this heat sink also to check the temperature of the power transistors.
Define Correct Order the Temperature Sensors
You have to make some initial configuration of your charger because there are three temperature sensors, ds18b20, on the single bus in this project. During start-up procedure the charger detects all the sensors in some specific order. You have to specify the correct order of your sensors the charger can work properly.
Load NiMh_Serial firmware to your controller and connect terminal to the UART port. Select 'temperature' menu item. Press encoder button. You can see the values of all temperature sensors. Heat-up some sensor and remember it position in the list. Repeat this process for each sensor. Now you can define the correct sensor order of your charger. Load the NiMH_Charger code to your Arduino IDE and locate the line "core.init(SO_BHA);" in the setup() function. To define correct sensor order, you have to specify correct SO_* code to the core.init() method. There are 6 possible combinations of the temperature sensors:
SO_ABH - Channel "A", Channel "B", internal Heat sink.
SO_BAH - Channel "B", Channel "A", Internal Heat Sink and so on.
This procedure can be performed only once.
Other possibilities of serial firmware
The *_serial firmware is a powerful tool you can use to debug your charger hardware. Using the serial menu, you can select one of the battery channel "A" or "B", define charging current, perform test charge, test discharge, heat sink fan test and temperature sensors test.
The project is still in progress because the battery charging process is time consuming and debugging requires much time. Hope, the project will be interesting for you.