SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By reklipz
#15170
OK, I've noticed that on a lot of the PCB's you can get from SFE, there are rather large capicitors on anything that has a 7805 regulator. Also, one of the tutorials said this was extremely common to see...

Seeing as how I use a 7805 regulator and (possibly) 2 LM317T regulators, and not a single capicitor, I was wondering If I should start using a cap, or two or three...

Anywho, I understand that the capicitors (termed decoupling caps), reduce noise from the power supply line, but I have no idea what sizes to use, and from what I got from the tutorial about the large cap, the bigger the better?

Now, I have 2 820uF 200V caps, and about 5 2200uF 16V caps (from a PSU that died on me....), so I've got some fairly large caps at my disposal if need be, lol (will it even work with these?!)

I guess, what I would like to know, is how to tell when caps are necessary, and how to decide which ones / how many / and in what configuration to use them.

Much thanks!
~Nate
By reklipz
#15176
OK, I feel like such an idiot now... If only I wasn't in such a hurry and did a quick search (although I did try this on "7805", and didn't find anything on capicitors...)

Here is pretty much what I was looking for:
http://www.sparkfun.com/cgi-bin/phpbb/v ... php?t=2401


Quick question though:
Wheelers post:
If you are doing something other than a straight-up digital circuit you will probably want to look at it more heavily before problems arise. Otherwise a general rule of thumb is a .1uF to decouple each VCC pin and 10uF near the regulator/voltage input for every 50 mA or so of current draw. Depending on the design, maybe a 1uF ceramic cap in to cut out some of the noise in the middle. As someone said above, they're dirt cheap and easier than sorting out noise problems later.

So, if I have say, a PIC, it would be a good idea to put a .1uF cap between the PIC's VCC and its Ground pins? (Is that correct?)

And, If I use a larger cap than say .1uF, is that gonna hurt anything, or should I stick as close as possible (if not exact...), I guess this is more so my question: for the input to the regulator, would an overkill cap really hurt anything?
By wiml
#15178
Decoupling capacitors are a slightly different thing from the capacitors that voltage regulators often have on their inputs and outputs.

Voltage regulators can be thought of as high gain amplifiers amplifying a constant voltage. And amplifiers have a tendency to oscillate, whenever you don't want them to. The voltage regulator's data sheet will often specify certain amounts of capacitance on the input and/or output of the regulator, in order to keep it in the region in which it was designed to be stable.
By reklipz
#15185
OK, well, way before I knew anything about anything, I purchased this overpriced POS from radioshack:
http://www.radioshack.com/product/index ... ab=summary

The packaging doesnt say anything but that one of its features are "Stable fixed output voltage"...

The datasheed for the 7805 here on SFE shows a .33uF cap on the input and a .1uF cap on the output. Would it be wise to do the same with the one from radioshack?

Also, on many of the Olimex programming boards, I've noticed the large capacitor on the input (looks like 220uF), and usually a diode, are these necessary?
By daemondust
#15186
Image

(Not that the "+" marks on the circuits are in no way polarization markings, they're the origin markings in Eagle Cad that I haven't figured out how to get rid of...)

The diode is to protect everything if you connect power backwards. If you plugged power in backwards on the first circuit above nothing would work, but you wouldn't destroy anything either. In the second circuit, everything still works fine, but you use three more diodes. The diodes form what's called a bridge rectifier, commonly used with a capacitor to convert AC to something close to DC.

The larger input capacitor is generally there to improve stability.
By wiml
#15201
It's always a good idea to check out the manufacturer's data sheet for things like this. Lots of people make 7805's, but National's data sheet for the LM78M05 shows a "typical application" with a 0.33 microfarad capacitor on the input and a 0.1 microfarad capacitor on the output. It says: "[Input capacitor] required if regulator input is more than 4 inches from input filter capacitor (or if no input filter capacitor is used). [Output capacitor] optional for improved transient response."

What's going on there is that the regulator can't deal with an inductive input, and 4 inches of wire is enough to make it inductive at high frequencies. So they recommend an input capacitor to swamp any inductance. Otherwise the regulator might oscillate.

The thing with analog circuitry, and power supply is definitely analog, is that you can't ignore frequencies you're not interested in. The components don't know that you're building an audio-frequency or DC circuit, and they'll happily start up a 300-MHz oscillation or something, and that'll screw up the rest of your circuit.

The output capacitor "for improved transient response" sounds like it really is just a decoupling capacitor, and not needed for stability. Still, it's probably a good idea, since digital circuitry puts lots of transients on the supply lines.

BTW, the "Stable fixed output voltage..." wording on the radio shack packaging probably means that the voltage won't drift over time or temperature. That's a good thing too, but it's a different kind of "stability" than "won't oscillate", which is what I'm taking about with the input capacitor up there.

You can probably put as large a capacitor as you want there. The only limit, besides bulk and expense, is inrush current: if you put a zillion-farad capacitor on your board, your power supply is going to struggle to charge it when first turned on. It'll be supplying a huge amount of current for a little while, and even then, the supply voltage might rise very slowly from 0 to 5v. That can confuse some microprocessors. The values recommended in the datasheet should be big enough to do the job, though.
By wiml
#15267
I happened to be reading the LM317-LZ datasheet today and noticed this paragraph, which reminded me of this thread:
Although the LM317L is stable with no output capacitors, like
any feedback circuit, certain values of external capacitance
can cause excessive ringing. This occurs with values
between 500pF and 5000pF. A 1µF solid tantalum (or 25µF
aluminum electrolytic) on the output swamps this effect and
[ensures] stability.