I want to create an adjustable power supply for my electronics projects, and the cheapest/fastest option seems to be using an LM317. However, I do not want to blow things up by doing something wrong (what is pretty possible, considering my little knowledge in electronics), so I want to have a few questions cleared:

  • What power should R1 be able to handle, considering a maximum drop of around 30v (from 32v to 1.25v) and, let's suppose, 1A of current (I have no idea of how much current I'll use, but I'm setting the value high to make sure)? If the calculation I did are correct, the power dissipated by the LM317 is of around 30w (I have a huge heatsink, heat on the LM317 shouldn't be a problem), but what should be the rated power of the resistor? 30w resistors aren't cheap, and the store I buy components from only offers resistors up to 10w (that are also very expensive).

  • Do I need a capacitor between the input of the LM317 and ground? If I don't use one, what could happen?

  • If I wanted to put a LED to indicate if my power supply is on, how could I transform my input voltage of 32v in the voltage of the LED without having to dissipate a ton of heat, and without expending much?

  • How can I protect my circuit from a short circuit, so I don't blow everything if mistakenly connect something wrong?

Schematic of my circuit

  • 2
    \$\begingroup\$ Please use the built-in schematic editor to show us your circuit. What is the thermal resistance of your heatsink? What have you calculated for the die temperature of the LM317? And, yes, of course, a resistor passing 1A with 30V across it is dissipating 30W, so you should look for a 50W resistor. \$\endgroup\$ Jun 21, 2019 at 16:01
  • 4
    \$\begingroup\$ A schematic of your proposed supply would help. However, if the "fixed resistor" you mention is between the LM317 Output and Adjust pins, it will only have 1.25 volts across is, regardless of the output current, so a 1/4 watt resistor will be fine. \$\endgroup\$ Jun 21, 2019 at 16:04
  • \$\begingroup\$ I can't use the built-in schematic editor, when I'm going to insert it the page loads forever. Anyway, the circuit is the same as the one presented in the first page of the LM317 ON Semiconductor datasheet, except that mine does not have Cin. The "fixed-resistance" resistor I'm talking about is R1. \$\endgroup\$
    – taarak
    Jun 21, 2019 at 16:39
  • \$\begingroup\$ "the page loads forever" When it does that to me I just cancel out of it and I find that my schematic has been inserted into my post. \$\endgroup\$
    – TimWescott
    Jun 21, 2019 at 16:48
  • \$\begingroup\$ Make a screen shot of the datasheet, adjust the picture (removing the Cin, or better, put a red cross on it) in paint or photoshop or whatever and update your original question with it. \$\endgroup\$
    – Huisman
    Jun 21, 2019 at 16:49

4 Answers 4


Power rating for R1 and R2 in a simple LM317 regulator

Since the voltage across R1 is a constant 1.25V, the power rating is 1.25^2 / 240 = 6.5mW so a 1/8th W resistor will be fine.

The voltage across R2 will always be that developed by the sense current through R1 (5.2mA, and I'm ignoring the 100uA IAdj of the regulator). So at the highest voltage you want out of your regulator (you said 29V) you would need R2 to be (29 - 1.25) / 0.0052 = 5336 Ohms and the power dissipated would be 0.0052^2 *5336 = 145mW. I'd recommend that you use a .25W potentiometer for this purpose.

Do I need a capacitor between the input of the LM317 and ground?

YES. While technically (and under ideal conditions) you might not need it, it's simply good practice to ensure stability with all the variations that can occur in wiring and on PCBs. (You don't mention what generates your Vin ….if it's a rectifier then you certainly need a large filter capacitor)

Can I use an LM317 to supply 1A load current over the whole voltage range?


From the LM317 datasheet you need to look at one particular graphic to understand how the LM317 deals with current limiting (it's very novel, and most folks don't take time to understand).

enter image description here

Notice that when the input to output differential is small (<5V or Vout of about 27V) or large (>30V or Vout of about 1.25V) then the current limit is reduced.
It looks like you can get 1A at low output voltages, but above about 27V you may not get 1A.
Do notice that in the mid range (from about 7 - 24V) you will easily get your 1A output. The LM317 is more than capable of dissipating 20W on a decent heatsink (altered from comments), though you'd be better considering a switching regulator to avoid large heatsinks.

Providing an LED power indicator

A simple series resistor and LED is all you require. This can be run from the Vin voltage (32VDC), though it is of course a bit energy wasteful.

So your final circuit would look something like this:

enter image description here

  • \$\begingroup\$ How could I be so dumb? I forgot that 32v should be no problem for a LED, and I should just limit the current. Anyway, thanks for helping. \$\endgroup\$
    – taarak
    Jun 21, 2019 at 23:52
  • \$\begingroup\$ The graph you provide says that the LM317 can not provide 1A with a voltage difference of 30V even if \$T_j = -55\$C. What kind of magic heatsink do you have? Did you realize that the temperatures are junction and not ambient? \$\endgroup\$ Jun 22, 2019 at 0:09
  • \$\begingroup\$ In your original answer you said that the LM317 could dissipate 30W, and in your comment to my answer you said the LM317 is "clearly capable of dissipating 30W" but the graph you show has no point where the dissipation is 30W. 3A at 10V? No. 1.5A at 20V? No. 1A at 30V? No. I hate to be blunt, but suggesting that a CPU heatsink with fan would be "good for up to 90W" on the LM317 under discussion is simply absurd. The thermal resistance of a typical CPU package is much, much lower than for a typical LM317. \$\endgroup\$ Jun 22, 2019 at 11:40
  • \$\begingroup\$ @ElliotAlderson You are absolutely right ….I altered the answer from 30W (my bad) to 20W ….which the device IS capable of. From the graph the highest power point is about 22W. Why keep laboring a point I've already conceded and altered the answer in line with. Is it just to make you feel good? Can I say again ...the device is NOT capable of 30W but IS capable of 20W ….and can deliver 1A over a broad range of output voltages. \$\endgroup\$ Jun 22, 2019 at 13:35
  • \$\begingroup\$ My goal is to leave correct information in the answers to this question. You have left in place a comment saying that a "smaller CPU heatsink with fan"...would be "good for up to 90W". Another of your comments, still in place, says that "The LM317 is clearly capable of dissipating 30W". It's important to me that future readers carefully evaluate those statements in light of the manufacturer's specifications. I contend that such unqualified statements are, at best, misleading because there is no discussion of thermal resistance and junction temperature increase. \$\endgroup\$ Jun 22, 2019 at 16:22

1) As has been stated in the comments, you will never see 30V across R1 nor will 1A ever pass through it. The voltage across this resistor is about 1.25V.

2) The datasheet should tell you whether, or under what circumstances, you need a capacitor to ground. This information is in Figure 1 of the datasheet I found online.

3) Heat is not measured in tons, and I don't know what you mean by "expending much". Choosing a resistor to use with an LED has been discussed over and over again, on this site as well as others.

4) What does the datasheet for the LM317 say about short-circuit protection? You should find all of the information you need.

Finally, I will say again that you need to revisit your plan to dissipate 30W in this regulator. I don't think this will be possible without "expending much".

  • \$\begingroup\$ It depends on the package the LM317 is in and the ambient temperature. The ON Semi datasheet specifies \$\Theta_{JC} = 5.0\$C/W for a TO-220 and max die temp of 150C...you need a heatsink of 0C/W, thermal grease of 0C/W, and an ambient of 0C to make that even remotely possible. I don't have a datasheet for a TO-3...do you have a link? \$\endgroup\$ Jun 22, 2019 at 0:02
  • 1
    \$\begingroup\$ Certainly for the OnSemi version I agree that 30W is beyond it's capability. It is however capable of 20W dissipation which would allow 1A output over most of the range of output voltages. I'll alter the answer I gave. \$\endgroup\$ Jun 22, 2019 at 0:43
  • \$\begingroup\$ @JackCreasey In other words, we agree that your first comment was not correct. I'll accept that. \$\endgroup\$ Jun 22, 2019 at 11:39

R1 MUST have 1.25 V across it while the other R adjusts the output voltage. This is how it adjusts Output Voltage and when across a power shunt resistor becomes a current limiter instead with no ground reference or voltage regulation.

To test it , use another power transistor on the heatsink as an active load and simply bias it with 0.1V or less max current drop for sensing current with Vout . Then put any sine wave on your DC bias and use XY on a Scope for current vs voltage to see your results. Use a 300Wac or 30W 24V Halogen light bulb or motor for current limiting your active FET to reduce the heat. But warning, inductive loads it has no flyback diode, to Vin for back EMF clamping.


LM317 won't be able to run 1.25A load fully from 32v input due to thermal waste. max load without seriously illying the LM317 would near 0.8A. specs say you're able to effectively reach 1.5A only when Vin/Vout difference is about 1/3. not the case for variable regulation below 19V for this case. it has a pretty bad thermal efficiency. Its thermal efficiency rate has a lobe you could interpret by yourself later.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.