The LM317 is a simple to use 3-pin adjustable voltage regulator.
Basically its output voltage is equal to the voltage at the ADJ pin plus 1.25V.
A voltage divider is all that is needed to set the output voltage anywhere between 1.25V and 35V.
This program allows you to calculate the output Voltage, when both R1 and R2 are given.
Or it can calculate R1 or R2 when the required output voltage is given and the other resistor is known.
Don't make R1 too high, for that will introduce an error due to the current through the ADJ pin.
A typical value for R1 is between 200Ω and 300Ω.
U = 1.25 x (1 + R2 / R1)
R1 = (R2 x 1.25) / (U - 1.25)
R2 = (U - 1.25) x R1 / 1.25
000– | |||
h LBL A | 001– | 25 13 11 | |
g X=0 | 002– | 15 71 | Is R2 unknown? |
GTO 2 | 003– | 22 2 | Yep, let's calculate R2 |
X⇋Y | 004– | 21 | |
g X=0 | 005– | 15 71 | Is R1 unknown? |
GTO 1 | 006– | 22 1 | Yep, let's calculate R1 |
÷ | 007– | 71 | R1 and R2 are given, lets calculate |
1 | 008– | 1 | the output Voltage |
+ | 009– | 51 | |
1 | 010– | 1 | |
• | 011– | 73 | |
2 | 012– | 2 | |
5 | 013– | 5 | |
× | 014– | 61 | |
h RTN | 015– | 25 12 | |
h LBL 1 | 016– | 25 13 1 | Calculate R1 |
g R↓ | 017– | 15 22 | X=R2, Y=U |
1 | 018– | 1 | |
• | 019– | 73 | |
2 | 020– | 2 | |
5 | 021– | 5 | |
× | 022– | 61 | R2 x 1.25 |
X⇋Y | 023– | 21 | |
h LST X | 024– | 25 0 | Get 1.25 back |
– | 025– | 41 | U - 1.25 |
÷ | 026– | 71 | |
h RTN | 027– | 25 12 | |
h LBL 2 | 028– | 25 13 2 | Calculate R2 |
g R↓ | 029– | 15 22 | |
X⇋Y | 030– | 21 | X=U, Y=R1 |
1 | 031– | 1 | |
• | 032– | 73 | |
2 | 033– | 2 | |
5 | 034– | 5 | |
– | 035– | 41 | U - 1.25 |
h LST X | 036– | 25 0 | Let's store 1.25 in T |
g R↓ | 037– | 15 22 | |
X⇋Y | 038– | 21 | |
× | 039– | 61 | (U - 1.25) x R1 |
f R↑ | 040– | 14 22 | |
÷ | 041– | 71 | |
h RTN | 042– | 25 12 |
The idea behind this program is that it will figure out by itself which one of the 3 properties it needs to calculate.
You enter the Voltage, the value for R1 and the value of R2, and then press the A key to start the calculation.
The unknown property has to be entered with a value of 0.
You do not have to enter 0 for the voltage by the way, the program will calculate the output voltage when both R1 and R2 are given.
The program does not check the range of any of the values.
Rubbish in will result in rubbish out.
Calculate the output voltage when R1 = 220Ω and R2 = 680Ω.
220 ENTER🠕
680 A
The answer will be 5.11V.
Calculate R2 if the required output voltage is 12V and R1 is 240Ω.
12 ENTER🠕
240 ENTER🠕
0 A
And the answer will be 2k06.
Calculate R1 if the required output voltage is 9V and R2 is 1kΩ.
9 ENTER🠕
0 ENTER🠕
1500 A
And the answer will be 242Ω.