Ni-MH battery charger using LM317T

Here is a current and voltage constant AA Ni-MH battery charger circuit. You may be like me. I use an electric shaver almost every day. It requires an alkaline battery, but it is very wasteful, I have to change this type of battery often.

NiCD NiMH battery charger using LM317

Later, the AA Ni-MH rechargeable battery increased its capacity. Thus, I use it instead. It made me save more money. According to the manufacturer’s information, We can charge it up to 1,000 times (if used properly). How could we do that?

Proper Ni-Cd/Ni-MH battery charger systems

It has an important condition:

  • It should be charged with a current of 0.1 of the capacity or called 0.1C, for about 12-16 hours.
  • While this type of battery is being charged, it should not exceed 1.55V.

Therefore, we should use a proper battery charger circuit.

Safe with Constant current

We should charge it with Constant current. This method is easy and safe. But it takes a very long time. 

For example 2400mAh battery of mine, a suitable charging rate is 0.1C. Thus, we should charge with a constant current of 240mA for 10 hours. But actually takes 14-16 hours. Because when the battery is almost full, the current will be charged less.

If needing to charge faster. We can increase the charging current to 720mA (0.3C). And the charging time will be faster to 3-5 hours.

Good sound? But…be careful!

When the battery is full, have to disconnect it immediately. Otherwise, the chemicals inside it get too hot. Until causing damage

For me, it is better to charge with 0.1C.

Keeping battery is not overvoltage

While this type of battery is being charged, its voltage should not exceed 1.5V.

Imagine we will charge two AA Ni-MH batteries. But set input voltage at 20V. It is too overvoltage. The charger circuit is heavily burdened by excess voltage and sometimes the battery voltage may increase too much.

How is this useful? Read more


How to pick a charger system

Ideas for choosing components or as some people called the design of the circuit. It is very interesting and challenging. Sometimes it is very painful. In this case, let’s think about it step-by-step.

LM317 constant current

First, think about charging by constant current. We use both the 7805 regulator chip, NPN transistor, and PNP transistor.

This time, let’s try LM317 chips. It is simple and easy, just like the 7805. It is good at the simple variable power supply and very useful. If I would explain to you all about it, this post will be very very long surely.

So you should read before: LM317 works pinout, and more.

Now, Let me explain to you how to use it as a simple constant current.

Look at the circuit below. Yes! there only is IC and Rs. Is it easy?

simple LM317 constant current

In short, we can find the output current (Iout) easily, too.

Iout = Vref ÷ Rs

Imagine we use Rs of 10Ω.
Vref = 1.25V
Therefore, Iout = 1.25V ÷ 10Ω = 0.125A

If we want Iout = 240mA = 0.24A

Rs = 1.25V ÷ 0.24A = 5.2Ω

You may use 5.6Ω.

Important: The input voltage should always be greater than the output voltage at 3.6V.

In this case, two AA battery charging. It is 1.2Vx2 = 2.4V. Therefore, the input voltage should be 6V.

With this level of voltage, the LM317 works at full capacity. It will lose less of the excess energy. And almost no chance that the voltage of each battery (while charging) will exceed 1.5V at all.

Regulated voltage Supply

We should use the input voltage to be a 6V 500mA regulated power supply, to maintain the efficiency of the circuit, and reduce the chance of overvoltage for a Ni-MH battery.

We have many circuits to choose from regulator ICs such as 7806, 7805 or even LM317 are easy to use.

But today let’s use a transistor circuit. We will try to calculate the components, modify them, and compare the differences. Even though the circuit is old. But if we already have these components. We should try to learn it.

Block Diagram of Universal NiCD NiHM Battery Charger

Here is a step-by-step process.

  • 10V unregulated Supply
    Almost all electronic projects that use the AC Main Circuit must use this part. It is a simple DC power supply circuit. That is easy to design.
  • Simple Voltage Regulated Supply
    It is Series Regulator with adjustable output voltage to make a constant voltage.
  • LM317 constant current
    It is an easy circuit. Why? read below.
  • Ammeter
    Shows the amount of current flowing into the battery and knows that the connection points are normal.
  • 2 Batteries in series

Let’s get started.

500mA DC Unregulated supply

The above simple regulator circuit requires the input source as DC unregulated supply.

Normally, a transistor regulator circuit requires an input voltage more than the output voltage of about 3.5V. Thus if the output voltage is 6V, the input voltage should be 9.5V up.

It means that we need to build a 9.5V unregulated power supply. Look at the circuit below.

500mA DC Unregulated supply
10V Unregulated power supply

It has a 9V transformer, If no load the DC output voltage is about 12.6V

When we use a battery with a size of about 2.4V and not more than 200mA. It is advisable to use the DC power supply 12V 300mA. Set …

  • The voltage of the secondary winding is 9V at 500mA.
  • Capacitor-C1 is the filter to smooth voltage. We use a 1,000uF 25V electrolytic capacitor for this current.

Related circuits about battery chargers

Then, we look at a simple regulated circuit. To adjust the voltage in all 3 levels above

basic Series Feedback 6V Voltage Regulator

It is a Series Feedback Voltage Regulator circuit that uses a transistor and a Zener diode.

Learn more: Series Regulator with adjustable output voltage

So what?

Here is a step by step to calculate roughly this circuit only. But it is enough for practical use.


When Vout = 6V
Get VB = 6V + 0.7V = 10.9V
Find RB = (12V – 10.9V)/1mA = 1.1K
Use RB = 1.2K


Some current of Vout is a bias current of Both Diodes-D1-D2 of about 4mA. So, the current flows RA of 4mA.

VD1D2 = 1.4V

It is a way to find RA = Vout – VD1D2 ÷ IRA

R4 = (6V – 1.4V) ÷ 4mA = 1.15K
But the resistor is not for sale. Therefore, we use a 1K resistor instead.

We will see that the bias current of the Diodes is still 4mA. Though Vout is lower than 10.3V.

Because… When Vout reduces. And the current of RA is lower, too. But the current of RB is more. So, the bias current Zener diode is 5mA.

Do you understand?


Then, set the current of RE is 2mA.
So, we can find RE = (2.4V + 0.6V)/2mA
Use RE is 1.5K


Vout = 3.1V
RV = (3.1V – 3V)/2mA = 50 ohms
Use 50 ohms

Vout = 5.5V
RV = (5.5V – 3V)/2mA = 1.25K
Use 1.2K

Vout = 10.3V
RV = (10.3V – 3V)/2mA = 3.65K
Use 2.7K and 1K in series

Then, we merge all parts together to become the complete circuits below.

Ni-Cd Ni-MH battery charger using LM317

We add LED1 to show circuit power on. And R8 is limiting the current resistor of LED1.

Plus we add an ammeter to indicate current charging into the battery. At first, it read high current. But when the battery is full we read it is zero.

We can select the voltage to charge the battery by SW1.

Parts you will need

0.25W Resistors, tolerance: 5%

  • R1: 1.2K
  • R2: 2K
  • R3: 1.5K
  • R4: 50Ω
  • R5: 1.2K
  • R6: 1K
  • R7: 2.7K
  • R8: 470Ω
  • R9: 27Ω
  • R10: 5Ω

Electrolytic Capacitors

C1: 1,000µF  25V


  • D1 to D6: 1N4007, 1000V 1A Diodes
  • LED1: LED
  • Q1: TIP41, 45V 3A NPN Transistors
  • Q2: S9013, 45V 800mA NPN Transistors
  • IC1: LM317 voltage regulator IC


  • T1: Transformer 9-0-9, 500mA
  • Meter
  • Wires, AC main, battery holder, and more

How to build

Since this project has quite a few parts. So, we may assemble them on the universal PCB or perforated board. You should check the diagram well before charging the battery.

Not only that you may like these projects

Get Ebook: Simple Electronics Vol-03


I always try to make Electronics Learning Easy.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.