Comparison

LM317 vs 7805 Voltage Regulator

Powering a 3.3 V microcontroller from a 9 V wall adapter with a 7805 requires an additional LDO because the 7805 is fixed at 5 V. Using an LM317 instead, two resistors set the output to any voltage from 1.25 V to 37 V. That adjustability is the LM317's entire value proposition. The 7805 wins on simplicity: three pins, no external resistors, and every engineering student has one in the lab drawer.

EEE, ECE, EI

Side-by-side comparison

ParameterLM3177805 Voltage Regulator
Output VoltageAdjustable — 1.25 V to 37 V set by R1, R2Fixed — 5.0 V ±4%
Setting FormulaVout = 1.25 × (1 + R2/R1); typical R1=240 ΩNo formula — output is fixed at 5 V
Minimum Output1.25 V (reference voltage)5 V (fixed)
Maximum Input Voltage40 V35 V
Dropout Voltage~3 V (Vin must exceed Vout by 3 V)~2 V (Vin must be ≥ 7 V for 5 V output)
Output CurrentUp to 1.5 A (with heatsink)Up to 1.5 A (with heatsink)
External ComponentsR1 (240 Ω), R2 (calculated), output capInput cap (0.1 µF), output cap (0.1 µF) — minimal
Quiescent Current~5 mA (flows through R1 to output, not GND pin)~8 mA to GND pin
Protection FeaturesThermal shutdown, current limiting, safe operating areaThermal shutdown, current limiting, safe operating area
PackageTO-220 (LM317T), TO-92 (LM317L for 100 mA)TO-220 (7805), TO-92 (78L05 for 100 mA)

Key differences

The 7805 has three fixed-function pins: Input, GND, Output — the output is 5 V with no external resistors. The LM317 has three pins labelled Input, Adjustment, Output; the output floats at 1.25 V above the ADJ pin, and the resistor network from Output to ADJ to GND sets the final voltage using Vout = 1.25×(1 + R2/R1). The LM317's quiescent current flows into the ADJ pin (50 µA typical) and through R1 — a key difference: the 7805's quiescent current dumps to GND and wastes power. Both have ~3 V dropout; for a 3.3 V output, LM317 needs at least 6.3 V input. Line regulation for LM317 is 0.01%/V; for 7805 it is 50 mV maximum variation over input range.

When to use LM317

Use the LM317 when output voltage needs to be anything other than 5 V — charging a 12 V lead-acid battery at constant voltage, generating a 9 V reference for an analog circuit, or building a lab bench supply that sweeps from 1.25 V to 30 V with a potentiometer.

When to use 7805 Voltage Regulator

Use the 7805 when you need exactly 5 V and want zero external circuitry — powering a 5 V-tolerant microcontroller like ATmega328P from a 9 V battery, driving a 5 V relay from a wall adapter, or any prototype where simplicity matters more than voltage flexibility.

Recommendation

Choose LM317 when your output voltage must be anything other than 5 V — the two-resistor formula gives you any voltage from 1.25 V to 37 V. Choose 7805 when 5 V is your target — it's simpler, well-characterized, and available everywhere. Both need heatsinking above 500 mA; for lower dropout, switch to an LDO like the AMS1117.

Exam tip: Examiners give you an LM317 circuit with R1=240 Ω and R2=720 Ω and ask for output voltage — apply Vout = 1.25×(1 + 720/240) = 1.25×4 = 5 V; also be ready to reverse-calculate R2 for a given target voltage.

Interview tip: Interviewers ask the difference in quiescent current path — for 7805, Iq flows to GND and is wasted; for LM317, Iq (50 µA) flows into the ADJ pin and through R1 into Vout, slightly adding to the load current calculation.

More Analog Electronics comparisons