Fads to Obsessions and Beyond...

Free domain for life, exceptional technical support, website transfer

LM317 Voltage Regulator

The LM317T, 3-terminal adjustable positive voltage regulator, is utilised in a variety of circuits to construct power supplies as per the datasheet application notes (e.g. 1.2-25V 1.5A, 4.5-25V 4A, and 1.8-32V 3A switching regulator).

All electronic projects require some sort of power supply, and generally a regulated power supply (i.e., without "major" voltage fluctuations and or noise levels). The wide availability of IC's designed as voltage regulators greatly simplifies the problem. There are different classes of voltage regulator IC, but they are commonly grouped as being either linear voltage regulator or a switched mode voltage regulator. The differences between linear and switched mode regulators is explained well by a Linear Technology application note (1).

Linear voltage regulator IC's are very easy to use and only require generally a couple of capacitors and two feedback resistors in the case of the variable regulators. While a switched mode power supply can be (is generally??) more efficient than a linear supply, if the un-regulated input voltage is well matched to the desired regulated output voltage (e.g., 13.8V input with a 10V output) the "efficiency" of the linear supply is already very acceptable, and the low parts count/circuit simplicity is an advantage.

While there are numerous linear voltage regulator IC's available, and the LM317 is now an over 30 year old design, this well know component has a wide background literature, is an adjustable analogue to the popular 78xx series fixed voltage regulators, and is easily/cheaply available (in the range of cents/item even for small quantities when sourced from ebay).

The LM317 datasheet lists other features of the component, notably thermal and current overload protection with a 1.2V to 37V output range at 1.5A (depending upon heat sinking). The current limiting and thermal overload shutdown make the LM317 a very tolerant part (i.e. excellent choice for a DIY circuit where opportunity for the "magic smoke" to leak out abound). While this component was "blindly" used in various project circuits (i.e., the datasheet application note examples used verbatim), some specific testing of the LM317 was performed, detailed in the following sections, to gain a better understanding of the use and performance of the component.

The usual schematic for the LM317 as per the datasheet is as follows.

basic circuit

"Basically" the output voltage (Vout) is determined by the ratio of the feedback resistors R1 and R2, using the following formula:

Vout = 1.25 x (
R2 / R1

The actual internal operation of the LM317 (and linear voltage regulators in general) is given in detail by an Analog Devices publication (2). Such detail/knowledge is likely of importance to assess the exact interaction of the LM317 with external circuitry. However, for the typical DIY scenario, the LM317 can be largely considered a "black box" that converts an input voltage to a regulated output voltage. Nevertheless, some knowledge of the device is required to enable appropriate incorporation into the desired circuit. The lab notes from this reference (3) provide what I consider is a good compromise, and since internet references can often be ephemeral, the following excerpts/paraphasing is reproduced.

Linear Voltage Regulator Operation [from (3)]

The LM317 internals can be simplified as comprising the following "block" components in terms of considering voltage regulation.

op-amp model

A 1.25V reference voltage (from the zener diode) is input into the non-inverting input of the op-amp. The action of the op-amp then produces an output, via the pass transistor, to produce a matching 1.25V voltage that is feedback to the inverting input of the op-amp (the "op-amp action" is to produce an output that makes the inputs of the op-amp equal).

The LM317 therefore internally "makes" the voltage difference between the LM317 output and adjust pins equal to 1.25V. From the diagram this 1.25V is across R1, 125 ohm in this example, and therefore from Ohm's Law 10mA of current. This 10mA current also flows through R2 (ignoring the minute current that flows from the adjust pin, 100uA from the datasheet), which in this example is 375 ohm, and therefore again from Ohm's Law R2 must drop 3.75V. Therefore, 1.25V + 3.75V = 5V across the LM317 output pin and ground. Therefore, by altering the value of R2 (or more accurately the ratio of R2/R1) the output voltage can be set.

In addition to the basic operation of the LM317 to produce a regulated voltage output, it is instructive to know the function/action/consequence of the associated external circuit components (capacitors C1, C2 for example) and the range of appropriate values for these components. This is discussed in the following sections.

Values for Resistors R1 and R2

From the LM317 datasheet, the IC requires a minimum load current to operate, which is stated to be typically 3.5mA (max 10mA). While it can be usually expected that the load (i.e. the remaining circuit the LM317 is supplying) will be greater than this minimum, R1 can also act as a dummy load to ensure operation of the LM317 (ie voltage regulation) even if the real load is not connected.

Since the LM317 will "ensure" 1.25V across R1 (see above operation section) with a 3.5mA typical minimum current, this calculates to a required value of 357ohm for R1. With a minimum current of 10mA, the value of R1 is 125ohm. The lower the value of R1 the more current is wasted, while the higher the value of R1 the more the regulator becomes sensitive to oscillation (and noise). Therefore, using 220ohm for R1 (which seems to be widely recommended) gives a current of 5.7mA, well within the minimum current requirements for the LM317 and appears to be a good compromise.

Taking a value of 220ohm for R1, and taking into account the datasheet specifies a maximum input voltage differential of 40V, this then limits the useful range for R2 (using the equation for Vout given above) to ~6800ohm (hence the usual value of 5K ohm for the potentiometer in the standard LM317 schematics). The following table gives the calculate output voltage for various combinations of values for R1 and R2, using standard E series resistor values (the highlighted column is for the recommended 220ohm value for R1).

Calculated Vout of LM317 with R1, R2 combinations
  R1 ohms
R2 ohms 150 180 220 240 270
R1 = 220 ohm recommended

Values for External Capacitors

From the datasheet, "An input bypass capacitor (C1) is recommended. A 0.1μF disc or 1μF solid tantalum on the input is suitable input bypassing for almost all applications. The device is more sensitive to the absence of input bypassing when adjustment or output capacitors are used but the above values will eliminate the possibility of problems".

Again from the datasheet, the inclusion of C2 is optional, but improves transient response (i.e., protecting against sudden changes in mains or load conditions e.g., surges), with values in the range of 1uF to 1000uF of aluminium or tantalum electrolytic being commonly used (for output capacitors of 25uF or less, there is no need for a protection diode).

The following circuit shows the addition of capacitor C3. This bypass capacitor prevents ripple from being amplified as the output voltage is increased. The datasheet advises a 10uF value is sufficient generally. If values of output voltage less than 25V are used with a 10uF value for C3, no protection diode is required (otherwise, should be included).

basic circuit

Dropout Voltage

The dropout voltage is the minimum difference between the input and output voltages that must be maintained in order for the regulator to perform the voltage regulation. Therefore, this means that the input voltage must be always greater than the output voltage. The dropout voltage varies both the load current and temperature. From the LM317 datasheet, the minimum dropout voltage is approximately 2V, and obviously this should be "de-rated" to give some margin.

Another consequence of the input voltage needing to be greater than the output voltage (and allowing for the dropout voltage) is that the greated the difference between the input and output voltage (assuming the same load current), the more power that will need to be dissipated by the LM317 and therefore the hotter it will get. See the Testing/Experimental Results section for practical examples.

Heat Sinking the LM317

From the testing done (refer to the graphs in the Testing/Experimental Results section), heat sinking of the LM317T is very important in enabling a regulated voltage at higher load current. The LM317 regulators have internal thermal shutdown to protect the device from over-heating. The datasheet advises under all possible operating conditions, the junction temperature of the LM317 must be within the range 0oC to 125oC. A thermal evaluation of a circuit, particularly when dealing with increased current, should be done to check if components will remain within thermal tolerances stated on datasheets. The thermal equivalent of an electronic circuit has an analogous relationship with Ohm's Law which are explained by these sites, which also include online calculators (4), (5). If you want further more detailed information about thermal metrics, a Texas Instruments application report is available (6).

LM317 High Current Circuits


LM317 improving regulation

Big thread http://www.diyaudio.com/forums/power-supplies/248335-lm317-tl431-really-8.html http://preamp.org/diyaudio/lm317-regulator-under-test https://www.youtube.com/watch?v=ICQXqVy3Hpc (eevblog LM317 regulator tutorial). http://www.tnt-audio.com/clinica/regulators2_impedance1_e.html - output impedance testing of LM317, noice etc about improving LM317 to reduce noice, ripple etc


LM317 switching regulator



Note: Image loading can be slow depending on server load.

  • LM317 Basic SchematicLM317 Basic Schematic

    Silver Membership registration gives access to full resolution schematic diagrams.

    LM317 Basic Schematic

This project did not require a PCB.

The construction was done using prototyping board. See the photographs and schematic diagram sections.

Qty Schematic Part-Reference Value Notes/Datasheet
1R12201/4W, 10% 
1R2As required for Vout calc1/4W, 10% 
1RV15KPotentiometer if for variable Vout
2D11N4002as required if protection diodes needed
Integrated Circuits
1U1LM317Linear Voltage Regulator   datasheet
1C10.1uFdisc or solid tantalum
1C21uF aluminium or tantalum electrolytic
1C310uFaluminium or tantalum electrolytic

There are a number of variables/conditions that could be examined such as load transient response, drop-out voltage, output voltage regulation, output voltage ripple/noise, etc. Each of these in turn examined versus temperature, input voltage, output load current etc.

In my case, the applications in which the LM317 are to be used (e.g. supply of microcontroller boards, small DC motors, relatively low current resistive loads etc) are not particularly sensitive to noise, supply voltage to the LM317 is via wall-warts and I have limited test equipment. Therefore, my "practical" testing of the LM317 involves simply measuring output voltage versus load current, with different input voltage levels, to determine when the output voltage stays within regulation. Since the LM317 IC temperature/power dissipation is an important practical characteristic, the external IC package temperature is also recorded under differing output voltage versus load current conditions (with and without attached heat sink).

Output load for the LM317 is produced using a DIY dummy electronic load. LM317 package temperature was monitored using a DIY digital thermometer based upon DS18S20 sensors. Other measurements of voltage/current performed using a DMM. See the photographs section.

  • Graph 1: Output voltage (and external package temperature) versus output load, Vin=12.2V with Vout = 10V and 6V

    graph 1graph 1

    Silver Membership registration gives access to full resolution schematic diagrams.

    Graph 1: Output voltage (and external package temperature) versus output load: Vin=12.2V with Vout = 10V and 6V

  • Graph 2: LM317 external package temperature versus observed power dissipation, Vin=12.2V with Vout = 10V and 6V

    graph 1graph 1

    Silver Membership registration gives access to full resolution schematic diagrams.

    Graph 2: LM317 external package temperature versus observed power dissipation, Vin=12.2V with Vout = 10V and 6V



No comments yet.

Add Comment/Question

Only Logged-In Members can add comments

"If we could sell our experiences for what they cost us, we'd all be millionaires".

Please donate any amount to help with hosting this web site.

If you subscribe (only $2/annum) you can view the site without advertisements and get emails abouts updates etc.



Only logged-in users with correct Membership Level can download.

Membership starts at only $2, so join now!