# 12V power supply with lm317

Status
Not open for further replies.

#### brq

##### New Member
Hi,

I'm supposed to build a circuit with a transformer. It's going to take 220V mains as the input and convert it to DC in a magnitude range of 1.25V to 12V. There shouldn't be any ripples in the output signal with an input of 176V to 264V. However my circuit starts to ripple around 230V when the input rms value is decreased from 264V. Also I cannot have steady display of the output signal on an oscilloscope. It vibrates up and down. When I try to measure it with a digital voltmeter it again won't give a distinct result. It keeps changing. I have been told that a reason to this failure would be the fact that I use a cable to connect LM317 to PCB and I have to shorten it.

What else can be the reason? Please tell me how to fix this.

#### MikeMl

##### Well-Known Member
Have you read the application notes section of the LM317 data sheet? Read the section on required capacitors. Also, read the data sheet where it talks about Dropout Voltage.

#### Hero999

##### Banned

What current are you drawing?

What's the primary and secondary voltage rating of the transformer?

It sounds like the secondary voltage of the transformer is too low or the filter capacitor isn't large enough.

#### brq

##### New Member
Output current is around 1A. Transformer rating is 220V/30V, 25W, but I am using it as a 220V/15V transformer with the middle terminal. I took a glance at the datasheet but i am going to read it carefully. And I thought 10000uF would be enough, isn't it?

P.S. Simulations were all fine but when I implemented the circuit it didn't go well.

#### Attachments

• 62.9 KB Views: 5,331

#### MikeMl

##### Well-Known Member
Problems: Filter cap is too small and the voltage sag on the filter cap drops below the Dropout Voltage of the LM317. Transformer secondary voltage is too low. By the time you allow for the forward drop of two diodes, the minimum voltage on the filter cap may be too low even if you make the cap bigger.

#### Hero999

##### Banned
Output current is around 1A. Transformer rating is 220V/30V, 25W, but I am using it as a 220V/15V transformer with the middle terminal.
15V is too low, 30V is too high.

176V is 80% of 230V

The LM317 requires the input voltage to be 3V higher than the output for the output voltage to be regulated properly.

The rectifiers will loose 2V.

You'll also want to allow for at least a Volt of headroom for ripple on the filter capacitor.

12+3+2+1 = 18V.

The RMS voltage will be 18/√2 = 12.7V so the output voltage from the transformer must be over 12.7V when the primary is 176V.

The primary is rated to 220V, the secondary must be rated to:
12.7/ .8 = 15.9V

The nearest standard voltage is 18V.

Now when the primary voltage is 176V the secondary voltage will be 14.4V.

I took a glance at the datasheet but i am going to read it carefully. And I thought 10000uF would be enough, isn't it?
10,000µF should be enough.

So lets calculate the maximum allowable ripple:

The peak voltage is 14.4√2 = 20.36V

20.36 - 15 - 2 = 3.36V

Calculate the capacitor size:

$C = \frac{10000 \times I}{V_{ripple}}=\frac{10000}{3.36} = 2972 \mu F$

The nearest E6 value is 3300µF but 10,000µF is much higher and higher is better.
What's the maximum voltage on the capacitor?

264 is 120% of 220V

The voltage at the secondary will be 18×1.2 = 21.6V

Peak voltage = 21.6V×√2 =30.5V

The transformer's output will increase by 10% when off load:

30.5×1.1 = 33.55V

So make sure the capacitor is rated to at least 35V.

With a 30V transformer the secondary voltage will be too high for the LM317 when it's set to low voltages and with a 15V transformer the voltage will be too low to avoid ripple.

P.S. Simulations were all fine but when I implemented the circuit it didn't go well.
Did you simulate it with a 1A load and vary the primary voltage of the transformer?

Last edited:

#### brq

##### New Member
I just simulated it with a 1A load and it ripples around 220V. I suppose I never paid attention on this. Do you think I should by another 220V/18V transformer?

#### Hero999

##### Banned
Yes, that's what I've just said.

Also don't trust simulators too much, real life components have tollerances and your simulator might not account for that.

#### brq

##### New Member
OK, I'll do that. Thank you for your assistance.

Status
Not open for further replies.