The LM317 is commonly used for voltage regulation in DC circuits. The IC is one of the popular adjustable positive voltage regulators that comes with features like overvoltage protection, internal current limiting, overload protection, low quiescent current (for more stable output), and safe area compensation (its internal circuits limit maximum energy dissipation, so it doesn't self-destruct). In addition to many features, fewer components are required to make it operational. Thus, the LM317 regulator is easy to use and assemble into a circuit.
In this project, an adjustable power supply using LM317 is designed, which powers the main AC sources (220V-230V AC) and outputs DC voltage below 12V. The LM317 has an adjustable output voltage of 1.28 V to 11 V and draws a maximum of 1.5 A of current.
The conventional steps of the designed power circuit are followed while assembling this circuit, including AC voltage reduction, conversion of AC voltage to DC voltage, DC voltage smoothing, transient current compensation, voltage regulation, voltage variation and protection against short circuit.
Required components –

Fig. 1: List of components required for IC-based adjustable power supply LM317
Block diagram –
Fig. 2: Block diagram of IC-based adjustable power supply LM317
Circuit Connections –
The circuit is assembled following conventional power circuit design steps. To step down the 230 V AC, a 12 V – 0 -12 V transformer is used. One end of the transformer's secondary coil and its center strip are connected to a full-bridge rectifier. The full bridge rectifier is constructed by connecting four SR560 diodes together designated as D1, D2, D3 and D4 in the schematics. The cathode of D1 and the anode of D2 are connected to one of the secondary coils and the cathode of D4 and the anode of D3 are connected to the central ribbon. The cathodes of D2 and D3 are connected, of which one terminal is taken for rectifier output and the anodes of D1 and D4 are connected, of which another terminal is taken for full wave rectifier output.
A 0.1 uF capacitor (shown as C1 in the schematic) is connected across the output terminals of the full-wave rectifier for smoothing purposes. For voltage regulation, the LM317 is connected in parallel to the smoothing capacitor. A variable resistor is connected in resistive voltage divider configuration with the regulator IC for voltage adjustment and a 1 uF capacitor (shown as C2 in the schematics) is connected in parallel at the output to compensate transient currents. There is a diode connected between the input and output voltage terminals of the voltage regulator IC for short circuit protection.
Get the schematic diagram drawn or printed on paper and make each connection carefully. Only after checking each connection made correctly, connect the power circuit to an AC source.
How the circuit works –
The power circuit designed here takes input from the main AC sources and has the circuit assembled in the following steps –
1. AC to AC Conversion
2. AC to DC Conversion – Full Wave Rectification
3. Smoothing
4. Transient Current Compensation
5. Voltage regulation
6. Voltage adjustment
7. Short circuit protection
AC to AC Conversion
The voltage of the main sources is approximately 220-230 V AC, which needs to be stepped down to the 12 V level. To step down 220 Vac to 12 Vac, a step-down transformer with center strip is used. The use of the center tap transformer allows generating positive and negative voltages at the input, however only positive voltages will be extracted from the transformer. The circuit experiences some drop in output voltage due to resistive loss. Therefore, a transformer with a high voltage rating greater than the required 12V needs to be used. The transformer must provide a current of 1.5 A at the output. The most suitable step-down transformer that meets the mentioned voltage and current requirements is 12V-0-12V/2A. This transformer reduces the main line voltage to +/- 12 Vac, as shown in the image below.
Fig. 3: 12-0-12 V Transformer Circuit Symbol
AC to DC Conversion – Full Wave Rectification
The reduced AC voltage needs to be converted to DC voltage through rectification. Rectification is the process of converting AC voltage to DC voltage. There are two ways to convert an AC signal to DC. One is half-wave rectification and the other is full-wave rectification. In this circuit, a full wave bridge rectifier is used to convert 24V AC to 24V DC. Full-wave rectification is more efficient than half-wave rectification as it provides full use of both the negative and positive sides of the AC signal. In the full-wave bridge rectifier configuration, four diodes are connected in such a way that current flows through them in only one direction, resulting in a DC signal at the output. During full-wave rectification, two diodes are forward biased and two other diodes are reverse biased.

Fig. 4: Full Wave Rectifier Circuit Diagram
During the positive half cycle of the supply, diodes D2 and D4 conduct in series while diodes D1 and D3 are reverse biased and current flows through the output terminal passing through D2, output terminal and D4. During the negative half cycle of the supply, diodes D1 and D3 conduct in series, but diodes D4 and D2 are reverse biased and current flows through D1, output terminal and D3. The direction of current in both directions through the output terminal in both conditions remains the same.
Fig. 5: Image showing negative cycle in the Full Wave Rectifier

Fig. 6: Image showing positive cycle in the Full Wave Rectifier
SR560 diodes are chosen to build the full-wave rectifier because they have a maximum (average) forward current of 2A and, in reverse bias condition, can sustain peak reverse voltage of up to 36V. This is why SR560 diodes are used in this design for full wave rectification.
Smoothing
Smoothing is the process of filtering the DC signal using a capacitor. The output of the full wave rectifier is not a constant DC voltage. The rectifier output has twice the frequency of the main sources, but contains ripples. Therefore, it needs to be smoothed out by connecting a capacitor in parallel to the output of the full-wave rectifier. The capacitor charges and discharges during a cycle, providing a constant DC voltage as output. Thus, a capacitor (shown as C1 in the schematic) of high value is connected to the output of the rectifier circuit. As the DC that has to be rectified by the rectifier circuit has many AC spikes and unwanted ripples, to reduce these spikes a capacitor is used. This capacitor acts as a filtering capacitor that shunts all the AC through it to ground. At the output, the remaining average DC voltage is smoother and ripple-free. A 0.1 uF capacitor is used to smooth the AC signal.
Fig. 7: Smoothing Capacitor Circuit Diagram
Compensating Transient Currents
At the output terminals of the power circuit, a capacitor (shown as C2 in the schematic) is connected in parallel. This capacitor helps in quick response to load transients. Whenever the output load current changes, there is an initial shortage of current, which can be met by this output capacitor.
The output current variation can be calculated by
Output current, Iout = C (dV/dt) where
dV = Maximum allowable voltage deviation
dt = transient response time
Considering dv = 100mV
dt = 100us
In this circuit a 1 uF capacitor is used so,
C = 1uF
Iout = 1 u (0.1/100u)
Iout = 1 mA
In this way it can be concluded that the output capacitor will respond to a current change of 1 mA for a transient response time of 100 us.
Fig. 8: Circuit diagram for transient current compensation
Voltage regulation
LM317 is used for voltage regulation. LM317 is a monolithic positive voltage regulator IC. As it is monolithic, all components are built into the same semiconductor chip, making the IC small, with lower power consumption and low cost. The IC has three pins – 1) Input pin where maximum 40 V DC can be supplied, 2) Output pin which provides output voltage in the range of 1.25 V to 37 V and 3) Tuning pin which is used to vary the output voltage corresponding to the applied input voltage. For input up to 40V, the output can range from 1.25V to 37V.
There is an OPAM (operational amplifier) built into the IC whose inverting input is connected to the tuning pin. The non-inverting input is defined by a band gap voltage reference whose voltage is independent of temperature, power supply, and circuit load. Therefore, the LM317 provides a stable reference voltage of 1.25V at its tuning pin. The reference voltage of 317 can be from 1.2V to 1.3V. The output voltage of 317 can be adjusted within a defined range using a resistor divider circuit between the output and ground.
To set the desired voltage at the output of the LM317, a resistive voltage divider circuit is used between the output pin and ground. By the effect of this setting, the voltage at the output pin can be adjusted. The value of the resistive voltage divider needs to be chosen in such a way that it can provide the required voltage range at the output. The voltage divider circuit has a programming resistor which has one fixed resistance (shown as R1 in the schematics) and another is a variable resistor (shown as R2 in the schematics). By setting a perfect relationship between the feedback resistor (fixed resistor) and the variable resistor, the desired output voltage corresponding to the input voltage can be obtained.
The 317 provides a stable 1.25V reference voltage at the tuning pin. This means there is also a constant voltage drop across R1. The current at the tuning pin is also constant and is in the range of 50 uA to 100 uA. Therefore, a constant current flows through R1 as well as R2. Therefore, the sum of voltage drop across R1 and R2 gives Vout as follows –
Vout = Vref*(1+(R2/R2))
Some amount of quiescent current also flows from the tuning pin; this current adds some error term in the above equation which makes the output unstable. This is why the IC is designed in such a way that the quiescent current must remain in microamps to make the output stable.
Vout = Vref*(1 + (R2/R2)) + Iq*R2
Where,
Iq = quiescent current is the current that flows from the tuning pin when the circuit is not driving any load.
As Iq is 100 uA, the term Iq*R2 is very small and can be neglected in the equation.
The LM317 provides a minimum load current of 10mA. Therefore, to maintain a constant reference voltage of 1.25 V, the minimum value of the feedback resistance is
R1 = 1.25/Imin
R1 = 1.25 V/0.010 = 125 ohms
The range of variable resistor R1 is 125 ohms to 1000 ohms and the typical value of R1 is 220 ohms to 240 ohms for better stability. Using the above equation, the value of R2 can also be calculated.
The LM317 has the following tolerable power dissipation internally –
Pout = (Maximum IC operating temperature)/ (Thermal Resistance, Junction-Environment + Thermal Resistance, Junction-Enclosure)
Pout = (150) / (65+5) (values according to technical data sheet)
Pout = 2W
Therefore, the LM317 can internally sustain a power dissipation of up to 2 W. Above 2 W, the IC will not tolerate the amount of heat generated and will start to burn. This can also cause a serious fire hazard. Therefore, a heat sink is required to dissipate excessive heat from the IC.
Voltage adjustment
The output voltage can be varied using the tuning pin of the LM317 IC. The variable resistor R1 is used to vary the output voltage from 1.28 V to 11 V.
Short circuit protection
A diode D5 is connected between the voltage input and voltage output terminals of the 317 IC to prevent the external capacitor from discharging through the IC during an input short circuit. When the input is shorted, the cathode of the diode is at ground potential. The anode terminal of the diode is at high voltage as C2 is fully charged. Therefore, in this case, the diode is forward biased and all the capacitor discharge current passes through the diode to ground. This saves IC LM317 from reverse current.
Fig. 9: Circuit diagram for short circuit protection
Tests and precautions –
The following precautions must be taken while assembling the circuit –
• The rated current of the step-down transformer, bridge diodes and voltage regulator ICs must be greater than or equal to the current required at the output. Otherwise, it will not be able to provide the required current at the output.
• The rated voltage of the step-down transformer must be greater than the maximum required output voltage. This is due to the fact that the IC 317 experiences a voltage drop of around 2 to 3 V. Therefore, the input voltage must be 2V to 3V greater than the maximum output voltage and must be at the limit of the IC 317 input voltage. LM317.
• Capacitors used in the circuit must have a higher voltage rating than the input voltage. Otherwise, the capacitors will start leaking current due to excess voltage on their plates and will explode.
• A capacitor must be used at the output of the rectifier so that it can deal with unwanted noise from the mains. Likewise, the use of a capacitor at the output of the regulator is recommended to deal with rapid transient changes and noise at the output. The value of the output capacitor depends on the voltage deviation, current variations and the transient response time of the capacitor.
• A protection diode should always be used when using a capacitor after a voltage regulator IC, to prevent the IC from countercurrent during capacitor discharge.
• For high output load activation, a heat sink must be mounted in the regulator holes. This will prevent the IC from exploding due to heat dissipation.
• As the regulator IC can only draw current up to 1.5 A, a 1.5 A fuse needs to be connected. This fuse will limit the current in the regulator to up to 1.5 A. For currents above 1.5 A, the fuse will blow and this will cut off the input power to the circuit. This will protect the circuit and regulator ICs from currents greater than 1.5 A.
Once the circuit is assembled, it's time to test it. Connect the circuit to the main sources and change the variable resistance. Take voltage and current readings at the output terminal of the power circuit using a multimeter. Then connect fixed resistors as load and check voltage and current readings again.
At the output terminals the input voltage was 12 V and when adjusting the variable resistance, the output voltage was between 1.28 to 11 V when no load was connected.
After setting the output voltage to 11 V and connecting a 20 ohm load, the output voltage is read as 10.4 V and the output current is measured as 520 mA, so the power dissipation in the resistance load of 20 Ω is as follows –
Pout = (Vin – Vout)*Iout
Pout = (12-11) * 0.520
Pout = 0.52W
While testing the circuit, it was found that when the current demand increases at the output, the output voltage starts to decrease. As the current demand increases, the IC 317 starts to heat up and the IC experiences more sags, which reduces the output voltage. Although from the above practical experience, the power dissipation in the IC is within the tolerable internal limits, it is still recommended to use a heat sink to help cool the IC and increase its service life.
The power circuit designed in this project can be used as a constant current regulatory source or as an adjustable power supply from 1.25 V to 37 Vdc.
Circuit diagrams
| LM317_power_source | ![]() |
