Skip to content
LumenaryAcademy
Electronics 70 min

Power supplies, regulators and noise

From a battery or an adapter to clean, quiet supply rails, and the noise that sets the floor under every measurement.

Code tested · 5AI-draftedAwaiting review by an electrical engineer

Your guides: Chloe · The Physicist, Margaret · The Bench Engineer, Gideon · The Design Reviewer

MotivationH

Clean rails from a messy source

Every circuit in the previous lessons quietly assumed a perfect supply: a fixed voltage that never sags, never wobbles and never carries interference. Real sources are nothing like that. A lithium-ion cell falls from 4.2 V to about 3.0 V as it discharges. A USB-C charger negotiates 5, 9, 15 or 20 V, and up to 48 V under the extended-power rules of USB Power Delivery. A car's 12 V system swings from below 9 V while the engine cranks to well above 14 V while charging. And the circuits want something else entirely: a processor core at well under 1 V, accurate to a few per cent while its current jumps by amperes in nanoseconds; memory at 1.1 V; input and output pins at 1.8 or 3.3 V; a quiet 3.3 V for an audio converter. A phone has dozens of such rails.

Turning messy sources into clean rails is the job of power supplies and regulators. Then, even with perfect rails, every signal carries noise, random fluctuations that come from the physics of charge itself and set the smallest signal you can ever measure. This lesson covers both, because both decide whether a design works when it leaves the simulator.

Note

Safe experiments use batteries, USB power banks and current-limited bench supplies at low voltage. Converting mains electricity is done inside enclosed adapters that are designed, tested and certified to safety standards by their manufacturers. Never open or modify a mains adapter or charger: its capacitors can stay dangerously charged after it is unplugged.

DefinitionsH

Linear regulators and LDOs

In Semiconductors and diodes a Zener diode held a rail steady by wasting current in parallel with the load. A series regulator does better: it puts a transistor, the pass element, between the input and the output, and controls it with a feedback loop so that it drops exactly the excess voltage.

−+V_inV_outpass transistorR1R2V_refC_outerroramplifier
A linear regulator. The error amplifier compares a fraction of the output, set by R1 and R2, with a reference voltage, and drives the pass transistor until the two are equal, so V_out = V_ref (1 + R1/R2). In an LDO the pass transistor is a p-channel MOSFET, which can work with very little voltage across it.

The circuit is the non-inverting amplifier of Operational amplifiers with a power transistor added at its output: the loop forces the divided output to equal the reference, so Vout=Vref(1+R1/R2)V_{out} = V_{ref}(1 + R_1/R_2). The reference is usually a bandgap reference, about 1.2 V, which combines a junction voltage that falls with temperature (about −2 mV/K) with a thermal-voltage term that rises with it, so that the sum is nearly constant; Bob Widlar and Paul Brokaw devised the classic versions in the early 1970s.

Definition— Dropout, LDO, efficiency

The dropout voltage is the smallest Vin−VoutV_{in} - V_{out} at which the regulator still regulates. Classic regulators with an npn pass transistor need about 1.5–2.5 V. A low-dropout regulator (LDO), with a p-channel MOSFET (or pnp) pass element that can be driven fully on, needs only about 0.1–0.3 V. Because the same current flows in and out (plus a small quiescent current IqI_q), a linear regulator's efficiency can never exceed Vout/VinV_{out}/V_{in}: η=VoutIoutVin(Iout+Iq),Pheat=(Vin−Vout)Iout+VinIq.\eta = \frac{V_{out} I_{out}}{V_{in}(I_{out} + I_q)}, \qquad P_{\text{heat}} = (V_{in} - V_{out})I_{out} + V_{in}I_q.

The heat has to go somewhere. A package's thermal resistance from junction to ambient, θJA\theta_{JA} in °C/W, gives the junction temperature TJ=TA+P θJAT_J = T_A + P\,\theta_{JA}, which must stay below the rated maximum, often 125 °C or 150 °C.

python
# Linear regulators: where the power goes, and how hot the regulator gets.
T_AMBIENT = 40.0        # degrees C inside an enclosure on a warm day
T_MAX = 125.0           # a typical maximum junction temperature

cases = [  # (description, V_in, V_out, I_out in A, quiescent current in A, theta_JA in C/W)
    ("12 V -> 5 V, 0.5 A, TO-220, no heatsink", 12.0, 5.0, 0.5, 5e-3, 50.0),
    ("12 V -> 5 V, 0.5 A, TO-220 on a heatsink", 12.0, 5.0, 0.5, 5e-3, 12.0),
    ("5 V -> 3.3 V, 0.3 A, SOT-223 LDO", 5.0, 3.3, 0.3, 1e-3, 60.0),
    ("3.7 V cell -> 3.3 V, 0.2 A, small LDO", 3.7, 3.3, 0.2, 50e-6, 150.0),
]
print(f"{'case':42} {'efficiency':>10} {'heat (W)':>9} {'T_junction':>11}")
for name, vin, vout, iout, iq, theta in cases:
    p_in = vin * (iout + iq)
    p_out = vout * iout
    heat = p_in - p_out
    tj = T_AMBIENT + heat * theta
    flag = "  too hot!" if tj > T_MAX else ""
    print(f"{name:42} {p_out / p_in:10.1%} {heat:9.3f} {tj:9.0f} C{flag}")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Dropping 7 V at half an ampere turns 3.56 W into heat, and a bare TO-220 package would reach 218 °C: it would shut itself down, if it has thermal protection, or fail. A heatsink brings it to 83 °C, but at 41.3% efficiency. The same physics favours linear regulators where the voltage drop is small: from a lithium cell to 3.3 V, an LDO is 89.2% efficient and barely warm. Linear regulators are prized because they are simple, cheap, small and quiet: their feedback loop actively rejects ripple and noise on the input, a property called power-supply rejection ratio (PSRR), typically 60–80 dB at low frequencies, falling at high frequencies as the loop gain falls.

ComputationC

Switch-mode supplies: the buck converter

A linear regulator wastes the voltage difference as heat because its pass transistor works as a variable resistor. A switch-mode supply instead uses transistors as switches, fully on or fully off, which in the Transistors lesson was the low-loss way to use them, and smooths the result with an inductor and a capacitor, which store energy but ideally dissipate none.

V_inhigh sidelow sideSWLCloadV_outv_SWi_LD × Ttime
A synchronous buck converter and its waveforms. The two switches alternately connect the switch node to the input and to ground, making a square wave of duty cycle D; the LC filter passes its average, D × V_in, to the output. The inductor current rises while the high-side switch is on and falls while it is off, a triangle around the load current.

The buck converter steps voltage down. The switch node spends a fraction DD, the duty cycle, of each period connected to VinV_{in} and the rest connected to ground. In steady state the inductor's average voltage must be zero (otherwise its current would grow without limit), so the output equals the switch node's average: Vout=D Vin.V_{out} = D\,V_{in}. Power, not current, is conserved: an ideal buck from 12 V to 5 V at 1 A draws only about 0.42 A from its input. While the high-side switch is on, the inductor has Vin−VoutV_{in} - V_{out} across it and its current rises; while it is off, it has −Vout-V_{out} and the current falls. The peak-to-peak inductor ripple and the resulting output ripple (for an ideal capacitor) are ΔIL=(Vin−Vout) DLfs,ΔVout≈ΔIL8fsC.\Delta I_L = \frac{(V_{in} - V_{out})\,D}{L f_s}, \qquad \Delta V_{out} \approx \frac{\Delta I_L}{8 f_s C}. Raising the switching frequency fsf_s shrinks the inductor and capacitor needed, which is why modern converters switch at hundreds of kilohertz to several megahertz. The program simulates an ideal buck, cycle by cycle, from rest.

python
# An ideal synchronous buck converter, simulated switching cycle by switching cycle.
VIN, FS = 12.0, 500e3          # input voltage and switching frequency
L, C, R_LOAD = 10e-6, 22e-6, 5.0
D = 5.0 / 12.0                 # duty cycle chosen for 5 V out
STEPS = 240                    # time steps per switching period (D x STEPS is a whole number)
dt = 1 / (FS * STEPS)

i_l, v_c = 0.0, 0.0            # inductor current and capacitor voltage, starting from rest
history = []
for n in range(int(3e-3 * FS) * STEPS):          # 3 ms of operation
    on = (n % STEPS) < D * STEPS                 # high-side switch on for the first D of each period
    v_sw = VIN if on else 0.0                    # the switch node: input voltage, or ground
    i_l += (v_sw - v_c) / L * dt                 # inductor: L di/dt = v_sw - v_out
    v_c += (i_l - v_c / R_LOAD) / C * dt         # capacitor: C dv/dt = i_L - i_load
    history.append((i_l, v_c))

last = history[-20 * STEPS:]                     # the last 20 periods, in steady state
i_vals, v_vals = [h[0] for h in last], [h[1] for h in last]
v_avg = sum(v_vals) / len(v_vals)
print(f"output {v_avg:.3f} V (D x VIN = {D * VIN:.3f} V), load current {v_avg / R_LOAD:.3f} A")
print(f"inductor ripple {max(i_vals) - min(i_vals):.3f} A peak to peak, "
      f"formula (VIN - VOUT) D / (L fs) = {(VIN - 5.0) * D / (L * FS):.3f} A")
print(f"output ripple {(max(v_vals) - min(v_vals)) * 1e3:.2f} mV peak to peak, "
      f"formula dI / (8 fs C) = {(VIN - 5.0) * D / (L * FS) / (8 * FS * C) * 1e3:.2f} mV")
peak = max(h[1] for h in history)
print(f"start-up: the output overshoots to {peak:.2f} V before settling (no control loop)")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The simulation settles at 5.000 V with 0.584 A of inductor ripple and 6.64 mV of output ripple, matching the formulas (0.583 A and 6.63 mV). Real converters lose a few per cent in the switches' on-resistance, in charging and discharging their gate and node capacitances every cycle, and in the inductor, so practical efficiencies are about 85–95%, against 41.7% for a linear regulator doing the same job. Higher-voltage outputs come from the boost converter (the same parts rearranged), and isolated supplies such as phone chargers use a transformer in a flyback or similar topology; Power electronics goes deeper.

The price of switching is noise. The switch node slews by the whole input voltage in nanoseconds, and the input current arrives in sharp-edged pulses, so a switcher radiates and conducts interference at its switching frequency and harmonics up to hundreds of megahertz. Products must meet electromagnetic-compatibility limits (in the international CISPR standards, the European CE regime and the United States FCC rules). A common arrangement uses both kinds: a switcher for efficiency, followed by an LDO for a quiet rail where an analog circuit needs it.

ComputationC

Ripple and decoupling

A regulator can hold its own output steady, but it cannot hold steady the supply pin of a chip a few centimetres away. When a processor's current jumps by an ampere in a nanosecond, even 1 nH of wiring between them develops L di/dt=10−9×109=1L\,di/dt = 10^{-9} \times 10^9 = 1 V. So every chip has decoupling (or bypass) capacitors right beside its supply pins, a local reservoir that supplies fast current changes until the regulator catches up. Engineers state the requirement as a target impedance: if a 0.8 V core rail may move by 3% (24 mV) when its current steps by 20 A, the supply network must look like at most 24 mV/20 A=1.2 mΩ24\ \text{mV}/20\ \text{A} = 1.2\ \text{m}\Omega at every frequency the step contains.

A real capacitor is not just a capacitance. It has an equivalent series resistance (ESR) and an equivalent series inductance (ESL) from its electrodes, terminations and mounting. Above its self-resonant frequency 1/(2πLC)1/(2\pi\sqrt{LC}) it behaves as an inductor. The traditional habit is to place a large capacitor and a small one together. The netlist computes the impedance of a 10 µF capacitor alone and with a 100 nF capacitor beside it, using plausible ESR and ESL values for small ceramic capacitors with their mounting; a 1 A AC current source makes the node voltage equal to the impedance.

spice
* Impedance of decoupling capacitors, including their ESR and ESL
* A 1 A AC current source into each node: the node voltage is the impedance in ohms.
* (a) one 10 uF capacitor
IA 0 a DC 0 AC 1
CA a a1 10u
RA a1 a2 5m
LA a2 0 1n
* (b) the same 10 uF with a 100 nF capacitor beside it
IB 0 b DC 0 AC 1
CB1 b b1 10u
RB1 b1 b2 5m
LB1 b2 0 1n
CB2 b b3 100n
RB2 b3 b4 20m
LB2 b4 0 0.7n
.control
ac dec 200 10k 1G
let za = abs(v(a))
let zb = abs(v(b))
meas ac za_min MIN za
meas ac zb_min MIN zb from=5Meg to=100Meg
meas ac zb_peak MAX zb from=5Meg to=30Meg
foreach f 100k 1Meg 10Meg 30Meg 100Meg
  meas ac zat FIND za AT=$f
  meas ac zbt FIND zb AT=$f
  echo "at $f Hz: 10 uF alone $&zat ohm, with 100 nF $&zbt ohm"
end
echo "10 uF alone: smallest impedance $&za_min ohm, its ESR, at its self-resonance"
echo "with 100 nF: a second dip of $&zb_min ohm, and a peak of $&zb_peak ohm between the dips"
.endc
.end
Frequency10 µF alone10 µF + 100 nF
100 kHz0.159 Ω0.157 Ω
1 MHz0.011 Ω0.011 Ω
10 MHz0.061 Ω0.121 Ω
30 MHz0.188 Ω0.057 Ω
100 MHz0.628 Ω0.253 Ω

The 10 µF capacitor reaches its ESR, 5.0 mΩ, at its self-resonance near 1.6 MHz, and above that its impedance rises like an inductor's. The 100 nF capacitor adds a second dip, 19.4 mΩ at 19.3 MHz, and helps above about 20 MHz, but between the two dips the first capacitor's inductance resonates with the second's capacitance in parallel, an anti-resonance that peaks at 0.240 Ω at 12.2 MHz. At 10 MHz the pair is worse than the single capacitor. Folk rules such as "always add a 100 nF" can backfire; power-integrity engineers simulate the whole network, including the board's planes and the chip's package, and choose values, counts and placements to keep the impedance under the target everywhere. What helps reliably is reducing inductance: small packages, capacitors right at the pins, and short, wide connections with several vias into solid planes (Printed circuit boards).

DefinitionsH

Noise: the floor under every measurement

Remove every interference source and a signal is still not perfectly clean, because current is carried by discrete charges in random thermal motion. Three kinds of intrinsic noise matter everywhere.

Definition— Thermal, shot and flicker noise

  • Thermal (Johnson–Nyquist) noise. Every resistance RR at temperature TT produces a random open-circuit voltage with root-mean-square value vn=4kTRBv_n = \sqrt{4kTRB} over a bandwidth BB, independent of any current flowing. Its spectral density, 4kTR\sqrt{4kTR} in volts per root hertz, is flat (white) up to frequencies far beyond electronics.
  • Shot noise. A current II that crosses a barrier, such as a p–n junction, as independent charges qq fluctuates with rms value in=2qIBi_n = \sqrt{2qIB}.
  • Flicker (1/f) noise. Below a corner frequency, from hertz to tens of kilohertz depending on the device, many components add noise whose power density rises as 1/f1/f. MOSFETs, whose channel carriers are trapped and released at the oxide surface, have much more of it than BJTs.

John B. Johnson measured thermal noise at Bell Labs in 1927–28, and his colleague Harry Nyquist derived the formula from thermodynamics in a paper printed right after Johnson's; Walter Schottky had described shot noise in 1918.

Noise sources that are uncorrelated add as powers, so their rms values add as a root-sum-square, not linearly. Averaging NN independent readings of a steady signal reduces the noise by N\sqrt N. The quality of a signal is measured by the signal-to-noise ratio, usually in decibels: SNR=20log⁡10(Vsignal/Vnoise)\text{SNR} = 20\log_{10}(V_{signal}/V_{noise}) for rms voltages.

python
import math
import numpy as np

k, q, T = 1.380649e-23, 1.602176634e-19, 300.0

print("Thermal (Johnson-Nyquist) noise, v = sqrt(4 k T R B)")
for r in (50, 1e3, 10e3, 1e6):
    density = math.sqrt(4 * k * T * r)                     # V per root hertz
    print(f"  {r:>9,.0f} ohm: {density * 1e9:7.2f} nV/rtHz, "
          f"{density * math.sqrt(20e3) * 1e6:7.3f} uV rms over 20 kHz")

i_dc = 1e-3
print(f"\nShot noise of 1 mA, i = sqrt(2 q I B): {math.sqrt(2 * q * i_dc) * 1e12:.1f} pA/rtHz")
print(f"kT/C noise on a 1 pF sampling capacitor: {math.sqrt(k * T / 1e-12) * 1e6:.1f} uV rms")

# Uncorrelated noise adds as power (root-sum-square), and averaging N readings
# cuts it by sqrt(N). Check both with seeded random numbers.
rng = np.random.default_rng(2026)
a = rng.normal(0.0, 3.0, 1_000_000)        # 3 uV rms
b = rng.normal(0.0, 4.0, 1_000_000)        # 4 uV rms, independent of a
print(f"\nrms of a + b: {np.std(a + b):.3f} uV (sqrt(3^2 + 4^2) = 5, not 3 + 4 = 7)")
signal = 1.0                                # a 1 uV DC level buried in the noise of a
for n in (1, 100, 10_000):
    means = signal + a[: (len(a) // n) * n].reshape(-1, n).mean(axis=1)
    snr_db = 20 * math.log10(signal / np.std(means))
    print(f"average of {n:>6} readings: noise {np.std(means):.4f} uV, SNR {snr_db:+.1f} dB")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

A 1 kΩ resistor at 300 K produces 4.07 nV/√Hz, or 0.576 µV rms across the 20 kHz audio band; a 1 MΩ resistor produces 128.7 nV/√Hz. That is why low-noise amplifiers use low resistances at their inputs, and why a microphone preamplifier's noise is quoted against the equivalent resistor. Sampling a voltage onto a capacitor freezes a noise of kT/C\sqrt{kT/C}, 64.4 µV for 1 pF whatever resistance charged it, a floor that sets the size of capacitors in analog-to-digital converters (Sensors and data conversion). And the simulation confirms the two rules: 3 µV and 4 µV of independent noise make 4.99 µV, not 7, and a 1 µV signal 9.5 dB below a single reading's noise rises to +30.5 dB after averaging 10 000 readings, 40 dB of improvement for a factor of 10410^4 in readings.

ExplanationH

Grounding and layout habits

"Ground" is a conductor, with resistance and inductance like any other, and current returning through it develops voltage. The most common source of mysterious errors is common-impedance coupling: two circuits sharing a stretch of return path. If a motor's 2 A returns through the same 10 mΩ of copper as a temperature sensor's signal, the sensor's ground moves by 20 mV every time the motor starts; at 10 mV per °C, that is a 2 °C error that appears and disappears with the motor. Habits that prevent such problems:

  • Give high currents their own return paths, joined to the sensitive circuits' ground at a single point (a star ground) near the supply, so that large currents never flow through the reference of a small signal.
  • Use a solid ground plane on a circuit board. At high frequencies return current flows in the plane directly under its signal trace, the path of least inductance, so an unbroken plane keeps loops small; a slot cut under a fast trace forces the return current around it and turns the loop into an antenna.
  • Keep fast, high-current loops tiny. In a buck converter the "hot loop" formed by the input capacitor and the two switches carries current that switches on and off in nanoseconds; its area sets how much the converter radiates. Layout guides from every converter manufacturer begin with it.
  • Place decoupling capacitors at the pins, with the shortest possible connection to the plane, as the impedance simulation showed.
  • Separate noisy from quiet: switchers, clocks and digital buses on one side of the board, analog inputs and references on the other, and never route a sensitive trace across a switching node.
  • Avoid ground loops between instruments. Two pieces of equipment each connected to earth and joined by a signal cable form a loop that picks up mains-frequency hum; balanced (differential) connections, which the instrumentation amplifier was built for, reject it.

These habits continue in Printed circuit boards, where layout becomes a discipline of its own.

ExplanationH

Power in professional practice

A phone or laptop board carries a power-management IC (PMIC) that integrates many buck converters, LDOs, battery charging and sequencing, so that rails come up in the order the processor requires. Servers and AI accelerators take this furthest: in many data centres 48 V is distributed to each board and converted down to below 1 V at hundreds of amperes right beside the processor, a problem Powering data centres describes. Designers start from manufacturers' online design tools and reference designs, simulate the control loop and the power distribution network, and measure ripple, transient response, efficiency and emissions on the bench. Anything connected to the mains is designed to international safety standards (from the International Electrotechnical Commission and its national counterparts) and tested by certified laboratories before it may be sold, which is why mains supplies are bought as finished, certified products rather than built at a workbench.

Common misconceptionsH

Common misconceptions

Misconception

"A linear regulator is efficient if it uses a good LDO." No regulator that passes the same current in and out can beat Vout/VinV_{out}/V_{in}. An LDO only allows a smaller difference; from 12 V to 3.3 V it is at most 27.5% efficient, however good it is.

Misconception

"A switching converter is just a more efficient linear regulator." It is a different machine, with its own costs: output ripple at the switching frequency, electromagnetic interference, a control loop to stabilise, and poorer behaviour at very light loads unless it changes mode. Quiet analog rails often still need an LDO after it.

Misconception

"Noise voltages add up." Independent noise sources add in power: 3 µV and 4 µV of uncorrelated noise make 5 µV. Only correlated signals, such as interference from a common source, add linearly.

Misconception

"Ground is zero volts everywhere." Ground is a conductor. Any current flowing in it creates voltage differences between its points, which is why where currents return matters as much as where they go.

Exercises

Exercises

1. Power supplies, regulators and noise

CoreHuman

An LDO makes 3.3 V at 0.4 A from a 5.0 V rail; its quiescent current is negligible. Its package has θJA=70\theta_{JA} = 70 °C/W and the ambient temperature is 25 °C. What is its junction temperature, in °C, to the nearest degree?

2. Power supplies, regulators and noise

Warm-upHuman

A 3.3 V LDO with a dropout of 250 mV runs from a lithium-ion cell that discharges from 4.2 V down to 3.0 V. Below what cell voltage, in millivolts, does the output stop being regulated?

3. Power supplies, regulators and noise

CoreHuman

A buck converter makes 5 V at 4 A from a 20 V input with 90% efficiency. What average current, in milliamperes, does it draw from the input? Round to the nearest milliampere.

4. Power supplies, regulators and noise

CoreHuman

An ideal buck converter steps 12 V down to 3.3 V, switching at 1 MHz with a 4.7 µH inductor. What is the peak-to-peak inductor ripple current, in milliamperes, to the nearest milliampere?

5. Power supplies, regulators and noise

CoreHuman

What is the rms thermal noise voltage of a 10 kΩ resistor at 300 K over a 100 kHz bandwidth? Use k=1.380649×10−23k = 1.380649 \times 10^{-23} J/K and give the answer in nanovolts, to the nearest whole number.

6. Power supplies, regulators and noise

Warm-upHuman

Three independent noise sources contribute 2 µV, 3 µV and 6 µV rms at an amplifier's output. What is the total rms noise, in microvolts?

7. Power supplies, regulators and noise

CoreHuman

A chip's supply rail shows ringing at about 80 MHz whenever the chip's activity changes. Its decoupling capacitor sits 3 cm away, connected by a thin trace. Which change will most reliably reduce the supply impedance at 80 MHz?

Choose one

8. Power supplies, regulators and noise

CoreComputational

Write buck_design(vin, vout, iout, fs, ripple_ratio=0.3, dv=0.01) for an ideal buck converter in continuous conduction. Return (duty, L, C):

  • duty =Vout/Vin= V_{out}/V_{in};
  • L chosen so that the peak-to-peak inductor ripple is ripple_ratio * iout, using ΔIL=(Vin−Vout)D/(Lfs)\Delta I_L = (V_{in} - V_{out})D/(L f_s);
  • C chosen so that the output ripple is dv volts, using ΔV=ΔIL/(8fsC)\Delta V = \Delta I_L/(8 f_s C).

The first test recovers the lesson's 10 µH and 22 µF from its ripple figures.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Further reading and resources