# LM317 Voltage regulator?

Discussion in 'General Electronics Chat' started by rougie, Dec 19, 2012.

1. ### rougie Thread Starter Active Member

Dec 11, 2006
410
2
Hello,

I am trying to use a LM317 adjustable regulator.

My Vin is 14VDC. I need to have an output of about 5VDC at 50ma.

My question is, is Vref a constant at 1.25VDC???

I looked at some previous posts and could not figure it out!

Why doesn't the formula take into account the Vin???

confused... can anyone show me the calculations to obtain approx. "14VDC in" to a variable "4.5 to 5.5 VDC" out using an LM317 V-regulator.

Thanks for all help!

Last edited: Dec 19, 2012
2. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
That is kind of the point, the reference is regulated, and it is 1.25VDC ±0.05V. This is what sets the whole formula. The 1.25VDC is regulated between Out and Adj, which sets up a constant current. This in turn sets a constant current through R2, so the voltage are locked in place due to the resistances.

This schematic is missing some very important caps (they control oscillation), but it has the basics.

3. ### nomurphy AAC Fanatic!

Aug 8, 2005
567
12
Also consider that:
14V - 5V = 9V
9V * 50mA = 450mW

You can lower the dissipation of the regulor by moving some of the wattage over to an input resistor. You need an input voltage of 7V or more to maintain good regulation.

50mA * (14V-7V) = 140 ohms @ 350mW

So, a 100 to 120 ohm 1W input resistor would significantly reduce regulator power dissipation at 50mA.

4. ### rougie Thread Starter Active Member

Dec 11, 2006
410
2
Hello guys, thanks for replying...

So Bill_Marsden suggests a 120 ohms as R1 and nomurphy suggests a 140 ohm as R2.

Vout = 1.25(1 + (R2/R1))

Vout = 1.25(1+ (140/120))
Vout = 2.7VDC ???

Confused!

5. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
There are several makes of the LM317. The garden variety requires 10ma through the chip (typically it is through R1 to be sure it is there) for reliable regulation (think of it as how the chip is powered). Several smaller versions require 5ma. It is one of those things you can play with, since the load will probably use more than 10ma (it is the throughput current that matters).

LM317 also make dandy current regulators, I use them regularly for LEDs.

No capacitors needed on this application.

6. ### nomurphy AAC Fanatic!

Aug 8, 2005
567
12
Perhaps you misunderstood -- if R1/R2 are the divider network determining the output voltage value, then I am suggesting R3 (not shown) as an input resistor between the input voltage source and the input pin of the regulator.

Regarding R1/R2, Bill is correct. I would pick resistor values that, when added in series, provide a mimimum load of 5mA across the output voltage.

So, with a desired output of 5V, the two resistors R1/R2 should add up to about 1K (5V/1K = 5mA). It isn't always possible to make this exact, just a rule of thumb.

Last edited: Dec 19, 2012
7. ### rougie Thread Starter Active Member

Dec 11, 2006
410
2
Hello guys,

Here is the spec sheet of the one I am using see KC (TO-220) PACKAGE

http://www.ti.com/lit/ds/symlink/lm317.pdf

Bof, Doesn't the spec say an IO of up to 1.5 A?

If the two resistors R1/R2 should add up to about 1K ... that could make R1 and R2 have many possibilities!!! You guys are looking at this in a too straight forwards way which confuses a noob like myself... I am more of a "use the equation given" kind of guy!

Can't we work with the formula given in the spec sheet. The spec says:

Vo = Vrerf(1+R2/R1) + (Iadj x R2)

5.0V = 1.25(1+R2/240) + (0.001 x R2)

Solving for R2 gives us 600 ohms!!!

I don't want to use the LM317 as a current regulator! And adding a series resistor between Vin and the input of the LM317 as av-drop could work, but I am sure we can do this without this extra resistor... no!

So confused ... can someone show the step by step calculations by taking into account the 14VDC in for a 5VDC output and with the ohmic values of R1 and R2 required and using this formula:

Vo = Vrerf(1+R2/R1) + (Iadj x R2)

I would like to see the work and calculations so I learn something at least!!!!
Sorry I never used an LM317 or any voltage regulators before!!! Still confused! Sorry again!

Thanks for your help... really appreciated

Last edited: Dec 19, 2012
8. ### nomurphy AAC Fanatic!

Aug 8, 2005
567
12
You can generally ignore the Iadj because it is a minor contributor.

There are two unknowns; R1 and R2, therefore you need to pick a value and perform iterative calculations (or create an Excel spreadsheet as I do).
R1 = 249 ohms
R2 = 750 ohms

Preferably 1% to maintain a proper voltage spread, because Vref may be anywhere between 1.20V and 1.30V per the datasheet.

Maybe ...you need to read the HEATSINK REQUIREMENTS section of the datasheet and do some math.

The attached PDF shows an example Excel spreadsheet, but not the math behind it.

• ###### LM317.pdf
File size:
19.2 KB
Views:
25
Last edited: Dec 19, 2012
9. ### Audioguru New Member

Dec 20, 2007
9,411
896
No.
The datasheet for the LM117 and LM317 shows that R1 should be 120 ohms for the LM317 and 240 ohms for the LM117.
If the value of R1 is higher then the datasheet says the output voltage might rise without a load. You NEVER want a regulated voltage to rise all by itself.

LM317, R1= 120 ohms and R2= 360 ohms. The output will be 5.0V with or without a load.

10. ### nomurphy AAC Fanatic!

Aug 8, 2005
567
12
No.
You must be looking at a strange brand of LM317; National app circuits show a 240 ohm for R1 and that is ~5ma (they also state a min load current of 3.5ma to 5mA).

However, note that I said a minimum load of 5-10mA is preferred, but any pre-loading is really dependent upon whether or not there is a sufficient constant load on the regulator. If the OP has a constant 50mA load, then no pre-load is really necessary and the divider resistors could be in the reasonable K ohms range if so desired.

Ultimately, this goes to the very basic issue of making sure to read the datasheet to understand the component(s) being selected. And, that a given component type can vary between manufacturers; so be careful when replacing one brand with another.

Be sure to READ and compare datasheets.

Also rougie -- note that manfucturers usually have some applications described within their datasheet (National Semi has always been pretty good about this) and reading the datasheet descriptions will typically explain what it is you need to know, such as biasing, thermal calcs for dissipation, and/or heatsinking requirements.

11. ### Audioguru New Member

Dec 20, 2007
9,411
896
Look at National's datasheet again. Almost EVERY circuit shows the more expensive LM117 that can use 240 ohms for R1.

• ###### LM317.png
File size:
22.7 KB
Views:
45
GopherT and Ron H like this.
12. ### Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
However, the load regulation for LM117 is still only spec'ed down to 10mA. I wonder why the discrepancy?

13. ### nomurphy AAC Fanatic!

Aug 8, 2005
567
12
The load spec is still 3.5mA min on the LM317 -- I'm saying the actual value depends on the circuit and actual load criteria (not one size fits all).

14. ### Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
Could you back that up with a datasheet we could look at?

15. ### Audioguru New Member

Dec 20, 2007
9,411
896
Where on Earth can you buy a "typical" IC?? You get whatever they have.
The "typical" current for SOME LM317 ICs is 3.5mA but the MAXIMUM is 10mA.
1.25V/10mA= 125 ohms so a 120 ohm resistor FITS ALL of them.

16. ### rougie Thread Starter Active Member

Dec 11, 2006
410
2
Hello,

To calculate R2, we do,

R2 = R1 * ( (VOUT/1.25) -1 )
R2 = 120 * ( (5/1.25) - 1)
R2 = 360 ohms

Please view my circuit. I have 14VDC in and output is 12.44 VDC ???

Bof! .... I am not able to get 5VDC !!!

I don't know why? Help someone!
r

File size:
54.4 KB
Views:
31
17. ### rougie Thread Starter Active Member

Dec 11, 2006
410
2
Nevermind guys... I am sooo embarrassed

In the spec sheet, they show the typical diagram with the Adj pin in the middle!!!!

In reality, when viewed from the front according to the spec sheet , the adj pin is the far left pin !!!!!

Now everything works according to the general equation!!!!

Also I used a 120 ohm as opposed to a 240. I don't see where it is recommended in the spec but I see that others recommend it for better accuracy I suppose! See here!

http://www.reuk.co.uk/Using-The-LM317T-To-Regulate-Voltage.htm

Thanks for your help guys...

Now let me see how stable this little critter is when hooked up to my circuit!

18. ### rougie Thread Starter Active Member

Dec 11, 2006
410
2
Wow, the 317 is very steady... I am running approximately 14ma and sometimes I may go up to about 35ma!

When I touch the metal tab on the LM317, its a little warm....

At a drop off of about 9VDC, should I use a heat sink?

thanks for all help!

19. ### GopherT AAC Fanatic!

Nov 23, 2012
6,309
4,029
It should be fine at those low amperages. The unit can handle 1.2 or 1.5 amps if I remember correctly. In cases where it gets really warm and you want to move some heat to another device, you can add a resistor between the power supply and the input pin on LM317. Just remember that your input has to be at least 2 volts above your output calculate appropriately on that resistor (mentioned above). Again, at 0.035 amps, you should be fine.

20. ### tubeguy Well-Known Member

Nov 3, 2012
1,157
197
Rougie... I think they did that just to mess with people, because you would naturally assume it's pinned like the LM 78XX series