Author Topic: LM317 Power supply questions.  (Read 20509 times)

0 Members and 1 Guest are viewing this topic.

Offline rohan-04Topic starter

  • Contributor
  • Posts: 45
  • Country: in
LM317 Power supply questions.
« on: May 31, 2013, 12:43:10 pm »
Some of you may know that I planned to make a power supply with an LM317 and a couple of switchs. I've now decided to use the conventional ten-turn pot and a moving coil meter to make the power supply.
The  limits for the new power supply are :-
a)1.5v-15V - 1A variable voltage.
b) 5V -1A output to a usb female.
The schematic is attached.
The promblem im have trouble getting around is, when the LM317 is turned to output a low Voltage out (in this case 4V>) the power rating at 1A is at 23Watts. I plan to use a 240VAC Primary - 24VAC Secondary - 2A Transformer. I think I could have also made a very silly error in my calculations, so if you guys could help me again.

Thank you.
« Last Edit: May 31, 2013, 12:56:57 pm by rohan-04 »
 

Offline rohan-04Topic starter

  • Contributor
  • Posts: 45
  • Country: in
Re: LM317 Power supply questions.
« Reply #1 on: May 31, 2013, 01:09:47 pm »
Exactly! so what can I do to reduce this? My first guess was to cut the out put current to 0.8ma. That would bring it down conciderably.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5015
  • Country: ro
  • .
Re: LM317 Power supply questions.
« Reply #2 on: May 31, 2013, 01:14:57 pm »
The LM317 can only dissipate about 15w of heat.

A 24v AC transformer would be rated as RMS voltage. The bridge rectifier would convert that to DC with a peak voltage of 1.414 x 24 = ~ 33v , minus the voltage drop on two diodes of the bridge rectifier.  So at the input, you'd have about 31-32v.

To get 1.25v at 1A, the LM317 would have to dissipate (32v - 1.25v ) x 1A = ~ 31.75w, which is not possible.

You need to always have this voltage difference between input and output as small as possible.

My advice is to get a transformer with center tap or two independent secondary windings. There are transformers ready made with 2x9 volts, 2x10v  or 2x12v.
The LM317 for the USB can always be powered from one winding, while the adjustable one can switch between using one winding, or both windings depending on the output voltage.
With a 2x9v  transformer, the rectifier DC voltage would be about 11v (after bridge rectifier diode drops), for 12v windings you'd have about 15v.

With 2x9v or 2x10v you can make your adjustable power supply have two ranges : 1.25-9v and 9v-18v and put a switch on the front which basically commutes the AC1 in your design between using one winding, or both.

With 2x12v, the peak DC of about 15v for a winding is big enough to do 1.25-12v directly. If it's center tap the second winding is pointless. If they're independent windings, you can put them in parallel to get twice the current amount.
 
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: LM317 Power supply questions.
« Reply #3 on: May 31, 2013, 01:29:45 pm »
First observation - put both Leds across their respective outputs. The way you have them, you're ONLY proving the switch works :-)
Use the TO3 version of the LM317 and IF you can't have a multi-tap transformer, use the OP Voltage to drive 1 or 2 Linear PNP
Pre-Regulators, also TO3. That way you wash off most the heat on dummy devices. Alternatively, you can use the PNP Transistors as
parallel current boosters, with the LM317 just providing control current. Check the application notes.
Hello <tap> <tap> .. is this thing on?
 

Offline rohan-04Topic starter

  • Contributor
  • Posts: 45
  • Country: in
Re: LM317 Power supply questions.
« Reply #4 on: May 31, 2013, 01:32:03 pm »
The LM317 can only dissipate about 15w of heat.

A 24v AC transformer would be rated as RMS voltage. The bridge rectifier would convert that to DC with a peak voltage of 1.414 x 24 = ~ 33v , minus the voltage drop on two diodes of the bridge rectifier.  So at the input, you'd have about 31-32v.

To get 1.25v at 1A, the LM317 would have to dissipate (32v - 1.25v ) x 1A = ~ 31.75w, which is not possible.

You need to always have this voltage difference between input and output as small as possible.

My advice is to get a transformer with center tap or two independent secondary windings. There are transformers ready made with 2x9 volts, 2x10v  or 2x12v.
The LM317 for the USB can always be powered from one winding, while the adjustable one can switch between using one winding, or both windings depending on the output voltage.
With a 2x9v  transformer, the rectifier DC voltage would be about 11v (after bridge rectifier diode drops), for 12v windings you'd have about 15v.

With 2x9v or 2x10v you can make your adjustable power supply have two ranges : 1.25-9v and 9v-18v and put a switch on the front which basically commutes the AC1 in your design between using one winding, or both.

With 2x12v, the peak DC of about 15v for a winding is big enough to do 1.25-12v directly. If it's center tap the second winding is pointless. If they're independent windings, you can put them in parallel to get twice the current amount.


Thats a good idea ill look into it now. So basically If i break it into two segments of voltage being 1.25v-7.5V and 7.5V-15. I'll need to have transformer (C.T) that gives  2x9V? and togther 18v? to supply the 15V? Also what about the LEDS? do we need to account for their voltage drop?
 

Offline rohan-04Topic starter

  • Contributor
  • Posts: 45
  • Country: in
Re: LM317 Power supply questions.
« Reply #5 on: May 31, 2013, 01:42:10 pm »
First observation - put both Leds across their respective outputs. The way you have them, you're ONLY proving the switch works :-)
Use the TO3 version of the LM317 and IF you can't have a multi-tap transformer, use the OP Voltage to drive 1 or 2 Linear PNP
Pre-Regulators, also TO3. That way you wash off most the heat on dummy devices. Alternatively, you can use the PNP Transistors as
parallel current boosters, with the LM317 just providing control current. Check the application notes.

Im gonna have to research that answer and get back to you in a day...
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: LM317 Power supply questions.
« Reply #6 on: May 31, 2013, 01:46:31 pm »
Go with a switcher, less than a watt or two for heat wasted and can put out 3 times the current, so easy to build.

You can use the non HV adj. version of the switching chip as your voltage from your transformer and bridge rectifier will be max about 33V, much less than 55V input, but so what, the 24V from your bridge rectifier does not require the HV version chip  in the circuit shown, so it is even cheaper to build.

You do not need 55V of high voltage into the switching regulator  that you see in this schematic, your 24V transformer circuit will work fine.

This switching circuit by itself, is clean enough at it's output to use with just about any circuit you will work with. And all this is done without using a wasteful linear regulator,  and this circuit, even in a little tiny way will help save the planet from global warming.

Here's some ideas to play with:

If you really want a very,very, quiet smooth output, change the voltage adj. potentiometer to a dual-ganged version and you can make the switcher always track at a voltage a little above the input voltage to the LM317 linear regulator so it always has just the right min. required input voltage to work perfect.

You see, you use the switcher circuit to supply the voltage going into the input of your LM317 regulator, to a voltage that is just about a few volts higher than the output of your LM317 regulator circuit, so the switcher can function either as a high-current supply alone (connected to jacks on the front panel of your power supply), or as a pre-regulator that so greatly reduces the amount of heat wasted in the linear regulator. 

Maybe a simple voltage raising circuit using two LED's connected in series or a zener diode can make the setting voltage of the switcher always be set a few volts higher then the LM317 regulator, and then, by just using one pot, you can vary the output voltage of both regulators. That is because the voltage across a zener or a one or two LEDs when on and lighting up is quite well regulated and does just right to serve to set the needs-not-to-be-so-closely-accurate voltage output of the pre-regulator a little higher. Schematic available on request.
« Last Edit: May 31, 2013, 02:37:53 pm by Paul Price »
 

Offline rohan-04Topic starter

  • Contributor
  • Posts: 45
  • Country: in
Re: LM317 Power supply questions.
« Reply #7 on: May 31, 2013, 02:14:03 pm »
Ok so now Im doubting the LM317, should i cuck this circut and go for a SMPS build instead? An SMPS is a better way of making a power supply right? as it handles the heat better?
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5015
  • Country: ro
  • .
Re: LM317 Power supply questions.
« Reply #8 on: May 31, 2013, 02:32:55 pm »

Thats a good idea ill look into it now. So basically If i break it into two segments of voltage being 1.25v-7.5V and 7.5V-15. I'll need to have transformer (C.T) that gives  2x9V? and togther 18v? to supply the 15V? Also what about the LEDS? do we need to account for their voltage drop?

Transformers with center tap will be listed in catalogues or online stores as total voltage, with a mention saying they're of center tap variety... for example you may see  "18V CT"  - that's 18 v AC rms, center tap ,  two secondary windings of 9v AC rms linked together in the middle.
So 24 AC CT  will be two 12 v windings linked in the middle.

Center tap transformers only have three wires in the secondary side.. some allow you to separate the center wire in two to have two separate secondary windings, some don't. You have to visually see the terminals of the transformer to determine that.
Transformers with independent secondary windings have just that, two separate windings. They'll be listed as full voltage, or 2x half voltage.
You can link those in parallel to get more current, or in series to get more voltage, or you can link the middle two terminals to create a three terminal center tap transformer from it.


So again, most transformers are advertised as Voltage RMS - when you convert that to DC voltage, you multiply that value by 1.414. 
So a 12v AC rms transformer will have a peak of 1.414 x 12 = 16.9 volts.
 But when you use a bridge rectifier to convert to DC, there's a voltage drop on the diodes in the bridge rectifier.  A diode drops about 0.4-1.1v depending on how big the bridge rectifier is and how much current goes through it, and in a bridge rectifier two diodes are always on, so you have to always keep in mind, you lose about 2 times the voltage drop on a diode inside the rectifier, about 0.8-2.2v.
So your 16.9 peak voltage becomes 16.9 - 2.2v = 14.7 volts.  We're always using the worst case scenario values, you might have better bridge rectifier but we just have to be sure it would work in all cases.
Now, remember this is a PEAK voltage. The rectified voltage will not be a straight, smooth, DC line, it will vary between this peak of 14.7 volts and go down close to 0v for very short amounts of time.  This is where the capacitor after the bridge rectifier comes in: it fills up when you get close to peak voltage and then when the voltage from transformer goes down, it fills the gap.
With an infinite size capacitor, you will get a perfect straight DC of about 14.7v  but infinite capacitors are impossible.  With more realistic values of something like 3300uF-4700uF, the DC voltage will fluctuate by about 1-2 volts, maybe a bit more depending on how much current your circuit uses.
So with this in mind, assuming in worst case scenario the voltage will vary by 2 volts in the capacitor, the linear regulator will at some points only receive about 14.7-2v = 12.7 volts.
The linear regulator itself needs about 2 volts above the output voltage to regulate the output properly, so that's what limits your output voltage ... 12.7v input - 2v drop on regulator = 10.7v  ... so a range of  1.25-10v is adequate and safe.

Now with these values, 12.7v DC input , 1.25-10v @ max 1A your maximum wasted power will be (12.7v-1.25v )x1A = 11.45w , the lowest would be (12.7v-10v) x 1A = 2.7w.
Both are below the maximum of about 15 watts, so as long as you have a good heatsink on the chip, it's perfectly safe and good.

One more thing you have to keep in mind... transformers don't always output exactly 12v ac rms (if they're rated for that) ... at low amounts of current, they may output up to 10-15% more.
Let's say you only use 100mA ... in this case the transformer may output 10% more, or about 13v AC rms ... that converts into over 18 volts and even with the drops in the bridge rectifier you may have a voltage after the bridge rectifier of over 16v.
If you don't know this, you may say "well, 14.7v dc is less than 16v so i'll use 16v capacitors to smooth out the rectified voltage" but you really have to use  capacitors rated for at least 25v, just for such cases.

LM317 is a good linear regulator.  It's easy. Just use a transformer with smaller voltage like I've explained above.
SMPS are harder to make and not work right on prototyping boards so you'll have to solder them on pcb, get adequate inductors, low voltage drop diodes, it's much harder to get them right.
If you're a beginner like you seem to be, it's a good project and learning experience to make one of these linear power supplies first. You'll learn from everything a lot.

Regarding LEDs... leds are current devices, they don't care about voltage that much as long as it's over a certain value. You need to use a resistor to limit the current going into the led, and the resistor will also drop the voltage on it.
The formula is simple ... let's say your led is rated for 3v 10mA ... at 10mA it would be super bright, so use 5mA to make it light less bright and live longer. 

You're going to power it from the input voltage as that won't vary... if your input is about 12v as I did the math above, you have the formula V  = I x R    so  12v  = 0.005 x R  so R = 12 / 0.005 = 2400 ohm.  You round up to a standard value like 2700 ohm  or you can put two 4700 ohm resistors in parallel to get 2350 ohm.  It's not a critical value, if it varies by a few hundred ohms, you get 4 or 6 mA of current in the led, still below the maximum of 10mA.
« Last Edit: May 31, 2013, 02:39:57 pm by mariush »
 

Offline rohan-04Topic starter

  • Contributor
  • Posts: 45
  • Country: in
Re: LM317 Power supply questions.
« Reply #9 on: May 31, 2013, 02:42:23 pm »
Alright, So tomorrow im gonna go hunt for a transformer. And im also gonna trim down the requirements and make it just a 12V system, and seee how it goes.

Thanks alot, you solved alot of my questions without me even asking them :)
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: LM317 Power supply questions.
« Reply #10 on: May 31, 2013, 02:46:39 pm »
It is a myth that  you always need a PCB to make a circuit like this.

I have built many well-working switchers like I show in the schematic, some putting out at least 3 to 5 Amps or so, just on perfboard, no PCB is really required, just try to keep leads short, but kinda neat looking, use reasonably larger wire for ground and power carrying connections, but use no wire so big it is clumsy to work with.

I have even built this circuit without any board  at all just hanging together in mid-air,  and it works very very well.
(of course, the power supplied into the switcher circuit was coming from a discarded 18.5V 3.5Amp wall wart lying on the table that once was used to power a Dell laptop and so I didn't have a big transformer and capacitor and bridge suspended in mid-air!)

Both types of power supplies have their building and operation pros and cons, but both are fun to work with.
« Last Edit: May 31, 2013, 03:24:07 pm by Paul Price »
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: LM317 Power supply questions.
« Reply #11 on: May 31, 2013, 02:48:05 pm »
You could just abandon the LM317 and make a switcher, so much easier to build or use my suggestion above to use both technologies and you will learn about switchers and linear power supplies.

You can get all the low-voltage drop diodes, maybe a small heat sink, and a large toroid inductor, maybe just about all the parts you need, (except for the LM2976, LM2975, etc regulator) for free to build this supply from salvaging the parts form a junk PC computer power supply.

I don't think, after making so many of these switchers in every PCB and Perfboard way,  that SMPS are harder to make and not work right on prototyping boards, that you'll have to solder them on pcb, or it is hard to find or get adequate inductors, low voltage drop diodes, that it's much harder to get them right.
« Last Edit: May 31, 2013, 03:00:54 pm by Paul Price »
 

Offline JackOfVA

  • Supporter
  • ****
  • Posts: 350
  • Country: us
Re: LM317 Power supply questions.
« Reply #12 on: May 31, 2013, 03:06:26 pm »
If you use an LM-317 note that they have a minimum current rating as well as a maximum current rating. TI, for example, spec's the LM-317 it manufactures as 3.5mA "typical" minimum current requirement and 10 mA "maximum" minimum current in order to maintain regulation.

The voltage divider that you use  to set the output voltage may draw sufficient current to meet this requirement.



 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: LM317 Power supply questions.
« Reply #13 on: May 31, 2013, 03:10:29 pm »
In your original schematic:

The 240 ohm resistor connecting from the output pin to the Adj. pin of the LM317 already ensures the min. current requirement for regulation is already met.

Did you know that you can also use a 7805 or 7812 regulator to create a variable output regulator without buying a LM317?
With a small negative supply for bias(LM555 circuit to make), they can also have a min. regulated output voltage down to zero volts. The 240 ohm resistor in the original schematic has to be increased to 3.3K to get it to work and the center ground pin become the adj. terminal.
« Last Edit: May 31, 2013, 03:29:04 pm by Paul Price »
 

Offline JackOfVA

  • Supporter
  • ****
  • Posts: 350
  • Country: us
Re: LM317 Power supply questions.
« Reply #14 on: May 31, 2013, 03:37:24 pm »
Drop between OUT and ADJ is 1.25 volts, and there's a 240 ohm resistor between these two points.

1.25V / 240 ohms = 5.2 mA. Meets typical but not worst case minimum current.

It's very likely adequate 99% of the time since  TI is usually conservative in its worst case specs, but it is a bit short of the worst case spec sheet value, so if one were to design to meet the worst case specification, something closer to 120 ohms would be required.

Or am I missing something?
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: LM317 Power supply questions.
« Reply #15 on: May 31, 2013, 03:53:55 pm »
For the 24V circuit he is using, the 240 ohm is more than adequate. See the attached graph at the point Vin<30V the requirement is less than 3mA.  See attached graph from NatSemi Spec Sheet.

I also show some very blurry photos(cell phone camera not so good) of the entire switching regulator built on a  1.5 x 3-in approx  perf board.  The black sausage-like object at the bottom(top view) is the inductor, the switcher chip is on right side with a small heat sink and there is a slightly off-board connector to fit the PC power supply plug for power coming in.
« Last Edit: May 31, 2013, 04:17:25 pm by Paul Price »
 

Offline JackOfVA

  • Supporter
  • ****
  • Posts: 350
  • Country: us
Re: LM317 Power supply questions.
« Reply #16 on: May 31, 2013, 04:23:44 pm »
For the 24V circuit he is using, the 240 ohm is more than adequate. See the attached graph at the point Vin<30V the requirement is less than 3mA.  See attached graph from NatSemi Spec Sheet.

I think the plot of Imin versus voltage differential is of "typical" Imin, not worst case. ON Semi, for example, has pretty much the same curve, but still specs Imin at 3.5 mA  typical; 10 mA worst case.  Fairchild data sheet has no similar plot, nor does STM for their LM317 offerings.

I agree, though, that 5 mA in the original circuit is adequate for almost all cases, but have a nagging concern about how often the "worst case" condition will surface.

 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: LM317 Power supply questions.
« Reply #17 on: May 31, 2013, 04:27:49 pm »
Not to split the current hair, but the graph is titled "Minimum Operating Current", and I would assume "operating" means that a regulator is operating as a regulator and the 240-ohm supplies current n x s.
« Last Edit: May 31, 2013, 04:29:32 pm by Paul Price »
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: LM317 Power supply questions.
« Reply #18 on: May 31, 2013, 04:32:25 pm »
Or am I missing something?

No, you are not.

What people typically miss in the LM317 datasheets is that all the circuits in them are typically for the LM117, not the LM317. And guess what, the LM117 has a max (worst case) Imin of 5 mA, vs the 10 mA of the LM317.

The 240 Ohm resistor one typically finds in the datasheet schematics is for the LM117. It typically also works for the LM317, but if you want to be on the save side, change it to 120 Ohm, and half the other resistor of the divider, too.

This is an issue with LM317 datasheets since forty or so years. And there must be millions of devices with LM317th out there with a too weak Imin. Apparently most of them work most of the time, so it isn't such a big thing.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: LM317 Power supply questions.
« Reply #19 on: May 31, 2013, 04:45:49 pm »
My hare-brained mind tells me to quit yakking and eat my lunch, but the LM117 maybe is the one much more critical with 240 ohm min current setting than the LM317 because it must meet spec from -85 to +150 deg C.

I always use a 220-ohm, because it is easier to find, standard 5% value that is very common in use.
 

Offline rohan-04Topic starter

  • Contributor
  • Posts: 45
  • Country: in
Re: LM317 Power supply questions.
« Reply #20 on: May 31, 2013, 05:02:58 pm »
Right so now in the morning im gonna go out an buy a 240VAC to 12VAC transformer, and hopefully build up the circuit to give out 10V. What value cap should i use on C1? Is 1000uf a fair amount? or should i up it to 3300 or 4700uf?. About the value of R1, I initially planed for a 15V circuit so i thought i would use 180Ohm plus a 2k ten turn pot to get 15V out of the equation. Now to get the pot to give 10V what value will I need 300 odd Ohms, will that be too much?
« Last Edit: May 31, 2013, 05:51:11 pm by rohan-04 »
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: LM317 Power supply questions.
« Reply #21 on: May 31, 2013, 06:39:21 pm »
4700 uF is better.  Use the same pot resistance values, change the resistors the pot connected to,  used with.

 Use the formulas! Have you read the spec sheet? The part about output voltage setting is not too technical.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: LM317 Power supply questions.
« Reply #22 on: May 31, 2013, 06:42:17 pm »
What people typically miss in the LM317 datasheets is that all the circuits in them are typically for the LM117, not the LM317. And guess what, the LM117 has a max (worst case) Imin of 5 mA, vs the 10 mA of the LM317.

Eureka!

I was wondering why that resistor is always too high in the LM317 datasheets - ignoring the example circuits, I've always come up with a value around 82-120. I've never used LM117, so I never realized it had a lower minimum current.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: LM317 Power supply questions.
« Reply #23 on: May 31, 2013, 08:02:40 pm »
sonofabitch! :) I've always wondered why every schematic I see with the LM317 uses that ubiquitous 240 ohm resistor almost religiously. Although I am pushing 50yrs old now, I have never worked with the LM117 so a reason never came to me.

When I do a design with the LM317 I always end up with 100-120 ohms there (usually 100 since it's often already part of the BOM). That's what I've always used, based on worst case design.

In fact, every single design I make is based on worst case everything, including possible failure modes.  I will design for that as a worst case sometimes too, and increase values to provide protection in case of that failure.

I find that there is too much stuff  on the web that is not really engineered, just slapped together and/or copied from somewhere else.

 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: LM317 Power supply questions.
« Reply #24 on: May 31, 2013, 08:33:23 pm »
Many companies do no longer offer the LM117 at all, and over time have "updated" their datasheets by meticulously replacing every  LM117 label in their schematics with LM317  - of course keeping the old magic 240 Ohm resistor. Probably having the interns done it. Why invest in checking 40 year old schematics in a datasheet for a jelly bean IC?

And unfortunately with every datasheet revision they seem to remove application examples. Of course, some stuff is outdated, e.g. how to do a switching regulator using a linear regulator, but if you have to repair or revise old stuff it helps if you can go back to where the original developer got his idea from.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf