LM317 has a maximum input voltage of 40v but you really shouldn't go higher than 37-38v.
When you rectify the output of a transformer using a bridge rectifier, you'll have a DC output with a peak voltage of Vac x 1.414. Depending on the current amount, there will be a voltage drop on the rectifier of about 1v - 2.2v (two times the voltage drop on one diode in the rectifier, the voltage drop varies with the current going through the diode and you have a graph in the datasheet for that rectifier).
You also have to be careful when choosing a transformer because at low currents, the output of a transformer will be higher than its specified rating by 5-10% usually, but it could be much higher especially if the transformer is small (has a low VA rating).
For example, if you go with a 24 Vac transformer rated for 75VA, that means that after rectification you may have as dc voltage with a peak that can be as little as 24x1.414 - 2x1.2v = ~ 31.5v and as much as ( 24v + 10% ) x 1.414 - 1v = about 35.2v
The maximum current this 75VA transformer will be able to provide can be approximated with the formula Current = 0.62 x 75VA / 24V = 1.93A, which is cool because LM317 can output a maximum of 1.5A so we know this 75VA is more than enough.
Now keep in mind, after rectification you have a dc voltage that has a lot of waves, it's not smooth. You need some capacitor after the rectifier which will make sure there A MINIMUM voltage all the time feeding the linear regulator:
Your input capacitor is close to useless, it's much too small. You can approximate the capacitance required using this formula : C = Current / (2 x FrequencyAC x Vripple) where FrequencyAC is your mains frequency and Vripple is how many volts you're willing to let the voltage go down from the peak voltage.
With my example, after rectification there's a voltage that can have a peek at about 31.5v in the worst case, so I use that. Let's say I want the LM317 to be able to output smooth 24v DC.
The LM317 needs to have the input voltage higher than the output voltage by about 1.5v -2v, depending on how much current it outputs. See page 5, figure 10 here :
http://www.onsemi.com/pub_link/Collateral/LM317-D.PDF You have there a graph... at 1.5 A that will be the maximum current I want and at about 100C (the temperature of the regulator, seems much but you'll see it can happen), the voltage drop will be about 2v.
So the input voltage has to stay always 2v above the maximum output voltage I want, 24v.
You can now go back and do the math. You have peak voltage of 31.5v, you want a maximum of 24v DC so you need the minimum voltage to always be 24+2 = 26v. This means your Vripple will be 31.5v - 26v = 5.5v
Assuming a frequency of 60Hz (replace with 50Hz if you're in Europe or some other countries using 220-240v 50Hz) then you can approximate the capacitor with the formula I already mentioned:
C = Current / ( 2 x Fac x Vripple) = 1.5A / 2 * 60 * 5.5 = 1.5/660 = 0.002272 Farads or about 2272 uF. So you need at least 2200uF to keep the voltage above 26v.
What voltage rating should the capacitor be? Well, normally you would think 35v rated capacitor will be enough because the maximum calculated voltage was 31.5v but now you know that at low currents both the transformer and bridge rectifier will work better (transformer outputs more, bridge rectifier has smaller losses) so you may have over 35v at low currents, therefore you should use a 50v or 63v rated capacitor.
Now you may think you're solved all the problems, but you'd be wrong.
See, linear regulators output a stable voltage by throwing away the difference between the input voltage and output voltage as heat. No matter how big of a heatsink you have, there's only so much surface through which heat can move away from the linear regulator, and too much heat will either burn the regulator, or will make the regulator stop working until it cools down.
Most linear regulators have some degree of thermal protection, and will stop working completely or behave erratically when they get too hot.
Let's check again the LM317 datasheet from On Semi that I linked above:
http://www.onsemi.com/pub_link/Collateral/LM317-D.PDFIf you go on page 2, you will see there an interesting line in that table:
Maximum Output Current
VI?VO <= 15 V, PD <= Pmax, T Package Imax = 1.5A minimum , 2.2A maximum
VI?VO = 40 V, PD <= Pmax, TA = +25C, T Package Imax = 0.15 minimum , 0.4 A maximum
and there's a note there at the bottom that says Pmax = 20w.
This basically says that the minimum 1.5A of current output is only guaranteed if the voltage difference between input and output is smaller than 15v and if the power dissipated is less than 20w.
In my example, the voltage regulator always has 26v or more at the input.
If I want to output 5v and what I connect to the power supply uses 1A, this means that there's a voltage difference of 26-5 = 21v and there's a power dissipated of (26v - 5v ) x 1A = 21w. Not only is my voltage difference bigger than 15v, the power dissipated is also larger at 21w.
Simply put, the linear regulator won't be able to provide 1A without overheating itself, no matter what heatsink you may use.
Another example, let's say I want 15v out and 1.5A ... I have 26v at the input in worst case, so voltage difference will be 26-15= 11v (which is ok) and the power dissipated will be (26-15) x 1.5 = 16.5w. This will work, but it's very close to the maximum permitted.
So how can you get around this issues, to have your power supply output anything between 1.25v and 24v DC without any issues?
Well, a very common and simple solution is to use a transformer with a center tap or two secondary windings. When you want low voltage, you flip a switch and connect just one half of the secondary side of your transformer, when you want big voltage you connect both secondary windings:
backup image, click on this one to view full size for example :
Note that I also suggested some other improvements. The fixed resistor for example is better to be lower at around 100-120 ohm, in some situations and depending on who made the chip, 220ohm can be too high. 100-120 ohm is better. The potentiometer you listed in schematic is too big so you won't be able to fine tune the output voltage well.
The output voltage is set by formula Vout = 1.25 ( 1 + R / Rfixed) or R = (V out / 1.25 - 1 ) * Rfixed so for 100ohm fixed resistor, if you want 24v DC out then the pot will be at R = (24/1.25 - 1) x 100 = 1820 ohm. Basically, if you use a 100k pot, you barely twist the knob a few degrees and you're already at maximum voltage. Use a 5k or 10k pot in worst case scenario.
But let's get back to the modification.
With the switch set to use just one half of the 24v AC transformer, you'll have 12v AC rectified to DC, so you'll have 12 x 1.414 - 2v (on rectifier, average) = 15v.
You have the formula C = Current / 2 x Fac x Vripple which can be rewritten to Vripple = Current / 2X Facx C so for 2200uF you have Vripple = 1.5A / 2 x60x0.0022 = 1.5/0.352 = 4.26v so that means your input voltage will be between 11.75 and 15v which in turns means that your lm317 will work just fine to output between 1.25v and 11.75-2 = 9.75v. Let's round it up to 10v.
Now you have 10v @ 1.5A max with switch on one winding, 24v @ 1.5A max with switch on both windings.
If we want 5v @ 1A , now the regulator will only waste (15v - 5v) x 1 = 10w and the voltage difference is only 10v.