Voltage Regulators and Capacitors (LM317)

Can someone explain (in not too complex language) what the purpose is of the capacitors on the sides of the regulator?

For example, this schematic, the .01 and 1uf http://www.electronics-lab.com/articles/LM317/

I have another schematic that uses 100uf on the left and 10uf and .1 uf on the right.

Ultimately I want to produce 3.3v for a shield, and I am trying to understand the point of the capacitors and what values I would really want.

Capacitors near power supplies are almost always to smooth out any surges that your circuit produces. A digital circuit switches from HIGH to LOW, from current draw to nothing, very quickly, very often. This ends up causing the overall supply voltage to brown-out or spike. These brown-outs or spikes can damage or confuse the digital circuits in their next working steps. Capacitors absorb spikes and fill in brown-outs. The sizes of the capacitors are tuned to the range of frequencies seen in the likely fluctuations.

In addition to the digital transients from other devices in the circuit (these are why you see 0.1uF caps recommended near the Vcc pin on digital ICs, like the ATmega), the regulator itself generates some switching transients.

To apply a plumbing analogy, have you ever turned the water off quickly and heard the pipes thump? The flowing water has inertia, and the thump is the water slamming the pipes around as it comes to a sudden stop. If you've got a good plumbing system, there's a device with some air in it (water hammer arrestor?) that absorbs that pressure spike to keep the pipes from rattling. A capacitor in a DC circuit fills the same role - it provides a bit of current for a sudden demand, or absorb some if there is a spike due to a sudden lack of demand.

The values of the caps relate to the frequency of the switching. Each regulator will recommend values suited to its design. Use whatever the datasheet for your regulator recommends unless you have reason to change.

-j

LM317 is a linear regulator.
The capacitors make the circuit stable i.e. fulfil its control laws.

The simpler description is that the power supply will have a very high risk of oscillating, i.e. generate a superimposed AC signal on the DC.

Magnus

Ok, thank you, that helps. So I am trying to understand why these two designers used different cap values on the sides of the same voltage regulator:

http://www.electronics-lab.com/articles/LM317/ (.1 and 1)

http://www.sparkfun.com/datasheets/Prototyping/Breadboard-PowerSupply-v2.pdf (100uf and 10uf / .1uf)

The spec for the unit specifies .1 and 1 (http://www.national.com/mpf/LM/LM317.html), and then has a note of "Normally, no capacitors are needed unless the device is situated more than 6 inches from the input filter capacitors in which case an input bypass is needed. An optional output capacitor can be added to improve transient response. "

So why is sparkfun putting such larger values on it, is that to protect from the unknown possible spikes or transients since he is selling a generic power supply?

You can normally not error on the high side of the capacitance.

If the capacitors are too far away will the time delay in the board to the capacitors make the system unstable.

Magnus

Not sure what SparkFun's design decisions may have been.

A large capacitor can act like a battery, to keep the voltage from dropping in the event of a sudden demand. An extreme case of this is a "supercap", which is a large value (e.g. 1F) capacitor that can act as a battery for short periods of time. Someone posting to the forums was experimenting with using one of these to power their arduino long enough to save some values to EEPROM when the power failed.

I saw one design for a regulator feeding a device that needed very clean , stable power. I think it had 6 or 8 capacitors of various values on the Vcc line.

-j

-j

Without knowing the exact characteristics of both the source voltage supplying the regulator and the load circuit(s) there is no 'perfect' capacitance configuration. Vendor's regulator chip data sheets show suggested general recommendations, but results can vary because of effects beyond the regulators domain.

After the fact analysis is best done using a scope under actual operation. Putting .1mfd caps across the Vcc and Vss terminals of all IC devices is very good insurance against random circuit load noise from causing problems, especially for high speed digital devices, as they draw current in high frequency pules rather then acting like constant DC loads.

Lefty

Normally when you power a "board", the board itself will have some bypass caps to handle some surges from the individual chips on the board. There's usually a moderately large cap for the whole board, at least one small cap (~100nF) for each chip, and maybe a mid-sized cap for each "handful" of chips.

As a "protoboard supply", I suspect that the sparkfun schematic is providing some of these bypass caps "for the board", beyond what is (or might be) needed by the regulator circuit itself...

If the capacitors are too far away will the time delay in the board to the capacitors make the system unstable.

No we are talking about power supply decoupling here and this normally can't be too big. Read my tutorial on it.

http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Note that if you do want to get very silly with very very large values of capacitors you might make the start up rise time of the power supply slow which could upset the reset circuit but we are talking really silly values.