BLOG / CIRCUITS / How Capacitors Work: A Beginner's Guide …
Blog Yazısı

How Capacitors Work: A Beginner's Guide with Practical Arduino Circuits

Viktor Build ~7 min read

How do capacitors work? Build two Arduino circuits to see smoothing and RC timing in action. No physics degree required.

How Capacitors Work: A Beginner's Guide with Practical Arduino Circuits

If you’ve ever looked at a circuit board and wondered what those little cylindrical or disc-shaped components are doing, you’re not alone. Capacitors are everywhere — power supplies, radio circuits, decoupling networks, even your Arduino board. But how do capacitors work, and more importantly, how can you start using them in your own projects without getting lost in the math?

In short, a capacitor stores electrical energy in an electric field. It’s like a tiny rechargeable battery that charges and discharges almost instantly. In this guide, we’ll cover the physical principles behind capacitors, decode the markings on common components, and build two practical Arduino circuits that show you exactly when and why to use them.

By the end, you’ll be able to confidently choose a capacitor, read its value, and wire it into a breadboard circuit — no physics degree required.


What is a Capacitor? The Water Analogy

Think of a capacitor as a water tower. A water tower stores water at height, giving it potential energy. When you open a valve, water flows down to turn a turbine. A capacitor stores charges at a voltage — when you connect it to a circuit, those charges flow as current.

The two key parameters are:

  • Capacitance (Farads): How much charge the capacitor can hold. Larger value = more stored energy.
  • Voltage rating (V): The maximum voltage you can safely apply. Exceed it and the capacitor can fail (sometimes dramatically).

Inside, a capacitor is simply two conductive plates separated by an insulating material called a dielectric. When you apply a voltage, one plate accumulates positive charge and the other negative, creating an electric field across the dielectric. This field stores the energy.

That’s it. No magic — just physics that behaves nicely in circuits.


Types of Capacitors You’ll Actually Use

You don’t need to memorize every capacitor type, but knowing the three most common will save you headaches.

Type Polarity Typical Values Best For
Ceramic disc No pF to µF Decoupling, high-frequency circuits
Electrolytic Yes (marked) 1 µF and up Power supply smoothing, audio coupling
Tantalum Yes (marked) 1–100 µF Compact, stable electrolytic applications

Important: Electrolytic and tantalum capacitors are polarized — they have a positive and negative leg. Wire them backwards and they can heat up, leak, or pop. Ceramic capacitors are non-polarized and can go either way.


Reading Capacitor Values

Capacitor markings look cryptic until you learn the code. Most common for small ceramic capacitors is a three-digit code:

  • First two digits = value in picoFarads (pF)
  • Third digit = number of zeros to add
  • The letter after = tolerance

Example: 104K → 10 + 0000 = 100,000 pF = 100 nF = 0.1 µF. The K means ±10% tolerance.

For electrolytic capacitors, the value is printed directly (e.g., 100 µF / 25 V) along with the polarity stripe.

Quick reference: 1 µF = 1000 nF = 1,000,000 pF.

If you’re working with Arduino circuits, you’ll most often see values between 0.1 µF (ceramic) and 1000 µF (electrolytic).


Why Your Arduino Already Has Capacitors

Look at any Arduino board — you’ll see small ceramic capacitors near the voltage regulator and the microcontroller pins. These are decoupling capacitors. Their job is to provide a local burst of energy when the chip switches millions of times per second.

Without them, the voltage in the chip would droop momentarily, causing glitches or resets. A typical decoupling setup is a 0.1 µF ceramic capacitor as close as possible to each power pin.

Now let’s build two circuits that make these concepts concrete.


Circuit 1: Smoothing a Fluctuating Power Supply

One of the most common real-world uses for a capacitor is smoothing or filtering. When you have a power source that varies (like a battery under heavy load or a noisy USB cable), a capacitor can hold the voltage steady.

Parts List

  • Arduino Uno or Nano
  • Breadboard and jumper wires
  • 10 kΩ potentiometer
  • 100 µF electrolytic capacitor
  • Multimeter (optional)

Circuit Setup

  1. Connect the outer legs of the potentiometer to 5V and GND on the Arduino.
  2. Connect the middle leg (wiper) to analog pin A0.
  3. Connect the 100 µF capacitor positive leg (long leg) to the A0 pin and the negative leg to GND.

Now the capacitor acts as a tiny reservoir — when you turn the pot quickly, the voltage on A0 doesn’t jump instantly. Instead, it rises or falls smoothly as the capacitor charges or discharges through the resistor.

Arduino Code

void setup() {
  Serial.begin(9600);
}

void loop() {
  int sensorValue = analogRead(A0);
  float voltage = sensorValue * (5.0 / 1023.0);
  Serial.println(voltage);
  delay(50);
}

Open the Serial Plotter (Tools → Serial Plotter). Turn the potentiometer slowly — the line will follow smoothly. Now turn it rapidly. With the capacitor, the line won’t spike. Without it (remove the cap), you’ll see sharp jumps. That’s smoothing in action.


Circuit 2: RC Time Constant — Blinking an LED Without a Timer

Here’s where capacitors get really fun. A capacitor and a resistor together form an RC circuit with a predictable time constant: τ = R × C, where τ is in seconds.

When you connect a capacitor through a resistor to a voltage source, the capacitor charges to 63% of the source voltage in one time constant, and to 99% in about 5 time constants. The same applies when discharging.

We’ll use this to blink an LED — no delay function, no external timer chip.

Parts List

  • Arduino Uno
  • 220 Ω resistor
  • 10 µF electrolytic capacitor
  • LED (any color)
  • Push button (optional)

Circuit Setup

  1. Connect the 220 Ω resistor between Arduino pin 9 and the LED anode.
  2. Connect the LED cathode to the positive leg of the 10 µF capacitor.
  3. Connect the negative leg of the capacitor to GND.
  4. (Optional) Connect a push button between 5V and the junction of the resistor and LED anode.

How It Works

When the button is pressed (or pin 9 goes HIGH), current flows through the resistor and LED into the capacitor. The LED lights immediately but then fades as the capacitor charges and the voltage across it rises.

When the button is released (or pin 9 goes LOW), the capacitor discharges through the LED, causing a gradual fade-out.

The total fade time is roughly: 5 × (220 Ω × 0.00001 F) = 0.011 seconds. That’s too fast to see — so increase the resistor to 10 kΩ for a visible 0.5-second fade.

Arduino Code

const int ledPin = 9;

void setup() {
  pinMode(ledPin, OUTPUT);
}

void loop() {
  digitalWrite(ledPin, HIGH);   // charge capacitor
  delay(100);                   // hold
  digitalWrite(ledPin, LOW);    // discharge
  delay(500);                   // wait for full discharge
}

Watch the LED fade like a slow heartbeat. Change the capacitor to 100 µF and the resistor to 10 kΩ — now you get a 5-second fade. Congratulations, you just built an analog timer.


Common Mistakes Beginners Make

Capacitors are simple in theory, but in practice we all make mistakes:

  • Reversing polarity on an electrolytic capacitor. Look for the stripe (negative) on the side. Double-check before powering up.
  • Using the wrong voltage rating. A 16V capacitor on a 12V circuit is fine, but leave 20% headroom for safety.
  • Forgetting decoupling capacitors. Every microcontroller project benefits from a 0.1 µF ceramic cap between VCC and GND right at the chip.
  • Assuming bigger is always better. A 1000 µF cap on a low-power circuit can cause inrush current that resets your microcontroller.

Where to Go Next

You now know how capacitors work, how to read their values, and how to put them to work in real Arduino circuits. The same principles apply when you build more advanced projects like the 555 Timer IC: Build a Simple LED Flasher or a GPS Module + Arduino.

If you want to dive deeper into power supply design, check out the Remote Control Fan (ESP8266 + Relay) project — it uses a large electrolytic capacitor to smooth the relay coil’s kickback.

For questions or to share your first capacitor circuit, join the community on Discord.

Capacitors aren’t magic — they’re just another tool in your maker toolbox. Use them well, and your circuits will be more stable, more elegant, and way more fun to build.


Discord'da Topluluğa Katıl

Sorular sor, yapımlarını paylaş ve diğer makerlarla takıl.

Discord'a Katıl — ücretsiz

Bu dersi beğendin mi?

Projelere erken erişim ve daha fazlası için Patreon'da kanalı destekle.

Patreon'da Destekle →