# LM317 to charge a NImh battery from usb [closed]

Hi want to charge my 4000 mAh 1.2V nimh cell battery simply, I do not use them very often. So I wanted to plug this kind of voltage regulator

which I think is like that : https://en.wikipedia.org/wiki/LM317#/media/File:LM317_typical_schematic.svg

I setup the Vout at 1.45V and plug it on my battery (Vout on the +) as the Usb should deliver 500mA@5v I would expect to have at least 500mA@1.45V.

but when I test it I have only 100mA for charging. The LM317 is hot (near 50°C). To test another way, I plug a power bank which can deliver 2A@5V but same thing current is near 100mA@1.45V.

Any idea to boost this current?

• You don't charge NimH cells from constant voltage for a start. There are ways to connect the LM317 as a current source, you'll find them easily if you look. – Brian Drummond Apr 7 '16 at 12:33
• What you now do is applying a voltage to the NiMh cell. That's no good, you need to charge these cells with a current. On most NiMh cells it will say something like: charge with 200 mA for 10 Hours Note the 200 mA, that is current ! In the TI's LM317 datasheet there is an example to use an LM317 as a current source/battery charger, see page 14 of the Texas Instruments LM317 datasheet. – Bimpelrekkie Apr 7 '16 at 12:34
• LM317 or LM35 or something else entirely? If you built the module, provide a schematic. If you bought it then provide the datasheet. – JRE Apr 7 '16 at 12:46
• @FakeMoustache just from curiosity, why is that not good? – JavaForStarters Apr 7 '16 at 14:06
• You mean why do we need to charge NiMh batteries with a current ? It is because of their chemistry and electrical properties. The voltage of a NiMh is dependent on temperature and internal resistance of the battery is very low. So charging with a voltage could result in charging too fast and/or stopping the charging when the battery is not full yet. – Bimpelrekkie Apr 7 '16 at 14:14

## 1 Answer

1.45V is not enough to force a higher charge current through the cell.

In fact, you will have to keep raising the voltage as the cell charges in order to keep the charge current up. This is the reason for using a constant current charger - you have to keep adjusting the voltage upwards to keep the charge current flowing, so you might just as well use a thing that does that automatically and correctly.

NiMH is normally charged with a fixed current source rather than a fixed voltage source. A current source will automatically raise the voltage in order to keep the desired current flowing.

You can charge NiMH at very low rates without damaging the battery. You still have to have a current source rather than a voltage source.

Do NOT raise the voltage on your voltage regulator to force more current into the cell. 100mA probably won't kill the cell quickly (if the cell is a typical 1000mAh or higher cell.) 500mA would probably shorten the cell's life considerably.

If you want to charge the cell at more than a safe trickle, you will need a way to automatically shut off the charger when the cell is full. There are many techniques to recognize a full cell. You can either do the research and find out how they work and implement it yourself, or you can by a charge management IC that knows how to do it. Or, of course, you can buy a commercial charger that has all that done for you.

Simply connecting a modern cell to a power source and waiting is a recipe for a dead cell, a fire, or an explosion. The higher the charge current, the more likely the explosion. And keep your paws OFF of rechargeable lithium cells if you don't have a proper charger - they are far more likely to self destruct.

Forget to mention: If you are trying to charge from the USB port on a PC, you will only get 100mA. 500mA from a PC USB connector requires that the USB device talk to the controller and request 500mA. This EE stackexchange question explains the details.

TL/DR: You need a proper charge circuit for NiMH.
Charging with a simple voltage regulator will sooner or later kill the cell.
You can't expect more than 100mA from a PC USB port.

• ok indeed constant current and NOT constant voltage is the key. So you advise me not to boost the voltage regulator because if it is at 100mA, one hour later it could go really futher. This is why I need current regulator, got it. My cell is 4000 maH so 400mA for charging is matching the 1/10C for 14hours recommanded way I think. Charging slowly nimh is difficult because it is hard to calculate the loss of charge as it grows up when the charge current goes down – bodtx Apr 7 '16 at 15:12
• Nope, I advise not to boost the voltage because when the battery is discharged (empty) the current will be much higher if you are using a regulated voltage instead of regulated current. – JRE Apr 7 '16 at 15:16
• If you charge a cell using constant voltage, and it starts out charging at 100mA, then after a while the current will drop and you won't be charging anymore. – JRE Apr 7 '16 at 15:16