• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / SMPS and Converters / LM317 Variable Switch Mode Power Supply (SMPS)

DIY Circuits | Learn Basics | Arduino Coding




LM317 Variable Switch Mode Power Supply (SMPS)

Last Updated on July 5, 2025 by Swagatam 118 Comments

So far in this website we have studied LM317 based linear power supply circuits, here I have explained how an LM317 can be executed as a variable switch mode power or SMPS with zero loss.

LM317 as Linear Regulator

We all know that an LM317 IC is internally designed to work as a linear voltage regulator IC, which has a serious drawback of power dissipation through heating. Moreover such topology also requires the input to be minimum 3V higher than the desired output, adding further restrictions to the given regulator configuration.

Here I have explained how the same IC could be simply implemented as a 0-40V variable power supply using SMPS topology and therefore eliminating the losses mentioned in the above paragraph.

Modifying LM317 Circuit into a PWM Switching Regulator Circuit

The LM317 variable SMPS circuit explained here effortlessly converts an ordinary LM317 IC into an inductor based switching regulator power supply counterpart, as exhibited in the following diagram:

Circuit Diagram

Referring to the above shown diagram we can see that the LM317 is configured in its usual variable regulator mode but with some additional parts in the form of  R6, C3, and D1.

We can also see an inductor attached with D1 and an associated power BJT Q1.

How it Works

Here the LM317 IC performs two tasks together. It varies the output voltage through the indicated pot R4, and in turn causes a PWM to initiate for the base of Q1.

Basically, the introduction of R6/C3 transforms the LM317 regulator circuit into a high frequency oscillator circuit, forcing the output of the LM317 to switch ON/OFF rapidly with a varying PWM, which is dependent on the setting of R4.

The BJT Q1 along with the inductor L1 and D1 forms a standard buck converter circuit which is controlled by the above explained PWM generated by the LM317 circuit.

This implies that while the pot R4 is varied, the voltage pulse width developed across R1 also varies proportionately causing Q1 to switch L1 in accordance with the varying PWMs.

Higher pulse widths enable the inductor to produce higher voltages and vice versa.

Capacitor C4 makes sure that the fluctuating output from L1 at the output is adequately smoothed and eliminated, this consequently enhances the ripple current into a stable DC.

In the proposed LM317 switch mode power supply circuit since the IC LM317 is not directly involved with the handling of the load current, it's restricted from dissipating current, and thus ensures an efficient regulation of the high input voltage into the desired low output voltage levels.

The design also allows the user to upgrade the circuit into a high current SMPS circuit simply by changing the Q1, L1, D1 rating as per the required output current specifications.

L1 can be built by winding bifilar enameled copper wire over any suitable ferrite core.

Although this LM317 SMPS circuit promises a near zero loss output, Q1 must be mounted on a heatsink and some degree of dissipation may be expected from it.

Interesting Feedback from one of the Avid Readers:

Mr. Swagatam:

I am a retired EE, but continue to have an interest in various areas.  Happened to come across your website when I was researching power  supplies using LM317. 

Saw the interesting switch mode power supply schematic using the LM317. 

As it turns out, the exact circuit shows up in the 1978 National Semiconductor Voltage Regulator Handbook, with additional verbiage to explain its behavior.

However, I found it even more helpful to simulate the circuit using LTSpiceVII (which is free to download and use) to get a better idea of how the circuit operates with component value changes. 

Anyway, I decided to scan the two pages from the 1978 Handbook and email to you in the event you care to post them with the schematic for others who might be interested in a little more detail.

Regards,

Denton Conrad

Raleigh, NC

Complete article can be found in the following pdf link:

https://www.homemade-circuits.com/wp-content/uploads/2023/05/LM317-switching-regulator.pdf

Another Feedback from a Dedicated Follower of this Blog, Mr. Prashanth Suvarna

As a dedicated follower of your work, I would like to share some observations related to the previous discussion.

I needed a balanced ±24V power supply for an output transformer (OPT) stage that only needed ±24V, not the 39V given by the original amplifier. I modified your basic circuit design to incorporate a negative switcher. One of the driver ICs is variable, which allows for accurate voltage balance.

One major advantage of this method is the substantial reduction in heat dissipation when compared to a similar circuit working in linear mode. The smaller Darlingtons (122/127) first concerned me because of their failures. They failed even without overheating. To remedy this issue, I replaced them with (TIP)143/147, which functioned excellently.

Please find the attached pictures below, which were taken while analyzing the design.

You'll also like:

  • 110 V to 220 V converter device110 V to 310 V Converter Circuit
  • boostHow to Build a Boost Converter Circuit: Explained with Calculations
  • smps2 Compact 12V 2 Amp SMPS Circuit for LED Driver
  • How to Design Customized 220V SMPS Circuits

Filed Under: SMPS and Converters Tagged With: LM317, Mode, Power, Supply, Switch, Variable

About Swagatam

I am an electronics engineer and doing practical hands-on work from more than 15 years now. Building real circuits, testing them and also making PCB layouts by myself. I really love doing all these things like inventing something new, designing electronics and also helping other people like hobby guys who want to make their own cool circuits at home.

And that is the main reason why I started this website homemade-circuits.com, to share different types of circuit ideas..

If you are having any kind of doubt or question related to circuits then just write down your question in the comment box below, I am like always checking, so I guarantee I will reply you for sure!

Previous Post: « How to Make LED Air Pollution Meter Circuit with Arduino
Next Post: Single LM317 based MPPT Simulator Circuit »

Reader Interactions

Comments

Anto Das8 says:
June 6, 2025 at 10:01 pm

Since 50uF capacitors and 240R resistors are not available in shops, can we use 47uF capacitors and 270R resistors

Reply
Swagatam says:
June 7, 2025 at 8:12 am

Yes, no issues, you can use them…those values are not too critical.

Reply
Daniel says:
July 2, 2024 at 7:38 pm

This is the high voltage regulator called maida regulator, it can up to 170v input

https://www.homemade-circuits.com/wp-content/uploads/2024/07/high-vooltage-LM317-regulator-circuit.jpg

Reply
Swagatam says:
July 3, 2024 at 8:45 am

Thank you, it looks good, but I am not sure how this can be converted into a buck converter using an inductor.

Reply
Daniel says:
July 2, 2024 at 7:22 pm

Please can the above lm317 buck converter be modified like this to take in high input voltage and regulate to produce current up to 10amps with corresponding input power. Thanks Mr Swagatam

Reply
Swagatam says:
July 2, 2024 at 7:38 pm

Hi Daniel,
10 amps may be possible by modifying R1, Q1, L1, but voltage cannot exceed above 60V.

Reply
Daniel says:
March 30, 2024 at 11:50 pm

please for 12v battery, which value should I set the charging for optimal efficiency with 60v input

Reply
Swagatam says:
March 31, 2024 at 8:30 am

You can use 14V max.

Reply
Daniel says:
April 5, 2024 at 7:02 pm

Thanks sir, please between using appropriate specs of voltage and current for a charger and converting excess voltage using buck converter, which is more effective and efficient for charging

Reply
Swagatam says:
April 6, 2024 at 7:56 am

That depends on your power supply source, if you have the exact spec then that is ideally suitable, but if you power supply does not match the battery spec, and has higher voltage and lower current, then using buck converter becomes a necessity.

Reply
michael roberts says:
April 11, 2023 at 4:18 am

Where is figure 10 in the latter part of the article?

Reply
Swagatam says:
April 11, 2023 at 9:12 am

It is not available with me. You may have to check the original datasheet for it.

Reply
M. Ahsan says:
January 12, 2023 at 5:41 pm

Thanks Mr. Swagatam! Cct is working perfectly. Suggest me upgrade , how can I add more components to make it more efficient.

Reply
Swagatam says:
January 12, 2023 at 6:03 pm

Thank You M.Ahsan, glad the circuit is working now.

However, I cannot suggest any upgrade except for the transistor and the coil, because rest all are designed by the manufacturer and cannot be upgraded or modified.

For the transistor and the coil you can upgrade these by increasing their current handling capacity appropriately, which will allow you to increase the output power of the circuit.

Reply
M. Ahsan says:
January 12, 2023 at 7:16 pm

Thank u sir, for your most valuable feedbacks.

Reply
Swagatam says:
January 12, 2023 at 7:49 pm

You are most welcome M. Ahsan

Reply
M.Ahsan says:
December 20, 2022 at 10:52 pm

Sir, will flyback generated by inductor L1 make some effect for other semiconductors after switching off the power? can I add some protection? r not necessary ?

Reply
Swagatam says:
December 21, 2022 at 8:59 am

The voltage generated from L1 will be stored inside C4, so it is fine no external protection is necessary. You can increase the value of C4 to 1000uf if possible.

Reply
M.Ahsan says:
December 24, 2022 at 8:46 pm

sorry sir for again, in present scenario above what should I do? should I increase the thickness of coil or decrease? for overcome heating and voltage dropping problems less then 2 amp?

Reply
Swagatam says:
December 25, 2022 at 8:55 am

You can try changing the transistor. You can perhaps try TIP2955. Yes increase the coil wire thickness to 1 mm at least.

Reply
M.Ahsan says:
December 24, 2022 at 3:39 pm

hi sir, today I tried to arrange this cct. I set it to 24 v input and 15 output. but the Q1 TIP36 got heated at load of 2 amp. and LM317 got burn. then I tried LM339 in place of LM317. this LM339 working perfectly without heating. but still Q1 is heating, with load.
and when I decrease the current of power supply, the output voltages drops from 15 to 9 V. .. and Input drops from 24 to 12v, with load. is it normal thing with decreasing input current? plz guide.
cct arrangement with some replacements.
a)D1– Fr107 instead of 1N3880
b)Q1– TIP 36 instead of 2N3792
c) inductor I think as it is. 600 u H
**and especially what can I do to overcome the heat of Q1?
thanks.
Regards:
M.Ahsan

Reply
Swagatam says:
December 24, 2022 at 5:26 pm

Hi M.Ahsan,
The LM317 is internally protected from output over current and short circuit and over heat, so it should never burn under any circumstances unless the input voltage exceeds 40 V. Also, the TIP36 is rated to handle up to 25 amps so it should not heat up at 2 amps. I think the parts you brought might not be original.

Yes LM338 being rated at 5 amps it will be cooler than LM317.

Yes if you decrease the input current then the output voltage will drop since the load is not getting sufficient current as per its specifications.

You can supply any amount of current at the input that will not cause any harm to the IC or the transistor, but the voltage to the load must be correctly adjusted so that the load and the transistor are not over loaded.

So you just have to take care of the following things:

Input voltage should be ideally below 40 V

Input current can be any value even upto a million amps, that is irrelevant.

Output voltage to the load is crucial and must be accurately set as per the load specifications..

Output load current specifications must be in accordance with the transistor specifications…2 amp is very less for TIP36 and it should not heat up. It can heat up slightly but not too much.

Make sure the inductor wire gauge is at least 1 mm or 2 mm thick.

Reply
M.Ahsan says:
December 24, 2022 at 7:34 pm

thank u sir for ur valuable reply.

Reply
Swagatam says:
December 24, 2022 at 8:00 pm

My pleasure!

Reply
M.Ahsan says:
December 19, 2022 at 9:09 pm

sir, Can I use 2n3055 in place of 2N3792?
and I am having problem to getting tantalum capacitors, plz suggest the replace. Regards, M.Ahsan

Reply
Swagatam says:
December 20, 2022 at 9:50 am

M. Ahsan,
2N3055 is an NPN transistor so it cannot be replaced with 2N3792. You can try TIP2955 or TIP36.
Tanatalum capacitor is recommended, but if don’t get it, you can use other ordinary type.

Reply
M.Ahsan says:
December 20, 2022 at 3:58 pm

thank u sir , u solve my problem.

Reply
Swagatam says:
December 20, 2022 at 5:36 pm

I am glad to help!

Reply
M.Ahsan says:
December 19, 2022 at 5:04 pm

it’s very useful. i like it. but u didn’t mention the wattage of resistors used in this cct. plz mention the wattage of resistors used in cct.

Reply
Swagatam says:
December 19, 2022 at 5:23 pm

Thank you! R1 and R2 can be 1 watt rated and rest of the resistors can be 1/4 watt rated.

Reply
M.Ahsan says:
December 19, 2022 at 5:36 pm

thanks bro for ur quick reply.

Reply
Tim Hofstetter says:
July 30, 2022 at 8:43 pm

That verbiage from the National Semiconductor Voltage Regulator Handbook was not descriptive of the circuit in question, it was descriptive of the next illustration, that of a much improved version using an NPN-PNP arrangement (a 2N2905 and three LM395s with internal overload protection) in place of the PNP transistor.

Reply
Vee says:
April 27, 2021 at 5:52 am

Hi Swagatam
I wrote to you regarding using IN 4148 in parallel but I think I made a mistake,
I thought they are 1amp diodes but realized they are only 150 ma……. sorry about that. I can’t use them.
Thanks again for all your help Swagatam
All the best
Regards
Vee

Reply
Swagatam says:
April 27, 2021 at 9:15 am

OK will do, no problem…

Reply
Prashanth Suvarna says:
October 7, 2024 at 5:48 pm

GE Sir, regarding available of the door in Q, I wish to point out that you can use a more easily available BA159 as it works perfectly well and is commonly used in many TV,s.

Reply
Swagatam says:
August 26, 2024 at 8:35 am

Thank you Prashanth,
I appreciate your images and your feedback very much, and I have already posted them in the above article.
Please check this link, at the bottom of the article you can find all your images published with the required details:
https://www.homemade-circuits.com/lm317-variable-switch-mode-power-supply/
And none of your comments have disappeared, they might be temporarily not visible to you due to cache…

Reply
Prashanth Suvarna says:
August 26, 2024 at 12:30 am

Hello there! I’m sorry, but I remember sending a reply to u but I presume a it may have disappeared.As req I hv sent the snaps for your perusal and hope it clarifies many of the issues raised by some of your readers. I want your observations on the waveforms esp the some waves and the awful amount of noise at the transistor collector. But most of the noise has instead come down dramatically at the Lm317 opt due to its noise filters. BTW AAS fast as poss was supposed an abbreviation for AFAP (like ASAP) for as far as possible. thnx for pointing it out. This is because I prefer to use glide typing as is quick and convenient, by we should always approve matter b4 posting. Of traders wish to clarify anything in cnnx with my variation on the above circuit. they could get in touch with me by raising any issues as I will be glad to help.Thank you.My mail id is prashanth58in@gmail.com

Reply
Prashanth Suvarna says:
August 22, 2024 at 11:29 am

Sorry boss 4 being out of touch 4 such a long time. Uc I 4got the original link 2 reply 2u. That should have been only far/fast as poss (As applicable) The word creepy in as I usually use glide typing which throws up errors sometimes whic we are supposed 2 lookout 4 B4 opposing which I overlooked Sorry abt that. Btw I hope you will highlight the photos that you have observed on these columns as it will be of significant interest to concerned members of your coloum due to its offbeat application.I appreciate any comments or Q on the above and will be glad to be of any help on the same. Thank you.

Reply
Swagatam says:
August 22, 2024 at 2:53 pm

Thank you Prasantha, for your kind feedback,
yes, understanding the text abbreviations or SMS language takes more effort…
I have added the photos which you sent me in my email.
I appreciate your observations and the experiments conducted on the above concept…
Many thanks…

Reply
Swagatam says:
August 18, 2024 at 5:50 pm

Thank You Prasanth,
I have seen the images you sent in my email, the results look very nice indeed!
In your previous comment you mentioned “AAS fast as poss ex”….can you please tell me what it means?

Reply
Prashanth Suvarna says:
August 18, 2024 at 4:14 pm

Fine boss! I hv uploaded my observations as directed into your E-Mail homemadecircuits@gmail.com

Reply
Swagatam says:
August 17, 2024 at 5:24 pm

Good evening Prashanth! Thank you for your kind concerns!
Yes, unfortunately there’s no facility to upload images in this commenting platform.
But no worries, you can send them to my following email ID, I will check them out:
homemadecircuits
@gmail.com

Reply
Prashanth Suvarna says:
August 17, 2024 at 4:41 pm

GdEvng Sir! Happy to hear your appreciation on my comments on the above. Now it was ONLY agree submition of my text that I realised that there was no option/provision for submitting photos, graphs etc as I could not locate the same. Pz guide me on the same Asap or send me your Em.I will post them imm. Thank you.

Reply
Swagatam says:
August 16, 2024 at 2:37 pm

Thanks so much Prashanth, for the interesting facts about this design, it is greatly appreciated!
I hope the readers will find this information very helpful while designing an LM317 IC based step-down switching regulator circuit.
Please let me how I can access the pictures that you have submitted…many thanks.

Reply
Prashanth Suvarna says:
August 16, 2024 at 1:07 pm

As a committed fan of your posts, I wish to add some of my observations to the above. I needed a balanced+-24-0-24 for powering a Opt stage that req only+24-24 instead of the 39 v that the unit was supplying to the original amp.I have used your basic circuit AAS fast as poss ex that I took it a step further and used it to make a negative switcher as well with one of the driver Ic,s being variable in order to realise a perfectly balanced voltage. Points worth mentioning is the dramatic reduction in the amount of heat dissipation compared to the same ckt working in the linear mode. The smaller Darlingtons122/127 made me quite apprehensive due to its failures twice even without heating, so they were imm changed to(Tip)143/147 which matched wonderfully.Ihave submitted the photos made at the time for your and the readers consideration.

Reply
M.Ahsan says:
December 19, 2022 at 9:15 pm

Dear sir, Thanks a lot for ur kind reply.

Reply
Swagatam says:
December 19, 2022 at 7:11 pm

Hi M. Ahsan, you can try FR107 or BA159 diode for D1.

Reply
M.Ahsan says:
December 19, 2022 at 5:35 pm

hi Swagatam!
I’m having problem to getting exact value of diode in cct. kindly plz suggest me any other value of diode.

Reply
Joe says:
March 25, 2022 at 9:29 pm

Will a pc817 work for the photo couple or do I need to make one with the photo resistor?

Reply
Swagatam says:
April 27, 2021 at 9:15 am

Hi Vee, Since the wire itself is super enameled, and since the turns are for a single winding therefore insulation is not needed between layers…

Reply
View Older Comments

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

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

Primary Sidebar

circuit simulator image



Subscribe to get New Circuits in your Email



Categories

  • Arduino Projects (93)
  • Audio and Amplifier Projects (133)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (85)
  • Datasheets and Components (109)
  • Electronics Theory (149)
  • Energy from Magnets (27)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (20)
  • Health related Projects (27)
  • Home Electrical Circuits (13)
  • Indicator Circuits (16)
  • Inverter Circuits (95)
  • Lamps and Lights (159)
  • Meters and Testers (71)
  • Mini Projects (28)
  • Motor Controller (68)
  • Oscillator Circuits (28)
  • Pets and Pests (15)
  • Power Supply Circuits (91)
  • Remote Control Circuits (50)
  • Renewable Energy (12)
  • Security and Alarm (64)
  • Sensors and Detectors (106)
  • SMPS and Converters (34)
  • Solar Controller Circuits (60)
  • Temperature Controllers (43)
  • Timer and Delay Relay (49)
  • Voltage Control and Protection (42)
  • Water Controller (36)
  • Wireless Circuits (30)





Other Links

  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap



People also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Stack Exchange
  • Linkedin



Recent Comments

  • Swagatam on Arduino 2-Step Programmable Timer Circuit
  • Swagatam on Simple Buck-Boost Converter Circuits Explained
  • Swagatam on IC IR2111 H-Bridge MOSFET, IGBT Driver IC: Full Datasheet, Circuit Diagram
  • Swagatam on Electronic Circuit Projects, Tutorials, and Practical Engineering Solutions
  • Kadir on Simple 3 Phase Inverter Circuit

© 2026 · Swagatam Innovations