Switch mode power supply tutorial: DC-DC buck converters


Today I’m going to teach you about “buck
converters”, and show you how to make a switch mode power supply that can work with input voltages
between 8 and 30V, and it steps the output down to 5 volts.
It can supply three amperes continuously and can handle peak currents of up to
5 amps for several minutes. Let’s start with why we need switch mode
power supplies in the first place. In previous videos I talked about linear
voltage regulators like the LM7805 and LM317. These are really easy to use, but they’re
very inefficient at high voltages. For example, if you try to power a linear
voltage regulator with 28 volts, and had by 5 volts and 3 amps on the output,
you’d end up with 69 watts of heat produced. And that might cause a few problems with
your circuit. For high powered projects you want to be using what is called a
switch mode power supply. There are many different types of switch
mode power supplies that can get you from one voltage to
another. But today we’re going to talk about buck converters which is a type of supply that can
step higher voltages down to lower voltages. Let’s start with an input voltage of 10V
and let’s put a switch in series with it. It doesn’t matter what the switch is… it
could be a bipolar transistor, a MOSFET, even a crazy person pushing a
mechanical switch. For efficiency reasons you should use a MOSFET but but let’s just use a generic switch
symbol for now. Next, let’s control the switch with a high
frequency pulse width modulated signal with a duty cycle of fifty percent. This
will give us a square wave that’s 10V half the time and 0V half the time. Now let’s add an LC low-pass filter. The inductor resists sudden changes in current,
and the capacitor resists sudden changes in voltage. The combined effect is that our LC low-pass
filter averages out the square wave and we get
5 volts of relatively steady DC on the output. Now unfortunately, if you build this in
real life, this will happen. But why? Well let’s say the switch is
closed… and our power supply is delivering some
current. This means that current is flowing through this inductor. Now let’s open the switch. Since current in an inductor cannot instantly change
this means that current is still flowing through the inductor. But this side of the inductor isn’t connected
to anything. So you get this huge mass of electrons building up here, creating a massive negative voltage
spike. This voltage spike can reach hundreds or even thousands of volts, enough to blow up any switch you connect
here. If you want more detail about this phenomenon, check out my video on inductive spiking. In
that video, you will learn that the solution to the
problem is to add a diode. With the diode in place, now whenever
you open the switch, current can flow in a nice complete path
and the voltage after the switch barely goes below zero. This is the classic buck converter configuration. And you can use this basic circuit
to step high DC voltages down to lower DC voltages in a much more efficient way than linear
regulators. Now in school they might tell you that this
formula will give you the duty cycle you need to get the output voltage you want.
Unfortunately in the real world this is garbage. As soon as you start drawing a few amps
from your power supply, the various non-ideal parts of the
circuit will complicate things. You’ll get power losses in your switch,
your diode, and your inductor, and even your wires. It’s also highly unlikely that your
output current will stay exactly the same. The more current your load draws, the more the voltage will drop. So what
we need is a system that can continually monitor the output voltage and adjust the pulse width accordingly. If
you draw more current on the output, and the output voltage drops too low,
increase the pulse width. If the output voltage gets too high, decrease the pulse width. And we have to do
this within a fraction of a second otherwise we could fry the thing we’re
trying to power! In other words we need a closed-loop control scheme with negative
feedback. We can accomplish this by adding a
feedback resistor network at the output, a ramp oscillator and an error amplifier.
We’re also going to need a precision voltage reference and a suitable slope comp- (SHUT UP!) Okay, how about we make things easy? Texas
Instruments has a portfolio of products called “simple switchers”. All the simple switcher products are
practically idiot proof and all you have to do is add a diode, an
inductor and some capacitors. They take care of the complicated
control electronics inside the chip. Let’s use the adjustable version of the
LM2678. And here’s the circuit diagram. On the
input we have a large electrolytic capacitor in parallel with a ceramic
capacitor and this is necessary to ensure that the LM2678 can easily switch current from the input
at very high speeds. If you don’t have sufficient capacitance
on the input, the parasitic inductance of your input
power wires will limit the amount of current you can
switch in every switching cycle and the regulator just won’t work. For
the diode, when you’re designing switch mode power
supplies you almost always want to use schottky diodes. These have a lower forward voltage than
regular silicon diodes so they produce less heat, which is
something you always have to worry about when you’re working with high currents. I’ll put links to the components in the
video description section. This is a bootstrap capacitor. It is used to help drive the switching
transistor inside the LM2678. It can 10nF to 100nF and it
should be a ceramic capacitor with at least a 50V rating.
On the output we have a combination of capacitors that will smooth out the high frequency
content of the switching waveform, leaving you with relatively clean and
stable DC. These resistors configure the LM2678 to give you a 5 volt output. Try to
use 1% resistors if you want an accurate 5 volt output. Alright let’s build this thing! You
don’t want to use a breadboard for this. Use perfboard, or make your own PCB. Solder in
in the LM2678 first leaving a large amount of space around
it to fit the other components. Solder in the input electrolytic
capacitor within a centimeter or two of the controller. And use short, thick lines of solder to
make the connections. Do the same with the diode and the
output capacitor. Keep the component leads short as
possible. When you solder the feedback resistors,
try to keep the wire going back to the chip as short as possible. The layout on the underside of the board
is even more important than the topside! Notice how my ground is one continuous
straight line, and I arranged all the components on the
top side around this. I also soldered on a ground wire for
oscilloscope probing later. And look how I soldered the ceramic
input and boost capacitors directly across the pins of the LM2678. If these capacitors are even a few millimeters
away from the chip, everything will perform a lot worse. Okay,
now that everything soldered up, I’m going to power my buck converter with
10 volts, and I’m going to use my programmable electronic load to see how it performs delivering
different amounts of current. If you are doing this at home, you can just
use 5 ohm 10 watt power resistors as a dummy load. First, let’s check the output voltage is what we want it to be. And it is! Perfect
5 volts DC! Excellent. Now let’s take a look at this
node in the circuit which is called the switching node. This is before the LC low-pass filter.
You can see our familiar 0 to 10 volt square wave, and the switching
frequency is 250 kHz. But you can see the duty cycle is about
52 percent instead of the theoretical 50 percent.
This is with a 0.5 ampere load on the supply. If I increase the load to 3 amps, the duty cycle increases to 56%. And at five amps, the power losses are significant enough
that the controller had to change the duty cycle to 61% to maintain the regulated
5 volt output. Remember when I said we were getting a
perfect 5 volts? I lied! Let’s change the coupling on
the oscilloscope to AC coupling and zoom in. You can see that there’s a
small AC component on the output because our low pass filter is not
perfect. We call this the output ripple of the power supply because it looks like little wave
ripples. We have about 20 millivolts of ripple and noise with a 3 ampere load. If I increase the load to 5 amperes, things
get noisier. If I increase the input voltage to 28
volts, the ripple waveform gets bigger, and it changes shape. Ideally we want this ripple to be as
small as possible. For most applications, under 100
millivolts peak to peak will be fine. But in general you don’t want to use
switch mode power supplies to power sensitive circuits like radio receivers. If you want to learn more about
measuring power supply ripple, enable video annotations and check out Dave
Jones’s excellent video on the subject. Now let’s
measure the efficiency of our supply and compare it to a linear voltage
regulator. From a 28 volt input my bench power supply is supplying 0.61 amperes
to the DC to DC converter. My multimeter says the output of the
converter is 5.019 volts. and I have the load set to exactly 3 amperes. If you’re doing this at home with
resistors as a load, make sure you use a multimeter to accurately measure the
output current. Here’s the equation for power supply
efficiency. Plugging in the values we measured earlier, we find that our power supply is around
88 percent efficient which is pretty good! This is why people
usually use switch mode power supplies for currents higher than 1 ampere. Alright, now you know how to make a high
current power supply, and knowing is half the battle. Thank you for watching, and if you liked this video please check out the video description section
to see how you can support me. Make sure you check out Patreon, which is
kind of like an ongoing Kickstarter campaign
to help fund the channel!

100 thoughts on “Switch mode power supply tutorial: DC-DC buck converters

  1. Once upon the time I wanted to power my homemade SSTC from a buck converter… yeah, due to interference it didn't work…

  2. Interested in learning about wireless power? Subscribers can get up to 80% off Wireless Power to the People – Wireless Charging 101 on udemy using the coupon code "YOUTUBE"
    http://www.udemy.com/wireless-power-to-the-people-wireless-charging-101/?couponCode=YOUTUBE

  3. Can buck converter increase the output current?
    I want to convert 12V 2.7 A to 1.5 V 20 A.
    I was built one using push pull oscillator with transformer (fewer turns on secondary), but produces hundreds KHz AC output that I must handle with skin effect. The AC output cannot be converted to DC easily by using reflecter diode, small resistance will produce loss / heat because low voltage high current.

  4. If the resistors on the right fail would the output be equal to the input? How can we prevent this by shutting it down or force the output to the lowest voltage if the resistors fail?

  5. Man ! U r the best ! U totally rock man…I am a noob and just by watching ur videos I can understand many many things about basic electronics. You explain stuff so easily.. You are the best teacher in YouTube ….
    Continue to make more videos bro …!!! Hats off

  6. “Crackhead mashing a mechanical switch” I cried laughing and my girlfriend doesn’t understand why because my headphones are in….

  7. Hello, I’m using piezoelectric and I’m getting a high ac voltage with a very low current and I rectified it , so is it circuit applicable for such since the voltage is intermitted

  8. schottky diode maybe chosen because of lower response time than silicon diode?

  9. Great little video. I wonder if anyone can help me. I'm looking to build a 12v and a 5V power regulator with NO ripple. It should be easy to do as input is 12-14vdc with lots of noise on line.

  10. Thank you for this amazing tutorial….. I have a question, please …. How about if I want the output voltage to be between 6 – 19 V and the power around 90 Watts ? How can I achieve that ?

  11. 9:41 "…and knowing is half the battle" G.I. Joe liked to tell kids this. They never did tell you that the other half of the battle is KILLING PEOPLE!

  12. Very nice video tutorial. I was interested in how the inductor played a part in the buck converter. How did you arrive at the 22uH inductor at 6 amps?

  13. I loved your video at just past 4:00 min into it! I was thinking the exact same thing and was about to skip the video untill it happened! Lol

  14. Dam I would have love to learn how to really build one as oppose to the plug and play option. For the sake of learning !

  15. Why is there 5V on the output without a load? Whats preventing it to bump the voltage up to 10V?
    Also my LTSpice simulation sometimes just goes crazy with this circuit. I did something wrong?

  16. Afrotechmods, First let me start by saying your videos are my favorite gotos for trying to learn more about electronics. I've watched most of your videos at least two times, often more.

    I may not be understanding all the concepts completely yet, but I had a thought and wondered if there was any merit to it:

    Would it be possible, or even make sense to use a buck converter to get the power roughly where you want it, then feed that into a linear regulator to compensate for the AC ripple, thereby getting the efficiency of the buck converter, and the smooth DC from the regulator?

  17. Can I use this circuit to power a Raspberry Pi, for example? I mean I know that RPI 3 is 2.5 A so more than enough but there is anything that I need to worry about , maybe the ripple?

  18. @Afrotechmods, What would be the advantage of building this (besides knowledge & personal satisfaction) over just buying one off Amazon? I see the cost of parts from the link you give in the description is around $12 while I can purchase a buck converter off Amazon for $6-7

  19. Love your vids, Not sure how much control you have over ads, but a 9+ minute ad at the end of the video, that is pretty insane, No hate on you, gotta make pay, but, wow. that ad. LOL

  20. How would I go about simulating this? TI seems to have the spice library on their site but I'm uncertain of how to make use of it in LTspice?

  21. Great video. Where did that graphic come from at 0:57? Seems like an excellent resource to finding alternative components if needed.

  22. Please Can you give me a circuit to get low voltage output 14 volts or 28 volt of 30 to 60 amps from a 100 volts 17amps input, i want to use it for a battery charging system from solar

  23. Am I still recommended to use this design if I need it for a 5V 500mA load? Or I should go with a different design?

  24. Wow, now. I really understand how buck converter works! Awesome video – sort, easy to understand and really good! Thank you!

  25. Hi! After you explained how the buck converter adjusts the duty cycle of the pwm signal, I noticed that as the duty cycle increases, more of the input power is usable. So if I understand correctly, the buck converter should be most efficient when the maximum output is drawn. And when the output is less and the duty cycle decreases, the efficiency should fall again. Is this way of thinking correct? Or is there something I’m missing?

  26. Good video. They only flaw I see is the use of solder to conduct current. To me that is always a no-no. Proper soldering technique requires all conductors to be as physically connected as possible with the solder only making up the last microns of conductivity. I've been in electronics repair for almost 40 years, and by far the most common failure I've seen is improper soldering on high power/heat connections such as transistors and power resistors. Never rely on solder to make the physical connection. For this demo, sure it works, but I wouldn't put that into anything I wanted to keep working for years.

  27. I'm having some trouble with my circuit. I need to switch some large currents and I'm using a TO-220 crackhead, but do you think the TO-3P package would have been a better choice? What kind style crackhead do you normally go for?

  28. Isn't adding the 10uF ceramic capacitor in parallel to the 1000uF electrolytic capacitor redundant since they are in parallel? What is the purpose of adding the 10uF capacitor?

  29. could we use this to essentially do 12V to 12V to isolate ground? I have some lights in my car with poor step up transformers that inject noise into the sound system via the car wiring.

  30. Not a EE guy… When I hear large capacitor and see uF my brain is like wtf. Is ”large” relative to the V/I of the given system? bc I’ve even heard .1uF filter cap is considered large in a guitar pedal application.

  31. can I put a linear converter behind the buck converter to smoth the output (since the input votage that is comming from the buck converter is already 5V there should not be a big power los right ?).

  32. A 10uF ceramic capacitor is quite large. Did you mean 0.01uF? That's the one that suppresses noise that gets through an electrolytic. 10nF or 103.

  33. Could anyone explain the purpose of the 10 [nF] bootstrap capacitor and as to why it is connected where it is (between the boost pin and inductor)?

  34. 0:39 A LM317T can only power 1.5a anyway, no matter the voltage drop. Trying to push 3amps through one is going to fry it anyway.

  35. I remember my first linear power supply with LM7805 and LM7812. We used a casing with was pretty much a big steel casing and inside we screwed those LM's to heat dissipation aluminum thingys. It was pretty powerful but it got hot. Not long afterwards I thought why did we not just heat dissipate to the case which should/could take even more. And sure it could have been a disaster but nowadays with pretty small sensor/RCB type of things I think the casing itself just to dissipate heat better.

  36. Seems like you could feed the output of a buck converter at desired DC+max ripple into a voltage regulator to have the best of both worlds: the heat dissipation on the regulator would then just be the RMS of the ripple voltage by the current, significantly less than down-converting from a primary source. And you'd get the smooth DC output you need for sensitive circuits.

  37. Your video is really valuable. I love your informative videos and these are Golden assets for me

    LOVE YOU 😘❤️😘❤️😘

Leave a Reply

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