In this post we are going to construct a smart Ni-Cd / Ni-MH battery charger circuit that can safely and reliably charge several nickel cadmium or nickel metal hydride batteries in series or single cell at an instant depending on user’s choice.
The proposed circuit sport several smart features that monitors the batteries in real time and if any irregularities found while charging, the charger simply terminates charging process to save the batteries from getting harm and alerts the user via buzzer and LCD.
We will see:
- Smart features of the proposed Ni-Cd / Ni-MH battery charger.
- How to charge a Ni-Cd / Ni-MH cell properly?
- How to terminate the charging process correctly?
- Circuit diagram of Ni-Cd / Ni-MH battery charger.
- Program code for the charger.
- Prototype images.
- How to operate the proposed charger and error message & alerts.
Smart features of the charger:
- Fully automatic cut-off with beep alert.
- Real time current monitoring and displaying it on LCD.
- Overcharging current cut-off & alert via buzzer.
- Countdown timer to display the time left for full charge.
- Low charging current alert on LCD.
- Battery reverses polarity protection.
- Automatic power failure recovery.
- Battery detached from holder indication on LCD.
- 1.2V to 8.4V charging capability (up to 7 x 1.2V cells in series).
- Wide range of battery capacities supported: 100mA (minimum) to 3800mAh (maximum).
Before we dive into the circuit diagram and construction details, it is very important to know how to charge a Ni-Cd / Ni-MH cell (or battery pack) properly, only then we can set the correct voltage, current and duration before we put the battery in to charge. If we set these parameters incorrectly, we might end up overcharge / undercharge the battery or reducing the lifespan or overheat or even an explosion.
How to charge a Ni-Cd or Ni-MH battery properly?
Charging a nickel cadmium or nickel metal hydride battery is far complex and difficult than charging lead-acid or li-ion / li-po battery types, in fact charging these types of batteries can be done precisely (cut-off), but not Ni-cd or Ni-MH types. If you are surprised why, you will know after you finish reading next few sections.
What is the charging voltage for Ni-Cd / Ni-MH cell?
The charging voltage for nickel cadmium or nickel metal hydride cell is not fixed and generally no manufacture specifies it.
Unlike li-ion cell or lead-acid types which have a fixed voltage defined by the manufactures (4.20V and 2.35V respectively), Ni-Cd or Ni-MH types don’t and the voltage is allowed to rise freely.
The Ni-Cd / Ni-MH are charged with a constant current, as long as the charging current is constant and within the manufacture’s limit, the voltage cannot rise too much to harm the battery.
Generally speaking the charging voltage should not be below the voltage of a cell or a battery pack.
For example, if a cell’s nominal voltage is 1.2V, the open circuit voltage of the charger must be above 1.2V. Same goes for battery packs, if a battery pack is rated for 4.8V the charging voltage must be above this.
What is the charging current for Ni-Cd / Ni-MH cell?
The universally accepted charging current for nickel cadmium or nickel metal hydride cell by all manufactures is 0.1C for 15 to 16 hours.
For example, if your cell or battery pack is rated for 1000 mAh then the charging current should be 100 mA and can be charged for 15 to 16 hours.
Here is a real life example, the below illustrated Ni-MH cell has 2800mAh capacity and the recommended charging current is 280mAh for 16 hours maximum.
The advantage of charging the battery at C/10 or 0.1C is you no need to worry about the initial charge state of the battery pack / cell, you can charge a partially discharged battery for 15 to 16 hours.
How to fast charge a Ni-Cd / Ni-MH battery?
From the previous section, you would have noticed that how slowly nickel based batteries charge. In some circumstances you may not get 16 hours to charge a battery pack or cell. Fortunately nickel based batteries can be fast charged with higher current in the range of 1C and a fully discharged battery can reach full charge in 1.5 hours.
However, detecting the full charge is the difficult part of the charging process; a poorly designed charger may hurt the battery if it fails to detect the full charge condition. Ni-Cd and Ni-MH batteries are intolerant to overcharge. While fast charging, timer based cut-off system is helpless because the initial charge state of the battery does matter.
If you fast charge a partially discharged battery (say 65%) for 1.5 hours at 1C, it will overcharge and heats up very rapidly. The timers in fast charger are last hope if the charging algorithm fails to detect full charge condition.
Why it is so difficult to detect the full charge condition for nickel based cell? Well, you will learn why in the next section.
In this project construction we will not use fast charging method; instead we will be using the industry recommended 0.1C charging current for 15 to 16 hours for safe charging and also for best battery lifespan.
How to detect when Ni-Cd / Ni-MH cell is charged fully?
A nickel based cell can be declared fully charged using the following two methods:
- Negative Delta Voltage (NDV) method.
- Delta Temperature (dT/dt) method.
Negative delta voltage: When a nickel based cell is charging the voltage across the terminal rises and when the battery reaches full charge the voltage across the battery terminal drops between -5mV to -20mV (this is less pronounced with Ni-MH) and when a microcontroller detects this change (delta) properly charging process can be terminated.
Unlike other battery types where higher terminal voltage can be an assumption of full charge, here a voltage drop is the actual signature of full charge. If a charger fails to detect it, the voltage rises again and overcharges the cell and excess heat will be produced and may get damaged.
Delta Temperature (dT/dt): This method monitors the battery temperature while charging and when there is a steep rise in the temperature with respect to time, the charging process is terminated. But this method can’t be relied fully if the ambient temperature varies.
The above two methods are suitable for fast charging, for 0.1C (overnight charging) these methods are irrelevant and a timer cut-off is sufficient.
Circuit diagram for Ni-Cd / Ni-MH charger:
The circuit consists of less than 10 components that are commonly encountered by an Arduino hobbyist and can be built in less than 1 hour on breadboard or PCB. Let’s understand about each of the components used.
I2C LCD Display Module:
The proposed battery charger project utilized I2C adapter module for 16×2 display, this reduces the number of wire count that connects from Arduino to LCD to just four: VCC, GND, SDA and SCL. Beginners will find less hassle with wiring, thus less prone to mistakes while making one. Use a small screw driver to adjust the trim POT provided to control contrast of the display.
INA219 Voltage and Current Sensor Module:
INA219 voltage and current sensor module is the heart of the project which can monitor the voltage and current passing through a load (battery), however in this project we will be extracting only the current (ampere) readings. This module can measure parameters with a precision on par with multimeters from our testing.
Specifications of INA219 module:
- Operating voltage: It can operate from 3V to 5.5V.
- Measuring voltage: It measure voltage up to 26V maximum.
- Measuring current: It can measure current in both directions up to 3.2A, +/- 0.8mA.
- Communication protocol: it utilizes I2C protocol to communicate with a microcontroller.
- Shunt resistor: It uses 0.1 ohm resistor rated at 2 watt.
- Pins: It has Vcc, GND, SDA, SCL, Vin- and Vin+. At Vin+ & Vin- terminals load is connected.
CC/CV Buck converter:
The above illustrated module is called a buck converter which is responsible for converting a higher DC voltage input to a lower DC voltage output and the output voltage can be adjusted by rotating the trim POT.
However, the above shown buck convert has a current limiting feature, using the other trim POT you can set a maximum output current limit. This module provides a constant current (CC) to the battery.
If you are building this project you definitely need a buck converter with current limiting feature and it may not need to look as illustrated one above.
A 12V relay is employed to connect and disconnect the battery from buck converter and the relay controlled by Arduino depending on the charge conditions.
The relay consumes around 200mA when energized and no Arduino pin can provide this current; to overcome this issue a NPN transistor is utilized. The transistor receives signal from Arduino and energizes the relay coil with higher current and voltage.
A diode is connected across the relay coil to arrest high voltage spikes that are generated while switching the relay ON and OFF.
Please note that you must NOT use a relay that comes with a breakout board as illustrated below and this project does not support this type of relay breakout boards:
Battery Reverse polarity Protection:
The proposed project can prevent batteries from getting charged in reverse polarity using a very simple arrangement of fuse and a diode as illustrated below.
When a cell or battery pack is connect in correct polarity, the diode will be reverse biased (does not conduct) and the current passes through the 500mA fuse and since the charging current will not go above 400mA (by design) the fuse will not blow.
If the battery got connected in reverse polarity accidentally by the user, the diode starts conducting and makes short-circuit with the battery and since a fuse is connected in series with the battery the fuse blows instantly and prevents charging in reverse polarity.
A 5V DC buzzer is utilized in the circuit to alert the user when the circuit requires user intervention. For example, when the battery is charged fully or when overcharge current is detected etc.
Ni-Cd / Ni-MH Battery Charger Prototype Images:
Program code for Ni-Cd / Ni-MH battery Charger:
Download the essential libraries for the program code:
- Press Ctrl + Shit + L (OR) Sketch -> Include libraries -> Manage libraries.
- Enter INA219 in the search box and click install.
- Now another window will pop-up and click install all and wait for some time to get installed and you are done.
2) I2C LCD Library:
Please click this link to download LiquidCrystal_I2C.h: Click Here
How to operate this charger correctly?
You need to set the correct voltage and current on the buck converter, if you set a current beyond the tolerance value of the charger, it will cut-off the battery and display error messages. The charger can only charge the cells in series and all cell’s capacity must be the same.
Setting the voltage on buck converter:
- Even though Ni-Cd / Ni-MH cells don’t have a fixed charging voltage, the open circuit voltage of the buck converter must be greater than the cell’s nominal voltage by +0.4V per cell.
- For example: If your cell’s nominal voltage is 1.2V, the minimum charging voltage must be 1.2V + 0.4V = 1.6V or above.
- For 2 cells charging in series 1.6V x 2 cells = 3.2V or above.
- For a battery pack with 7 cells in series, the charging voltage must be, 1.6V x 7 cells = 11.2V or above.
The simplified charging voltage formula: V = 1.6V x Number of cells in series.
Setting the charging current on buck converter:
This is the most important parameter to be set properly on the buck converter.
- After you finish setting the voltage for your buck converter for a given number of cells, now keep the current adjust trim POT to minimum position.
- Grab a multimeter and measure the short-circuit current at buck converter’s output. Now slowly raise the current to 0.1 x mAh.
- For example, if your battery pack or cell is rated for 1000mAh, then set the current precisely to 0.1 x 1000 = 100 mA. It doesn’t matter if you are connecting a single cell of 1000mAh or series of same capacity cells.
Note: As long as the current is set to the recommended levels, the voltage cannot rise too much to harm the cell or battery pack.
How to start charging:
- Turn on the circuit with completed circuit setup and set the voltage and current as recommended above.
- First, it will ask you set the battery capacity as shown below. Press INC button to set from 100 mAh to 3800 mAh, each press will increment 100 mAh.
- Press start/enter button to save; now it will recommend you a current value to be set at the buck converter’s output and make sure that buck converter’s short-circuit current matches the recommendation and you have +/- 15mA tolerance.
- After the displaying current recommendation window, it will ask you to set charging duration in hours and minutes. You should set it between 15 to 16 hours.
- Use INC button to set hour (0 to 23) and press enter.
- Next it will ask you set minutes, press INC button to increment minutes on the screen and press enter, the battery starts charging immediately.
- The charging screen looks as illustrated below, with real time current monitoring and a countdown (hours, minutes, seconds left for full charge).
- When the battery is fully charged i.e. when countdown reaches 00:00:00, the relay disconnects the battery and buzzer makes a long beep and you may remove the battery from its holder.
Note: If you want to stop charging the batteries before countdown reaches zero, please long press INC and START button together to until “charging halted” message appears on the display. If you directly disconnect the AC supply, the charger will consider as power failure and next time when you connect the supply it will start from where the countdown left (Hour & minute).
Important error messages:
The proposed project can detect abnormal charging conditions like low charging current, high charging current, power failure etc. and if it finds any it will display it on the LCD and beeps.
If you accidentally set a higher current value than the recommended current, the charging process with be halted and an error message will be displayed accompanied with beeps once every 5 seconds.
Overcharge condition occurs if the charging current exceeds 15 mA more than the recommendation.
Low charge current:
Low charging current condition occurs if the charging current drops 15 mA below the recommendation. Here the charging process will NOT be halted and continue to charge at a lower current. The display will show this alert once every 1 second.
Automatic power failure recovery:
The charger can recover from a power failure and resume charging when AC power is restored. It can remember the time when power failure occurred thanks to internal EEPROM on Arduino.
No Battery Detected Alert:
You will see this alert when you remove the battery while charging or when no battery is connected after pressing start or when there is some wiring issue with the circuit that connects from buck converter to battery.
When battery is removed while charging the timer stops and when you re-insert the battery the timer resumes.
If you have any questions regarding this project, please feel free to ask us in the comments, you get a guaranteed reply from us.