# Is it possible and safe to charge a NiMH battery with this circuit?

I am trying to design a circuit to charge NiMH battery packs from 2.4V to 9.6V and also single cells. From what I have read about charging NiMH batteries, it seems that all that needs to be done is to supply them with a constant current and monitor the voltage and possibly temperature to know when they are done charging.

My first thought was to use an op-amp current source to supply a constant current. I have started out with the schematic below from an instructable on building a constant current source by GreatScott:

Here is my schematic:

simulate this circuit – Schematic created using CircuitLab

I kept most of the circuit intact except for changing the op-amp to one that can handle a 12 volt power supply. The potentiometer will be replaced by a voltage divider of precision resistors once I have determined the values needed for the correct charging current. The only issue I have is choosing the value of the sense resistor. I am planning to charge the cell or battery pack at a current of 1A, which should be OK for 2300mAH AA-size cells. How should I choose the value of the sense resistor for this?

• Using M3 that way to disable the charge current is not a very elegant way. What is a neater solution is to pull the reference voltage (+ input of opamp) to ground using M3. You will need to add a fixed resistor at the top side of R2, I suggest 1 M ohm so that the maximum reference voltage will be 1.2 V (roughly). If you trim that reference voltage to 1 V you'll get 1 V across R3 as well. Since you want 1 A flowing you need a 1 ohm, 1 Watt resistor. May 11 '16 at 20:30
• Since you're charging with 1 A you must also limit the maximum charging time as you cannot rely fully on only the voltage of the cells. Ideally you also want to measure their temperature because when the cells are charged, all energy you're charging with will be converted to heat. In your case that will be about 9.6 V * 1 A = 9.6 W which is a lot and heat up your cells and you want to prevent that as it decreases their lifetime. May 11 '16 at 20:33
• Would a simple analog temperature sensor such as an LM335 or TMP36 work for that, or do I need something more accurate? May 11 '16 at 20:34
• Sure, any temperature senor would work, actually you only need to detect a "sudden" (actually not so sudden, it will take minutes) temperature increase. Because that's the sign that the cells are charged. In my opinion I'd choose the temperature measurement over the voltage measurement. The voltage does not tell you that much unfortunately. And the voltage measurement also relies on a good contact to the cells. Unless you switch off the charge current, wait a few seconds, then measure the voltage, then charge again (or not). May 11 '16 at 20:35
• Switching off the charge current to measure the voltage is what I was planning on doing as I noticed that my existing smart charger does that. May 11 '16 at 21:05

Yes, it is possible to charge an NiMH battery with that circuit. Just not reliably, and no, it would not be safe.

∆V charge termination is fiddly and unreliable at best. Worse, it is not a state, but a single event, and events can be missed. This is an easily missed event, so there is the definite possibility of uncontrolled overcharging, and it is even fairly likely.

And of course, cells will often exhibit false voltage depressions at various points during a charge, especially fresh NiMH cells. So its just as likely your microcontroller will terminate the charge much too soon.

dT/dt is the most reliable, safest, and preferred method for charge termination of both NiCd and NiMH cells when you are charging at a relatively high rate like 1A. This requires a temperature sensor, which you will need anyway if you want to build a safe charger. You cannot make a charger that is safe without it being able to sense the battery's temperature. If a charger can't do that, it cannot be safe. It's as simple as that.

Temperature sensors are a dime a dozen and cheap as anything though. Any thermistor will do as long as you know its resistance tables and have them programmed on your µC. You simply charge at a constant current, with a hard voltage limit as well. I.e., it will charge at 1A unless the voltage needed to maintain 1A rises above some set level. If it does, the charger will simply stay at that maximum voltage and the current will fall. This is because the chemical reactions in the cell are not purely current driven, there are different (and unwanted) reactions that normally don't occur, but can if enough voltage is applied to the cell. Most manufacturers seem to agree that this cutoff is about 1.8V per cell for NiMH batteries. So you want to charge at 1A, but only if you can do so using less than 1.8V.

You do that while constantly doing a running calculation on how fast the battery's temperature is rising. As soon as it starts increasing faster than 1°C per minute, terminate the charge.

Even this alone is not enough however, because a cell with high internal resistance will charge at a lower current (due to the 1.8V maximum) and may not ever actually be dissipating enough power to heat that quickly. It will instead just heat up until it vents (explodes in a controlled manner) from pressure. A safe charger requires a failsafe, which is a temperature charge termination failsafe. Terminate the charge due to temperature rise, but also terminate it if the battery reaches a certain temperature. 50°C is really the maximum you should ever aim for, but 45°C is going to be a little safer and will probably help with cell longevity.

Finally, while this is neither required for effectiveness or safety, it is good to have a timer termination as well. Yes, a third charge termination system. This is literally just a timer, set for the maximum reasonable amount of time you feel like a cell could ever take to charge (remembering that old cells with higher internal resistance could take quite a while longer to charge than brand new cells) and always terminate the charge due to the timer if the other termination conditions fail to ever occur first. This prevents the charger from cooking a weak cell for hours or days, keeping it at 40 degrees C or something but the cell is at equilibrium thermally, and just sits like that. NiMH cells do not like heat, and that will artificially age the battery very quickly, and have a very negative impact on its current condition and long term usable life.

The TL081 is not good in this circuit because its inputs only work down to about 3V above the negative supply. You should use an op amp whose common mode input range includes the negative supply, eg. LM358.

A 9.6V NiMH battery will go up to about 11.2V (1.4V/cell) at full charge. Therefore your constant current circuit needs to drop less than 0.8V at 1A if your power supply is 12V. Since there are also losses in the FETs, wires, and connections to the cells, you want the voltage drop across R3 to be as low as practicable. A value of 0.1Ω would cause 0.1V drop at 1A.

Watts = Volts x Amps. At 0.1V and 1A your resistor would dissipate 100mW. However for reliability you should use a much high wattage rating, and a metal film or wirewound type for stability.

Potentiometer R2's wiper voltage must match the voltage across R3, so most of the pot's range will be unused. You should put a resistor between +12V and the pot so that it has the voltage required for maximum current (eg. 0.1V) at the top end.

I am planning to charge the cell or battery pack at a current of 1A,

This may not be safe, because if your MCU fails to detect the voltage change at full charge then the battery will overheat. If possible you should add a temperature sensor to terminate the charge if delta-peak detection fails.

When charging a single cell at <0.5C the voltage change at the inflection point will be quite small. Your ADC should have an effective resolution of ~5mV, but also must be able to measure up to 12V. This requires at least 11 bits. To reduce measurement noise you can 'over-sample' by summing a large number of readings and dividing by the number of samples. If you only have a 10 bit ADC then divide by half the number of samples to get an 11 bit result.

To eliminate errors caused by contact and wiring resistances you should turn off the charging current when measuring the battery voltage. This only needs to be done for a few seconds every minute.

• Is there any reason to use a dual op-amp for this purpose (would an LM741, LM308 or an LM301 work too)? May 11 '16 at 21:45
• LM741, LM308 and LM301 do not have sufficient common mode voltage range. 8 pin DIP is the smallest through-hole package, and you get a spare op amp that you might need for reading the voltage. May 11 '16 at 22:02
• I just tried this circuit with the dT/dt approach suggested in the other answer, an LM324 op-amp, a 0.5 ohm 1 watt resistor, and a 2SK3561 MOSFET that I literally ripped off of the board from a broken power supply I had lying around, and it worked perfectly when charging 4 cells in series (with careful supervision, of course.) Now all I need to do is to add the rest of the recommended safety features in the code. May 13 '16 at 3:17