Why not just use a resistor?
The crude way to drop 12V to 5V is a linear regulator: burn the difference as heat across a pass transistor. It works, but at any real current the wasted power is enormous — dropping 7V at 3A means dissipating 21W as pure heat for every 15W actually delivered to the load, an efficiency around 42%. A buck converter gets the same job done a completely different way: instead of continuously resisting the excess voltage, it switches a transistor fully on and fully off very quickly, and lets an inductor and capacitor smooth the resulting pulses into a clean lower DC voltage. Switching devices dissipate very little power while either fully on (low resistance) or fully off (no current), so efficiencies of 85-95% are routine.
Duty cycle sets the output: V_out = D·V_in
The switch is driven by pulse-width modulation (PWM): it's on for a fraction D of every switching period (the duty cycle, between 0 and 1) and off for the remaining 1−D. While on, the input charges the inductor through the load; while off, a diode or a second switch lets the inductor's stored current keep flowing to the load as it discharges. In steady state the inductor's net voltage over a full cycle must average to zero — otherwise its current would ramp away without limit — which is called volt-second balance and directly gives the converter's defining equation:
volt-second balance: (Vin - Vout) * D = Vout * (1 - D)
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
volts across L volts across L
while switch ON while switch OFF
solve for Vout: Vout = D * Vin
so duty cycle D directly sets the output voltage, 0 < D < 1
A feedback loop measures V_out and continuously adjusts D to hold it steady as the input voltage sags or the load current changes — this is the job of the PWM controller chip sitting at the heart of every buck-based supply, from a phone charger to a CPU's voltage regulator module delivering over a hundred amps at under 1V.
Inductor current ripple
The inductor current doesn't sit at a constant value — it ramps up while the switch is on (the input voltage difference pushes current through L) and ramps back down while it's off, tracing a triangle wave. The peak-to-peak size of that triangle is the ripple:
delta_I_L = (Vin - Vout) * D / (L * f_sw) increase L -> smaller ripple, bigger/costlier inductor increase f_sw -> smaller ripple, smaller inductor, more switching loss
This is the central design trade-off of every switching converter: pushing the switching frequency up shrinks the required inductance (and physical inductor size) for the same ripple, but every switching transition wastes a little energy in the transistor, so higher f_sw means more switching loss and lower efficiency. Modern designs push into the hundreds of kHz to megahertz range specifically to keep passive components small in phones and laptops, accepting the efficiency cost.
Continuous vs discontinuous conduction mode
At a healthy load current the inductor current ripples up and down but never actually reaches zero — continuous conduction mode (CCM), where the V_out = D·V_in relationship holds cleanly. Drop the load current low enough, though, and the downward ramp hits zero before the next switching cycle starts, forcing the current to sit at zero for part of the period — discontinuous conduction mode (DCM). In DCM the simple duty-cycle formula breaks down and the output voltage becomes dependent on the load itself, which is exactly why light-load efficiency and control-loop stability are a separate, harder design problem from the full-load case.
Frequently asked questions
Why is V_out = D*V_in in a buck converter?
By volt-second balance: in steady state the inductor's average voltage over one switching cycle must be zero, otherwise its current would ramp away without bound. Solving (V_in-V_out)·D = V_out·(1-D) for V_out directly gives V_out = D·V_in.
What determines the inductor current ripple?
ΔI_L = (V_in − V_out)·D / (L·f_sw). Ripple grows with a bigger voltage difference across the inductor during the on-time and shrinks with a larger inductance or a higher switching frequency, which is why modern converters push switching frequency up to shrink the inductor size.
What is discontinuous conduction mode (DCM) and why does it matter?
At light load, the inductor current can ripple all the way down to zero and stay there for part of the cycle instead of flowing continuously — discontinuous conduction mode. The simple V_out = D·V_in relationship no longer holds in DCM; output voltage becomes load-dependent, which complicates control loop design at low currents.
Try it live
Everything above runs in your browser — open Buck Converter — PWM Switching and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Buck Converter — PWM Switching simulation