Capacitors

While a resistor is a component that resists the flow of charge through it, a capacitor stores charge. Capacitance is measured in Farads (or more formally, "Faradays") with an equation symbol "C" and a unit symbol "F." Typical capacitors you will use range in value from uF (micro-Farads) down to pF (pico-Farads).

The relationship between current, capacitance, and voltage is given by:

   I = C * dV/dt

where dV/dt is the rate of voltage change over time.

The schematic symbols for capacitors are shown in Figure 4-26. The component on the far left is bipolar, while the other two are unipolar. A unipolar capacitor has a positive lead and a negative lead, and it must be inserted into a circuit with the correct orientation. Failing to do so will cause it to explode. (Unipolar capacitors have markings to indicate their orientation.) A bipolar capacitor has no polarity.

Capacitor symbols

Figure 4-26. Capacitor symbols

Applying a voltage across a capacitor causes the capacitor to become charged. If the voltage source is removed, and a path for current flow exists elsewhere in the circuit, the capacitor will discharge and thereby provide a (temporary) voltage and current source (Figure 4-27).

Capacitor charging and discharging

Figure 4-27. Capacitor charging and discharging

This is an extremely useful characteristic. A given voltage source may have a DC component (a fixed voltage) and an AC component (a ripple voltage superimposed). (Here, "component" does not mean a physical device, but rather a fractional part of a voltage.) The capacitor becomes charged by the DC component of the voltage source to a given level and is then alternately charged and discharged with the AC component. In effect, the capacitor averages out the peaks and troughs of the AC component and, as a result, removes the AC ripple from the voltage source. This is known as the capacitor decoupling the AC and DC components of the voltage source. This is a common technique used to remove electrical noise from power supplies, for example.

The flip side of this is that a capacitor can also be used to block the DC component of a voltage, allowing only the AC component to pass through (Figure 4-28).

Blocking capacitor

Figure 4-28. Blocking capacitor

Capacitors may also be used in series or parallel (Figure 4-29).

Capacitors in series and in parallel

Figure 4-29. Capacitors in series and in parallel

The relationship is the opposite of what it is for resistors. In the series case, the total capacitance is calculated by:

   CTOTAL = C1 * C2 / (C1 + C2)

In the parallel case, the total capacitance is given by:

   CTOTAL = C1 + C2

Types of Capacitors

There are over a dozen different types of capacitor, each based on a different technology. The ones you are most likely to come across are ceramic , electrolytic, and tantalum.

Ceramic capacitors are small in size and small in value. They range from a few picofarads (pF) up to around 1 uF. They are commonly used as decoupling capacitors for power-supply pins of integrated circuits and as bypass capacitors in crystal circuits (among other uses).

Electrolytics look like small cylinders and are used primarily for decoupling power supplies. They range in value from 100 nF to several F (and we're talking big capacitors here). Their accuracy is terrible. Their actual value can vary quite a bit from what it is supposed to be. Therefore, they are not used where critical tolerances are required. Use them only where "ballpark" values are sufficient.

The other problem with electrolytics is that they age, and the older they get, the worse they become. Expect a circuit using electrolytics to eventually fail. Having said that, most consumer electronics still use them heavily, and for one reason—they are very cheap. By the time they've failed, the product will be well out of the warranty period. However, electrolytics will outlast the useful lifetime of your average computer product. You'll have upgraded your PC to a newer model long before its electrolytics have passed on.

Tip

The most common cause of failure in old radios and hi-fi gear is that the electrolytics have failed. You can often pick up a very cheap bargain at a garage sale. Ten minutes with the soldering iron and you've replaced the electrolytics, and what "doesn't work anymore" suddenly comes back to life as good as new. Well, most of the time anyway.

Tantalum capacitors are somewhat larger than ceramics but not as physically large as electrolytics. In through-hole devices, they have the appearance of small, shiny plastic bulbs. Surface-mount tantalums look much like all other surface-mount capacitors: small ubiquitous rectangles. They range in value from around 100 nF up to several hundred uF. They are commonly used to decouple power supplies. They are more accurate than electrolytics, meaning their actual value is closer to their stated value. I always use tantalums in preference to electrolytics in my designs where possible. I like my machines to last.

Some common capacitors are shown in Figure 4-30.

Capacitors (not to scale)

Figure 4-30. Capacitors (not to scale)

Get Designing Embedded Hardware, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.