Variable Voltage regulator using LM317
The LM317 is an adjustable 3−terminal positive voltage regulator capable of supplying in excess of 1.5 A over an output voltage range of 1.2 V to 37 V. This voltage regulator is exceptionally easy to use and requires only two external resistors to set the output voltage.
By using the ratio of two resistances, one of a fixed value and the other variable (or both fixed), we can set the output voltage to the desired level with a corresponding input voltage being anywhere between 3 and 40 volts.
The output voltage of the LM317T is determined by ratio of the two feedback resistors R1 and R2 which form a potential divider network across the output terminal as shown below.
The voltage across the feedback resistor R1 is a constant 1.25V reference voltage, Vref produced between the “output” and “adjustment” terminal. The adjustment terminal current is a constant current of 100uA. Since the reference voltage across resistor R1 is constant, a constant current i will flow through the other resistor R2, resulting in an output voltage of:
Then whatever current flows through resistor R1 also flows through resistor R2 (ignoring the very small adjustment terminal current), with the sum of the voltage drops across R1 and R2 being equal to the output voltage, Vout. Obviously the input voltage, Vin must be at least 1.25 volts greater than the required output voltage to power the regulator.
Also, the LM317T has very good load regulation providing that the minimum load current is greater than 10mA. So to maintain a constant reference voltage of 1.25V, the minimum value of feedback resistor R1 needs to be 1.25V/10mA = 120 Ohm and this value can range anywhere from 120 ohms to 1,000 ohms with typical values of R1 being about 220Ω’s to 240Ω’s for good stability.
If we know the value of the required output voltage, Vout and the feedback resistor R1 is say 240 ohms, then we can calculate the value of resistor R2 from the above equation. For example, our original output voltage of 9V would give a resistive value for R2 of:
R1.((Vout/1.25)-1) = 240.((9/1.25)-1) = 1,488 Ohms
or 1,500 Ohms (1k5Ω) to the nearest preferred value.
Of course in practice, resistors R1 and R2 would normally be replaced by a potentiometer so as to produce a variable voltage power supply, or by several switched preset resistances if several fixed output voltages are required.