HomeRaspberry Pi SensorsCapacitors for beginners

Capacitors for beginners

It's almost like going back to the future!

This guide to capacitors for beginners aims to give you all the knowledge you need for Raspberry Pi and Arduino projects.

Capacitors are made to store an electric charge, comparison to a rechargeable battery is often mentioned. It takes some time to charge the capacitor, then the energy is stored until it’s release. That’s the very basic way of describing what it does. Generally, it takes the same amount of time to charge a capacitor and to discharge it.  When the component is being charged, the voltage starts to increase, a spike in voltage is not linear, and the more energy is stored, the slower voltage (and charge) increases.

Capacitors respond differently to DC and AC power. When DC is applied to the capacitor in series (coupling), it will charge up, and upon reaching its capacitance no current will be passed through (see leakage below though). If AC is applied, the capacitor will attempt to even out the voltage spikes by releasing stored charge. Instead of retyping it’s all here I found an excellent explanation describing DC/AC behaviour here.

The capacity of the component is expressed in farads (F), other characteristics include maximum voltage we can drop across the pins, leakage – which tells us how much current can go through the component causing the capacitor to drain it. Resistance especially in series (ESR) this value is generally small but can add up when multiple capacitors are used, and tolerance which like in resistors tells us how precise is the capacitor’s specification.

Types

CeramicElectrolyticSupercapacitorsFlux Capacitors

One of the most popular capacitors.  Comes in a compact size, and small capacitance. On the plus side, the component suffers very little ESR and leakage. Ceramic capacitors are well suited for high freq coupling and decoupling applications. It’s worth mentioning that these are usually bi-directional,  not suffering from the polarity limitations.

electrolytic capacitor
The biggest advantage of electrolytic capacitors is the ability to store a big charge and deal with high voltages. The high capacitance also means that the component is polarized and need to be placed in the circuit accordingly. Longer pin is the anode, capacitor often is labeled accordingly as well. Failing to adhere to correct placement will end up with an explosion and a shorted circuit. The disadvantage of these is leakage, which means they are not ideal for charge storage, but very useful to deal with high voltage applications.

supercapacitor
What’s so super about these you ask? Created to store as much charge as possible, the tradeoff here is the low voltage. To overcome this limitation, these capacitors are used in series to be able to deal with bigger voltages.

Unless you are traveling back in time, you won’t need to know more about these!

Flux capacitor

Schematics

capacitors for beginners


Capacitors are passive components, ceramic ones are  bidirectional, while electrolytic are polarized and need to be placed accordingly to avoid spectacular failure!

Math

I’m going to skip the technical calculations, as in real situations we will be either looking for a specific capacitance needed, or checking if the current capacitance and voltage will allow us to continue. The relation between charge stored (Q), voltage (V) and capacitance is as follows:

Q=C*V

You will quickly notice that in any given capacitor (known and fixed capacitance (C)) stored charge will depend on the value of voltage dropped across the component. So one 1F (farad) would be the ability to store 1 unit of energy per volt.
Knowing this dependency – we can introduce the current.

i = C*(dV)/(dt)

In a situation where the voltage is steady,  dV is essentially 0V and no current is flowing through the capacitor.

As you probably know by know components act differently based on a circuit design. Capacitors behave exactly opposite to resistors when placed in series or parallel.

Capacitor in SeriesCapacitors in parallel

Capacitors in series

1/Ctot = 1/C1+1/C2+1/C3

Similarly, if you have 2 capacitors you can use the easier way to calculate the total capacitance:

Ctot = C1*C2/(C1+C2)

As mentioned before putting resistors in series allows us to increase the voltage we can put through the capacitors, so if  C1 and C2 are able to deal with 2V each, the total voltage in the circuit could reach up to 4V.

capacitors in parallel

Ctot = C4+ C5+C6

Calculating capacitance of the capacitors in parallel is simple, just add the values of each capacitor in the parallel configuration.

Usage

Decoupling

decoupling

Storing and releasing charge can be used to stabilize and even out the voltage spikes.  This configuration allows using the capacitors as buffer negating high-frequency noise, taking the small excess voltage, and releasing it back during the voltage drops. This helps to protect sensitive modules like ICs. Since only high frequencies can run through the capacitors, there is no risk in creating the short between VCC and GND. For best decoupling performance, capacitors should be placed as close as possible to the module we are trying to protect.

Power Supply Filtering

We already know from this article that diodes can be used as a bridge rectifier to change the AC into DC.  adding a parallel capacitor to the mix we can level the voltage spikes and provide a much more steady stream of power.

Energy Storage and Supply

I have mentioned this before, capacitors aren’t as efficient as batteries however they can release the charge much quicker. This particular behaviour is used to power up a camera flash, which requires a short burst of energy. After the discharge capacitor needs only a few moments to recharge again. Another advantage of the capacitor over the battery is the charging cycles. Capacitors are very resistant to the damage caused by charge and discharge cycles.

Signal Filtering

Since capacitors respond uniquely to different frequencies, we can use them to block the low frequencies or DC signal while allowing high-end output to go through. This is used in radio applications or even speakers where a capacitor is used as a passive crossover making sure that high-end output of the music signal is never passed over to the subwoofer.

De-rating

To avoid sometimes catastrophic failures when working with capacitors you should always use components with a higher tolerance than required by the circuit.  Voltage spikes can be deadly to your capacitors and entire boards or components.  This is why you should always check the working limits of your capacitors against the calculated and expected voltages. Process this is called de-rating.
This should give you a great start to your projects. If you think something else should be included in the capacitors for beginners guide let me know in the comments.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

M5Paper

Programable, ESP32 based awesome dev platform with 4.7 e-ink display by M5Stack

More HATs

client-image
client-image

Argon One M.2

Enclose Raspberry Pi 4 inside this great case with custom I/O, cooling and GPIO and M.2 SSD support

More cases on

client-image
client-image

Best Raspberry Pi Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

Slow Internet Warning

0
From time to time my Internet grinds to a stop. Since Raspberry Pi 4 comes with a 1Gbps Ethernet, I decided to take advantage of it and create a reporting system in NodeRED that will monitor and report when the ISP is not keeping the contractual agreements. Works with Alexa, Google Home, Android and Windows 10.

How fast Raspberry Pi NAS is?

0
Let's see how fast Raspberry Pi NAS really is?

Argon18: Argon ONE SSD modification

0
Argon One case just got better - now you can boot it from USB without ruining the design thanks to Argon 18: Argon One SSD modification

HOW TO...

How to boot Raspberry Pi 5 from NVMe M.2 SSD

0
This is how you can boot your Raspberry PI 5 from NVMe in 10 min! Check out these easy instructions

It took me 2 months to boot CM4 from NVMe

0
Complete beginners guide to Compute Module 4 boot from NVMe.

Raspberry Pi Zero 2 W vs other Zero boards

0
It's time to test the Raspberry Pi Zero 2 W against other Raspberry Pi boards from Zero series: power, WiFi, temperature and core performance

C/C++ and MicroPython SDK for Raspberry Pi Pico on Windows

0
A guide to SDK toolchain for Raspberry Pi Pico and C/C++ , Micropython on Windows.

A comprehensive guide to Grafana & InfluxDB

0
How to use Grafana and InfluxDB on Raspberry Pi for IoT sensors in home automation