EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: XOIIO on November 12, 2013, 03:23:21 pm

Title: Do all LM 317's work the same? (if not which do I need)
Post by: XOIIO on November 12, 2013, 03:23:21 pm
Alright so I need a specific voltage for a project (4.5v) and came across this

http://static.electro-tech-online.com/imgcache/991-LM317.gif (http://static.electro-tech-online.com/imgcache/991-LM317.gif)

R1 needs to be 150r
r2 needs to be 390r

My question is, do all lm317s work the same? I tried with an lm317t and it didn't work at all, the one I can get locally is an LM317UC, will that work? If not what adjustment do I need to make to the circuit?
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: John Coloccia on November 12, 2013, 03:29:26 pm
The T in LM317t just specifies a slightly different package.  It should work the same, so it's either broken or you did something wrong.  I have no idea what an LM317UC is.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: XOIIO on November 12, 2013, 03:31:54 pm
The T in LM317t just specifies a slightly different package.  It should work the same, so it's either broken or you did something wrong.  I have no idea what an LM317UC is.

Hm, must have gotten damaged somehow then, I did salvage it from an old board.

yknow looking at their listing a lot of regulators have UC after them, i wonder why. I guess it's just some stock thing maybe http://www.be-electronics.com/product_p/lm317uc.htm (http://www.be-electronics.com/product_p/lm317uc.htm)
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: John Coloccia on November 12, 2013, 03:37:31 pm
It might just be a rev too.  There's a whole alphabet of letters that you find at the end of some chips, and the LM317 is one of them.  There's no way to memorize them all.  You need to have the secret decoder ring from the specific datasheet.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: mariush on November 12, 2013, 03:50:28 pm
There's all kinds of LM317 - they're made in different packages, they're made by different companies, usually the difference between them is the maximum input voltage and how well they handle heat (in linear regulators, the difference between input voltage and output voltage is turned to heat, and some packages are more resistant to heat, others have to heatsinked and kept cooler)

The formula to determine the output voltage is  Vout  = 1.25  x (1 + R2 / R1 ) but the R1 must be a value close to 100-120 ohms.  Both 100 and 120 are standard resistor values so you can easily find these. So determine R2 with the formula, or use R2 =  (Vout / 1.25  - 1  ) x R1 which for 4.5v and R1 = 120 ohm gives you about 312 ohm, which is not a standard value, but you can put two 620 ohm resistors in parallel to get 310 ohm and then get vOut  = (310/120 + 1 ) x 1.25 = 4.48v  Or you can put a standard 330ohm  or a 100ohm and a 220 ohm in series to get 320 ohm and get about 4.55-4.6v at output.

150 ohm may work but in some cases and with some lm317 regulators it may randomly not work properly.

Read the datasheet and see the examples but keep in mind the examples are with LM117 which needs a 240 ohm resistor, while LM317 works with 100-120 ohm like I said: http://www.ti.com/lit/ds/symlink/lm117.pdf (http://www.ti.com/lit/ds/symlink/lm117.pdf)

Also keep in mind that LM317 needs about 1.5-2v ABOVE the output voltage, to work properly so you'll need about 6-6.5v at the input to get 4.5v. There are other linear regulators that don't need as much input voltage, chips with 1117 (they're made by various companies, 1117 is like 317 in the LM317, a pretty much standard code) in the name for example would only need about 1-1.2v above 4.5v to work, for example.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: XOIIO on November 12, 2013, 03:53:12 pm
Have you checked the value of r1 and r2 ? 150 and 390 will give you something around 1.6V output.

oh, really? What do I need for 4.5v then?

I guess there is probably an online calculator for this lol.

There's all kinds of LM317 - they're made in different packages, they're made by different companies, usually the difference between them is the maximum input voltage and how well they handle heat (in linear regulators, the difference between input voltage and output voltage is turned to heat, and some packages are more resistant to heat, others have to heatsinked and kept cooler)

The formula to determine the output voltage is  Vout  = 1.25  x (1 + R2 / R1 ) but the R1 must be a value close to 100-120 ohms.  Both 100 and 120 are standard resistor values so you can easily find these. So determine R2 with the formula, or use R2 =  (Vout / 1.25  - 1  ) x R1 which for 4.5v and R1 = 120 ohm gives you about 312 ohm, which is not a standard value, but you can put two 620 ohm resistors in parallel to get 310 ohm and then get vOut  = (310/120 + 1 ) x 1.25 = 4.48v  Or you can put a standard 330ohm  or a 100ohm and a 220 ohm in series to get 320 ohm and get about 4.55-4.6v at output.

150 ohm may work but in some cases and with some lm317 regulators it may randomly not work properly.

Read the datasheet and see the examples but keep in mind the examples are with LM117 which needs a 240 ohm resistor, while LM317 works with 100-120 ohm like I said: http://www.ti.com/lit/ds/symlink/lm117.pdf (http://www.ti.com/lit/ds/symlink/lm117.pdf)

Also keep in mind that LM317 needs about 1.5-2v ABOVE the output voltage, to work properly so you'll need about 6-6.5v at the input to get 4.5v. There are other linear regulators that don't need as much input voltage, chips with 1117 (they're made by various companies, 1117 is like 317 in the LM317, a pretty much standard code) in the name for example would only need about 1-1.2v above 4.5v to work, for example.

alright thanks. I ordered one of those assorted resistor packs so I got whatever I need. Thanks for the tips.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: Andy Watson on November 12, 2013, 03:57:27 pm
Have you checked the value of r1 and r2 ? 150 and 390 will give you something around 1.6V output.

oh, really? What do I need for 4.5v then?
DOH ! Sorry, I'd managed to interchange R1 and R2 between figure and calculator. Ignore me, go with  what mariush posted.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: XOIIO on November 12, 2013, 06:46:12 pm
Well, what the hell. I've seen schematics without the caps but this won't work for some dang reason, I need over 11 volts for 4.3 output, and higher it just rises. Do I absolutely need those? I don't have a .1microfarad polarized cap on hand.

(http://i42.tinypic.com/313hwso.jpg)
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: c4757p on November 12, 2013, 06:55:13 pm
You often do need them for stability. Doesn't need to be 0.1uF (and that's too low anyway). Just stick a big one on there - 10 to 100 uF maybe? I usually use 47uF. Also, another possible problem - despite the example circuits in the datasheet, the upper resistor really needs to be 120 ohms or lower to work properly with no load at all, to meet the minimum 10mA. Usually it works fine with one a bit higher (often up to the example 240 ohms), but if your LM317 just barely meets the specs, you may need to increase the load on the output. (If you don't want to change the divider resistors, try adding 2.7k in parallel with the output to increase the load without changing the set voltage)

The LM78xx series doesn't absolutely require caps, though they should still have them. LM317 does require them.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: Andy Watson on November 12, 2013, 07:01:28 pm
Suggest you study figure 6 on page 3 of the document that mariush linked to, very carefully!
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: c4757p on November 12, 2013, 07:05:34 pm
Suggest you study figure 6 on page 3 of the document that mariush linked to, very carefully!

|O

Orrrr... you could have it wired wrong. Yep. Next time I'll look at the photo.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: XOIIO on November 12, 2013, 07:10:21 pm
Suggest you study figure 6 on page 3 of the document that mariush linked to, very carefully!

|O

Orrrr... you could have it wired wrong. Yep. Next time I'll look at the photo.
Suggest you study figure 6 on page 3 of the document that mariush linked to, very carefully!


 |O |O |O |O |O |O |O |O |O |O |O |O |O |O |O
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: Andy Watson on November 12, 2013, 07:19:46 pm
With regard to capacitors: I think it depends on the manufacturer. TI's data sheet seems to imply that it is safe to omit the output capacitor! What I do know is that I have destroyed several of the TO-3 package devices before noticing that I had (inadvertently) not connect the output capacitor. Some loads, particularly inductive loads, can cause the device to oscillate which defeats its internal protection mechanisms - I assume this to be the case - since adding an output capacitor the power supply has been happy for a good many years.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: c4757p on November 12, 2013, 07:22:17 pm
With regard to capacitors: I think it depends on the manufacturer. TI's data sheet seems to imply that it is safe to omit the output capacitor!

Depends on the application:

Quote
Although the LM117 is stable with no output capacitors, like any feedback circuit, certain values of external
capacitance can cause excessive ringing. This occurs with values between 500 pF and 5000 pF. A 1 ?F solid
tantalum (or 25 ?F aluminum electrolytic) on the output swamps this effect and insures stability. Any increase of
the load capacitance larger than 10 ?F will merely improve the loop stability and output impedance.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: XOIIO on November 12, 2013, 07:41:00 pm
damn whoever made that picture needs to be hanged, this is the most stressed out ive gotten in two days, I thought I screwed it up twice but luckily I didn't.

I may make a small quick board and send it to osh park to avoid that trouble in the future. Sheesh

(http://i43.tinypic.com/21ninv7.jpg)
(http://i42.tinypic.com/2ec3r6o.jpg)
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: Monkeh on November 12, 2013, 08:07:32 pm
damn whoever made that picture needs to be hanged, this is the most stressed out ive gotten in two days

Why? It's a schematic diagram, not a drawing or a pinout. Do not confuse them. It's straight out of the TI datasheet you were told to read (read, not skim.).
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: c4757p on November 12, 2013, 08:25:57 pm
Why? It's a schematic diagram, not a drawing or a pinout.

To expand on that a bit, schematics are not supposed to correspond directly to pinouts. In fact, prepare for some engineer-strength derision if you go to great lengths to make them match. Schematics are supposed to show the intent of the circuit, not the build pattern, so you instead follow the convention: signals (or power, in a power circuit) flow from left to right, and higher voltages go above lower. That's where the arrangement of pins in the diagram comes from.

You can label pin numbers on the schematic - that's encouraged.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: XOIIO on November 12, 2013, 08:37:01 pm
Why? It's a schematic diagram, not a drawing or a pinout.

To expand on that a bit, schematics are not supposed to correspond directly to pinouts. In fact, prepare for some engineer-strength derision if you go to great lengths to make them match. Schematics are supposed to show the intent of the circuit, not the build pattern, so you instead follow the convention: signals (or power, in a power circuit) flow from left to right, and higher voltages go above lower. That's where the arrangement of pins in the diagram comes from.

You can label pin numbers on the schematic - that's encouraged.

yeah, that would have helped lol
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: SeanB on November 12, 2013, 08:54:43 pm
Remember as well negative voltage regulators have a different pinout, and the adjustable ones a different one as well. Even worse is some will be just different depending on the manufacturer. Always helps to refer to the exact manufacturers datasheet, as you will find that different manufacturers will change specs and ratings depending on both package and whim.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: XOIIO on November 13, 2013, 06:44:34 am
If anyone is interested here is a board I threw up on osh park, I also made it single sided so that anyone who has the stuff can make it at home.

http://oshpark.com/shared_projects/IU9KGZF8 (http://oshpark.com/shared_projects/IU9KGZF8)
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: dr_p on November 13, 2013, 07:30:17 am

If anyone is interested here is a board I threw up on osh park, I also made it single sided so that anyone who has the stuff can make it at home.

http://oshpark.com/shared_projects/IU9KGZF8 (http://oshpark.com/shared_projects/IU9KGZF8)


Usually(*), in beginner designs, the 317 is powered from a transformer. So you NEED a big filtering capacitor.
1. the 0.1uF is not an input filtering capacitor, that one needs to be way bigger. A general rule of thumb is a couple thousand uF for each amp. Given the LM317 can deliver 1 or maybe even 2A, I would go for at least 2200uF (with twice the vorking voltage rating). Output capacitor is ok at 22-100uF(with twice the vorking voltage rating). If, however, you are powering it from a car battery (for instance) you can lower the input cap value.
2. you need to thicken the traces where current flows. So from Vin to Vout, also include the input/output capacitors and the ground return for the current. All of these have to be thicker (lower resistance) or you will drop voltage on them and that screws up your regulation and will heat up for no reason.



Try to think of the whole current loop: from Vin, via C1(+), to 317, via C2(+), to Vout, then through the LOAD, then back in the output ground, via C2(-), to C1(-), then back to the input ground. So I recommend separate input and output grounds, it makes for a neater design and it's easy to connect the wires.
So all the traces carry large currents, except for R1/R2 and the small 0.1uF capacitor.

And try to keep them all the same size - if all the traces are 1mm then you can't skimp on the ground return, making it 0.2mm.
Also, for power supplies like this, it might be a good idea to make the power traces as big as possible.  A 1mm trace is decent for 1.5A. If you need 1mm, make them as large as they fit. They won't do any harm, only good, there will be more copper acting like a heatsink,
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: Rick Law on November 13, 2013, 07:46:11 am
You often do need them for stability. Doesn't need to be 0.1uF (and that's too low anyway). Just stick a big one on there - 10 to 100 uF maybe? I usually use 47uF. Also, another possible problem - despite the example circuits in the datasheet, the upper resistor really needs to be 120 ohms or lower to work properly with no load at all, to meet the minimum 10mA. Usually it works fine with one a bit higher (often up to the example 240 ohms), but if your LM317 just barely meets the specs, you may need to increase the load on the output. (If you don't want to change the divider resistors, try adding 2.7k in parallel with the output to increase the load without changing the set voltage)

The LM78xx series doesn't absolutely require caps, though they should still have them. LM317 does require them.

First ... the LM317 appears rather easy to blow out by over current or mis-connected.  I had one that seem to work and then stop and then work and then stop...  I cooked it too hot once.  Perhaps your LM317 might have cooked once?

Second... Interesting.  I recently made a voltage logger and I initially had a hell of an occasional run-away oscillation problem.  After experimenting a while, a 100+uF at the input and a 47uF at the LM317 output is exactly what solved my problem.  When I commit the circuit to solder, I ended up using a 220uF at the input (to both a 7805 and an LM317 separately for dual voltage) and two 47uF - one at the 7805 output and one on the LM317 output and I have not had an oscillation problem in over a month.

(The oscillation gets started by the AC coming on, or the dish/cloth washer - a burst of noise 100 micro second'ish that most of the time is just noise, but frequently enough to knock the circuit into oscillation.)

Now I am religious in ensuring I have a capacitor at the LM317's output and put some thought into heat-sink needs.
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: XOIIO on November 13, 2013, 05:41:50 pm

If anyone is interested here is a board I threw up on osh park, I also made it single sided so that anyone who has the stuff can make it at home.

http://oshpark.com/shared_projects/IU9KGZF8 (http://oshpark.com/shared_projects/IU9KGZF8)


Usually(*), in beginner designs, the 317 is powered from a transformer. So you NEED a big filtering capacitor.
1. the 0.1uF is not an input filtering capacitor, that one needs to be way bigger. A general rule of thumb is a couple thousand uF for each amp. Given the LM317 can deliver 1 or maybe even 2A, I would go for at least 2200uF (with twice the vorking voltage rating). Output capacitor is ok at 22-100uF(with twice the vorking voltage rating). If, however, you are powering it from a car battery (for instance) you can lower the input cap value.
2. you need to thicken the traces where current flows. So from Vin to Vout, also include the input/output capacitors and the ground return for the current. All of these have to be thicker (lower resistance) or you will drop voltage on them and that screws up your regulation and will heat up for no reason.



Try to think of the whole current loop: from Vin, via C1(+), to 317, via C2(+), to Vout, then through the LOAD, then back in the output ground, via C2(-), to C1(-), then back to the input ground. So I recommend separate input and output grounds, it makes for a neater design and it's easy to connect the wires.
So all the traces carry large currents, except for R1/R2 and the small 0.1uF capacitor.

And try to keep them all the same size - if all the traces are 1mm then you can't skimp on the ground return, making it 0.2mm.
Also, for power supplies like this, it might be a good idea to make the power traces as big as possible.  A 1mm trace is decent for 1.5A. If you need 1mm, make them as large as they fit. They won't do any harm, only good, there will be more copper acting like a heatsink,

Yeah, this circuit will be powered by a wall plug, it's just to drop it down from 6v, and I'll just be powering some simple logic and some LED's so I won't get near the 1.5v current limit of the LM317
Title: Re: Do all LM 317's work the same? (if not which do I need)
Post by: dr_p on November 13, 2013, 06:33:01 pm
Yeah, this circuit will be powered by a wall plug, it's just to drop it down from 6v, and I'll just be powering some simple logic and some LED's...


Figure 12, Page 7 from the datasheet (http://www.ti.com/lit/ds/symlink/lm117.pdf) says no. Input voltage must be 1.5 to 2.5V higher than output voltage for proper regulation. Mind you that your wallwart is powered from a transformer, thus gets AC, rectifies it and then filters it with a capacitor. But under load there will be ripple on the output. So an initially clean 6VDC will look like a saw-tooth between 6V and (let's say) 5.5V. And that needs to be 1.5-2.5V higher than 5V. See the problem?