Parts

7805 vs LM317 vs AMS1117: three linear regulators, three different jobs

By

All three are linear regulators: they burn the extra voltage as heat, so none of them is efficient when the input is far above the output. Each suits a different job.

  • The 7805 gives a fixed 5 V at up to 1.5 A. TI recommends 7 V to 25 V at the input and gives a typical dropout of 2 V at 1 A. It needs no setting resistors, and its metal tab is ground.
  • The LM317 is adjustable from 1.25 V to 37 V with two resistors, at up to 1.5 A. It wants at least 3 V between input and output, and its tab is the output.
  • The AMS1117 is a low-dropout part, mostly sold as fixed 3.3 V or 5 V in SOT-223. It regulates with 1.4 V of headroom at most, even at 1 A. But SLKOR's sheet recommends 600 mA at most in SOT-223 and allows only 0.75 W of heat there, and it needs at least a 10 µF tantalum capacitor on the output to stay stable.

Start from two numbers: how much headroom you have between input and output, and how many watts the regulator will have to throw away.

Datasheet: Texas Instruments uA78xx Fixed Positive Voltage Regulators, SLVS056P (PDF)

Advertisement

Pinout by package

uA7805C TO-220 · Texas Instruments1=IN 2=GND 3=OUT
tab =groundprinted facetoward youIN1 InputGND2 Common (ground)OUT3 Output

Printed face toward you, leads down: input, ground, output from left to right. The tab is ground (TI calls it COMMON).

Source: Texas Instruments uA78xx Fixed Positive Voltage Regulators, SLVS056P, p. 3 (TO-220 top view with the tab on COMMON; pin table: INPUT 1, COMMON 2, OUTPUT 3)

LM317 TO-220 · Texas Instruments1=ADJ 2=OUT 3=IN
tab =outputprinted facetoward youADJ1 AdjustOUT2 OutputIN3 Input

Printed face toward you, leads down: adjust, output, input from left to right. The tab is the output.

Source: Texas Instruments LM317 3-Pin Adjustable Regulator, SLVS044Z, p. 5 (Pin Functions: ADJUST 1, OUTPUT 2 and TAB, INPUT 3 (TO-220, TO-263, SOT-223))

AMS1117-3.3 SOT-223 · SLKOR1=GND 2=VOUT 3=VIN
tab = VOUTtop viewGND1 Ground (adjust on the adjustable version)VOUT2 OutputVIN3 Input

Top view, tab at the top, leads toward you: ground (or adjust), output, input from left to right.

Source: SLKOR (Shenzhen SLKOR Micro Semicon) AMS1117 1A Adjustable / Fixed Low Dropout Linear Regulator, p. 2 (pin description, SOT-223-3L: 1 ADJ/GND, 2 VOUT, 3 VIN); SLKOR (Shenzhen SLKOR Micro Semicon) AMS1117 1A Adjustable / Fixed Low Dropout Linear Regulator, p. 7 ("The case of all devices in this series is electrically connected to the output")

The pinout trap

The 7805 and the LM317 come in the same TO-220 body, and people swap one for the other all the time. The pins don't match: the 7805 runs input, ground, output from the left; the LM317 runs adjust, output, input. The pinout drawings at the top of this page show all three parts.

Drop an LM317 into a 7805 footprint and your input voltage lands on its ADJ pin, the output pin sits on your ground track, and the input pin feeds the circuit that expected 5 V.

The tab matters too. A 7805 can bolt straight onto a grounded metal case or heatsink. An LM317 or AMS1117 tab carries the output voltage, so on a grounded heatsink it needs an insulating pad and an insulated screw bushing, or it shorts the output.

The AMS1117 and the LM317 share the same order (adjust or ground, output, input), which is why many boards take either one in the adjustable version.

Side by side

Limits, from the TI datasheets (7805, LM317) and SLKOR's AMS1117 sheet
ParameteruA7805CTO-220LM317TO-220AMS1117-3.3SOT-223
Output5 V fixed1.25 V to 37 V, set by two resistors1.5, 1.8, 2.5, 2.85, 3.3 or 5.0 V fixed, or adjustable
Output current IO1.5 A1.5 A1 A in the title; 600 mA recommended in SOT-223
Input voltage VI7 to 25 V recommended; 35 V absolute max3 V to 40 V above the output18 V maximum
PackageTO-220 (also TO-263)TO-220, TO-263, SOT-223SOT-223, TO-252, SOT-89
Tab connected togroundoutputoutput
Thermal resistance to air RθJA19 °C/W (TO-220)23.5 or 37.9 °C/W (TI’s two TO-220 builds); 66.8 °C/W SOT-223135 °C/W SOT-223
Power dissipation, SOT-223 PDnot given; thermal-overload protectednot given; thermal-overload protected750 mW max
Junction temperature, operating TJ0 to 125 °C0 to 125 °C−40 to 125 °C
Electrical characteristics (typical figures unless the row says otherwise)
ParameteruA7805CTO-220LM317TO-220AMS1117-3.3SOT-223
Output accuracy25 °C4.8 / 5 / 5.2 Vreference 1.2 / 1.25 / 1.3 V3.234 / 3.30 / 3.366 V (3.3 V part)
Headroom needed2 V typ dropout at 1 A3 V minimum recommended1.30 V typ, 1.40 V max dropout at 1 A
Ground or bias currenttyp / max4.2 / 8 mAADJ pin 50 / 100 µA3 / 10 mA
Minimum loadnone given3.5 mA typ, 10 mA max at 40 V across it3 mA typ, 10 mA max
Current limit750 mA short-circuit, 2.2 A peak1.5 A min, 2.2 A typ (15 V or less across it); 0.15 A min at 40 V1.2 A min
Capacitorscharacterized with 0.33 µF in, 0.1 µF outnone needed within 6 in (15 cm) of the filter capacitorsat least 10 µF tantalum (or 50 µF aluminium) on the output, ESR 0.5 Ω or less
Ripple rejection120 Hz, typ78 dB57 dB; 64 dB with 10 µF on ADJ70 dB (22 µF tantalum out)

The thermal resistance figures are measured on standard test boards. A part standing in free air on a thin board runs hotter, so treat the temperatures in the examples below as the best case. The AMS1117 is made by several companies under the same number, and their sheets don't all agree; the AMS1117 page compares two of them.

Which one fits your job

  • 5 V from 9 V or 12 V, with no adjustment: the 7805. There are no resistors to set, the tab is ground, and TI quotes 4.8 to 5.2 V at room temperature.
  • Any other voltage, or one you want to trim: the LM317. Two resistors set it, and the LM317 calculator picks them.
  • 3.3 V from a 5 V rail (USB, Arduino, a 5 V adapter): the AMS1117-3.3. The 7805 can't make 3.3 V, and the LM317 wants 3 V of headroom where you only have 1.7 V.
  • A big drop at more than a few hundred milliamps: none of them. Work out the watts first (example 1). Above roughly 2 to 3 W, a switching buck module wastes far less, and the LM2596 page covers one.
0 V1 V2 V3 V4 V5 V6 V7 V8 Vinput minus output (headroom)AMS11177805LM317USB sagging to 4.6 V → 3.3 VUSB 5 V → 3.3 V9 V battery → 5 V12 V → 5 V1.4 V max at 1 A2 V typ at 1 A3 V recommended minimum
Figure 1. Headroom each part needs before it regulates (green), against the gap four common jobs offer (dashed): USB to 3.3 V gives 1.7 V, a sagging USB port 1.3 V, a 9 V battery to 5 V gives 4 V, and 12 V to 5 V gives 7 V.

Worked examples

1. 12 V in, 5 V out at 500 mA

The regulator drops 12 − 5 = 7 V at 0.5 A, so it turns 3.5 W into heat.

  • 7805 (TO-220, 19 °C/W): 3.5 W × 19 °C/W = 66.5 °C above the air. At 25 °C ambient the junction sits near 92 °C. That is under TI's 125 °C limit, but far too hot to touch, so add a small heatsink.
  • LM317 (TO-220): 3.5 W × 23.5 °C/W = 82 °C rise on TI's KCS build, about 107 °C at the junction. On the KCT build (37.9 °C/W) the figure is 133 °C rise, well past the limit. It needs a heatsink.
  • AMS1117-5.0 (SOT-223): SLKOR allows 0.75 W at most in SOT-223, and 3.5 W is 4.7 times that. It will heat up until its thermal shutdown cuts in (150 °C typical, per the datasheet). Don't use it here.

Double the load to 1 A and the 7805 has 7 W to lose: 7 × 19 = 133 °C rise with no heatsink. At that point a buck module is the better answer. The 7805 page sizes the heatsink for this case, and the regulator thermal design lesson explains the method.

050 °C100 °C150 °C125 °C780592 °C (19 °C/W)LM317 KCS107 °C (23.5 °C/W)LM317 KCT158 °C (37.9 °C/W)AMS11174.7x its 0.75 W limit: shuts down
Figure 2. Junction temperature in example 1 (3.5 W of heat, 25 °C air, no heatsink) against the 125 °C operating limit (dashed). The AMS1117 is not drawn: 3.5 W is 4.7 times its SOT-223 limit.

2. 5 V USB to 3.3 V at 300 mA

The headroom is 5 − 3.3 = 1.7 V.

  • 7805: no 3.3 V version in the µA78xx family.
  • LM317: TI recommends at least 3 V between input and output. 1.7 V is not enough.
  • AMS1117-3.3: dropout is 1.4 V max at 1 A, so 1.7 V works with 0.3 V to spare. It burns 1.7 V × 0.3 A = 0.51 W. At 135 °C/W that is a 69 °C rise, about 94 °C at the junction in 25 °C air. That is under the 0.75 W and 125 °C limits, but hot, so give the tab some copper on the board.

Keep the input steady. A USB port that sags to 4.6 V leaves only 1.3 V of headroom. That is the typical dropout at 1 A and below the 1.4 V maximum. The dropout is smaller at 300 mA, but the sheet only guarantees the 1 A figure, so at that point a 3.3 V rail can start to follow the input down.

01 V2 V3 VAMS11177805LM317USB at 5 V1.7 V: AMS1117 onlyUSB at 4.6 V1.3 V: under the AMS1117 maximum
Figure 3. Headroom in example 2 against what each part needs (dashed). At a steady 5 V the AMS1117 has 0.3 V to spare over its 1.4 V maximum dropout; a port sagging to 4.6 V falls under it, and the LM317 is 1.3 V short at 5 V.

3. 9 V battery to 5 V

A 9 V battery drops as it drains, so the question is how long each regulator holds 5 V.

  • 7805: TI's recommended minimum input is 7 V. Below that the output is no longer guaranteed, even though a fresh battery starts well above it.
  • AMS1117-5.0: needs 5 + 1.4 = 6.4 V at most (the 1 A figure; the dropout shrinks at lighter loads). It keeps regulating for longer as the battery runs down.

Count the standby current too. With no load, the 7805 draws 4.2 mA typical and the AMS1117 3 mA typical (10 mA max). On a small battery that alone matters, and a regulator built for low quiescent current does much better.

4. LM317 set to 5 V

With TI's usual R1 = 240 Ω, the formula is VOUT = 1.25 × (1 + R2/R1) + IADJ × R2, with IADJ at 50 µA typical. Exactly 5.00 V needs R2 = 713 Ω.

  • R2 = 720 Ω gives 1.25 × 4 + 0.036 = 5.04 V.
  • 720 Ω is not a standard value. The nearest E24 value, 750 Ω, gives 5.19 V. A 680 Ω and a 39 Ω in series (719 Ω) give 5.03 V.
  • The reference itself can be anywhere from 1.2 V to 1.3 V (TI, full temperature range), so the output can land 4% either side whatever resistors you pick: 4.83 V to 5.23 V with the 719 Ω pair. If you need exactly 5.00 V, use a trimmer for part of R2, or use a 7805.
4.7 V4.9 V5.1 V5.3 V5.5 Vtarget 5.00 V720 Ω5.04 V typ750 Ω5.19 V typ680 + 39 Ω5.03 V typ
Figure 4. Where the output lands for three R2 choices with R1 = 240 Ω. The tick is the typical 1.25 V reference; the band runs from 1.2 V to 1.3 V, the spread TI allows.

The LM317 calculator does this for any voltage and snaps to standard values. The resistor combination finder finds series and parallel pairs like 680 + 39.

3 IN 2 OUT 1 ADJ LM317 +12 V C1 100 nF R1 240 Ω R2 750 Ω 5.19 V C2 1 µF RL 10 Ω
Figure 5. Example 4 with the 750 Ω resistor at the example 1 load: 12 V in, R1 240 Ω, R2 750 Ω, a 10 Ω load. Simulated in ngspice with a behavioural LM317 built from TI's figures (1.25 V reference, 50 µA from ADJ): 5.19 V out, 519 mA in the load, 3.57 W of heat in the regulator.

Worked example in numbers

12 V to 5 V at 500 mA
3.5 W of heat
7805 junction, no heatsink
92 °C
AMS1117 headroom from USB
1.7 V
LM317 reference spread
±4%

Swapping one for another

TO-220: printed face toward you, leads down, left to right. SOT-223: top view, tab at the top.
PartPinsVerdict
LM317 for a 7805ADJ-OUT-IN vs IN-GND-OUTWorks electrically with two resistors set for 5 V, but not in the same footprint: all three pins move, and the tab becomes the output.Texas Instruments uA78xx Fixed Positive Voltage Regulators, SLVS056P, p. 3; Texas Instruments LM317 3-Pin Adjustable Regulator, SLVS044Z, p. 5
AMS1117-5.0 for a 7805GND-VOUT-VIN (SOT-223)Only with the input at 18 V or less and the heat under 750 mW in SOT-223: from 12 V that is about 107 mA at most.SLKOR (Shenzhen SLKOR Micro Semicon) AMS1117 1A Adjustable / Fixed Low Dropout Linear Regulator, p. 2
Adjustable AMS1117 for an LM317ADJ-OUT-IN, same orderSame pin order and the same 1.25 V reference, so a board can take either, but only up to 18 V in and 600 mA out in SOT-223.SLKOR (Shenzhen SLKOR Micro Semicon) AMS1117 1A Adjustable / Fixed Low Dropout Linear Regulator, p. 2; SLKOR (Shenzhen SLKOR Micro Semicon) AMS1117 1A Adjustable / Fixed Low Dropout Linear Regulator, p. 3
Advertisement

Tips and checks

  • Work out the watts first: (VIN − VOUT) × current. Over about 1 W in SOT-223 or 2 W in a bare TO-220, plan for copper area or a heatsink.
  • Fit the AMS1117's output capacitor. SLKOR asks for at least 10 µF tantalum or 50 µF aluminium electrolytic, with an ESR of 0.5 Ω or less. Without it the part can oscillate, and the output looks fine on a meter while it rings on a scope.
  • Give the LM317 a load. TI's minimum load current is up to 10 mA at the highest input-output difference. The 240 Ω R1 already draws about 5.2 mA (1.25 V / 240 Ω), which is why that value is so common.
  • Check the input limit on the AMS1117 sheet for the part you buy. SLKOR allows 18 V, but AMS1117s from different makers don't all share that figure, and a "12 V" adapter can read well above 12 V with no load.
  • Insulate the tab on the LM317 and AMS1117 if it touches anything grounded.

The most common mistake

Using a linear regulator for a big drop at real current. A 7805 fed from 24 V and driving 500 mA wastes 9.5 W, nearly four times what the load gets (2.5 W). With no heatsink, 9.5 W × 19 °C/W works out to a 181 °C rise, far past the 125 °C limit. Use a buck converter for the big drop, and a linear regulator after it if you want a quieter rail. The switching regulator lesson shows why a buck wastes so much less.

02.5 W5 W7.5 W10 Wload2.5 W usedfrom 12 V3.5 W of heatfrom 24 V9.5 W of heat
Figure 6. Where the power goes with a 5 V, 500 mA load: from 12 V the 7805 wastes 3.5 W, from 24 V 9.5 W, 3.8 times the 2.5 W the load uses.

What we'd do

For a 5 V rail from a 9 V to 12 V adapter at a few hundred milliamps, we'd use a 7805 with a small clip-on heatsink, because the ground tab makes mounting easy. For 3.3 V off USB, an AMS1117-3.3 with a 10 µF tantalum on the output. For a bench supply or any odd voltage, an LM317 with the resistors from the calculator. Past about 3 W of heat, we'd skip all three and use a buck module.

Questions people ask

Can I replace a 7805 with an LM317?

Yes, electrically, but not in the same footprint. The pins are in a different order (7805: in, ground, out; LM317: adjust, out, in), so you need to rewire the three pins and add two resistors to set 5 V.

Can an AMS1117 replace a 7805?

Only if the input stays at 18 V or less and the heat stays under 0.75 W in SOT-223. For 12 V to 5 V at more than about 107 mA (7 V × 0.107 A = 0.75 W), it will overheat.

Why does my 7805 get hot with nothing much connected?

Work out the watts. From a 12 V adapter, even 200 mA means 7 V × 0.2 A = 1.4 W. With 19 °C/W that is a 27 °C rise, warm to the touch. Also check that the adapter isn't putting out much more than 12 V with a light load.

Is the LM1117 the same as the AMS1117?

The LM1117 is a similar low-dropout regulator from a different maker, but don't assume the figures match. This page uses only SLKOR's AMS1117 datasheet, so check the sheet for the part you actually buy. The AMS1117 page compares the clone sheets.

What is dropout voltage?

The smallest gap between input and output at which the regulator still holds its output. Below it, the output follows the input down. TI gives the 7805 2 V typical at 1 A; SLKOR gives the AMS1117 1.4 V maximum at 1 A.

Where to go next

The linear regulators lesson covers how all three work inside. Each part has its own page with the full ratings and a bench check: 7805, LM317 and AMS1117. For other parts compared the same way, see 1N4007 vs 1N4148 vs 1N5819 and LM358 vs 741 vs TL072.

Advertisement

One email a month from the bench

New circuits, lessons, part guides and calculators, on the first Sunday of each month.

We'll send one email to confirm. Every email has a one-click unsubscribe. Privacy policy

Used in these lessons

Lessons that go deeper

Datasheets this page was checked against

Makers revise datasheets. If the copy you download has a newer revision and a number here disagrees with it, the datasheet wins, and we would like to hear about it.