LM317 Adjustable Voltage Regulator Tutorial

LM317 Adjustable Voltage Regulator Tutorial

In a previous video I talked about fixed
voltage regulators that take an unregulated voltage
on the input and supply a tightly regulated
voltage on the output.
For example the popular 7805
is used to create a constant five volt supply.
In this video I’m going to show you how to use
the LM317 adjustable voltage regulator
to create any regulated voltage voltage you want
all the way up to thirty seven volts.
You can use it as a power supply for a lot
of projects such as a fan speed controller.
You can get an LM317 from anywhere
that sells electronics.
Sometimes they are called LM317T or LM317AT.
Once you’ve got it put a heatsink on it so
it does not melt your breadboard.
The next thing to do is put a couple of capacitors
on the input and output pins.
Put a 0.1 microfarad ceramic capacitor
on the input and a one microfarad electrolytic
capacitor on the output.
Remember to use capacitors rated higher than the
voltages that you are working with.
If you want to use more capacitance that is
fine too. These capacitors are not always necessary
but putting them in there guarantees that
the output voltage will be stable
in almost any situation.
Next we set the output voltage using two
resistors labeled R1 and R2.
You can use this equation to figure out the
output voltage.
But to start out with I’ll show you the quick
and easy way to use an LM317.
Let’s make R1 510 ohms and let’s use
a 10 kilohm variable resistor for R2.
Doing this gives us a constant voltage supply
that we can adjust from 1.25 volts
to 25 volts.
But remember, your input voltage needs to be
at least two or three volts higher than the
output voltage. Otherwise the output voltage
is limited.
For example here I have a twelve volt lead acid
battery and it is
charged up to 13.5 volts.
When I use it to power my adjustable regulator
I can get an output range from 1.25 volts
to 12.5 volts when it is under a small load.
The headroom I need is called the “dropout voltage”
and it will always be given the datasheet.
So anyway this is a very common way to make
an adjustable fan speed controller, or test
circuits at different operating voltages. Or see how
many volts it takes to blow something up.
Alright now let’s say you don’t want to
use a potentiometer, you just want a fixed voltage
using two resistors.
Here’s the formula I showed you earlier.
If you are curious about how the equation is
derived, read the LM317 datasheets
from National Semiconductor and Texas
In order to simplify the equation let’s pick a
value for R2.
Let’s make it 4.7 kilohms and
now the equation becomes much easier.
Next you can rearrange the equation like this.
Now you can find out the value of R1
based on the output voltage that you want.
For example let’s say you wanted a nine volt
Inserting that into the equation gives you
R1=782 ohms and
R2 is still the 4.7 kilohms we chose.
So I put a 680 ohm resistor in
series with a 100 ohm resistor
which gave me 780 ohms
and that was close enough to give me nine volts.
Finally let’s talk about wasted heat.
The LM317 is a linear voltage regulator
and the efficiency equations are
exactly the same as the 7805’s equations.
The bigger the difference between the input
voltage in the output voltage
the more heat gets produced.
Let’s say you have your output set to 6 volts
so you can get more
speed and torque out of a servo.
And lets power it from a nickel metal hydride
battery charged to 8.4 volts.
And let’s say the servo draws one ampere.
The heat generated in the LM317 would be
2.4 watts.
Now if you powered the LM317 from a
higher voltage source
like a lead acid battery charged to 13.8 volts
all of a sudden things get a lot hotter.
7.8 watts is a lot of heat that you’ll
have to dissipate.
So you should try to keep your input and output
voltages fairly close to each other if you
expect to be drawing a significant amount
of current.
And that’s it!
Check out my other videos to learn more about
other electronic components.

100 Replies to “LM317 Adjustable Voltage Regulator Tutorial”

  1. hi .. How can i get the lowest heat at IC ? as i am trying to make the buck converter … for my own bike .. same 13.8 voltage as you shown … any such way to conver the 13.8 to 5v with minimum heat .. currently i am connecting my IC direct to the covet of Ckt which i used metal body as heat sink .. … .. but still i am using 7805 …

  2. What is the reason for putting some capacitors on the input and and others on the output side voltage regulator as seen in 0:45? Does it make a difference?

  3. the voltage didn't drop below 20 v at 28 volt ac input when i lower the resistance of potentiometer please help as soon as possible because i need it.

  4. tem algum equipamento eletrônico que eu possa encontrar um LM317 dentro? Onde eu moro não tem eletrônica…

  5. What can be used to adjust my voltage in my 24v power supply but also handle up to 18 amps as that's what it's capable of putting out, but still be small enough to fit as my space Is limited.? Could just a 100k pot banner this on its own? Thanks for any help. Been trying to find an answer to no avail so far

  6. Does the ceramic cap have polarity? Electrolytic caps do, but ceramics dont….? If thats the case, your symbol on the VIN side is wrong… No curved line on the ceramic…

  7. I need some help. I need stable 12v for the LED turn signals on my motorcycle but the bike doesn't have a battery (from the factory) so everything is in AC. I used a bridge rectifier which outputs anywhere between 25-45 volts DC (depending on engine RPM) but my flasher relay works on 12V. I made a circuit containing a 1000uF capacitor, 7812 stabilizer and 2 smaller ceramic capacitors, the components were connected in that order. It worked, the output I got was a stable 11.9 (according to my butchered multimeter). I put all of that in a plastic shroud from a glowplug relay and hot glued everything in place. It worked for a little bit until it stopped working, the capacitors are fine but the 7812 stabilizer shows no voltage on the output pin. My question is, did I fry it with too much voltage coming out of the rectifier, or was my mistake inadequate cooling? What would you guys suggest I build to make my turn signals work?

  8. I am curious if it would be practical to use multiple LM317's to step down to 12v from a 24v supply, or is there a better way?

  9. Hi I made a version of this adjustabe regulator, and work just fine, but in two acations now, by mistake I make the electrodes in the output touch one to another and then the lm317 just broke. There is any way to protect it from this?? regards from Chile

  10. I made it when I turn the potentiometer to left it burns a smoke started coming out of it what do I do please reply

  11. Could you tell me the capacitor on the input can only be a ceramic and if yes, Why? Just learning. Thanks for the video.

  12. is it possible to just use a voltage divider? or are there any drawbacks (like power loss/limited current?) when using voltage dividers? thank you in advance. 🙂

  13. Can someone help me, i dont know how to connect the LM317t to a potentiometer….I'm using a circuit board

  14. Hello, Love your videos. I teach physics and electronics is my hobby. I have a project that my students are doing. They are helping the Wildlife service to stun fish so the fish can be measured and tagged. I got most of the circuit done, but I looking for a transformer and adjustable voltage regulator to help me step-down the 120 v to about 60 v and then use a MOSFET to switch it. I need to produce a varying square wave with variable duty cycle also while switching the 0-60 vdc. Any suggestions? Thanks again. Curtis

  15. Hey, How can I use this for a windmill without blowing out the resistors ? I need 15v but all the resistors I can find don't bear more than 3W

  16. hi nice video have question i made this circuit for 24 v but when i put my loud it goes to 5v and not heats my soldering iron any suggestion

  17. I am building a small wind generator and the voltage out put is varying due to the varying wind speed. How to regulate the output voltage against varying wind speeds?

  18. hey I want to build my own power supply out of an LM317 and for the input I bought something that can supply 12V and 1,5A so is it too much current for the LM317 ?? (sorry for bad english I'm french 😉 )

  19. I couldn't understand your explanation of the equation. Like where did you get the values 1.485 and 5875 from?

  20. hi excellent explanation
    i tried building same as your one but some how i blowed up the potentiometer . my output was 12v and input was also 12v and 2apihere what sjould i do

  21. I burnt 2 317s because I am stupid 🙁 . On the first one I let the magic smoke out and the second one has a weird thing where the voltage stays near the ends (0v and 24v) and doesn't want to go between those. Finally with my third one it works. I guess you always have losses. If you're like me remember this: You're going to be letting a lot of magic smoke out, so when you buy parts don't buy only 1 so you can fry them and still be able to build something.

  22. So i have a question, if i use this setup with my 10k pot i have laying around, only the first part of the potentiometer turn will make the voltage change, at less then half a turn i reach the max 11 volts, and the rest of the turn it will stay like that… can't i use more of the turn to get a more precise voltage change?

  23. Hello sir. I want to make DC power supply of 30 volt 500 mA with speed regulator and I also forward / reverse switch for my surgical motor which rotate about 35000- 45000 RPM. Sir can you please guide me and tell me the necessary electronic components and circuit diagram. Also is there any alternative to transformer( don"t want to use as they are heavy) because I need something which is light in wight.

  24. Afrotechmods
    sir .i have 12-0-12 transformer 2 amps . .i will supply lm317 with 24volts? it is safe if i use the same diagram as you made?

  25. This is all very great,But how to build regulator that adjust voltage from 50 to 350 volt dc??The maximum voltage is 350 volt but how to control it and make lower???

  26. thank you for this great video ..
    i have problem if you can help with ..

    it's getting to high temperature when i use it to control my 12v soldering iron voltage..
    any suggestions or different solution for high loads ?

  27. Thank you for this instructional video.
    I have a question. I need a step-up regulator that converts 3.7V to 9V. How can I get it?

  28. So, if I wanted a fixed voltage of 18v, and I was shitty/lazy at math, what would R1 and R2 be? Asking for myself (I have no friends). Also, can I daisy chain to power multiple units, or do I need an lm317 for each stage? Thank you.

  29. I need to out put 3V and 1A max, what value do i input in the 2nd arm of the equation on the right side? (1000*R2)??? Pls answer since the datasheet only say its I(adj) but doesn't mention what the units are. Cheers.

  30. I´m studying electronics in Germany and I really have terrible teachers, making my studies a nightmare… your videos literally made me refall in love with my job thank you a 1000´ times!

  31. I don't know what to do, I want to create a motor controller for a vehicle like those I buy from ebay, so I need to voltage regulate 36 or 48v down to 12 or 5v for my 555 timer board, for my headlights and stuff I use a 'dc dc step down' but my 555 timer will not draw very much current at all … could I just use a resistor before the input of a 18v or 36v IC ? ?

  32. Can we replace regulators with those tiny buck-boost modules which are so popular today in modding community?

    I'm thinking of making schematics where the power side is based on the mt3608 module rather than the old regulator designs.

  33. Good day sir can i request for voltage regulator with digital voltmeter range to 30v at least 3 0r 2 amper's?

  34. Hi I have a (ZHAOXIN PS-3005D DC Power Supply) but it is stuck on 50V which is MAX! it does not adjust to a lower voltage do you know where I should look ?

  35. Could someone explain why mine might not work? I followed all the steps but i get a output voltage of a little less than the input

  36. does the amperage flow through the potentiometer or or is it setting the bias point of that voltage regulator to change how much it conducts could you make a tutorial of a similar regulator but use one that handles at least 5 amps instead? 1.5 is abit low

  37. Not sure why bother using a transistor when you could just as easily adjust the with the potentiometer alone . why use capacitors too? Is the electricity running from ground to possitive?

  38. I found this video on how to increase the current output: bypass the LM317 with a transistor while using the LM317 for voltage regulation. What do you think, will it work, is it safe?


  39. A nice, clear and understandable video on LM317 Adjustable Voltage Regulator. Thank you for posting such valuable content !

Leave a Reply

Your email address will not be published. Required fields are marked *