Linear vs Switching Regulators: Which Should You Use?

An LDO can power a 3.3V sensor with microvolt-level noise, while a buck converter can drop 12V to 5V at 95% efficiency. Both are voltage regulators, but they solve different problems. Pick the wrong one and you get a hot board, a dead battery, or a noisy ADC reading. This guide gives you the numbers, the circuits, and a decision framework so you can choose correctly the first time.

Quick Takeaways

  • Linear regulators (LM7805, AMS1117, LDOs) are simple, quiet, and cheap, but they burn the voltage difference as heat.
  • Switching regulators (buck, boost, buck-boost) reach 85-95% efficiency but add switching noise and need an inductor and careful layout.
  • Use a linear regulator when Vin − Vout is small, current is low (<200mA), or the load is noise-sensitive (ADC, RF, audio).
  • Use a switching regulator when the voltage drop is large, current is high (>500mA), or you run on a battery.
Feature Linear (LDO) Switching (Buck)
Efficiency Vout/Vin (e.g., 27% for 12V→3.3V) 85-95%
Output noise 10-100 µVrms 10-100 mVpp ripple
External parts 2 capacitors Inductor, diode/FET, 2+ caps
Cost Very low Low to moderate
Boost capability No Yes (boost, buck-boost)
Heat High at large drops Low
Layout sensitivity Low High
Quiescent current 1 µA to 5mA 15 µA to 5mA

How a Linear Regulator Works

A linear regulator acts as a variable resistor between input and output. An internal pass element (a BJT or MOSFET) is controlled by an error amplifier. A voltage divider samples Vout and compares it with a bandgap reference (typically 1.2V). If Vout drifts, the amplifier adjusts the pass element until the output returns to the setpoint.

The key consequence: the regulator passes the full load current, and the excess voltage becomes heat.

Power dissipation:

P_diss = (Vin − Vout) × I_load

Example: a 7805 powering a 5V, 300mA load from a 12V supply.

P_diss = (12V − 5V) × 0.3A = 2.1W

A TO-220 package with no heatsink has a thermal resistance near 50°C/W. That means a 105°C rise above ambient, which triggers thermal shutdown. Your efficiency is 5/12 = 41.7%.

Linear Regulator Types

Type Dropout Voltage Example Parts Best For
Standard (NPN pass) ~2V LM7805, LM317 Bench supplies, legacy designs
LDO (PNP/PMOS pass) 100-500mV AMS1117-3.3, MCP1700 Battery devices, 3.3V rails
Ultra-low-noise LDO 100-300mV TPS7A47, LT3045 ADCs, RF, sensors
Micropower LDO ~200mV MCP1700, TPS7A02 Always-on, coin-cell devices

Key Linear Regulator Specs

  • Dropout voltage (VDO): The minimum Vin − Vout for regulation. Below it, the output tracks the input.
  • PSRR (Power Supply Rejection Ratio): How well the regulator rejects input ripple. High-end LDOs reach 70-100 dB at 1kHz and fall off at higher frequencies.
  • Quiescent current (Iq): Current the regulator draws with no load. The MCP1700 draws about 1.6 µA.
  • Output capacitor ESR: Older LDOs like the LM1117 need a minimum ESR for stability. Many modern LDOs are stable with ceramic capacitors.

How a Switching Regulator Works

A switching regulator turns a MOSFET on and off at a high frequency (typically 300kHz to 2MHz). An inductor stores energy during the on-phase and releases it during the off-phase. A PWM controller adjusts the duty cycle to hold the output steady. Because the switch is either fully on (low resistance) or fully off (no current), very little power is lost.

The Three Core Topologies

Buck (step-down): Output is lower than input.

Vout = Vin × D     (D = duty cycle, 0 to 1)

Boost (step-up): Output is higher than input.

Vout = Vin / (1 − D)

Buck-boost: Output can be above or below the input. Useful for a single-cell Li-ion (3.0-4.2V) powering a 3.3V rail. Common ICs include the TPS63020 and TPS63802.

Key Switching Regulator Specs

  • Switching frequency (fSW): Higher frequency allows a smaller inductor but raises switching losses.
  • Inductor selection: Choose a value that keeps ripple current near 20-40% of the maximum load current. Check that saturation current exceeds the peak current.
  • Operating modes: PWM mode gives low ripple at all loads. PFM/Power-Save mode improves light-load efficiency but adds low-frequency ripple.
  • Efficiency curve: Efficiency drops at very light loads and very high loads. Check the datasheet curve at your actual operating current.

Direct Comparison: Linear vs Switching

Parameter Linear Regulator Switching Regulator
Step-up capability No Yes
Efficiency at large Vin−Vout Poor Excellent
Output noise Very low Higher; needs filtering
EMI None Radiated and conducted
Transient response Fast, simple Depends on loop compensation
PCB area Small Larger (inductor)
Design effort Minimal Moderate to high
Typical cost (BOM) $0.10-$1 $0.50-$3 (module: $1-$2)
Heatsinking Often required Rarely required
Battery life impact Wastes headroom Extends runtime

Efficiency Math: A Real Example

Powering a 3.3V, 500mA load from a 12V source:

Regulator Output Power Input Power Loss Efficiency
AMS1117-3.3 (linear) 1.65W 6.0W 4.35W 27.5%
LM2596 module (buck) 1.65W ~1.9W ~0.25W ~87%

The linear option dissipates 4.35W, which requires a large heatsink. The buck converter runs nearly cool.

When to Use a Linear Regulator

Choose a linear regulator or LDO when:

  1. The voltage drop is small. Example: 4.2V Li-ion to 3.3V, or 5V to 3.3V at under 200mA.
  2. The load is noise-sensitive. ADC references, op-amp stages, PLLs, RF front ends, and audio preamps all benefit.
  3. Current is low. Under about 200mA, the wasted heat is usually manageable.
  4. Board space and EMI are critical. No inductor means no radiated switching noise.
  5. Simplicity matters. Two capacitors and a regulator is the whole circuit.

When to Use a Switching Regulator

Choose a switching regulator when:

  1. The voltage drop is large. Example: 12V or 24V down to 5V or 3.3V.
  2. Current exceeds ~500mA. Linear heat becomes impractical.
  3. You run on batteries. Efficiency translates directly to runtime.
  4. You need to step up. Powering 5V logic from a single AA cell requires a boost converter.
  5. Thermal budget is tight. Enclosed designs cannot dissipate watts of waste heat.

Hybrid Approach: Buck + LDO

Professional designs often combine both. A buck converter does the heavy step-down efficiently, then an LDO cleans up the rail for sensitive circuits.

12V ──► [Buck → 4.0V] ──► [LDO → 3.3V] ──► ADC / sensor

Set the buck output about 300-500mV above the LDO dropout requirement. The LDO’s PSRR attenuates the buck’s switching ripple, giving you high efficiency and low noise together. Total efficiency is roughly buck efficiency × (3.3/4.0), which is about 75% and far better than a lone linear stage.

Circuit Breakdown: LDO Reference Design

Typical AMS1117-3.3 / LM1117 wiring:

Vin (5V) ──┬──[C1: 10µF]──┬── IN  [AMS1117]  OUT ──┬──[C2: 22µF]──┬── Vout (3.3V)
           │              │          │              │              │
          GND            GND        GND            GND            GND

Pinout (SOT-223):

Pin Name Function
1 GND/ADJ Ground (fixed version)
2 VOUT Regulated output
3 VIN Input voltage
Tab VOUT Connected to output; use as heat spreader

Layout tips:

  • Place C1 and C2 within 5mm of the pins.
  • Add copper area on the tab to spread heat.
  • Keep ground return short.

Circuit Breakdown: Buck Converter Layout

A typical LM2596 or MP1584 buck circuit includes:

  • Input capacitor (Cin): Low-ESR ceramic or electrolytic. Supplies pulsed input current.
  • Inductor (L): Typically 22-100 µH for the LM2596 (150kHz), or 2.2-10 µH for MHz-class parts.
  • Catch diode (D): A Schottky diode (e.g., SS34) for non-synchronous designs.
  • Output capacitor (Cout): Controls ripple.
  • Feedback divider (R1/R2): Sets Vout.

Feedback resistor formula (for a 0.8V reference):

Vout = Vref × (1 + R1/R2)

Layout rules:

  1. Keep the hot loop (switch, diode, input cap) as small as possible.
  2. Route the feedback trace away from the inductor and switch node (SW).
  3. Use a solid ground plane under the converter.
  4. Keep the switch-node copper small to reduce radiated EMI.

Real-World Project: Powering an ESP32 Sensor Node

Goal: Run an ESP32 with a BME280 (I2C) and a high-resolution ADS1115 ADC from a 12V lead-acid battery.

Power architecture:

Stage Part Output Purpose
1 MP1584 buck module 5V Efficient step-down from 12V
2 MCP1700-3302 or TPS7A20 LDO 3.3V Clean rail for ESP32 and sensors
3 LC filter (optional) 3.3V (AVDD) Extra isolation for ADS1115

Why this works: The buck handles 12V→5V at roughly 90% efficiency. The LDO removes switching ripple so ADC readings stay stable. A direct 12V→3.3V linear drop would waste over 70% of input power.

Firmware: Measuring Rail Voltage with ESP32 (Arduino C++)

Use a divider to monitor the supply on GPIO34.

// ESP32 supply monitor via resistor divider
// R1 = 100k (top), R2 = 33k (bottom) -> ratio = 33/(100+33) = 0.248
// Max measurable input ~ 3.3V / 0.248 = 13.3V

const int ADC_PIN = 34;          // GPIO34: input-only ADC1 channel
const float R1 = 100000.0;       // Top resistor (ohms)
const float R2 = 33000.0;        // Bottom resistor (ohms)
const float VREF = 3.3;          // ADC reference (approx.)
const int ADC_MAX = 4095;        // 12-bit resolution

void setup() {
  Serial.begin(115200);
  analogReadResolution(12);              // 12-bit ADC
  analogSetPinAttenuation(ADC_PIN, ADC_11db); // ~0-3.1V input range
}

float readSupplyVoltage() {
  long sum = 0;
  for (int i = 0; i < 64; i++) {         // Average 64 samples to reduce noise
    sum += analogRead(ADC_PIN);
    delayMicroseconds(100);
  }
  float adcAvg = sum / 64.0;
  float vPin = (adcAvg / ADC_MAX) * VREF;       // Voltage at pin
  return vPin * ((R1 + R2) / R2);               // Scale back to supply voltage
}

void loop() {
  Serial.printf("Battery: %.2f V\n", readSupplyVoltage());
  delay(1000);
}

Averaging reduces the effect of any residual switching noise. A clean LDO rail improves accuracy further.

Diagnosing Common Regulator Problems

Symptom Likely Cause Fix
Regulator too hot to touch Large Vin−Vout at high current Switch to a buck or add a pre-regulator
Output oscillates Wrong or missing output capacitor Use the datasheet-specified Cout and ESR range
Output below setpoint Dropout condition Raise Vin or choose a lower-dropout part
Noisy ADC readings Switching ripple on rail Add an LDO post-regulator or LC filter
Buck output unstable Poor layout or wrong inductor Shorten the hot loop; check saturation current
Random MCU resets Load transient sag Add bulk capacitance (47-220 µF) near the load
Whining or audible noise PFM mode with ceramic caps Force PWM mode or change capacitor type

Measuring ripple correctly: Use an oscilloscope with a 20MHz bandwidth limit and a short ground spring instead of the long ground clip. A long clip picks up noise and overstates ripple.

Selection Checklist

  1. Calculate Vin − Vout and multiply by I_load to find linear dissipation.
  2. If dissipation exceeds ~1W in a small package, use a switching regulator.
  3. If the load is an ADC, RF, or audio circuit, add an LDO at the point of load.
  4. For battery projects, compare Iq and efficiency at your actual sleep and active currents.
  5. If you must step up, choose a boost or buck-boost converter.

FAQ

Is a linear regulator or a switching regulator more efficient?

A switching regulator is more efficient, typically 85-95%. A linear regulator’s efficiency equals Vout/Vin, so a 12V→5V drop is only about 42% efficient.

Can I replace a linear regulator with a switching regulator?

Yes, in most cases. Many buck modules are pin-compatible with the LM7805 (e.g., the Recom R-78 series). Check output ripple if the load is noise-sensitive, and add an LDO or filter if needed.

Why are switching regulators noisier?

They rapidly switch current through an inductor at 100kHz to several MHz. This creates ripple and EMI at the switching frequency and its harmonics. Proper layout, shielded inductors, and post-filtering reduce it.

What is dropout voltage and why does it matter?

Dropout voltage is the minimum difference between Vin and Vout at which a linear regulator still regulates. A standard 7805 needs about 2V, while a modern LDO like the MCP1700 needs about 178mV at light load. Low dropout extends battery life by allowing use of more of the cell’s discharge range.

Hot this week

The 74HC Logic Family: A Practical Guide to the Chips Every Maker Should Know

Master the 74HC logic family: pinouts, voltage levels, 74HC595 and 74HC14 code, and comparisons with 74LS and 74HCT. Build your first circuit today.

Microcontroller vs Microprocessor vs FPGA: What’s the Difference?

This guide compares architecture, performance, power, and cost, then walks through a practical build for each. Read the full guide now.

Through-Hole vs SMD: Should You Switch to Surface-Mount?

Through-hole or SMD? Compare size, cost, soldering difficulty and reliability, then learn how to switch to surface-mount step by step.

Electrical Noise and EMI: What Causes It and How to Reduce It

Learn what causes electrical noise and EMI in circuits and how to fix it. Layout, filtering, and shielding techniques with code. Read the guide.

Temperature and Humidity Sensors Compared: DS18B20, DHT22, BME280, and SHT4x

Compare DS18B20, DHT22, BME280, and SHT4x sensors by accuracy, protocol, and cost. Get wiring, pinouts, and code. Pick the right one today.

Topics

The 74HC Logic Family: A Practical Guide to the Chips Every Maker Should Know

Master the 74HC logic family: pinouts, voltage levels, 74HC595 and 74HC14 code, and comparisons with 74LS and 74HCT. Build your first circuit today.

Microcontroller vs Microprocessor vs FPGA: What’s the Difference?

This guide compares architecture, performance, power, and cost, then walks through a practical build for each. Read the full guide now.

Through-Hole vs SMD: Should You Switch to Surface-Mount?

Through-hole or SMD? Compare size, cost, soldering difficulty and reliability, then learn how to switch to surface-mount step by step.

Electrical Noise and EMI: What Causes It and How to Reduce It

Learn what causes electrical noise and EMI in circuits and how to fix it. Layout, filtering, and shielding techniques with code. Read the guide.

Temperature and Humidity Sensors Compared: DS18B20, DHT22, BME280, and SHT4x

Compare DS18B20, DHT22, BME280, and SHT4x sensors by accuracy, protocol, and cost. Get wiring, pinouts, and code. Pick the right one today.

Sensors Explained: How Electronics Measure the Real World

Learn how sensors convert heat, light, motion, and pressure into signals. Wiring, code, and specs for hobbyists and engineers. Start building today.

Lithium Batteries for Electronics: Li-ion, LiPo, and LiFePO4 Compared

Compare Li-ion, LiPo, and LiFePO4 for electronics: voltage, safety, charging circuits, and ESP32 code. Pick the right battery today.

Logic Levels Explained: 3.3V vs 5V, TTL vs CMOS, and Level Shifting

Learn logic levels, 3.3V vs 5V compatibility, TTL vs CMOS thresholds, and level shifting circuits with wiring and code. Protect your MCU today.

Related Articles

Popular Categories