Proposed tutorial on Decoupling

De-coupling

Once you get more than a handful of active components together you need to de-couple the power supply. What this is, and why, is described here.

The problem

When an otherwise good design works, but is erratic, unreliable or just goes crazy then nine time out of ten it is the power supply de-coupling. And you will find that the tenth time, turns out to be power supply de-coupling as well. So what is it, and why is it needed?

Basically when an integrated circuit works it works by switching current on and off. This switching happens very rapidly. Each time the current changes the voltage changes as well. This is because of the fact that everything has a resistance, even wire and copper traces on a printed circuit board have resistance. It’s not a very big resistance but it doesn't have to be. A changing current passing through a resistance will produce a changing voltage across it. Now consider a chain of several ICs being powered:-

shapeimage_10

As the current changes in ICA the voltage supplying that IC also changes, what is worse the voltage supplying all the ICs changes. But it gets worse, as ICB works its current changes and that also causes the voltage to vary on the other ICs and so on. In fact the voltage supplying the ICs is changing very rapidly due to the contribution of all the ICs in the circuit. The switching in an IC happens very rapidly so this voltage variation is very rapid or at a high frequency. The more rapid the circuit switches the higher the frequency of this voltage variation on the power supply, this is called noise, but another way of describing it is to say that the individual parts of the circuit are coupled together. Things can get so bad that the noise can stop a circuit from functioning correctly. It is to get rid of this noise that we have to de-couple the power supply. Essentially getting rid of the noise is easy, at least conceptually simply put a capacitor across the supply to smooth out the supply or filter the noise out.

Practicalities

If you look at the frequency spectrum of this noise you will find that it has a wide range so you might think it is easy to filter it out, just use a large capacitor. Unfortunately it is not as easy as that. A capacitor looks like a low resistance for high frequencies, the higher the frequency the lower it looks. The capacitive reactance (or XC ) is the name we give to the resistance of a capacitor for an alternating signal, this frequency dependent "resistance" is also known as an impedance. It is given by this formula:-
shapeimage_1

Where F is the frequency in Hz C is the capacitance in Farads. So a practical first approximation to a solution is use a 0.1uF or a 0.01uF capacitor like this one across the supply of each chip. It is much much better than nothing.
Ceramic Cap

Don’t just ignore that formula, look at it for a moment. It is a reciprocal, that is it is one over something. This means that the bigger things are on the bottom of the fraction the smaller the other side of the equation gets. But while it can get small it will never get to zero. You will see the bigger the capacitance the more of a short it look like, also the higher the frequency the more of a short it look like. Great so all we need to do is put in a big capacitor and that will remove all the high frequencies. Well sorry no, life is a bit more complex than that.

Inductance

As well as everything, like wires, having a resistance they also have an inductance. That is everything acts like a coil as well. An inductor is the reverse of a capacitor, It looks like a very high resistance to an alternating signal. The effective resistance to an AC signal is called the inductive reactance (or XL) and is given by:-

shapeimage_2

Where F is the frequency in Hz L is the inductance in Henrys.
Note that it is very similar to the capacitive reactance only its not a reciprocal. That means the bigger the frequency and inductance gets the higher the effective resistance is. Here is a plot of reactance against frequency for some real capacitors with a large values.

shapeimage_11

So why does this matter? Well every capacitor has also an associated inductance and the total resistance presented to an alternating signal is the sum of them both. So over a frequency range one goes down and the other goes up. The practical upshot is that for a given capacitor it only filters noise up to a certain frequency. This is known as the “self resonant” frequency of a capacitor at at any frequency above its self resonance the component looks like an inductor and is doing nothing to remove noise from the supply. The lowest point on the graph above is this self resonance frequency.

You will also see from the graph above it is not always the largest or smallest capacitor that has the best high frequency effect.
The graph below shows both capacitive and inductive reactance for several different values of capacitor but all having an inductance of 1nH. These are theoretical curves.

shapeimage_12

In the case of large electrolytic capacitors a high inductance is produced due to the way it is built, as a sandwich of metal foil and insulator, all rolled up, this is a lot like a coil. However for small ceramic capacitors the biggest cause of inductance is the components leads. To maximise the effects these must be as short as possible.

For effective supply de-coupling that frequency has to cover as wide a range as possible and certainly the range of noise being generated by the circuits. So this is why we often see two different values of capacitor used in parallel. One large one to filter out the low frequency variations and a small on for the high frequency noise. Typical values are 47uF and 0.1uF or 0.01uF (10nF) and as low frequency variations are system wide you tend to need only one large capacitor. However, high frequency noise is no so easily suppressed and so you tend to need a small capacitor on every, or every other chip. The type of capacitor construction that produces the lowest inductance is the ceramic type and those are always used for the smaller capacitors.
The lead from the circuit board to the capacitor body can produce a lot of inductance so it is important that this is as short as possible. Surface mounting capacitors are ideal in this respect and are to be preferred if practical. Modern IC designs often have the positive supply and ground pinned out next to each other to make this de-coupling especially effective.

shapeimage_13

The way this is drawn indicates that the capacitors are close to the IC and the supply is fed to the capacitor before being passed on to the next IC. For smaller circuits you would probably get away with a de-coupling capacitor every other IC but professionals do de-couple every IC. In general I try to aim at at least half the number of de-coupling capacitors as ICs and if there is an especially heavy current IC I will often throw in another large electrolytic.

There are occasions when you require more isolation with particularly sensitive circuits like oscillators or A/D converters for example. Here I would use a series resistor to boost the isolation for that chip alone. This helps to isolate it from the rest of the chain, and is shown in the circuit below.

shapeimage_14

This has the disadvantage of reducing the supply impedance and increasing the noise for heavy currents.

For the ultimate in de-coupling use a small choke or inductor as well. This is called a Pi filter because the circuit resembles the Greek symbol for Pi π. The inductance value is not too critical, but generally as big as you can manage, a few tens of mill Henrys is normal. This is useful if the load generates a lot of noise. Not only does this protect the load from noise it also prevents noise generated by the load from getting into the rest of the circuit.

shapeimage_15

This arrangement would be especially suited to the case where the load was not an IC but a motor. Motors can generate so much noise on the supply that a single one can cause an Arduino to reset. Larger capacitors after the choke can also help in those situations.

shapeimage_16

As motors draw a lot of current these can often be several hundred micro Farads. Note any motor should have a flyback diode across it. This is easy if the motor only has to run in one direction, just a single diode with its cathode to the supply and anode to the other end of the motor. But in the case where the motor can run in either direction a more complex arrangement of four diodes need to be used. But that is for another tutorial.

In Conclusion

Decoupling is more of an Art than a Science. While the component values used here are typical they are not guaranteed to work in every case. You might need larger electrolytic capacitors when the current is larger or you can get away with smaller ones when the current is lighter.

Remember it is always better to fix a problem "at source", that means concentrating of the cause of the interference rather that mitigating the effects of it on the rest of the circuit. For example switching heavy or high voltage loads might require snubber circuits to reduce the rate of voltage with time. In other words to slow down the voltage rise and so reduce the interference.

11 Likes

Compliments on the writeup. First time I saw a crisp description why you sometimes see two caps in parallel.

Can you get self resonance with the inductor capacitor combo, or is that something entirely different?

1 Like

Any component, capacitor or inductor can have self resonance. It is the point when a capacitor starts to look like an inductor like I said.

But it also applies when an inductor starts to look like a capacitor, because as inductors are a winding on a core it will have a capacitave value because the windings are like parallel plates on a capacitor. There are special ways of winding a coil so that this is nullified, but we are only talking about very high frequencies here like UHF circuits.

The combination of a capacitor and inductor can combine to give you a resonant effect and that is what is used when you are specifically designing filters. These points are known as poles and zeros and are not really relevant here. But if you want to know this site will explain it.
Poles and zeros in transfer functions

But it is quite mathematical and not immediately relevant to the specific problem of decoupling, although deep down it is one and the same thing with specific aims.

I call this sort of thing "the onion effect" in electronics, in that the more you want to know or do the more layers of the onion you have to peel off to get to what you know, or explain effects you are seeing.

A good example of this is when someone, normally a beginner, sees a simple circuit, and wants to scale it up to do the same thing a hundred times. Effects come into play that are not normally an issue.

3 Likes

Good tutorial, hopefully will help beginners avoid the mistake I made of skimping on a decoupling capacitor....
Let me say there was a few strange behaviors with that circuit, I added a decoupling capacitor on the chip and it worked perfectly.

I always use decoupling capacitors after that incident.

2 Likes

Looks good, but I would just comment that calling the impedance of a capacitor or inductor "resistance", could get people very confused later when they discover it isn't a resistance at all! At least maybe a note to say that for AC they have an "impedance" which in some ways can be thought of as like a "resistance" in that it impedes the flow of alternating current but acts differently for direct current.

1 Like

Good point I have amended the text in the post to say:-

The capacitive reactance (or XC ) is the name we give to the resistance of a capacitor for an alternating signal, this "resistance" is also known as an impedance.

I don't want to get too deep into these things because in practical applications like this an impedance is just a frequency dependent resistance.

2 Likes

I'd rather use the Pi filter on the supply to the microcontroller and sensors, rather than on the line to the motors or whatever noisy high current load you may have.

Both arrangements separate the sensitive bits from the high power bits, but you need much smaller components as there's a much smaller current to filter. As added bonus you also filter out the power supply noise.

Did you not spot that there are two diagrams that are Pi filters. It is only the last one that talks about a motor load. Indeed your suggested use is covered by the first instance of a Pi filter arrangement.

The smallness of the inductor is only because of the thickness of the wire used to carry the current. Most inductors I have used are well suited to carry enough current to power a small motor. However, I would agree that surface mount inductors can't handle a heavy load, but they aren't big enough to be useful except when working at UHF frequencies.

1 Like

Note that the finished tutorial can be found here:

1 Like

Should it be in the tutorial section?

It’s a useful doc! (Thx @Grumpy_Mike )

It is on it's way there, but only the moderators (and one moderator specifically) can place it there. He as already agreed to this, this morning and I am following instructions I was given.

Oopss - I posted there directly recently, I now see that there is a process… so much for reading the stickies… my bad (will talk to moderation)

3 Likes

I've moved it for you Mike.

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.