• 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 | Hire Me | Contact | Calculators-online
You are here: Home / SMPS and Converters / LM317 Variable Switch Mode Power Supply (SMPS)

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.

Table of Contents
  • LM317 as Linear Regulator
    • Modifying LM317 Circuit into a PWM Switching Regulator Circuit
    • Circuit Diagram
    • How it Works
    • Another Feedback from a Dedicated Follower of this Blog, Mr. Prashanth Suvarna

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:

  • Build this 85V–265V AC to 12V 5A SMPS Design Using UC3843 (With Calculations)
  • Build Customized 220V Flyback SMPS Circuits: 12V, 5A, 60W Example Discussed
  • 110 V to 220 V converter device110 V to 310 V Converter Circuit
  • Difference Between Forward Converter and Flyback Converter

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

Questions & Answers

Total Posts: 118
Newest Oldest
Anto Das8
June 6, 2025 • 1 year ago #180083

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

Reply
SwagatamAdmin
June 7, 2025 • 1 year ago #180149

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

Reply
Daniel
July 2, 2024 • 2 years ago #153368

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

high vooltage LM317 regulator circuit

Reply
SwagatamAdmin
July 3, 2024 • 2 years ago #153376

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

Reply
Daniel
July 2, 2024 • 2 years ago #153366

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
SwagatamAdmin
July 2, 2024 • 2 years ago #153367

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

Reply
Daniel
March 30, 2024 • 2 years ago #151182

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

Reply
SwagatamAdmin
March 31, 2024 • 2 years ago #151193

You can use 14V max.

Reply
Daniel
April 5, 2024 • 2 years ago #151364

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
SwagatamAdmin
April 6, 2024 • 2 years ago #151368

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
April 11, 2023 • 3 years ago #141712

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

Reply
SwagatamAdmin
April 11, 2023 • 3 years ago #141718

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

Reply
M. Ahsan
January 12, 2023 • 4 years ago #138815

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

Reply
SwagatamAdmin
January 12, 2023 • 4 years ago #138817

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
January 12, 2023 • 4 years ago #138820

Thank u sir, for your most valuable feedbacks.

Reply
SwagatamAdmin
January 12, 2023 • 4 years ago #138823

You are most welcome M. Ahsan

Reply
M.Ahsan
December 20, 2022 • 4 years ago #137740

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
SwagatamAdmin
December 21, 2022 • 4 years ago #137775

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
December 24, 2022 • 4 years ago #137928

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
SwagatamAdmin
December 25, 2022 • 4 years ago #137933

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
December 24, 2022 • 4 years ago #137911

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
SwagatamAdmin
December 24, 2022 • 4 years ago #137915

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
December 24, 2022 • 4 years ago #137919

thank u sir for ur valuable reply.

Reply
SwagatamAdmin
December 24, 2022 • 4 years ago #137922

My pleasure!

Reply
M.Ahsan
December 19, 2022 • 4 years ago #137653

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
SwagatamAdmin
December 20, 2022 • 4 years ago #137670

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
December 20, 2022 • 4 years ago #137729

thank u sir , u solve my problem.

Reply
SwagatamAdmin
December 20, 2022 • 4 years ago #137734

I am glad to help!

Reply
M.Ahsan
December 19, 2022 • 4 years ago #137638

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
SwagatamAdmin
December 19, 2022 • 4 years ago #137642

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

Reply
M.Ahsan
December 19, 2022 • 4 years ago #137645

thanks bro for ur quick reply.

Reply
Tim Hofstetter
July 30, 2022 • 4 years ago #131950

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
April 27, 2021 • 5 years ago #88770

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
SwagatamAdmin
April 27, 2021 • 5 years ago #88775

OK will do, no problem…

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



Categories

  • Arduino Projects (95)
  • Audio and Amplifier Projects (134)
  • Automation Projects (18)
  • Automobile Electronics (103)
  • Battery Charger Circuits (89)
  • Datasheets and Components (109)
  • Electronics Theory (150)
  • Energy from Magnets and Earth (40)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (20)
  • Health related Projects (27)
  • Home Electrical Circuits (13)
  • Indicator Circuits (16)
  • Inverter Circuits (100)
  • Lamps and Lights (163)
  • Meters and Testers (72)
  • Mini Projects (28)
  • Motor Controller (68)
  • Oscillator Circuits (30)
  • Pets and Pests (15)
  • Power Supply Circuits (91)
  • Remote Control Circuits (50)
  • Security and Alarm (65)
  • Sensors and Detectors (107)
  • SMPS and Converters (46)
  • Solar Controller Circuits (62)
  • Temperature Controllers (44)
  • Timer and Delay Relay (50)
  • Voltage Control and Protection (44)
  • Water Controller (37)
  • Wireless Circuits (31)



Circuit Simulator

circuit simulator image



Subscribe to get New Circuits in your Email



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 |



Recent Comments

  • Swagatam on 2 Cool 50 Watt Inverter Circuits for Students and Hobbyists
  • Swagatam on The Perfect FM Radio Circuit using TDA7000 IC
  • Swagatam on 9 Simple Sine Wave Generator Circuits Explored
  • way on 2 Cool 50 Watt Inverter Circuits for Students and Hobbyists
  • Athull on The Perfect FM Radio Circuit using TDA7000 IC

Social Profiles

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

© 2026 · Swagatam Innovations