In this tutorial you’ll learn how capacitors work, not by reading but by experimenting! The best thing about it, you don’t need any previous knowledge about capacitors to follow this tutorial.
It is a part of #100DaysOfHardware. - A challenge, I pioneer to learn about electronics, micro-controllers and eventually IoT.
Not sure where to start, some other requests? I’m available on twitter, just approach me if you need any help along the way or want to join the challenge.
We pick up the strong mental model, which we build in the post about the Central Mental Model of Electronics. Based on that, we build a basic circuit and start using the multi-meter to investigate what exactly capacitors do.
I really recommend to build your own circuit alongside this tutorial that way you can experiment yourself. It will make our findings much more relatable and easier to memorize.
You need the following components:
2 Capacitors (100µF)
1 LED (5V,0.02A)
1 Battery (9V)
1 Resistor ((9v-5v)/0.02A)= min. 200 Ohm)
If you don’t have any of these, and you want to actively participate in #100DaysOfHardware, I recommend to pick-up the “Upgraded Electronics Fun Kit” by ELEGOO. I personally use it, the components are of good quality and it should be available internationally too.
You also will need a multi-meter to get the most out of this and the following tutorials. I use this multi-meter , it’s digital, auto ranging and quite affordable.
👷 Safety Measures
Before we can start experimenting, there are some important safety measures to talk about . Don’t touch the two leads of the capacitors ever. Why? That’s what you will learn today.😉
It’s also important that you plug them the right direction into you breadboard. The longer leg is the anode and always needs to be connected to the higher voltage. If you wire it up the other way around with the cathode getting a higher voltage, prepare for an exploding cap!
The Circuit Layout
To help you build your own circuit I have created a schematic. For everyone who isn’t familiar with schematics yet, it doesn’t represent the exact layout on the breadboard but describes how you need to wire your different electrical components. Most importantly it shows in which direction the current is flowing. Remember, it’s crucial this time to add the capacitors correctly, so they won’t explode.
If you look at my breadboard layout, you may wonder why I used very long wires, the reason is simple, it allowed to have a better view from above. Your layout might be much more compact.
When you design a circuit, it’s fundamental to decide if you want to use components in parallel or in series. This has some major implications on the components’ properties.
As you probably realized the circuit comes with two buttons.
When you push the first, you create a closed circuit including the the power source and the capacitors. If you also push the second button the LED is also included in the circuit.
Now, when releasing button one, you cut off the power source from the circuit. However, the LED is not shut instantly. Instead, it continues glowing for a little bit.
🤔 How to interpret this observation?
We don’t know much, but it seems that capacitors have the ability to store and release electrical charge…
To help you reason about this behavior, we can extend the central mental model of electronics.
The central mental model in electronics is a water tank with a hose allowing the water to flow out. To have a clear image of what a capacitor does, imagine a capacitor to be a water reservoir the water from the tank flows through. First the reservoir fills up, when water is flowing through it. If the inflow of water is interrupted, the water still keeps flowing for a while till the reservoir is empty.
In this analogy water represents current flowing through a circuit. So as we witnessed, capacitors can be charged and discharged.
Now it’s time to get your multi-meter out! We already know what capacitors are good for, you might watch this video starting from 4.30min to learn why they can store charge. Next, we look at how capacitors are charged and discharged.
First, we use the multi-meter to measure the voltage at one of the capacitors.
If you use the capacitor the first time, the multi-meter should show 0V initially, otherwise you might see some residual voltage.
When we hit button “one”, you can see the voltage at the capacitor goes up to 9V very quickly.
Here I want to add some context, you will have a hard time experiencing yourself.
When reasoning about charging a capacitor you look at two points in time:
t0, the moment you push button “one”
t∞, the maximal far away moment in time
You’ll see in a moment why this is important.
We know, that our capacitors are receiving 9V which makes sense, as they are wired in parallel, that’s why (by definition) voltage is constant over all components.
The capacitors’ voltage value will remain to be 9V till as long as it isn’t fully charged. From our observation we can tell, that charging the capacitor can be described as a exponential function. It will increase from 0V to 9V during starting at t0.
Let’s reason about current. In a parallel circuit current may vary between components, as it splits up between the different routes.
To be honest, I have forgot to measure the current initially. So let’s apply Ohm’s law to calculate it.
I = V/R
is the formula to apply here. Since we do not have a resistor in our charging circuit we assume the value is 1 Ohm.
As a result, we have current flowing through the circuit at t0, as soon as the capacitor’s voltage reached 9V, it is equal to the overall voltage in the circuit and no more current flows.
In case you measure some other behavior and think my reasoning is bollox - give me a head-up on twitter!
The ‘capacitance’ it another important unit to reason about - it is used to describes the ability of capacitor to collect and store electrical charge. It is is measured in farads (F). Mostly you will see capacitors with only a fraction of a farad, often a thousandth of a farad called a micro-farad (µF) or even smaller a pico-farad (pF).
You can measure the capacitance of each capacitor with a multi-meter similar to how you would measure resistance. If your multi-meter comes with that feature. The capacitors used in this circuit have the value printed on them. Bare in mind, there is a wide variety of models not all come with a print.
To learn about the total capacitance in our parallel circuit we can simple sum up our single capacitors values:
C = C1 + C2 + ... + Cn
this is a great moment to branch out and do a little experiment on your own. Try to connect your capacitors in series and only use a single capacitor. What’s the results? And how are they connected to the total capacitance in your circuit?
We have made some observations and have drawn some conclusions by applying basic electronics theory. Now it’s time to release button “one” and push button “two” again to investigate what happens during the discharging phase.
Here we also look at two points in time again.
It’s easy to measure what happens to our Capacitors’ Voltage value. We see it is dropping rapidly from 9V to 2V and then continues to slowly decay. Since voltage is proportional to current, this value will decay in the same manner, till eventually the capacitor is fully discharged.
Extension: The missing time value
You might want to know how long it takes to charge and discharge a capacitor. It really depends on the values of your other components, if you are interested in a deep-dive into that topic I recommend this video
Let’s sum up, we have build a circuit and observed and invistigated what capacitors are actually doing. We applied basic math to explain certain behaviour too. I consider the most important take away a new approach to learning. It makes a big difference if you read about something of go through the discovery process yourself.
Are there questions left, or did new once spawned? Talk to me on twitter and most importantly keep learning about electronics, micro-controllers and IoT!