Charge accumulates on two conductive plates separated by an insulator. No current crosses the gap, yet current flows into and out of the capacitor as the voltage across it changes. Hence the two headline behaviours:
Capacitance is measured in farads, which is an enormous unit — real parts are microfarads (µF), nanofarads (nF) and picofarads (pF).
| Type | Typical range | Polarised? | Used for |
|---|---|---|---|
| Ceramic | 1pF – 1µF | No | Decoupling, filtering, timing |
| Electrolytic | 1µF – 10,000µF | Yes | Bulk supply smoothing |
| Tantalum | 0.1µF – 100µF | Yes | Compact bulk; fails dramatically if reversed |
| Film | 1nF – 10µF | No | Audio, precision timing |
Reading small markings: ceramics use a three-digit code in picofarads — 104 means 10 followed by 4 zeros = 100,000pF = 100nF = 0.1µF. That part number is so common it is worth memorising on sight.
τ = R × C (tau, in seconds, with R in ohms and C in farads) after 1τ -> 63% of the final voltage after 3τ -> 95% after 5τ -> 99%, treated as settled // 10kΩ with 100µF τ = 10000 × 0.0001 = 1 second
The same arrangement is a low-pass filter: slow changes get through, fast ones are smoothed away. The cutoff frequency is f = 1 / (2πRC), shown in the calculator above. Swap the positions of R and C and you get a high-pass filter instead, which passes changes and blocks the steady level — that is how audio coupling works.
Mechanical contacts physically bounce for a few milliseconds when they close, so a microcontroller polling fast enough sees several presses. Two fixes, and you should know both:
Knowing the hardware version matters even if you use software, because it explains a whole family of "my input is noisy" problems — and the same RC smoothing applies to analogue sensor lines, where software cannot help you.
Your microcontroller resets whenever a relay switches. You already have a 100nF ceramic near the chip. What is the most likely fix?