# LM317 upper and lower

#### Rob1959

Joined Oct 30, 2023
6
I am using the classic adjustable voltage regulator circuit from the lm317 datasheet, The input voltage is 15 volts. I need to modify the circuit so that at the lowest potentiometer setting the output is 5 volts, and at the highest potentiometer setting the output is 12 volts. Does anyone know how to do this?

#### dl324

Joined Mar 30, 2015
16,693
How close to 5V and 12V does it need to be? IIRC, the dropout voltage can be up to 3V, so, depending on current, 12V might not be possible.

#### WBahn

Joined Mar 31, 2012
29,867
One way is to figure out the resistance you need for 12 V and the resistance you need for 5 V and choose a potentiometer that is equal to the difference between the two and a fixed resistor that is equal to the remainder.

#### MrChips

Joined Oct 2, 2009
30,494
This is your basic LM317 adjustable voltage output circuit.

Put fix resistors (or adjustable trimmers) on both sides of R1 to set the upper and lower limits on the combined value of R1.

#### joeyd999

Joined Jun 6, 2011
5,171

#### crutschow

Joined Mar 14, 2008
34,050
If you don't need more than 800mA, the similar LM1117 low drop-out regulator would be less marginal for a 12V output with a 15V input.

#### Rob1959

Joined Oct 30, 2023
6
How close to 5V and 12V does it need to be? IIRC, the dropout voltage can be up to 3V, so, depending on current, 12V might not be possible.
Thanks for responding. I would like it to be pretty close, say within half a volt. The most important factor is not to drop below the 5 volt limit or exceed the 12 volt limit. The power source is a single 18650 connected to a tp4056 charge module. The output of the tp4056 module goes into a dc-dc converter module that is currently set to 15 volts. The output from there goes into the lm317 circuit. The current requirement is less than 500 mA.

#### Rob1959

Joined Oct 30, 2023
6
This is your basic LM317 adjustable voltage output circuit.

View attachment 308042

Put fix resistors (or adjustable trimmers) on both sides of R1 to set the upper and lower limits on the combined value of R1.
Are you serious? It's that easy? Thanks!

#### crutschow

Joined Mar 14, 2008
34,050
The most important factor is not to drop below the 5 volt limit or exceed the 12 volt limit.
Then you might want to use 3 pots, one to adjust between 5 and 12V, and the other two to set the limits.

#### WBahn

Joined Mar 31, 2012
29,867
Thanks for responding. I would like it to be pretty close, say within half a volt. The most important factor is not to drop below the 5 volt limit or exceed the 12 volt limit. The power source is a single 18650 connected to a tp4056 charge module. The output of the tp4056 module goes into a dc-dc converter module that is currently set to 15 volts. The output from there goes into the lm317 circuit. The current requirement is less than 500 mA.
Within half a voltage of 5 V is between 4.5 V and 5.5 V. But you are saying that it's important not to drop below 5 V. So does that mean that you want the lower limit to be between 5 V and 5.5 V?

If so, then I'd recommend choosing resistors that nominally give you 5.2 V to 11.8 V and then determine the tolerances you need to be sure that you go no lower than 5.1 V and no higher than 11.9 V. That gives you at least a bit of margin.

#### MrChips

Joined Oct 2, 2009
30,494
Are you serious? It's that easy? Thanks!
R1 is simply a resistor.
Adjust R1 for 5V output then measure the resistance of R1 (with the power OFF).
Do the same for R1 for 12V output.
Now you know the range that R1 needs to be.

It's as easy as pie.

#### crutschow

Joined Mar 14, 2008
34,050
E.g. running under Wine:
I prefer running under Bourbon.

Note that for the minimum 10mA operating current of the LM317, the resistance between the output and the ADJ pin should never be greater than 120Ω to insure that it stays in regulation with no external load.

#### joeyd999

Joined Jun 6, 2011
5,171
Note that for the minimum 10mA operating current of the LM317, the resistance between the output and the ADJ pin should never be greater than 120Ω to insure that it stays in regulation with no external load.
That's one way of doing it. Another is to add a dummy load resistor on the output (I've always preferred to minimize the power dissipated by a trim pot).

In the old days -- when I'd actually consider using something like an LM317 -- there was usually always a load attached of at least 10mA, eliminating the need to carefully control the current in the adjustment network.

Regardless, I was just showing an example of how I'd use my calculator to compute optimal values for range and setability. The input pot value can be changed and the fixed resistors will be quickly recalculated.

#### Audioguru again

Joined Oct 21, 2019
6,613
The circuit schematic in post #4 shows a 240 ohms resistor and is from circuitstoday.com (on the other side of the world) but it shows an LM317 which is wrong. The datasheet shows on its page 1 a more expensive LM117 using a 240 ohms resistor. The LM317 calculates using a 120 ohms resistor.