LM317 battery charging circuit.
Mar 8, 2006 at 7:28 PM Thread Starter

#### MASantos

am starting to build a charging circuit and have some question regarding it.
I am thinking about doing something like the PINT charging circuit.
THe battery pack will have between 14,4-16,8v and between 600mA-900mA made with AAA cells. It will power a PIMETA which is drawing around 60mAh in its current configuration(double buffers in L/R channels, OPA627, class A).
The power supply is a 24v TEPS.
The schematic(the resistor value is wrong) and pcb layout are in the attachments.
The objective is to be able to charge the battery pack while the amp is on
My questions are:
I understand that the resistor sets the current, but what sets the voltage to correspond to the battery pack voltage?

I read the datasheet of the LM317 but didn't find away to claculate the resistor value acording to the current needed?Is it only needed to apply ohms law?

Is the layout aceptable? I will bend the LM317 over the resistor and diodes to reduce space. In some of hte wire holes I will place a connectro of some sort for servicing purposes.

What could I improve here?

Manuel

Mar 8, 2006 at 7:53 PM

#### NeilR

You have to adjust the Steps voltage to some reasonable value. I think the generally accepted formula is (#cells * 1.55V) + 1.5V. If you use 10 cells you would need about 17V.

The idea being that the cells need about 1.55V each (additive if in series) plus an extra volt or two. That is the voltage acros the terminals; add in any voltage drops across diodes and the LM317.

I added a trickle charger to my Pimeta, but I used a resistor instead of an LM317. In my case the voltage played a major role in determining the charge current. In your case, the LM317 will do that. I protoboarded it, more or less, and played with my resistor value and voltage to get a charge curve I liked.

Mar 8, 2006 at 7:56 PM

#### amb

##### Member of the Trade: AMB Laboratories
The LM317 CCS formula is simply R = 1.25 / I
where current is in amps. For example, if you want 25mA, then use a 50Ω resistor.

Mar 8, 2006 at 9:14 PM

#### MASantos

Could I add diodes in series in order to drop the voltage and adjust it?

Mar 8, 2006 at 10:02 PM

#### amb

##### Member of the Trade: AMB Laboratories
Quote:

 Originally Posted by MASantos Could I add diodes in series in order to drop the voltage and adjust it?

If you're going to be using a LM317 CCS for charging, then there is no need to drop the voltage with diodes. If you're going to use just a plain resistor (which will cause the charge current to be larger initially and then reduce to a lower value as the battery voltage increases), then you need to determine the power supply voltage and the resistor value so that the initial charge and ending trickle charge currents are optimized. This is not a trivial matter need to be quite exact. Morsel and I are working on this for the upcoming Mini³ pocket amp. When done right, this will give you the best of both worlds -- faster initial charge and safe ending trickle current.

Mar 8, 2006 at 11:08 PM

#### MASantos

I remember Tangent saying on an old thread that the current draw from the map needed to the bigger than the one going through the batteries otherwise the circuit wouldn't work. Would this be true in this case?

Mar 9, 2006 at 12:46 AM

#### NeilR

I said "reasonable voltage" above because I was concerned about the power dropped across the naked regulator, which will be lying on diodes and might be packed in a tight case. With the configuration given, it might be dropping up to a watt, which the data sheet suggests will raise the temp 50c.

Mar 9, 2006 at 6:55 PM

#### MASantos

Mar 9, 2006 at 7:13 PM

#### NeilR

Quote:

 Originally Posted by MASantos I was thinking about using these AAA batteries to build the battery pack: http://cgi.ebay.co.uk/AAA-900mAh-NiM...ayphotohosting What do you think of the specs? Could someone help me with the question in the post before(#7), regarding the currents?

I remember reading that (Tangent's) post just prior to building a charger into my Pimeta. I don't recall his reasoning. I know my Pimeta can draw less current than the batteries/charger (as currently configured) and I have not had any issues. It would be interesting if someone could provide a link to that post.

Mar 9, 2006 at 7:19 PM

#### mono

Quote:

 Originally Posted by MASantos I remember Tangent saying on an old thread that the current draw from the map needed to the bigger than the one going through the batteries otherwise the circuit wouldn't work. Would this be true in this case?

It would be easier to know what he meant if we had the context, could read the thread. In general, an LM317 CCS circuit does not depend on the amp drawing any current, the amp could be turned off and the batteries would still charge.

I assume "map" means "amp", I was scratching my head wondering what a map was.

Quote:

 I was thinking about using these AAA batteries to build the battery pack: http://cgi.ebay.co.uk/AAA-900mAh-NiM...ayphotohosting What do you think of the specs?

They look typical, and many poor rechargeables may share them. Important is how reliable those specs are, a variable I don't know. Also missing is a self-discharge rate spec, some generics discharge fairly quickly and that's already a weak point for some uses of NiMH cells. Unless you have independant (and competent) comparisons by a 3rd party, buying generic cells is a gamble, you might win or you might be better off buying the more popular and universally regarded cells such as sanyo.

Mar 9, 2006 at 7:20 PM

#### tangent

##### Top Mall-Fi poster. The T in META42. Formerly with Tangentsoft Parts Store
Quote:

 Originally Posted by MASantos what sets the voltage to correspond to the battery pack voltage?

You simply set the supply voltage sufficiently high, and any excess is dropped by the regulator.

I use the rule cells * 1.55 + 2 as a good rule for finding the minimum supply voltage. It's conservative, but that's good engineering for you.

Quote:

 Could I add diodes in series in order to drop the voltage and adjust it?

That's not "free". All that will do is change where the heat is produced in the circuit, not change the fact that you're dissipating power.

Let the LM317 do what it's there for: soak up the excess voltage.

Quote:

 Originally Posted by amb When done right, this will give you the best of both worlds -- faster initial charge and safe ending trickle current.

It does do that, but that's not the whole story.

Faster charging means the cells will die after fewer charge cycles. How many fewer? I don't know. To find out, one would have to do a long-term test with many samples. I'd be kind of surprised if that has been done, since constant current charging is so prevalently the standard.

I suspect the reason constant current charging is the standard is that it charges the battery fastest for a given safety level. Say we want to use a 0.1C charge current (e.g. 75 mA for a 750 mAh battery) to get a long cycle life. With a CCS charger, you simply set it at 0.1C, and you're done. With a resistor setting the charge current, the only way to meet that goal is to start with 0.1C; inevitably, the charge current will drop over time, so the charge time will be longer. To get the same charge time in this variable current scheme as with a CCS charger, you must start with a faster charge current (thus putting more stress on the cells) and end with a lower current, such that the average charging current over time is 0.1C.

The question then becomes, which one damages the cells more? Imagine a graph of cell damage vs. time. For a CCS charger, I imagine you'd have a flat line during the time that the battery is charging (constant damage), then tilting upward at the end as you overcharge the battery. For a variable charger, the damage curve would start higher, then drop over time, and probably tilt up again at the end, but at a shallower angle than with the CCS charger. Now if you plot the total damage over time, I believe you'll have two curves that intersect at some point, which will tell you how many hours of overcharging it takes for the CCS charger to exceed the total damage caused by the initially high damage caused by the variable charger.

What is that number? I don't know, and I don't think Team Mini3 knows, either. Therefore, I choose the conservative path: use a CCS charger, and don't neglect the amp for too long. I don't worry much about several hours of overcharge, when you're using a trickle charging current. Battery manufacturers have been saying it's safe to trickle charge NiMHs for a full year. No doubt it isn't good for them, but given that, how much can a few hours extra hurt?

Quote:

 Originally Posted by MASantos I remember Tangent saying on an old thread that the current draw from the map needed to the bigger than the one going through the batteries otherwise the circuit wouldn't work. Would this be true in this case?

It depends entirely on the layout of the power flows. The charging current needs to be higher than the amp draw when the amp is fed from the battery only, so that even the wall voltage goes through the battery circuit.

In the case of the PINT charger, that's not the case, because D1 provides a path for the wall current that goes past the battery. The battery sips what it needs to charge, and the amp takes what it needs. The two are more or less in parallel here.

Mar 10, 2006 at 1:26 AM

#### MASantos

Thanks for all you imput! Questions are popping in my head as I think about layout and features I want.

In order to implement a SPST switch to control on/off charging where is the best place to put it in the circuit. From what I understand, if I place it betweeb W+ and LM317- IN this will make this possible right?

Mar 10, 2006 at 9:30 AM

#### morsel

Accupower makes 1000mAh (1Ah) AAA NiMH batteries.

14 cells, 1Ah each
C = 1A (current to charge battery in 1 hour)
C/5 = 200mA (reasonable starting current)
C/10 = 100mA (reasonable average current)
C/20 = 50mA (reasonable ending current)
A = 4 (desired ratio of starting to ending charge current)
Vbmin = 17.5V (batteries are dead)
Vbmax = 20.26V (batteries are fully charged)
Vc = charging voltage = (A*Vbmax-Vbmin)/(A-1) = (4Vbmax-Vbmin)/3 = 21.2V
Vrmax = Vc - Vbmin = 21.2 - 17.5 = 3.7V
Vrmin = Vc - Vbmax = 21.2 - 20.26 = .94V
R = 3.7V / 200mA = .94V / 50mA = 18.5 Ohms
24V-21.2V = 2.8V = 4*.7V = 4 diode drops
P = I²R = (.2)²*18.5 = .75W

So, use 4 diodes to drop the 24V supply to 21.2V,
and a 18.5 Ohm 1W resistor to do the charging.

Mar 10, 2006 at 9:35 PM

#### MASantos

Quote:

 Originally Posted by morsel Accupower makes 1000mAh (1Ah) AAA NiMH batteries. If you wanted to use resistive charging, how about this: 14 cells, 1Ah each C = 1A (current to charge battery in 1 hour) C/5 = 200mA (reasonable starting current) C/10 = 100mA (reasonable average current) C/20 = 50mA (reasonable ending current) A = 4 (desired ratio of starting to ending charge current) Vbmin = 17.5V (batteries are dead) Vbmax = 20.26V (batteries are fully charged) Vc = charging voltage = (A*Vbmax-Vbmin)/(A-1) = (4Vbmax-Vbmin)/3 = 21.2V Vrmax = Vc - Vbmin = 21.2 - 17.5 = 3.7V Vrmin = Vc - Vbmax = 21.2 - 20.26 = .94V R = 3.7V / 200mA = .94V / 50mA = 18.5 Ohms 24V-21.2V = 2.8V = 4*.7V = 4 diode drops P = I²R = (.2)²*18.5 = .75W So, use 4 diodes to drop the 24V supply to 21.2V, and a 18.5 Ohm 1W resistor to do the charging.

How did you calculate the VBmin and VBmax?

A regular rechargeable NIMH has 1.2volts. 14 cells* 1.2 volts=16.8V

So should VBmin be less than that?

Mar 10, 2006 at 10:03 PM

#### morsel

Quote:

 How did you calculate the VBmin and VBmax?

Vbmax was measured across 2 (7 cell) fully charged Accupower NiMH 9V batteries while on C/20 trickle charge. A C/3 load was used to drain the batteries until the voltage rapidly plummeted and was disconnected at 12V. A C/5 charging current caused the voltage to rise rapidly and stabilize in the vicinity of Vbmin after about 1 minute.

Quote:

 A regular rechargeable NIMH has 1.2volts. 14 cells* 1.2 volts=16.8V So should VBmin be less than that?

Good question. 17.5V / 14 = 1.25V per cell. Vbmin and Vbmax are measured across the batteries with charging current applied, which is very different from measuring batteries that are not being charged, whether loaded or unloaded.