A line power supply converts 120V or 230V AC mains voltage into a stable, low-voltage DC output for electronic circuits. The fundamental design decision you must make on the bench is choosing between a linear and a switching topology. This choice is rarely about which is universally 'better'; it is a strict tradeoff between output noise tolerance, thermal constraints, and physical size. If you are powering a 24-bit audio DAC or a precision strain-gauge amplifier, you need a linear supply. If you are charging a 12V LiFePO4 battery bank or driving a 5A LED array, a switching supply is the only practical choice. This guide breaks down the hard numbers behind both topologies, walks through a complete 12V 1A linear line power supply design with dropout and thermal math, and details the input protection required to keep your circuit safe from mains transients.

Topology Showdown: Linear vs. Switching Line Power Supplies

When deciding between linear and switching architectures for your load, you must evaluate efficiency, heat dissipation, and electromagnetic interference (EMI). Linear regulators operate by burning excess voltage as heat across a pass transistor, acting like a smart, variable resistor. Switching power supplies (like Flyback or LLC resonant converters) use high-frequency MOSFET switching and magnetic energy storage to transfer power, achieving much higher efficiency but introducing high-frequency ripple.

Here is how the three most common line power supply topologies compare under a typical 12V 1A (12W) load:

Parameter Linear (Transformer + LDO) Flyback (Switching) LLC Resonant (Switching)
Typical Efficiency 40% - 55% 75% - 85% 90% - 95%
Heat Dissipation (at 12W out) 10W - 15W (Requires large heatsink) 2W - 4W (PCB copper pours) < 1.5W (Minimal thermal management)
Output Ripple & Noise < 1 mV RMS (Broadband) 50 - 150 mV p-p (Switching frequency) 20 - 50 mV p-p (Soft-switched)
Mains Isolation Method 50/60Hz Iron/Core Transformer High-Frequency Ferrite Transformer High-Frequency Ferrite Transformer
BOM Cost & Complexity Low ($5-$10, simple layout) Medium ($8-$15, requires EMI filtering) High ($20+, complex control loops)
Weight & Volume Heavy & Bulky Light & Compact Light & Compact

The Verdict: Choose a linear topology when your load includes sensitive analog-to-digital converters (ADCs), RF receivers, or audio preamplifiers where switching noise will degrade the signal-to-noise ratio (SNR). Choose a Flyback or LLC switching topology when your load draws more than 1A, when the device is enclosed in a sealed plastic housing with poor airflow, or when you need universal 85-264VAC input compatibility without a massive iron transformer.

Design Example: 12V 1A Linear Line Power Supply

Let's design a robust 12V 1A linear line power supply for a benchtop analog sensor hub. We will use a traditional step-down transformer, a full-wave bridge rectifier, a bulk filter capacitor, and a linear regulator.

Input/Output Specifications

  • Input: 120VAC, 60Hz (Nominal)
  • Output: 12V DC @ 1.0A continuous
  • Target Ripple: < 5 mV RMS at the output terminals

Component Selection and Headroom Math

The most common mistake in linear supply design is underestimating the regulator's dropout voltage and the rectifier's ripple, leading to 100Hz hum on the output. According to Texas Instruments' linear regulator design guidelines, you must calculate the minimum instantaneous voltage reaching the regulator input to ensure it stays in regulation.

  1. Transformer: We select a 12VAC RMS, 18VA transformer. The peak AC voltage is $12V \times \sqrt{2} = 16.97V$.
  2. Rectifier: A KBU808 bridge rectifier introduces a voltage drop across two conducting diodes. Assuming 0.7V per diode, the drop is 1.4V. Peak DC voltage at the filter capacitor = $16.97V - 1.4V = 15.57V$.
  3. Filter Capacitor: The capacitor must hold up the voltage between the 120Hz rectified peaks. Using the standard ripple approximation $C = \frac{I}{f \times V_{ripple}}$, if we target a 1V peak-to-peak ripple: $C = \frac{1A}{120Hz \times 1V} = 8,333\mu F$. We will specify a standard 10,000\muF, 25V electrolytic capacitor. This reduces our actual ripple to $V_{ripple} = \frac{1}{120 \times 0.01} = 0.83V$.
  4. Regulator Dropout Check: The minimum voltage hitting the regulator is $15.57V - 0.83V = 14.74V$. If we use a standard LM7812, its worst-case dropout voltage at 1A is 2.5V. The required minimum input is $12V + 2.5V = 14.5V$. Our 14.74V clears this by just 0.24V. Bench Note: While this passes on paper, a 5% mains brownout will collapse this headroom and introduce 120Hz ripple directly into your 12V rail. For real-world reliability, upgrade to a 15VAC transformer or use a Low-Dropout Regulator (LDO) like the LM2940 (dropout ~0.5V).

Input Protection, Thermal Derating, and Real-World Margins

A line power supply connects directly to the grid, meaning it is exposed to lightning-induced surges, inrush currents, and wiring faults. You must implement primary-side protection and properly derate your thermal components.

Mains Input Protection

WARNING: Always de-energize and verify dead with a CAT III multimeter before probing primary-side mains circuits. Primary-side components retain lethal voltages even when unplugged if the bulk capacitor is not bled down via a high-value resistor.
  • Metal Oxide Varistor (MOV): Placed directly across the Line and Neutral after the fuse. For a 120VAC system, use a 150V RMS MOV like the Littelfuse TMOV20RP150M. It will clamp transient spikes at roughly 395V, protecting the downstream bridge rectifier. Consult the Littelfuse varistor selection guide to match the MOV's energy rating (Joules) to your expected surge environment.
  • Inrush Limiting (NTC Thermistor): Charging an empty 10,000\muF capacitor from a low-impedance mains source can cause inrush currents exceeding 50A, tripping branch breakers or welding fuse elements. An NTC thermistor like the Ametherm MS35 10018 (10\Omega cold resistance) limits this inrush. As current flows, the NTC self-heats and its resistance drops to < 1\Omega, minimizing steady-state power loss.
  • Fuse: Use a 1A, 250V time-delay (slow-blow) fuse. A fast-acting fuse will nuisance-trip every time you flip the power switch due to the capacitor inrush and transformer magnetization current.

Thermal Derating and Heatsink Sizing

The LM7812 in a TO-220 package will dissipate significant heat. We must calculate the required heatsink thermal resistance ($\theta_{SA}$) to prevent thermal shutdown.

  • Average Input Voltage ($V_{in(avg)}$): $15.57V - (0.83V / 2) = 15.15V$.
  • Power Dissipated ($P_d$): $(15.15V - 12V) \times 1A = 3.15W$.
  • Thermal Budget: The absolute maximum junction temperature ($T_j$) is 125°C, but for long-term reliability, we derate to a maximum of 85°C. Assuming a worst-case ambient enclosure temperature ($T_a$) of 40°C, our allowable temperature rise is $85°C - 40°C = 45°C$.
  • Maximum Thermal Resistance ($\theta_{JA}$): $\frac{45°C}{3.15W} = 14.28°C/W$.
  • Heatsink Selection: The TO-220 package has a junction-to-case resistance ($\theta_{JC}$) of ~5°C/W. Adding a silicone thermal pad adds ~1°C/W ($\theta_{CS}$). The required heatsink-to-ambient resistance is: $\theta_{SA} = 14.28 - 5 - 1 = \mathbf{8.28°C/W}$. A standard extruded aluminum heatsink like the Aavid 576002B03900G (rated at ~7.0°C/W) provides the necessary margin.

Verification: Ripple, Noise, and Transient Testing

Designing the circuit is only half the job; verifying the output requires proper oscilloscope technique. A common error when measuring line power supply ripple is using the standard oscilloscope probe ground lead. That 3-inch alligator clip wire acts as an antenna, picking up ambient 60Hz magnetic fields and high-frequency switching noise from nearby bench equipment, making a clean linear supply look like a switching supply on the screen.

To accurately measure the < 5 mV ripple expectation of this linear design:

  1. Use a Tip-and-Barrel Probe: Remove the standard ground clip and plastic probe tip. Expose the ground ring near the probe tip and use a short spring ground attachment, or wrap a bare wire tightly around the probe ground ring and solder it directly across the output capacitor terminals.
  2. AC Coupling and Bandwidth Limit: Set the oscilloscope channel to AC coupling to block the 12V DC offset, allowing you to scale the vertical axis to 10mV/div. Engage the 20MHz bandwidth limit on the scope to filter out radiated RF noise that the power supply isn't actually producing.
  3. Load Transient Testing: Connect an electronic load set to pulse between 0.1A and 1.0A at 1kHz. Observe the output voltage dip. A well-compensated linear supply with adequate bulk capacitance should recover within 50\mu s with less than a 100mV deviation. If you see sustained ringing, your filter capacitor's Equivalent Series Resistance (ESR) may be too high, or your PCB traces are introducing parasitic inductance.

By respecting the mathematical realities of dropout voltage, properly sizing your thermal management, and implementing primary-side surge protection, you can build a line power supply that delivers ultra-clean DC power reliably for years. For further reading on rectifier theory and capacitor charge/discharge curves, review the foundational texts on rectifier circuits at All About Circuits.