LM317 Adjustable Voltage Regulator Tutorial
HTML-код
- Опубликовано: 16 апр 2011
- A tutorial on the LM317 voltage regulator. Shows you how to make a 1.25 to 25V adjustable voltage supply, or choose any other output voltage you want. An example of a fan speed controller is shown.
LM317s on Amazon: www.amazon.com...
Want more easy to follow videos about electronics? Check out my website www.afrotechmod... Наука
this is by far the best explanation of how to use a LM317. None of the other literature i found gave guidelines and explained what happens when the Vin and Vout are wildly different. This video was awesome
Gunhaver Thanks!
yeah just that 90 % of cheap lm317 dont like r1 to be 500r use a 100r resistor with 3k pot for 1.2 - 36v psu
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!
M
The best electronics channel ever. You are above and beyond any other professional or educational provider. While there are professors and mentors I hold as exceptional, none have your personality. Whether deemed basic or intermediate+, your content is proficient and entertaining. Please do more.
I'm so happy you take the time to make these video's. I've been fighting with regulators [and feeling stupid the whole time, WHY CAN'T I UNDERSTAND!!!!] anyways..... Your videos have really helped me get a better understanding of electronics that my HIGH SCHOOL ELECTRONICS TEACHER couldn't even convey to me. I've been out of school for over a decade, and some of your topics have eluded me until now.
Don't stop please, you really ARE helping THOUSANDS of people, if not millions!
how goes the hobby?
Thanks! Works great with a computer power supply. Since a cpu power supply has -12v and +12v and voltage is equal to the difference, you can use the -12v as the ground instead of a 0v ground and get a variable 24v.
Thank you so much, no one else was able to provide this info in 2024, so crazy
You are one sharp cookie who knows what you are talking about! I like your style for I need to design a fixed voltage power supply. I can tell you are a college teacher. From one scholar to another, I appreciate your knowledge and your teaching mode. Keep up the good work.
Useful video, although as with most others it makes lots of assumptions that will cause many viewers confusion, and it also demonstrates some basic errors. The LM317 has certain requirements for best operation, and one of these is a minimum current into the ADJ pin.....as I recall, 240 Ohms or thereabouts is the maximum recommended value between the 317's OUT pin and the ADJ pin to keep the ADJ current within recommended limits. Secondly, if you want an adjustable regulator, you keep the resistor between OUT and ADJ constant and adjust the resistance between ADJ and ground; this video suggests the opposite, and while it will work that way after a fashion, it is not good design practice and can cause problems. Finally, a 1uF (one microfarad) tantalum (not electrolytic) capacitor is recommended between the OUT and ground to prevent oscillation as the regulator tries to keep the OUT voltage constant; this has nothing to do with reducing ripple (as from a regulator having an input derived from a rectifier coming from an AC supply), it is just there to improve stability of the IC.
Then, for the math-challenged folks, the simplified formula for calculating the OUT voltage on an LM317 circuit is V-Out = 1.25 x (1 + (R2 / R1)), where R1 is the resistor between OUT and ADJ, which is usually fixed at 240 Ohms, and where R2 is the resistor between ADJ and ground. Note that ground itself is not connected to the LM317. But to find the resistors required to achieve a desired fixed output voltage, you switch the formula around like this:
R2 = ((V-Out / 1.25) - 1) x 240 this assumes that R1 is fixed at 240 Ohms
Example: If you want the OUT voltage (V-Out) to be 7.2V, and you fix the R1 value at 240 Ohms, then you solve as follows:
V-Out / 1.25 is the same as 7.2 / 1.25 or 5.76
then do the part where 1 is subtracted from the previous intermediate value
5.76 - 1 = 4.76
then multiply the new intermediate value of 4.76 by 240 (same as 4.76 x 240) = 1142.4
this can be rounded slightly to 1142, which is the R2 value in Ohms, more commonly represented as kilo-Ohms, or 1.142k
Put the 1.142k resistor in the LM317 circuit in the R2 position.
Don't have a 1.142k resistor (it is a non-standard value)? Well, a 1.2k (1200 Ohms) is a standard value, and nearly the same.....if you stick it into the R2 position in the original formula V-Out = 1.25 x (1 + (R2 / R1)), it will look like this:
V-Out = 1.25 x (1 + (1200 / 240))
solving in stages:
V-Out = 1.25 x (1 + 5)
V-Out = 1.25 x 6
V-Out = 7.5
Not close enough to 7.2 volts to suit your needs? Then you need to add smaller value resistors to add up to a value closer to 1.142k, or you need to use a slightly smaller value (perhaps 1k) resistor in series with a small value potentiometer (usually you pick a value twice what is needed, so if you are making 1.142k out of a 1k resistor plus a potentiometer, then the difference between 1.142k and 1k is 142 Ohms, and doubling that gives 284 Ohms, so you might get the closest standard potentiometer value of 250 Ohms, set it to roughly mid-range, and make small adjustments from there until the LM317 puts out exactly 7.2V. This arrangement of a large fixed resistor value in series with a smaller potentiometer allows you to use the potentiometer to easily trim the overall resistance value up and down by the same amount, and since the potentiometer is not making up ALL the resistance, you have better selectivity doing it this way.
The other thing to remember is that, as the video mentions, the LM317 (like all linear voltage regulators) gets rid the the extra voltage (the difference between the input and output voltage) in the form of heat. When the current coming out of the regulator to your load is more than a hundred milliamps (mA) or so, that dropped voltage times the output current comes to more wattage (in the form of heat) than the LM317 can get rid of by itself, hence the need to add a heatsink.
Ah ok. I was wondering about. The resistors. Do the regulators work with ac or just dc?
when masters speak :)
@@j5892000 this particular regulator works for dc only (typically an input of 2-47v I think, check the datasheet). If you have an ac output then rectify it using diodes (a single diode with a capacitor will do the job for small voltages but a full bridge rectifier is better for higher voltages of ac)
Oh wow, I appreciate you so much :)
Could of caused me a world of hassle if i didn't have a read of the comments.
May have been 3 years since you posted it, but these are the gems that are hidden away in the depths of youtube.
I am agreeing with Alf, this is great - the combination of a video maker with the motivation to do the video even with some rough patches, plus some extra hints and course corrections from a clever person like Youtuuba, is pure community genius --- thanks to both of you (I note that the circuit diagram shows a 240 ohm resistor....)
you sr, are my inspiration. i think i told you before. i had done nothing with electronics, till one day i started soldering. i searched the web for information and you came up 100% of the time. and i tell you what. i would recommend you over any electronics class. thank you for teaching me a new skill. :)
Miss you, man! You have been my all-time favorite electronics RUclipsr.
Mr. Carlson's Lab is my number two fav. But I still really miss you!
I have a dream where gifted people just like you post videos easy-explained just like yours teaching a circuit with voltage and current regulator with potentiometer. Maybe one day!
@L1ne3 No - as I recall it's from a 50uA bias current. So just do (50x10^-6)xR2.
3.3uF is fine.
I've used the LM317 and 337 (for split rail power) in a power supply I made, easy parts to work with and quite reliable.
I love the humor you stick in your videos. You keep them informative, but not dry, Thank you for posting. Things like "Lines = heat not spider sense", or "Let's not be blowing headphones" on another video.
"This is a very common way to ... see how many volts it takes to blow something up!" Laughed out loud; a nice piece of humour in a very informative video.
prime vid man. I just borrowed "Electricity (1882) from the library. Taking myself to school on all things electrical, magnetism included. Keep the vids comin i hope to have an intelligent question to ask you in the future lol
@bluetorch13 Watch my voltage divider tutorial video. In short, it's extremely inefficient to use a potentiometer to supply any more than a few mA. Also the voltage output won't be as reliable (hence "regulated")
Thanks for taking all the time and extra effort to produce such high quality, easy to understand video tutorials. Hopefully more are coming.
after realizing I had everything back wards it is now working :D
thank you
Am I the only one who notiiced Mr T at 0:40? :D
Thanks, I really should have known that,I saw that later also explained on another video. Most videos neglect that part of the equation, they say because the difference it makes to the outcome in most instances is miniscule.
Pause at 0:40 and look to the right of the video
I pity the fool who does that...! ;-)
I don't get it, what is that?
its calles a unit price.
More like at 0:39 - in the middle of the right section, a guy's face pops up for a brief moment
Yeah - it's Mr. T
About my case bellow...
After a lot argument that the 317 needs 100-120R as R1 to meet the minimum current and Pot as R2 which for some reason was not regulating the Voltage at least without Load,i decided to SCREW the minimum current and add a Fixed R2 and a Potentiometer in Series to 100Ohm resistor as R1 and BINGO!
Bingo boys,3 nights in a row and my first thought worked better,but the nights were still gone.
I really should have got another Regulator like LM1084 which i know inside out.
@Shaunakde Yes, but LED supplies are switchmode constant current supplies whereas normal DC-DC converters output a constant voltage.
@Intosia Hah! I'm an idiot for forgetting to talk about this. Basically you should hook up your multimeter to the output, measure the voltage, and make adjustments accordingly. Once you've got the voltage you want, connect up your load.
I learned more watching this video than my house wiring class. Thank you!
@Shaunakde Here's the problem... building DC-DC converters on a breadboard gives dreadfully noisy outputs. Building them on protoboards is slightly better but still crap for high currents. The right way to do it is carefully etch your own PCB or buy a pro made PCB. But once you are paying for all the components plus all the effort to make the PCB you might as well just pay $10 for an off the shelf solution. Anyways... National Semiconductor's "Simple switcher" line are the easiest to use.
Afrotechmods: The best educational videos, very professional, these videos make you wish to learn more and more, this man knows how to teach electronics, is awsome.
@Intosia Ahhh... well depending on the feedback resistors used in the design you may need to put a small load on the device for the output voltage to be stable. So yeah measure it with a 1k load or so.
Hey Afrotechmods, Good video. The LM317 works as a variable power supply but the heat dissipation issue to me kinda limits it usefulness to only a couple of volts. You would need a massive heat sink, preferably with a big ass fan if you wanted to run it at 3 volts with a 12 volt or greater supply voltage. I think a fixed linear or a SMPS would be a better option. They are o.k. as far as learning to use one, but I think I'll stick with linear for now, not very often do I need a variable supply. Take care, C.
I don't understand the equation to figure out resistance. I want to generate 3.3 volts from a 4.7 Volt 18650 or maybe a lipo battery what would the equation be because I did not understand the way he described it
Holy **** I just realized how long ago you posted this sorry LOL but since I already asked the question I like to add I know that five volts would be a lot easier I could just use in 7805 but I'm trying to minimize voltage and current draw for this tiny circuit then I'm building I'm trying to make it as efficient as possible. I know I could run it off a buck converter but all I have or some really ****** Chinese ones that are flaky as all hell and I don't wanna risk it
@SirArghPirate Sure, but the most important thing is to not overdischarge lipos, or overcharge them.
@reactor1system Use a diode+very large capacitor to have a more stable voltage on the input before the LM317. Or buy/build a SEPIC DC-DC converter.
This video filled my needs so perfectly
For bigger things such as motors, use 555 and mosfet for pwm. Google PWM voltage regulation for more info. 317 is just for small things like fans and small amplifiers. Good luck!
i want to make a 7.5 volt power supply with 1A from a 12 volt power supply with 20A, with the lm317. what would be the values of the resistors R1 and R2?
Thanks
@KIBProductionz Any voltage regulator IC will be better than a zener. The zener voltage can easily vary by +/-10% over their full current and temperature range. Sometimes that's good enough though.
u r a good communicating teacher
@DackIsBack Because you are wrong. CMOYs are built out of low current op amps that are completely unsuitable for driving the 4 or 8 ohm speakers he wants to drive.
Best tutorial for make variable source
A nice, clear and understandable video on LM317 Adjustable Voltage Regulator. Thank you for posting such valuable content !
This Afrotech guy is the best.... I wish I had professors as good as he is. Two thumbs up for ya !!!
Love Mr. T's cameo at 0.40😆
@nlimchua That is the approximate adj current shown in the datasheet.
that is one cool theory video. the owon and the fluke are sweet! i will feature it these days in my site for sure. keep it going.
@superTransformer99 It's worth trying. If you put 0.1 ohm resistors on the output of each regulator then tie the other side of the resistors together it will definitely work.
This is great and really easy to understand, especially when trying to learn electronics yourself.......thanks
Thank you. This is very easy to understand.
So it means if I'm going to make a 12V powersupply, I've got to use 15V transformer? coz u said 2-3V higher than Vo.
if you want to make powersuply that you connect to wall, you can use a transformer thats rated fir mains, with for example 16V CT (CT = center tapped 8+8) and use full bridge rectifier to make it dc, and from there you go to this video steps
And I need to make it with 5 amps, what regulator should be used?
@bananastalktome oops... copy and paste error! You are right.
Great vid, but you can avoid using thi specialty reg and use regular 7805, 7809, 7812, 7815.....etc. You use the same potentiometer trick and this creates a floating ground circuit so the IC still 'thinks' it is regulating a lower voltage. These are generally good to about 35 volts DC output max. But a great set of videos overall. Say, what brand of O scope would you recommend if one does not want spend top dollar ( i'd rather have more frequency in exchange! ) thanks
I have no idea what you're doing but it's great stuff.
Wow, 1m views for a circuit part! Maker movement is alive and well
Excellent video, had an LM317 lying around and was trying to figure out how to use it and was wondering why the voltage was never varying even when I checked the datasheets. Never added a R1, since I thought I didn't needed it(and never paid attention to the equation in the datasheet).
Very good information...perfect mix of information, technicals, and wit!
lol anyone noticed Mr. Ts face pop up when he said "LM317T or LM317AT"
what's up SUCKER ?!?!
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?
@catatonicprime lol... the script for this video has been like 6 months in the making... totally forgot to update that part.
@FlumenSanctiViti You want what is called a switchmode power supply, or a switching regulator, or a buck regulator, step down DC-DC converter, all different names for the same concept. National.com has the easiest solutions if you want to roll your own from scratch.
I made my own voltage regulator on my own with LM317T . It was easy to make.
if you still need the resistor values, you can google lm317 calc and there are some website where you can put 2 values for resistors and it will give you the output voltage
The LM317T is a high-current version of the LM317. They both work the same, and have the same pinouts, but the LM317T is more expensive and can handle up to I think 1.5 amps, whereas the LM317 can only handle around 100mA.
Awesome. I need to step down the viltage (5v to 3.3v) coming from a development board into a wii chuck and I just happen to have one of these ICs lying around.
GREAT VIDEO! Learned so much!
Also i appriciate you amplified the cats purr. I was like: "Common Amplify the cat's purr who was yawning." Later: "PURRR PURRRRRRRR PURRRRRRR" After you are done the cat's like: "OOOOOOH! Snack time. Wat iz dis? Mic? Meez eat mic."
Also COME BACK you make thhe best tutorials in the world
Meow
Simple circuit. And my friend watched me pull out of a radio... the parts to regulate a project. Even taught him how to trick fixed chips to going higher with a diode on the ground..
Nice tutorial and very well explained.
So let me get this straight. Instead of spending a minimum of $100 for a variable voltage supply so I can switch from 5 to 3.3 volts for my little projects ... I butcher up a 9 volt wall wart and wire in a LM317 and put an LED display. I must be missing something ... will I be eaten by the "ripple monster?". Great videos ! I am constantly finding my way back.
I love how all of your clips are singed haha. Great videos by the way, very useful for an EE student like me.
@Afrotechmods Thanks!! I'm planing on starting to build LED drivers. Your vids are more than excellent.
How would that circuit look on a PCB I'm building a circuit similar to that but also has a 3 volt DC motor SPST Switch it's to control a camera mount like a telescope. I want to do a etched PCB but not to sure how to lay it out oh by the way I'm a newbie at electronics.
Afrotechmods will it work with lm317
that was pretty cool when it caught fire, could you do more fire videos and explain why it caught fire?
One time I had blown up a transistor and repeated the same steps a few times until I changed my circuit design around. It was pretty cool and sound like a firecracker just from a tiny little transistor. my power source was some kind of radio shack 3v rechargeable.
Awesome and clear - Thanks!
Thank you for the tutorials.
When I calculate the current through R1 and R2 do I use the input volts or the output volts. I especially want to get a variable pot with the correct watts.
Thanks.
Thanks for the good electronics instructions, they are very helpful. Wouldn't the 1/4 watt resistor you had hooked up there fry, if you used the power supply to supply a 7.8 watt load?
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
@Afrotechmods Thanks. I still seem to have problems.
I have a 100k potentiometer and i want the max out to be 5 volts. I cant seem to figure out how much R1 should be.
You can use this exact circuit to do what you want. The video explains the circuit, and there are a zillion webpages which also explain, if the video is not enough.
(However, you will need to put a big ol' heatsink on the LM317T, because you'll be dropping 4 volts at as much as 3 amps, which is 12 watts of power. Some soldering irons run at 15 watts, so: HOT.)
can you make a exact tutorial how to put a lm317 and other electronic component..
Thanks again: I'm binging out on your tutorials today: great video!
You can use 7805,7812 etc as adjustable voltage regulator.Put between middle pin and minus variable resistor an you will change the voltage.
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 ...
What (if anything) would need to be changed if I use a LM 338T to draw up to 5A? Thanks!
super nice tutorial. thanks.
Your vids are deeply appreciated.
Thanks👍
Good to see that you are back and making videos. I really enjoy them! Would you consider making a video on DC to DC converters???
I would like to thank you for making these videos! I have learned so much from you!
I just subscribed, simply because I love how you explain everything :)
@unifiedlinux you should have hooked something up to make the voltage smaller before it got to the regulator so it wasnt as much voltage
i used this as a constant current and dimmer for my ir led :D
thankyou. i needed this regulate my computer fan speeds
Great video as usual, good teaching. I've use this chip before but never paid attention to the inefficiency calculations.
Can you going to make a video on the more efficient yet more complected switching regulator?
Thanks Again for all of your videos!
As usual another excellent video. Please make more!!
Thanks sir for giving us such a nice video on lm317t........Thanks
I would like to build this device for automotive usage. I would not need it to handle very much amperage. Since the range of usage would be from half a volt to 12 volts (with little to no amperage), I need to be able to determine how much output voltage is being supplied . If I were to place a digital volt meter on the output side of this device , would it affect the out put voltage ?
lm317 can't regulate down to half a volt, the minimum input is around 3V and the minimum output is 1.25V. There are low dropout voltage regulators but I doubt they can regulate an input of 1.5 V. If your input is more than the dropout voltage, then you can get around the 1.25V output restriction by placing two silicon diodes (that have a voltage drop of 0.6-0.7V each) right after the output pin. Using a voltmeter won't affect output voltage by any significant amount
What options do you have if the load being regulated could potentially draw up to 20 amps?
At that point a linear regulator doesn't make sense. A switch mode power supply with some kind of current regulation does
Just use a buck converter
that was my second channel, make sure its a high power one :]
@Afrotechmods @Afrotechmods did it without the resistors and it didnt work. i also read online that you would need some extra components. I didnt know what those components were so i bought a LM338 instead. havent gotten to test it yet, but it should work.
i used the lm338 instead because it can take 5 amps of current i got the one in a TO-3 STEEL
Metal Can Package and attached it to a bend aluminum plate with plenty of thermal grease :)
so a 3 amp (the transforer is 3 amps) 12v supply :D
Could you do a video on switch mode power supply building?
i just wanna say THANK YOU very helpful
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?
nicely done and you make it look simple but i have a question the input i have is 28-24 volts (battery voltage is higher while charging) i need to do it while the output is 24-23v. is it possible??
Hi Afro, Great video and easy to learn with your clear straightforward videos.
I will be sure to link to your Amazon.com page in the future. Glad to do it .!
Cheers, G.