LM317/LM337 Adjustable Regulator Calculator: Voltage, Ripple, Current and Heatsink
Divider, unit-to-unit spread, minimum load, current operating window and heatsink sizing for a three-terminal adjustable regulator.
The LM317 does one thing and does it well: it holds 1.25 V between the output and the adjust pin, always, and everything else follows from that. Two resistors set the output voltage, while the adjust pin — the weak point of the circuit — adds its own contribution. This tool starts from the transformer secondary, selects the divider, shows how much the output voltage can actually vary from one device to another, checks the minimum load, plots the available-current operating window and sizes the heatsink.
The input ripple is simulated period by period with the transformer secondary resistance and diode drop included, just as in the fixed-voltage regulator tool. Ripple rejection is instead derived from the divider and the capacitor on the adjust pin, using a model that reproduces the two manufacturer-published points within one and a half decibels.
The device
The values below come from the datasheet for the selected device and remain editable: if you are using a part from another manufacturer, or prefer to work with worst-case instead of typical values, enter the numbers from your datasheet.
The divider and output voltage
R1 is connected between output and adjust and always sees the reference voltage: it therefore sets the current flowing through the divider. R2 is connected between adjust and ground and raises the output voltage. The classic value for R1 is 240 Ω, but it is not a rule: it is a compromise between current wasted in the divider and the minimum load required by the regulator.
Output voltage versus R2, with the band in which any device may fall when reference voltage, adjust current and resistor tolerance are taken into account.
Why adjust current matters — and when it stops mattering
The current leaving the adjust pin flows through R2 and produces a voltage across it that adds to the divider voltage. It is typically fifty microamps, one hundred at most, and changes little over the operating range: its guaranteed variation is five microamps. The problem is not the current itself, but the fact that it is multiplied by R2: with a 2 kΩ R2 it contributes about one hundred millivolts; with 20 kΩ it contributes one volt.
This leads to the practical rule of keeping R1 fairly low, around two hundred ohms: R2 remains lower for the same output voltage, the contribution of adjust current is reduced, and the divider draws enough current to satisfy the minimum-load requirement by itself. The price is a few tens of milliwatts of wasted power, which is insignificant at these current levels.
Input: transformer, rectifier and capacitor
The voltage to enter is the RMS voltage of the winding section feeding the rectifier: with a bridge it is the whole secondary; with a center tap it is half of the secondary.
Minimum differential check
The worst case must be evaluated with all adverse conditions at once: minimum mains voltage, capacitor at the bottom of its tolerance, maximum output current, and output voltage at the top of its possible range, because that is what raises the required threshold.
Worst-case input voltage over one mains period, with the threshold below which the regulator falls out of regulation.
Operating window
The current that is really available depends on two limits that move in opposite directions: cooling, which becomes more restrictive as the input-output differential rises, and the regulator’s internal protection, which reduces current above a certain differential to stay within the safe operating area.
Available current versus input-output differential. The solid curve is the calculated cooling limit; the two lower segments are the only current values published by the manufacturer, and the shape between them is unknown.
Power dissipation and heatsink
Power dissipation versus average input voltage, showing the three operating points and the cooling-imposed limit.
Residual output ripple
Here the divider matters directly: ripple reaching the adjust pin is amplified by the same ratio that raises the output voltage. The capacitor on the adjust pin removes that ripple, and it matters more than any other capacitor in the circuit.
How rejection is derived, and how accurate the estimate is
The datasheet gives only two numbers: 65 dB without a capacitor on the adjust pin and 80 dB with 10 µF, measured at 10 V output and 120 Hz. By themselves those values are not enough, because rejection depends on the divider you use.
The mechanism is entirely contained in those two points: ripple present at the adjust pin appears at the output multiplied by one plus R2 over R1, while the capacitor effectively shorts R2 at frequencies above its corner frequency. Deriving the unity-gain rejection from those two points gives 83 dB; recalculating the case with 10 µF gives 81.5 dB instead of the published 80 dB — a difference of one and a half decibels from the manufacturer’s figure.
Protection, capacitors and layout
The two diodes almost nobody installs
- D1, from output to input, cathode toward the input. When power is switched off, the output capacitor remains charged while the input discharges: without this diode, current flows backward through the regulator.
- D2, from output to the adjust pin, cathode toward the output. It protects the capacitor on the adjust pin: if the output is shorted, those ten microfarads discharge into the chip through the adjust pin, which is the most vulnerable part.
- The output capacitor is required for stability: 1 µF tantalum, or 10–25 µF electrolytic. Unlike fixed-voltage regulators, it is not optional.
- The metal tab of the TO-220 package is connected to theoutput, not ground: if the heatsink is connected to the chassis, the regulator must be insulated.