Buck converter: how it works and when it beats a 7805
How a buck converter lowers a voltage with almost no heat: switch, diode, inductor and capacitor, duty cycle, ripple and a comparison with the 7805.

A 7805 regulator makes 5 V from 12 V by turning the extra 7 V into heat. At 1 A that is 7 W, and the load gets only 42 % of the power the regulator takes from the source. How the 7805 works and how hot it gets is on the Rectifiers and voltage regulators page, and the graph of the heat is on Powering a project.
A buck converter (a step-down converter) makes the same 5 V from 12 V, but it doesn’t turn the extra voltage into heat. It switches the input voltage on and off very fast, and an inductor and a capacitor turn those pulses into a steady voltage. That way it uses 80 to 90 % of the energy. This page explains how it works, where its limits are and when a 7805 is still the better choice.
The four parts

A buck converter has four main parts:
- Switch S1 is a transistor that turns on and off. In the LM2596 this switch is inside the chip and switches 150,000 times a second.
- Diode D1 is a fast Schottky diode.
- Inductor L1 is a wire wound round a core.
- Capacitor C1 smooths the output voltage, like the capacitor after a rectifier.
The only new part is the inductor. For this page you need to know just one thing about it: an inductor resists changes in its current. While the current through it rises, it stores energy in its magnetic field. When the current tries to stop suddenly, the inductor gives that energy back and pushes the current on in the same direction. The same property makes a high voltage when a relay switches off, which is why a relay’s coil has a protection diode next to it.
The switch is on (left schematic): the current flows from the source through S1 and L1 into the load R1 (the orange path). The current through the inductor rises, and the inductor stores energy. The diode doesn’t conduct, because its cathode is at almost 12 V.
The switch is off (right schematic): the source no longer gives any current, but the inductor won’t let the current stop suddenly. The voltage at the inductor’s left end falls a little below zero and the diode conducts. The current now flows round through D1, L1 and R1 (the blue path), and the inductor gives back the energy it stored. The current slowly falls.
Capacitor C1 smooths the output voltage all the time: while the inductor’s current rises, it takes in the extra current, and while it falls, it adds what is missing.
The duty cycle
The switch is on for only part of each period. That part is called the duty cycle D. The inductor and the capacitor turn the voltage pulses into their average, so the output voltage is roughly:
It is the same idea as the PWM that changes the brightness of an LED: the LED switches on and off fast, and the eye sees the average. In a buck converter the inductor and the capacitor make the average, so the output isn’t pulses but a steady voltage.
The current in the inductor

The graphs are calculated for an LM2596 making 5 V from 12 V at 1 A, with the parts from the LM2596 schematic on the Rectifiers and voltage regulators page (33 µH and 220 µF). They show 20 µs, three periods of 6.67 µs (150 kHz):
- U2 (top) is the voltage where the switch, the diode and the inductor meet. While the switch is on, it is about 11.3 V (12 V minus the voltage lost in the switch), and while it is off, −0.4 V, because the diode conducts. The switch is on for 3.1 µs of every 6.67 µs, 47 % of the time.
- IL (middle) is the inductor’s current. It rises while the switch is on and falls while it is off, between 0.71 and 1.29 A. Its average is exactly 1 A, what the load takes. The difference of 0.59 A is called the ripple current.
- U3 (bottom) is the output voltage, greatly magnified. It ripples between 4.97 and 5.03 V, about 59 mV from peak to peak.

With a smaller current the picture changes. At 0.2 A the inductor’s current falls to zero before the end of the period and stays at zero for about 1.2 µs. This is called discontinuous mode. While the current is zero, neither the switch nor the diode conducts, so U2 equals the output voltage of 5 V. A real converter then also has a short ringing on U2, which the model leaves out. The output is still 5 V; the switch is just on for less time, 37 % of the period.
Output ripple
Where do the 59 mV at the output come from? The inductor’s current goes up and down by 0.59 A, but the load takes a steady 1 A. Capacitor C1 takes in and gives out the difference, and that changes the output voltage in two ways:
- The capacitor charges and discharges. With 220 µF that is only about 2 mV.
- The capacitor also has a small internal resistance, its ESR (equivalent series resistance). With an ESR of 0.1 Ω and 0.59 A that is 0.1 Ω · 0.59 A ≈ 59 mV.
So in a buck converter it matters less how large the capacitor is than how small its ESR is. Capacitors for switching supplies have a small ESR and say low ESR. A small ceramic capacitor next to the electrolytic one also cuts down fast interference.
A 7805 has only tens of microvolts of noise at its output, more than a thousand times less. That is why a linear regulator is a quieter supply for measurements with analogRead(), for sound and for sensitive sensors.
Power in and power out
A converter can’t give out more power than it takes in, and it loses part of the power as heat. If η is its efficiency, the power at the input is:
A comparison for 5 V at 1 A, from the LM2596 model:
| Input voltage | 7805: input current | 7805: heat | 7805: efficiency | buck: input current | buck: heat | buck: efficiency |
|---|---|---|---|---|---|---|
| 7 V | 1.0 A | 2.0 W | 71 % | 0.83 A | 0.80 W | 86 % |
| 9 V | 1.0 A | 4.0 W | 55 % | 0.64 A | 0.77 W | 87 % |
| 12 V | 1.0 A | 7.1 W | 41 % | 0.48 A | 0.75 W | 87 % |
| 24 V | 1.0 A | 19 W | 21 % | 0.24 A | 0.82 W | 86 % |
In a 7805 the heat grows with the input voltage: from 24 V it would be 19 W, more than it can get rid of even with a large heat sink. In a buck converter the heat stays at about 0.8 W, and the input current falls as the input voltage rises. That is why batteries last longer with a buck converter.
Efficiency and the load current

The efficiency also depends on the load current. The graph is calculated from the same model: the voltage lost in the switch and the diode, the inductor’s resistance, the losses each time the switch turns on and off, and the 5 mA the chip uses for itself. The current axis is logarithmic: each line on it is ten times more current.
- From 0.1 to 3 A the buck converter uses about 80 to 87 % of the energy, from 12 V and from 7 V alike.
- A 7805’s efficiency can never be higher than U3 / U1: 42 % from 12 V, 71 % from 7 V.
- At small currents the efficiency of all of them falls. The LM2596 and the 7805 each use about 5 mA for themselves, and at a current of a few milliamps that is more than the load takes. Newer buck chips use less than 1 mA, so they do better at small currents.
In this model the buck converter beats the 7805 at every current. At a small current it doesn’t matter, though. A 20 mA sensor powered through a 7805 from 7 V makes only (7 V − 5 V) · 0.02 A = 0.04 W of heat in the regulator, which you couldn’t even feel with a finger. When the heat is that small, the linear regulator’s strengths (a quiet voltage, simplicity) matter more than its efficiency.
How does the converter know which voltage to make?
The LM2596-ADJ chip has an FB pin (feedback). Two resistors between the output and GND feed part of the output voltage to it, and the chip compares it with an internal 1.23 V. If the output voltage is too low, the chip keeps the switch on longer, and if it is too high, shorter. That way the output stays at 5 V even when the input voltage or the load current changes.
Example: 5 V for servos from a 12 V adapter

A typical job for a buck converter: a project with a 12 V adapter, an Arduino Uno and two servos. The circuit is the same as on a buck module, only with every part drawn:
- F1 (2 A) protects the adapter and the wires if there is a short circuit somewhere.
- The Arduino gets 12 V on its VIN pin, not 5 V from the converter. That way the voltage dips and the interference the servos make on the 5 V line don’t reach it. Its regulator turns only (12 V − 5 V) · 0.05 A ≈ 0.35 W into heat.
- C1 (680 µF) supplies the pulses of current the switch takes from the input. It must withstand at least 12 V, so it is a 25 V capacitor.
- The LM2596-ADJ with R2 and R1 gives 5.03 V. Its ON/OFF pin is connected to GND, so the chip runs as soon as it gets power.
- D1 is a 1N5824 Schottky diode (3 A, 40 V), L1 a 33 µH inductor, and C3 a 220 µF capacitor with a small ESR, as in the model on this page.
- C4 (470 µF) sits next to the servos and gives them current when they start suddenly, as on the Powering a project page.
An SG90 servo takes up to about 0.7 A when it starts, so two of them need up to 1.4 A. The converter then takes 5 V · 1.4 A / (0.85 · 12 V) ≈ 0.69 A from 12 V. The inductor’s highest current is about 1.4 A + 0.59 A / 2 ≈ 1.7 A, less than the 3 A the chip can handle. The GNDs of all the parts are connected, and the servos’ signal wires (to the Arduino’s pins) aren’t drawn.
A 7805 or a buck converter?
| 7805 | Buck converter (LM2596) | |
|---|---|---|
| Efficiency, 5 V from 12 V at 1 A | 41 % | about 87 % |
| Heat, 5 V from 12 V at 1 A | 7 W, needs a large heat sink | about 0.8 W |
| Input current, 1 A at the output, 12 V | 1 A | about 0.5 A |
| How much higher the input must be | at least 2 V | about 1.5 V |
| Highest input voltage | 35 V | 40 V |
| Current it uses for itself | about 5 mA | about 5 mA, newer chips less than 1 mA |
| Ripple and noise at the output | tens of µV | tens of mV |
| Interference with other devices | none | yes: fast jumps in voltage and current |
| Response to a sudden change in current | very fast | slower |
| Parts | the regulator and two capacitors | chip, inductor, diode, capacitors, resistors |
| Protection in the chip | current limit, thermal shutdown | current limit, thermal shutdown |
7805, pros:
- Simple: three pins and two capacitors, nothing to adjust.
- A quiet output voltage without interference.
- Reacts fast when the load current changes suddenly.
- Works on a breadboard.
7805, cons:
- Turns the extra voltage into heat: P = (U1 − U3) · I.
- The input must be at least 2 V higher than the output.
- Takes the load’s whole current from its input, so it drains batteries faster.
Buck converter, pros:
- Little heat and an efficiency of 80 to 90 %, even when the input voltage is much higher than the output.
- Takes less current from its input than it gives out.
- Works over a wide range of input voltages.
Buck converter, cons:
- Its output has a ripple of tens of millivolts, and the converter makes interference.
- It has more parts, and the wires between them must be short, so you don’t build one on a breadboard (that is why people buy a ready-made module).
- A module has to be adjusted before you connect anything.
Which regulator for which job
A linear regulator is a good choice when:
- the current is small, for example for a sensor that takes a few tens of milliamps,
- the voltage difference is small. For that there are LDO regulators (low dropout), which need only about 1 V of difference, for example the AMS1117-3.3, which makes 3.3 V from 5 V,
- a quiet voltage matters: analog sensors, the reference voltage for
analogRead(), sound.
A buck converter is better when:
- the project runs on batteries, so every bit of energy counts,
- you need 5 V from 12 V at more than about 100 mA,
- you need to power servos, motors or LED strips.
Often both are used: a buck converter brings the voltage close to what is needed, and a linear regulator after it removes the ripple. For example, a buck converter makes 5 V from 12 V for the servos, and an AMS1117-3.3 makes a quiet 3.3 V from those 5 V for a sensitive sensor.
The pins of two common linear regulators:


| Regulator | Package | Pins |
|---|---|---|
| 7805 | TO-220 | 1 IN, 2 GND, 3 OUT (seen from the front, writing towards you, pins down); the metal tab is GND |
| AMS1117-3.3 | SOT-223 | 1 GND, 2 OUT, 3 IN; the wide metal tab is also OUT |
Not every regulator has its pins in the same order: the LM317 has ADJ, OUT and IN. So check them in the datasheet before you connect one.
What to watch out for with buck modules
Before you connect a module
- Set the output voltage before you connect a load: connect only the input, measure the output with a multimeter and set it with the potentiometer.
- Mind the polarity. Most modules have no protection against reversed polarity, so a reversed input destroys them.
- When a converter fails, its switch can stay on for good. Then the whole input voltage reaches the output, and an Arduino on the 5 V line gets 12 V. Protect an expensive or sensitive device with a fuse and a Zener or TVS diode after it: if the output voltage rises, the diode draws a large current and the fuse blows.
- The chip and the inductor get hot at larger currents. Don't touch them while the module is running.
Common problems with modules:
- The number on the module isn’t the current it gives. 3 A is the chip’s highest current. An LM2596 module without an extra heat sink gives about 2 A. On some cheap modules the chip isn’t a genuine LM2596, and they give even less.
- Connecting to a supply that is already on. When you connect a module that has only ceramic capacitors at its input to a supply that is already switched on, through long wires, the input voltage can jump for a moment to almost twice its value. Modules with an electrolytic capacitor at the input (like the LM2596 ones) cope with this better. Connect small modules (for example with an MP1584 chip) before you switch the supply on.
- Two supplies on the same 5 V line. If a buck module is connected to the Arduino’s 5V pin while the Arduino is also connected to a computer by USB, current can flow from the module into the computer’s USB port. How to power an Arduino safely is on the Powering a project page.
- Interference in measurements. One step of
analogRead()on an Arduino Uno is 5 V / 1024 ≈ 4.9 mV, so a ripple of 59 mV moves the reading by about a dozen steps. Power an analog sensor from a quieter supply or through a linear regulator, and keep the wires short. - The potentiometer can move when the module gets a knock or a screwdriver touches it. Measure the output voltage again after you fit the module.
Other kinds of switching converters
A buck converter can only lower a voltage. To get a higher voltage from a lower one there is the boost converter: the lab power supply has a module with an XL6019 chip that makes 16 V from 12 V. When the output must sometimes be higher and sometimes lower than the input, a buck-boost converter is used, and for a negative voltage an inverting converter. They are explained on the Boost, buck-boost and inverting converters page.
A phone charger and a computer’s ATX power supply are switching supplies too, but they run straight from the 230 V mains. Never open them.
Measure it yourself
For this you need an LM2596 module, a 12 V supply, two multimeters, and power resistors of 10 Ω / 5 W and 100 Ω:
- Set the module to 5 V with nothing connected.
- Connect the 100 Ω resistor (50 mA). Measure the input current with one multimeter (in series with the supply) and the output current with the other. Then measure the voltages U1 and U3.
- Work out the efficiency: η = (U3 · I3) / (U1 · I1).
- Repeat with the 10 Ω resistor (0.5 A), and then with two of them in parallel (1 A).
- If you have an oscilloscope, connect it to the module’s output: AC coupling, 20 mV per division, 2 µs per division. Connect the probe’s ground with the shortest wire you can, because a long ground wire picks up interference itself. You will see the ripple and short spikes each time the switch turns on.
At 0.5 A a 10 Ω resistor turns 2.5 W into heat and gets very hot: put it on something that doesn’t burn, and don’t touch it. Compare what you measure with the table on this page. The table is calculated from a model, so your numbers won’t be the same.
Note
The diagrams, graphs and values on this page are calculated from simplified models or are typical examples. They are here to explain, and may differ from the actual specifications of the parts. Before you build anything, always check the datasheets of the parts you use.
What did we learn?
- A buck converter has a switch, a diode, an inductor and a capacitor. The switch turns the input voltage on and off fast, and the inductor and the capacitor turn that into a steady voltage.
- The output voltage is roughly the duty cycle times the input voltage: U3 ≈ D · U1.
- The inductor’s current rises while the switch is on and falls while it is off. Its average is the load current.
- A buck converter uses 80 to 90 % of the energy and takes less current from its input than it gives out. A 7805’s efficiency can’t be higher than U3 / U1.
- A buck converter’s output has a ripple of tens of millivolts, mostly because of the capacitor’s ESR, while a 7805 is quiet.
- For small currents and sensitive analog circuits a linear regulator is still a good choice.
Quick quiz
1. Roughly what is the duty cycle when a buck converter makes 5 V from 9 V?
2. A buck converter with an efficiency of 85 % gives 5 V at 2 A. How much current does it take from a 12 V supply?
3. A sensor needs 3.3 V and 20 mA, and the project has 5 V. Which do you use, an LDO regulator or a buck converter?
4. Why does the ripple at a buck converter's output depend more on the capacitor's ESR than on its capacitance?
5. What happens if the switch in a buck converter fails and stays on for good?