Are de-coupling caps always needed? - Page 1
Forum section: electronics / beginners

author: level6
author_rank: Regular Contributor
timestamp: December 19, 2019, 06:29:24 pm
content: If I'm using an opamp for a very low frequency application, i.e. a voltage comparator, do I always need supply de-coupling capacitors at the opamp device? I already have de-coupling at the power supplies for the board I'm working on.

author: iMo
author_rank: Super Contributor
timestamp: December 19, 2019, 06:34:35 pm
content: Yes.

author: tggzzz
author_rank: Super Contributor
timestamp: December 19, 2019, 06:39:10 pm
content: You need to be an expert to predict when you don't need decoupling caps, and even experts don't get it right all the time.The frequency of your signals is usually irrelevant; what matters is how your particular opamp in your particular circuit interacts with the inductance in the power leads and other "parasitic" capacitances. To make it simpler: if you use a 200MHz opamp for a 1Hz signal, then it may well oscillate at several tens of MHzOld engineering adage: "amplifiers oscillate, oscillators won't".

author: AG6QR
author_rank: Frequent Contributor
timestamp: December 19, 2019, 06:40:25 pm
content: If you're using an op-amp as a comparator, the transitions from one state to the other may contain high frequency components, even if the transitions don't happen often.There are multiple reasons why a comparator is better for the task than an op amp, but that's for another thread.If there are truly no high frequency components in the input or output of the op amp, you may be able to do without the decoupling caps right near the chip. But follow the data sheet, or deviate from it at your own risk.

author: ejeffrey
author_rank: Super Contributor
timestamp: December 19, 2019, 06:44:24 pm
content: Basically decoupling of low speed low density parts like most opamps and discrete logic is done by convention as it isn't usually worth the effort to figure out what you really need. For high speed/density parts like big FPGAs or SOCs, or very high speed amplifiers you need to be more careful.The part speed matters more than the signal. A high speed opamp needs better bypassing even if the signal it sees is relatively slow. It also depends on what else is in the circuit, how far away your "bulk" capacitors are, and how you are using the part, and what your requirements are.Bypass capacitors are also important for EMI, so your circuit may work properly but radiate a lot of excess noise on the power supply wiring, which you may or may not care about.So your circuit will probably work without local bypass. Is it worth your effort to figure that out vs. just putting capacitor there?

author: schmitt trigger
author_rank: Super Contributor
timestamp: December 19, 2019, 06:48:23 pm
content: And ceramic capacitors are cheap, I mean, really cheap.Won't hurt if you added a 0.1uF/16v X7R that is not really required.

author: tggzzz
author_rank: Super Contributor
timestamp: December 19, 2019, 07:41:10 pm
content: Quote from: AG6QR on December 19, 2019, 06:40:25 pmToo many people don't realise that.Here's one set of measurements that "validate" the theory:https://entertaininghacks.wordpress.com/2018/05/08/digital-signal-integrity-and-bandwidth-signals-risetime-is-important-period-is-irrelevant/

author: level6
author_rank: Regular Contributor
timestamp: December 19, 2019, 07:43:12 pm
content: Thanks for everyone's input!I see it is a unanimous "YES" :-)

author: CatalinaWOW
author_rank: Super Contributor
timestamp: December 19, 2019, 10:34:00 pm
content: I'm going to add to the yes votes by saying that the pedagogical answer is no. You don't always need them. But the analysis to prove that you don't is difficult, and often results in the answer that they really are needed. And as stated before the decoupling caps are really cheap. And have fringe benefits in reducing susceptibility to power line spikes and the like. If you aren't insanely pushed for space or cost use decoupling caps.

author: mcovington
author_rank: Regular Contributor
timestamp: December 20, 2019, 12:31:16 am
content: Opamps need them more than most kinds of circuits.Wasn't there an EEVBLOG video, or somebody's video, about how digital circuits don't need one on every chip? But opamps do.

author: David Hess
author_rank: Super Contributor
timestamp: December 20, 2019, 03:10:54 am
content: It depends on the parts involved and the loads and the circuit layout. Slow parts, meaning low gain-bandwidth product parts, have low di/dt (slow change in current over time) so inductance in the supply connections has less of an effect and decoupling can be located further away, possibly at the power supply. A circuit using 4 LM324s over 8 square inches could likely get by with just a 1 microfarad tantalum or 10 microfarad aluminum electrolytic capacitor across the supply pins our regulator's output.

author: JustMeHere
author_rank: Frequent Contributor
timestamp: December 20, 2019, 04:08:39 am
content: What do decoupling capacitors do? They provide a shorter path for your current to set up.When you create a signal current, as it flows down you trace, a return current must be set up at the exact same time. This return current is essentially the magnetic field. So before your signal current can move down the trace, the magnetic field must be set up between your positive charge and ground. The more distance the current moves through the longer it takes to set up. Two ways to address this are to run your positive and gnd trace next to each other, or -- even better -- have a big copper plane under your trace. The closer the return path and the signal path, the less time it takes for the magnetic field to set up.When the term frequency is used, it does not always mean what you see in a sine or square wave. It has to do with the edge time. Picture a square wave that is switching between 0 and 1 at 1 MHz. In order for the signal to get from 0 to 1 fast enough for it to happen 1 million times a second, the rate at which the voltage needs to change must be fast enough. On your oscilloscope, your frequency counter will see the 1 MHz signal. Now let's change our square wave into just a single transition from 0 to 1. The rate of that transition will still be the same. Now the signal doesn't transition back to 0, your oscilloscope will not see a frequency. The transition did happen and it happened at the same speed of a 1 MHz signal. Thus it is important to consider the speed of the step edge when you are thinking about frequency.So what does the decoupling capacitor do? It provides a very short path down to the ground plane. We have heard the term "capacitors pass AC and block DC." AC is changing current and DC is steady current. The current from the magnetic field passes through the capacitor. Since the capacitor is close to your IC, is small, and connects to the ground plane the magnetic field can do this much more quickly then if the field has to "reach" around the board to set up. Since the magnetic field sets up more quickly, the decoupling capacitor allows your signal to change more quickly. Inductance is reduce and we know high frequency currents take the path of less inductance.Since the magnetic field sets up more quickly, it also had to spread out less in order to set up. Most of the magnetic field is between the trace and the ground plane. This "loop" to the gnd is very small. If field has to set up across the board (because there is no close return path) then the magnetic field of the ground loop will set up between the trace and the ground point. It will travel through everything in between. So reducing the size of the loop by using the decoupling capacitor, you also reduce the size of the ground loops and the amount of magnetism radiated across the board. This reduces noise. So decoupling capacitors also reduce the noise that your changing current creates.I've mentioned ground plane in this explanation. If you don't have a ground plane and use traces to provide the gnd, then the shape of your traces is important. If your grd trace follows your signal trace it acts much like the gnd plane. The size of the capacitor (distance between the terminals) will be most of the distance between the traces. If you route your gnd trace around the board, and away from the signal trace, then the distance between traces becomes more significant than the size of the capacitor. This effectively removes the benefit of the decoupling capacitor. So if you are not paying much attention to your return path, decoupling capacitors might not beneeded.This response is getting too long, so I will stop here. I may not be 100% correct, but I believe I am close. The important thing to understand is that the 100nF high frequency decoupling capacitor helps the magnetic field's establishment time and reduces the field's size, and this works if you keep you ground loops small.

author: SL4P
author_rank: Super Contributor
timestamp: December 20, 2019, 08:47:21 am
content: QuoteIs that a SHORT circuit ?

author: TimFox
author_rank: Super Contributor
timestamp: December 20, 2019, 02:11:18 pm
content: Unless the manufacturer's data sheet specifies otherwise, the most important bypass cap on an op amp is between the positive and negative power pins, by as short a path as possible. This is a nuisance, since they are usually on opposite ends of the part. The next most important cap is between the power pin from which the output voltage is generated (usually the negative pin) and ground. Of course, single-supply op amp circuits usually ground that pin directly. If you give a feedback amplifier an excuse to oscillate, it will take it.

author: level6
author_rank: Regular Contributor
timestamp: December 20, 2019, 04:33:56 pm
content: Quote from: TimFox on December 20, 2019, 02:11:18 pmWouldn't you want a cap on the positive supply also, in the case of dual rails?

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 20, 2019, 06:59:25 pm
content: Quote from: tggzzz on December 19, 2019, 06:39:10 pmI vote this answer as the forum winner for the day!

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 20, 2019, 07:32:48 pm
content: Quote from: Wimberleytech on December 20, 2019, 06:59:25 pmYep. We can explain why -- but honestly, it's not an explanation the beginner will get much use out of, so it's just as well to leave it well-enough-alone, as above...It's not something you need to take on faith, but it's also not something that can be explained instantly. The gap between must be bridged with knowledge.(So of course, I'll go on to explain, fully expecting the zooming "over my head" sounds from readers. I know, sorry.)In short, the problem is not just transient (see above examples, like use as a comparator), but dynamic. It is a problem of stability.The amplifier responds to differences in voltages, not just between its inputs proper, but between its power pins as well (this is measured as PSRR, Power Supply Rejection Ratio).We can make the amplifier proper, into an oscillator, by connecting a feedback circuit between its input and output.Well, if the power pins act as inputs as well, we can also construct an oscillator by connecting a feedback circuit in its power pins. The power pins are both input and output, so it's not obvious if we can get lucky enough for this to oscillate -- but, just whether it's possible, absolutely.In fact, transient reasons aren't very interesting to general purpose op-amps: the output might change state in microseconds, and might deliver tens of mA in that time. That's a slew rate of 10mA/us. Current rate times inductance equals voltage drop. The inductance needed for a significant voltage drop (say 1V) is a whopping L = V / (dI/dt) = 100uH. That's alongpower cable (about as many meters, give or take)! And that would just be a momentary dip, it might not necessarily oscillate.The trick is, an amplifier might oscillate in the low MHz, and combined with stray capacitances of nF to uF, we can end up with an accidental feedback network that makes the power supply oscillate. This is plausible in breadboarding situations. This is the most likely failure condition, I think.In lieu of a complete analysis, the best preventative against this situation, is probably a nice little electrolytic capacitor, say 1-10uF, across the supplies. This is better than a film or ceramic cap of the same value, because the electrolytic has adequate ESR to dampen oscillations in most cases. Additional bypass (usually local to other chips) can be, say, 0.1uF ceramic or whatnot.Tim

author: tggzzz
author_rank: Super Contributor
timestamp: December 20, 2019, 07:51:33 pm
content: Quote from: Wimberleytech on December 20, 2019, 06:59:25 pmAnd don't ignore the rest of the sentence, viz " and even experts don't get it right all the time."Plus the obligatory dig: solderless breadboards suck (time and willpower), Manhattan construction rulez.

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 20, 2019, 07:55:31 pm
content: Quote from: T3sl4co1l on December 20, 2019, 07:32:48 pmPerhaps you misunderstood my reason for voting the comment as winner. That answer conveys the complexity of the problem in the fewest number of words so I felt it deserved accolades.I was not being pejorative.

author: iMo
author_rank: Super Contributor
timestamp: December 20, 2019, 07:59:06 pm
content: Quote from: imo on December 19, 2019, 06:34:35 pmImagine an eevblog thread would finish that way

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 20, 2019, 08:35:49 pm
content: Quote from: Wimberleytech on December 20, 2019, 07:55:31 pmI didn't feel my response was calling out pejorativeness? I agree, and basically my response stands as a far less optimal example.Tim

author: David Hess
author_rank: Super Contributor
timestamp: December 20, 2019, 09:21:12 pm
content: Quote from: TimFox on December 20, 2019, 02:11:18 pmIt is more complicated than that because decoupling depends on the current return path from the output which can go to either the positive or negative supply. Analog devices published an excellent application note included below which shows the details of what is going on.

author: JustMeHere
author_rank: Frequent Contributor
timestamp: December 21, 2019, 01:10:35 am
content: Quote from: SL4P on December 20, 2019, 08:47:21 amNo. Look up displacement current, and watch Dave's video on capacitors passing AC current. And Yes (whoops), after watching the video to the end, you're right too. As the capacitor is charging, it is a short circuit.

author: Jwillis
author_rank: Super Contributor
timestamp: December 22, 2019, 05:16:07 am
content: I have a noob question about decoupling caps on op amps . I read somewhere that aside from one at each rail tied to ground it was suggested to put one from rail to rail as well right close to the op amp . Is that really necessary?Another question is since I'm running the ones I have (OPA445) at +55V and -15V I can't find any ceramics for that voltage. Higher voltage polys would work just as well right?

author: David Hess
author_rank: Super Contributor
timestamp: December 22, 2019, 05:23:52 am
content: Quote from: Jwillis on December 22, 2019, 05:16:07 amThe application note from Analog Devices that I included in my earlier post covers what is required and why. For a dual supply, sometimes the third capacitor is used to further reduce impedance when the load is attached to a supply rail instead of ground. A load might be connected this way to keep its return current out of a sensitive ground circuit.Quote100 volt ceramic capacitors are common but plastic film capacitors work fine also.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 22, 2019, 11:45:18 am
content: Two capacitors in series are equivalent to one capacitor of, essentially, the same overall component length.If that length is adequate for the amp's stability, it won't matter if it's delivered from one up close, or one at a modest distance (lead length), or two (or more) in series (having the same overall lead+component length).Tim

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 22, 2019, 03:23:15 pm
content: Quote from: David Hess on December 20, 2019, 09:21:12 pmExcellent article. The key takeaway is that you need to see what the manufacturer recommends unless you have the skill to peer inside the architecture and figure it out on your own. Quite often, though, the details of what is inside is not published, so again, follow the recommendations of the manufacturer.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: December 22, 2019, 05:24:36 pm
content: When i started i thought the same : i already have a cap at the PSU so its good.Then i found out : your ICs can also make the power line dirty, fast logic can give noise back to the power line.From now on i have all ICs a 100n ceramic cap, and no ceramic at the power supply, only a big elko.By example a optocoupler i place the 100n not close to the IC, instead i make sure the optocoupler-resistor is also behind it, as close as possible ofcourse.

author: David Hess
author_rank: Super Contributor
timestamp: December 22, 2019, 05:32:47 pm
content: Quote from: Wimberleytech on December 22, 2019, 03:23:15 pmThe situation is not quite that dire. Almost all outputs are either uncommitted to one power rail (open collector/drain/emitter) (1) or totem-pole to both. The designer gets to choose whether the load terminates into ground or one of the supply rails so can know exactly what the current return path is.(1) I have never seen an open source output but ECL is open emitter. The LM311 comparator can be configured as open collector or open emitter.

author: exe
author_rank: Unknown
timestamp: December 22, 2019, 08:10:31 pm
content: Some opamps can oscillate internally, like ne5532, or many hi-speed opamps.As of "signal frequency", there is enough EMI around...One can try to get away with old and slow opamps such as tl072 or lm358 that work well on a breadboard with long wires and without decoupling, but even then I'd add decoupling for better signal integrity.