The only electronic website that replies to every comment, and addresses all circuit related issues.

Variable Power Supply Circuit Using IC LM317

Whether it’s an electronic noob or an expert professional, a variable power supply unit is required by everybody in the field. It is the basic source of power that may be required for various electronic procedures, right from powering intricate electronic circuits to the robust electromechanical devices like motors, relays etc.


A variable power supply unit is a must for every electrical and electronic work bench and it’s available in a variety of shapes and sizes in the market and also in the form of schematics to us.


These may be built using discrete components like transistors, resistors etc. or incorporating a single chip for the active functions. No matter what the type may be, a power supply unit should incorporate the following features to become a universal and reliable with its nature:

  • It should be fully and continuously variable with its voltage and current outputs. 
  • Variable current feature can be taken as an optional feature because it’s not an absolute requirement with a power supply, unless the usage is in the range of critical evaluations.  
  • The voltage produced should be perfectly regulated.

LM 317 pin diagram



 With the advent of chips or ICs like LM317, L200, LM338, LM723, configuring variable power supply circuits with the above exceptional qualities has become very easy nowadays.

Here we’ll try to understand how to construct a simplest power supply circuit using the IC LM317. This IC is normally available in TO-220 package and has three pin outs. 

The pin outs are very easy to understand, since it consists of an input, an output and an adjustment pins that just needs to be wired up with the relevant connections.

The input pin is applied with a rectified DC input, preferably with the maximum tolerable input, that’s 24 volts as per the specs of the IC. The output is received from the “out” pin of the IC while the voltage setting components are connected around the adjustment pin.

LM 317 variable power supply circuit diagram


As can be seen the diagram, the assembly needs hardly any components and is in fact a child’s play to get everything in place.

Adjusting the pot produces a linearly varying voltage at the output that may be right from 1.25 volts to the maximum level supplied at the input of the Ic.

Though the shown design is the simplest one and therefore includes only a voltage control feature, a current control feature can also be included with the IC. 

LM 317 Current Limit Circuit


The figure below shows, how the IC LM317 can be effectively used for producing variable voltages and currents, as desired by the user. The 5K pot is used for adjusting the voltage, whereas the 1 Ohm current sensing resistor is selected appropriately to acquire the desired current limit.

The IC can be further enhanced for producing currents higher than its rated values. The diagram below shows how the IC 317 can be used for producing more than 3 amps of current. 

LM 317 power supply circuit 3 amp
   



Please Share this Post:
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble



  • 90 comments:

    1. hi,
      i want to replace my laptop batteries by a simple power supply with 3 output levels of 3.7v , 7.4v and 11.1v. (AC input)
      (the batteries add to 11.1 volts and 2200 mAh).
      could this be possible, (the output current is high)
      thank you

      ReplyDelete
      Replies
      1. Yes you can try the first circuit shown in this article for the application.

        Build three of them, adjust the voltages for the relevant outputs.

        The inputs to the above circuits may be derived from a single transformer, bridge, capacitor network, rated at 5 amps.

        The IC for the circuits may e replaced with LM338

        Regards.

        Delete
    2. sir i dont know anythin abuot how to design a power supply , so how sshould i start from simple in proper way,guide me pls send email on sanketkataria@gmail.com

      ReplyDelete
      Replies
      1. Please read the following article to know the various simple power supply configurations, just bring those components and solder them together.

        http://homemadecircuitsandschematics.blogspot.in/2012/03/how-to-design-power-supply-simplest-to.html

        Delete
    3. Sir, can u say the max current output for three circuits plz...
      Thanks in advance...

      ReplyDelete
      Replies
      1. 1.5 amps max for the first two and 3 amp for the last circuit...

        Delete
      2. Past 1 month observing yours technical article looks very helps
        Thanks ;)

        Delete
    4. Sir, Plz say about implementing "NOT Gate" using IC/Transistors with lower power consumption.
      Plz sir.. Thanks in advance...

      ReplyDelete
      Replies
      1. Hi Vinay,

        Can you elaborate more about your project, I mean what are planning to make?

        Delete
      2. Sir,
        I am planning to make wireless power detector/sensor.That means, when AC Supply is present or not. By using inductor, we can find wether the supply in AC wire is present or not. We need to place our sensor near the Supply to find.Can you help me to make this circuit,sir..?

        I'm a CSE(Computer) student.I'm intrested in this field. Your blog helped me a lot to know few things that i dont know. And sir,your detailed explination about topic is also plus point for me.
        First of all, THANKS for your blog & sharing your Knowledge sir.
        It's really awesome...

        Delete
      3. Sir, can u say the real use of disk capacitors(104=100nF)
        1. Across terminals &
        2. For triggering (like 2nd terminal in NE555 IC)

        Delete
      4. sir, can u publish a circuit that exacttly compatable(Voltage & Current ratings) for USB port. Because, many mobiles & ipod's or other devices supports USB charging.Please sir...
        Thanks in advance......

        Delete
      5. Thanks Vinay Kumar,

        I think the following circuit is exactly what you are looking for:

        http://homemadecircuitsandschematics.blogspot.in/2011/12/how-to-make-non-contact-ac-mains-phase.html

        Delete
      6. Hi Vinay,

        Which circuit are you referring to?

        Delete
      7. For USB ports? If there's USB adapter cable available in the market then probably I can use it in conjunction with my previously posted 7805 circuit and modify it for charging USB cell phones.....

        Delete
    5. Hi I want to design a power supply supplies three outputs at the same time 5V, 3.7V and 1.5V. Which type of circuit is the best for this designation ?

      ReplyDelete
      Replies
      1. You can try the first circuit design, make three of them and adjust the presets as per the needs to get the required three outputs.

        Delete
    6. Sir I designed your your first circuit my ic lm 317 burst into several parts. I used 12v transformer and in40007 diodes for rectification. And 230ohm resistor, 0.1uf 1 if capacitor please help me.

      ReplyDelete
      Replies
      1. you might have done something seriously wrong with the pinout connections or there was a hidden short within the connections. Otherwise it would have stared working immediately.

        Delete
    7. Dear Mr Majumdar,

      I made two adjustable dc power supply using LM 317 on veroboard and thy worked perfectly ok.
      Recently i made a homemade pcb using marker pen and ferric chloride. After making the pcb i added the component according to the same schematic that i followed making my earlier power supply on veroboard. But my pcb version is not working. It shows the highest voltage and are not regulated. I checked and rechecked my component and connection, and they are ok.
      Will you please tell where is the problem. It makes me crazy. Please help.

      Mamun
      Dhaka, Bangladesh

      ReplyDelete
      Replies
      1. Dear Mamun,

        I would be difficult to troubleshoot without seeing it, obviously there might be something that's wrongly done or some short across the tracks.

        Delete
    8. hello sir, I want to ask that for the above circuit which dynamo would be suitable as we want to charge our laptop from dynamo by using it in our bike wheel. and to charge a laptop e will require atleast 24v and from dynamo I don't know this much power can be generated or not and if it can be done then which dynamo will be used as there are different types of dynamo.
      so should we use a d.c. motor as an input source or dynamo can work here. and please specify the ratings and type of d.c. motor or dynamo.
      Thank you.

      ReplyDelete
      Replies
      1. Hello concor,

        you can use any small dynamo rated at around 28V/2amp for the project, the dealer will be able to advise you better with the product.

        Delete
    9. Dear sir
      Aap ne jo 7805 ke help se charger banane ki idea diya hai thanx for that . maine kal wo banake dekha . to successfully run hua . but wo 12v 12amp pe chalane ke bad hot ho raha tha . to plz usake liye koi solution batawo . sir muze actually muti pin charger aur sibhi automobile battery ke liye (motorcycle , car , truck )ke liye charger banana tha . so plz help me sir


      ReplyDelete
      Replies
      1. Dear Shrikant,

        Use a large aluminum heatsink with the 7805 IC for preventing it from getting hot.

        For using the circuit with many cell phiones you can try the folowing design

        http://4.bp.blogspot.com/-6nMOBLLNkTQ/UgMfLIQHHRI/AAAAAAAAE8w/Ke2Ci0w91Oo/s1600/LM123%20Cell%20phone%20charger%20circuit.png

        Delete
    10. I am trying to design a power supply for an analogue clock which draws a minimal residual current.
      The clock uses a AAA 1.5V battery and draws 50mA every 1 second in a 24ms pulse to advance the second hand.
      I want to run the clock from a suitable rechargable battery pack. A single 1.2V battery does not work.
      The best combination I have come up with is a 2.4V battery supplying a 1.8V single supply, single OP-AMP with unity gain, voltage divider input, driving a BC547C.
      Do you have any easier design ideas?

      ReplyDelete
      Replies
      1. 50mA per second is huge, it's the problem of your clock not the battery configuration, I don't think any external circuit can help to reduce this.

        If you increase the voltage from 1.5 to 1.8 would force the clock to consume even more current so that's not a correct approach, and the opamp has no role in the situation.

        One method could be to use LM317 with an input of 2.4V and output of 1.25V supplying the clock

        Another possible way could be to use a joule thief circuit.

        Delete
      2. Hello Mr. Majumdar. What have to be done differently to adjust the output current to a specific value? I mean I would like to make the available current adjustable to that it could go through a digital ammeter before the terminal. Also, for the high current circuit, how should the circuit be fused? Thank you.

        Delete
      3. Hi Courtney,

        Please refer to the following posts where you will find a simple method of controlling current using a variable resistor:

        http://homemadecircuitsandschematics.blogspot.in/2013/06/universal-high-watt-led-current-limiter.html

        Delete
    11. Hi Swagatam

      I need your help to get rid of the frustration I am experiencing with my first LM317 circuit.

      As the configuration is quite simple, I soldered the components on PCB straightaway. The value of the resistor was selected based on the value of the POT and the required output voltage (30V). The step down transformer is about 500mA

      Initially the 30V-analog voltmeter would show more than 30V. When I adjusted the POT, I noticed some spark or flash inside the POT. And then the output remains within 28V-32V. The current consumption of the load is hardly 100mA.

      I assembled fresh components on a breadboard but same results. I checked the circuit on the simulator, it works perfectly................so where am I wrong???

      ReplyDelete
      Replies
      1. Hi Abu-Hafss,

        R1 could be 240 ohms or a 120 ohms, it won't make any difference as long the pot is selected for satisfying both the values... in other words a 10K pot would be just enough.

        so R1 is not so crucial.

        There's hardly anything one can suggest regarding the troubleshooting of the first circuit, because it's as simple as can be.

        Only two things which you probably know that could be causing the problems are, incorrect pin connections, or faulty (duplicate) devices. there's nothing else that could blow these devices of as these devices have a thorough and very robust internal protection circuitry.

        Delete
      2. Hi Swagatam

        Here is how I made the connections.

        https://dl.dropboxusercontent.com/u/20969135/LM317.png

        So far I have used 3 devices unsuccessfully. None of them blew, instead I noticed flash inside the POT. Please confirm if R1 is 1/4W rated.

        Delete
      3. I have updated the connection diagram. Please re-check. That is how I am connecting the components.

        I have tried another IC (4th one). When the POT is providing very low resistance the voltmeter shows about 5V. When trying to rotate the shaft of the POT, I can see light inside the POT which means it cannot withstand the current flowing thru it. Do I have to use a wire-wound POT?

        Delete
      4. Hi Abu-Hafss,

        use a new IC and try with a 24V supply, I think the 36V input could be damaging the IC....and it should 240 ohms for R1 and 10k for R2 ideally.

        Delete
      5. Just fried the 220 ohms resistor when used with 10k wire-wound POT.
        Supply is 32V. And there is no load, no C2 only a 30V analog voltmeter.

        I assume, earlier the carbon film of 5K POT could not withstand the I(adj) and now the 220 ohms resistor failed to withstand that current. Why I(adj) is so high?

        Delete
    12. As per datasheet the output voltage range is 1.5 - 37V. And input voltage must be 1.5V higher than the output, which means to get 37V at output the input should be 38.5V ! However, in my case the input is not 36V, it is 32V.

      Ok, I will try with 220R (240R not have) and 10k POT.

      ReplyDelete
    13. I checked with 24V supply:

      R1=180, R2=5K POT, Output 24V at low R2 and high R2, POT frying.
      R1=180, R2=10K POT wire wound, Output 1.5V at low R2, 24V at slight increase in R2, R1 heating up.

      I have tried the fifth and last LM317............all behaving similarly.

      ReplyDelete
      Replies
      1. Hi Abu-Hafss,

        You decide how this can be possible, LM317 can be never wrong, its datasheet cannot be wrong, the indicated part values cannot be wrong.

        I am suspecting that the entire lot of your LM317 could be duplicate and faulty... assuming your connections to be perfectly correct as per the diagram.

        a wire wound pot is not required, even a preset should work here.

        Delete
      2. That is what I also thinking. But, is there any way to check and confirm if all those 5 regulators are dude?

        Delete
      3. Hi Abu-Hafss,

        the sparking of the pot itself suggests that the ADJ pin is shorted with the input pin which is probably causing the input supply to short to ground through the pot making all those sparks inside the pot.

        Delete
    14. Hi sir,
      I came across your work on “​Bicycle Dynamo Battery Charger Circuit” in Homemade circuit design blog. It was really informative. I would like to ask something regarding that article. I am working on a hexapedal robot with battery switching mechanism. Once the primary battery gets beyond a preset voltage, secondary battery will power up the robot’s system. My concern is not regarding the switching circuit. Together with this, I am working on energy generation by attaching a generator to each motor. The current generated is intended to be used to recharge 30C 11.1V 2200mAh 3 cell LiPo battery. I am aware that the circuit mentioned in “Bicycle Dynamo Battery Charger Circuit” will not be useful for my purpose. Can you give me any other option pertaining my issue. I just need to know on how to modify the circuit to make it LiPo compatible. Thanks, looking forward for a reply.


      Regards,
      Arun Prashan

      ReplyDelete
      Replies
      1. Hi Arun, yes I'll post the required design in this blog soon, may be by tomorrow, so please be in touch

        By the way if you are assuming that you would be able to charge the battery with the same energy which is being used for operating the robot, that may be not feasible....the output will be always less than the input

        Delete
    15. Hi, I am trying to build a variable PSU using a 24 v smps and LM338. The circuit works but the output current is very low. The same circuit works with LM317. Could you advise me if any changes are needed in components for LM338. I have used the first circuit as shown here on top.

      ReplyDelete
      Replies
      1. Hi, please provide all the info regarding what exactly you are trying to include in your power supply, and what are the input/output amp specs

        Delete
      2. I am trying to build a benchtop variable supply. I just require variable output using LM338, 5k wirewound potentiometer which will be used to vary the voltage.Input amperes is 3A and same is needed at output. The 24v SMPS is a ready made manufactured by meanwell. Hope this info is helpful.

        Delete
      3. The IC LM338 is designed to provide in excess of 5amps at its output, so if the input is 3amps you should get 3 amps full at the output of the IC, across the whole variable voltage range, if this is not happening your IC could be faulty(duplicate) or not connected correctly.

        A 10k pot would work better than 5k

        Delete
      4. Thanks Swagatam, will try that.

        Delete
      5. Hi i tried the same circuit using 10k pot, still i get the same result. Now for the resistor between ADJ and Vout, do we need it to be of higher wattage, currently i am using 220 ohms 1/4 watt.

        Delete
      6. All resistors can be 1/4 watt rated, it cannot be an issue.

        Delete
      7. Hi Swagatam, As you said, the LM338 turned out to be faulty. I ordered same ICs from Texas Instruments samples and they worked perfectly.
        Now another issues is do LM338 have short circuit protection ? If not can i use your suggested circuit which uses relay to protect the SMPS from damage ?

        Delete
      8. Hi Janesh, yes the LM338 has in-built output short circuit, over load protection, still for getting a desired current control you can add a BC547 transistor with the adj pin of the IC as shown in the following diagram...R4 is not important can be replaced with a wire link

        http://homemadecircuitsandschematics.blogspot.in/2012/04/how-to-make-solar-battery-charger.html

        Delete
    16. Dear Mr Swagatam,
      is there a possibility that a 5Amps 50Hz transformer be combined with timer to regulate the Vout? I've successfully built a variable bench power supply with ic L200 and a few power transistors, but I don't think it's efficient enough.

      ReplyDelete
      Replies
      1. Dear imanul, i have no idea how a timer can be used for voltage/current regulation, one of the best options is shown in the above article first diagram, an LM338 may be used instead of Lm317 for a 5amp input

        Delete
      2. I'm sorry, not a timer, i mean some controller that's designed for smps, like pwm.
        When using a linear regulator like LM317 I can feel a lot of heat on the heatsinks both from the ic and power transistors, and I believe that's a wasted power.
        I googled the formula of the wasted heat, (Vin - Vout) x Amps.
        eg. (18V - 6V) x 3A = 36Watts of wasted heat.
        So if you could please teach me how I can get high efficiency by using alternative other than linear regulator. Building a complete smps, with ferrite core, is too hard for me.

        Delete
      3. the formula and the calculations that you have shown is true for resistors and zeners, not for these sophisticated power regulator ICs. These ICs may dissipate say about 10% of the total power, which is quite reasonable.

        You can try LM338 circuit for your application, or if you are interested to get 99% efficiency then ferrite cored smps is the only way to go..

        Delete
      4. Thank you Mr. Swagatam, a new lesson learned today.
        Anyway I'd like to stock up common diodes at home, like 1n4001. Most people recommend the 1n4007-the highest voltage rating ones. With their particularly equal price, why do the manufactuter still make the lower ones? When I go to the retailer and ask for 1n4001 they give me 1n4007 instead, and saying "its the same". I dont think it's true, a "marking" means "something", right. And what about 1n5819 Schottky diodes, should I stock them up for my everyday electronics? Can they be used as the substitute for the 1n400x series?
        Thank you in advance Mr. Swagatam for your advice.

        Delete
      5. Thanks Imanul, yes the numbers definitely indicate a lot of things, 1N4007 is much better than 1N4001 in terms of reverse voltage handling capability, and nowadays all other variants are slowly getting obsolete except 1N4007.

        1N5819 may be considered an enhanced version of 1N4007 in terms of speed and forward voltage drop but as far as voltage rating is concerned its far inferior just around 30V

        Delete
    17. Well.... Sir....we hav a project to design a 40mA power supply with transformer.... So basically I could be using either of these IC's.... But since we have just entered our branch I do not have knowledge to the depth.... Could you please suggest me what changes is to be done in the values of the passive components so as to get a 40mA power supply

      ReplyDelete
      Replies
      1. you can try the first circuit with IC LM317....no changes in the component values is required, use a 50mA transformer in order to restrict the output current to the specified limit

        Delete
    18. Well.... Sir....we hav a project to design a 40mA power supply with transformer.... So basically I could be using either of these IC's.... But since we have just entered our branch I do not have knowledge to the depth.... Could you please suggest me what changes is to be done in the values of the passive components so as to get a 40mA power supply

      ReplyDelete
    19. Sir,
      I have done this ...
      It working well..
      But one problem... the IC LM317 is too heating when some load (like a 6 volt dc motor) is connecte. I also used a medium size heat sink.

      So please tell me how can reduce the heating problem...
      Thank you...

      ReplyDelete
      Replies
      1. Narottam, Linear ICs like 317 and 338 will always heat up even with normal loads...it cannot be avoided, you can try LM338 instead and see the response

        or try reducing the input voltage

        Delete
    20. Ooh...thanks Sir...

      Also I thinking that if I use two IC(LMLM317 or LM338) in parallel than have any chance to reduce the heat ??

      ReplyDelete
      Replies
      1. A single LM338 would be enough since it's rated to handle up to 5 amp current

        Delete
    21. Ok..
      Thank you...very much... Sir..

      ReplyDelete
    22. I've seen some ckt on Google...they have a diode that is connected betwwen the Vin and Vout of the regulator..whats that for? can you explain? tnx

      ReplyDelete
      Replies
      1. that's for protecting the IC in a situation where the output of the might have a filter capacitor, and the input of the IC is shorted to ground, which is never possible under normal conditions.

        Delete
    23. Can I change the current sensing resistor from fixed to a variable? like pot?

      ReplyDelete
      Replies
      1. yes if you are able to get a value with the specific low Ohms range

        Delete
    24. So it needs a very low resistance? The higher the value..the lower the current? and vice versa?...

      and where is the negative of the output? base or emitter?

      ReplyDelete
      Replies
      1. yes that's correct, negative is at emitter, and positive at the base

        Delete
    25. Hi Si. In 1st circuit, can I replace lm317 with lm388 or LM396?

      ReplyDelete
    26. To adjust current in 2nd circuit, make a Variable pot. How much ohm pot? Max

      ReplyDelete
      Replies
      1. Sorry I am asked again. Pot 2 ohm is nothing, can I paralel pot 4.7ohm with R 3.3 ohm (is 1.94 ohm) or with parallel with R 3.6 ohm (is 2.04 ohm)?

        Delete
    27. Sir swagatam hello again..pls. advice me wat to do abwt my power bank..it is charging to my samsung galaxy but remain to its voltage percentage not increasing..I am using a 9 packs of battery in serries connection, Ni-MH AA1500mAh 1.2V.
      I took my circuit from a car charger..pls.pls. pls.mr swagatam I need your expertise especially me still learning in this

      ReplyDelete
      Replies
      1. Hi Mark, I think I have already answered this question in another post, I'll repeat it again, your power bank output capacity must be significantly higher than your phone battery capacity, especially the AH rating, otherwise the performance will never be at the optimal level

        ....and make sure the power bank bats are fully charged before using them for the intended purpose

        Delete
    28. Hello sir, i can use the lm337 to reduce the voltage 72 volts DC to 38 volts DC ??

      ReplyDelete
      Replies
      1. Hello Matt, no that's not possible, because LM337 is rated to handle a maximum of 38V input, and moreover it's a negative voltage regulator

        Delete
    29. Sir can I use 220 ohm resistor instead of 240 ohm

      ReplyDelete
    30. Hi. Swagatam,
      Re: High Current Adjustable Regulator
      I have difficulty sourcing the LM195/LM395 in my country. Is there any other product that I can use that will do the job?
      Regards
      Jan

      ReplyDelete
      Replies
      1. Hi Jan,

        But I think you can get LM338 easily, if you get LM338 you can apply it in the last circuit which is shown the above article, and upgrade the transistor rating and achieve the required high output current.

        Delete
      2. sorry, actually the last circuit itself utilizes the LM195....to eliminate this you can change the configuration and connect the lower BJT in a different method as shown in the following article

        http://makingcircuits.com/blog/2017/06/7812-7805-ic-current-booster-circuit.html

        consider the 78XX as your LM338 or LM317, adn apply the BJT as recommended in the article

        Delete
    31. Hi Swagatam,
      Thank you for the advice. I can get these parts locally.
      Regards
      Jan

      ReplyDelete

    Please Note: If you find any DEAD link starting with http//:homemadecircuitsandschematics.blogspot.com, please replace it with http://www.homemade-circuits.com/ for making it visible and alive again.