# Current limiter for NiMH battery charger

I am trying to learn about electronics by making my own MCU controlled battery charger for standard AA 1.2V NiMH and NiCd batteries. The supply voltage is 5V from a USB battery pack.

I did a lot of reading on http://batteryuniversity.com/, as well as studying Energizer and Panasonic battery charging guides. I now have a very crude working prototype which controls the current input into the battery by stepping down my 5V down by burning some energy through a transistor and a diode. I have expermentaly found the amount of voltage step down required for 700mA into the battery, but this is highly variable depending on my power supply (which is highly annoying).

Now that I have the proof-of-concept working, I'd like to do the power circuit right. Controlling the voltage can obviously be achieved better with a switching voltage regulator, except that I am not really looking to hold the voltage constant. What I really need is constant current (let's say 700mA), and the voltage can vary as needed.

I have no idea how to build this kind of circuit. Are there "current regulators" that I can buy just like voltage regulators? Is this something I can build by measuring the voltage drop on a sense current resistor?

I am looking for suggestions on how to solve this problem cheaply, as well as any relevant reading material.

Thanks!

You may be looking for something more like a battery charger IC rather than a buck regulator IC. Basically a buck regulator that better understands current limit mode, which also includes charge termination and other battery protections in the same IC.

However, these are generally meant to operate standalone, so they might not give you the opportunity to program your own MCU code. Still, you can learn what features you might want to aim for in your own circuit by checking out what such a solution typically offers, and why they are important. For example:
http://para.maximintegrated.com/results.mvp?fam=batt_chrg&168=NiCd|NiMH

There are probably better circuits, but this one's interesting and easy to understand.

simulate this circuit – Schematic created using CircuitLab

If you take a 5V regulator, and put a fixed resistor across its output, then it will supply exactly enough current (100 mA) to put 5V across the resistor. Anywhere in series with that circuit the current will be 100 mA also. The resistor "Your Load" is supposed to represent your battery.

An obvious disadvantage is that you need enough voltage to keep the 7805 in regulation, but the principle is sound. You can use a 3V regulator, for example. Or an adjustable one. This may aid in understanding some of the other current regulating circuits.

• It's a decent answer for converting a linear reg to a current source but it won't work if the input supply voltage is close to the battery voltage. The op's question is unclear about this. Apr 19, 2014 at 23:13
• @Andyaka: The input is 5V, the battery is standard AA, so 1.2V Apr 19, 2014 at 23:14
• @val I see you've edited your post to specify the battery BUT what is the "4 volt" parameter all about? Apr 19, 2014 at 23:18
• @Andyaka: That was an arbitrary voltage I picked that provided me with the current I wanted. Apr 19, 2014 at 23:19
• @val 4 volts should never be across a 1.2 volt battery when charging it. I think folk may get confused (as I did) with this value. Apr 19, 2014 at 23:24

If you need to provide circa 4 volts to the battery and have an input voltage that ranges from 2 volts to 5 volts then you need a buck-boost converter. This will initially convert the input voltage via a boost circuit to above 5 volts and then use a buck regulator to convert to about 4 volts.

The added complication is that the buck regulator has to operate as a constant current source. However, there are plenty of circuits that will do this and, standard buck voltage regulators can be easily made into current sources.

I'd look at what Linear Tech have to offer - they have great search engines for their parts and always provide app circuits on data sheets. 1 hour from now you should have what you want.

If, on the other hand your input voltage is steady at 5 volts then a buck regulator is all you need.

The op has edited the question and now the battery voltage is somewhat less than the 4 volts specified. However, a buck reg is still the best choice and LT are a good candidate for finding a suitable part.

• I am sorry, I still don't get it... You are saying that I could take a buck regulator, set it to 1.5V (sufficient voltage for charging) and hook it up straight to the battery? But then how do I control the current that goes into the battery? Apr 20, 2014 at 0:09

You can do it with a linear regulator, but just barely. Use an LM317. Connect your +5 to the input. Connect the output to a (nominally) 1.78 ohm resistor, minimum 1 watt, and 2 watts or more is better. Connect the other end of the resistor to the control input of the LM317 and to the high side of the battery. Connect the low end of the battery to ground. When charging, the LM317 will maintain the voltage across the resistor at 1.25 volts, and give you 700 mA. In operation, the battery will show a maximum of ~1.6 volts, the current limit resistor will drop 1.25 volts, and the regulator requires a minimum of ~2.2 volts to operate correctly (see Dropout Voltage on the data sheet). So the voltage in needs to be a minimum of 5.05 volts. And I do believe that counts as "just barely".

If you actually want a little margin, cut back the charge current to 500 mA. This will be slightly easier on the regulator and give you about 0.1 volts margin. That's still "just barely", but a little less so.

An LM317AHVT in TO220 package will cost you $.75 from Digikey. Make sure you get a small heat sink. A Linear Technology LT317AT has a dropout voltage a couple of tenths of a volt lower, and would be a better choice. It's available from Digikey for about$4.00.