## What is a capacitor

A capacitor is an passive device that stores electrical energy in an electrical field. In layman terms it is a reservoir for energy the same way a rechargeable battery is, although it has many other properties that make it useful in electronics. There are many types of capacitors (electrolytic, ceramic, tantalum), each with their own characteristics but which ultimately have all the same function.

In the image aside is shown a 100uF 25V electrolytic capacitor.

## What is a decoupling capacitor

A decoupling capacitor is just a regular capacitor which is used to decouple one part of an electrical circuit from the another. The capacitor itself does not have a (new) characteristic which makes it special. Rather, is the way we use it that makes it special.

## Why do we need decoupling capacitors

If you have an electrical circuit with a power supply and two or more different loads (eg. amplifier, IC, logic, micro-controller, etc) the current drawn/pushed from/into circuit by one load could create a (AC) voltage ripple (noise) into the other circuit(load) that could severely affect it. For some circuits a ripple of few tens or hundred millivolts is not an issue, however in case of an IC or micro-controller this might cause an unexpected behavior making the circuit unpredictable.

Now just imagine the following scenario:

- you have a circuit with a power supply that can keep up with oscillation on the order of 1MHz or lower
- the circuit's load(s) operates in the range 10MHz or higher
- basically it means that the power supply is not fast enough to supply with power that circuit

So we have two reasons for using a decoupling capacitor (ie. they provide two functions in a circuit):

- charge supply
- filtering.

#### (A) Charge Supply

So what is happening: when the 10MHz load changes its states between high and low it will pull enough current into it and will drag the power supply line to a lower voltage that will affect the rest of the circuit. On the other hand if this 10MHz load will push current into the circuit then it will create voltage oscillations (ripples) with a frequency of 10MHz which the other loads might not expect and thus their functioning might be uncertain.

We can avoid this situation simply by decoupling one part of the circuit from the other. We do that by mounting some local reservoirs of energy very close to the loads. How this is usually done is by mounting a larger reservoir very close to the power supply and a second smaller reservoir locally, very close to the load:

where Q is the charge, C is the capacitance and V the voltage.

When the load goes through these transitions then instead of drawing current from the power supply it will draw current from the local reservoir. The larger the energy reservoir the larger the charge to make these transitions. If that is still not enough, the current is drawn ultimately from the largest reservoir mounted very close to the power supply. By doing this we are avoiding dragging the line down or creating high frequency oscillations on the line that would affect other circuits. So it's nothing special about the capacitors but with the way we are using them for a particular case.

#### (B) Filtering

A capacitor has this intrinsic property which is called capacitive reactance. While the capacitor is used in an AC circuit it oscillates between being charged and discharged with the frequency of the AC signal frequency. As the capacitor is charged/discharged the flow of current is limited by its internal "impedance". This internal impedance is also known as capacitive reactance (X_{C}). The higher the capacitance (C) the less it opposes the current flow. The higher the frequency (f) of these charge/discharge transitions the less it can oppose to the current flow:

When dealing with AC currents this capacitive reactance is called capacitive impedance (Z_{C}) and is expressed as a complex number in terms of capacitance (C) and angular frequency expressed in radians/s:

^{2}=-1).

So by mounting a capacitor between the positive and negative rail of a circuit and choosing an appropriate value, it will have such small capacitive impedance that it will actually allow current to flow through through it like in a short circuit. So any voltage ripple propagated with a frequency greater than the value it was calculated for would be shunted to the ground instead of traveling down along the line affecting the other loads on the circuit.

For very sensitive circuits this approach is necessary but not sufficient. We would need to extend it to what is called the topology which includes also an inductor. But more on this another time.

### What size the capacitor should have for (A) or (B) ?

#### (A) Charge Supply

Let's review the following equation:

So for a given circuit with a voltage V where we have a load which draws huge amount of current (ie. requires a large charge Q) all we need is a capacitor with large capacitance C.

#### (B) Filtering

Let's review the following equation:

So if we want to include only those voltage ripples that propagates with a specified max. frequency () then we have to make sure that the capacitor's capacitive impedance (Z_{C}) is low, ie. we use a capacitor with large capacitance C.

So in both cases we see that a capacitor with a large capacitance is needed and therefore it raises the following question: wouldn't be reasonable to use the largest C possible? The short answer is yes and NO!

With an ideal capacitor (like the one aside) which has no ESL or ESR or any parasitic resistor the answer would be YES. However, in real life there is no such thing like ideal capacitor. They usually have some equivalent series inductance (ESL), some equivalent series resistance (ESR) and most probably some parasitic resistor in parallel with the capacitor, like the one in the image below:

So in the reality the capacitor 's capacitive impedance is going to be lower and lower as the frequency grows until it reaches a point (the resonant frequency) where the capacitor is going to be more and more inductive. The resonant frequency of capacitor is the point :

So we would want to choose a smaller value for C such that we push the point further.

Well, so how do we calculate the right size for the capacitor? In order to understand how to we calculate the size we should understand how the capacitor works in a real circuit.

Let's assume that we have a circuit with a capacitor that is charged and discharged during time every T seconds.

Look at the first graph in the Fig. 5 below:

- At the beginning our circuit is at the low state then it goes in the high state. When this happens the capacitor will start charging during a short period (rise time) by drawing current from the circuit, at some point I
_{Cmax}it will be fully charged then it will start discharging. - Its current is going to be pulled/used by the circuit, thus it starts discharging;
- While the system is using its current we see no charge/discharge in time, its charge is almost zero
- After T seconds the process repeats again.

The second graph is the Fourier transform of the first one where on x-axis we have the log of the frequency (f) and on the y-axis the log of the current(I). We see that the capacitor is charging linearly for a while then it reaches a certain frequency (f_{c}) called cutoff/corner/break frequency when it rolls off.

Ok, it's good with all these details but what what do we do with all this info now? Normally we use such decoupling capacitors for high-frequency devices like transistors, ICs, micro-controllers. Usually their data sheet features such information like the peak current, the rise time (tr), the transition frequency (f_{T}) which is given as transitions per seconds (ie. Hz). For instance the 2N2222A transistor has a peak current I_{Cmax}=0.8A, rise time tr=25ns while its transition frequency f_{T}=300MHz.

Let's review the charge equation:

If we want to see how the charge varies with the time we take the derivative of this:

, where*I*is the current peak in the graph above,

_{tr}*tr*is the rise time and V

_{max}is the maximum ripple we can stand. So by answering the question what is the maximum voltage ripple

*V*that we can tolerate before the system changes its state uncontrollable given the fact that we should provide maximum

_{max}*I*current for a short period of time

_{Cmax}*tr*, we answer in fact the question what size the capacitor should have.

#### Example:

Let's say that we look in the datasheet and at transition the circuit we try to decouple from the rest of the system draws I_{max}=0.8A, its raise time is tr=25ns and the maximum voltage ripple we can tolerate is V_{max}=0.1V. What is the size of the decouple capacitor?

so we would need in this case for these variables at least this capacitor to decouple the circuit from the system.

Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.

#### Eugen Mihailescu

#### Latest posts by Eugen Mihailescu (see all)

- Dual monitor setup in Xfce - January 9, 2019
- Gentoo AMD Ryzen stabilizator - April 29, 2018
- Symfony Compile Error Failed opening required Proxies - January 22, 2018