If you look at any professional board, you'll find very small capacitors stuck right next to every chip. These are decoupling capacitors (or bypass capacitors). They don't look important, but without them chips can reset by themselves, misread, or behave in baffling ways.
The problem
Digital chips draw current in very fast bursts: every time the transistors inside switch, they draw a momentary current lasting nanoseconds.
But the long trace or wire from the power supply has inductance, meaning it can't deliver current suddenly. The result: the voltage on the supply pin dips for a moment with each burst, and the chip sees a "choppy" supply.
In numbers
A rule of thumb: a thin trace or wire has about 1 nH per millimetre. So 20 mm = about 20 nH.
The chip drew 50 mA in 2 ns. The voltage dropped across the trace = L × (the change in current ÷ the time):
- 20 n × (0.05 ÷ 2 n) = 0.5 V!
Half a volt of momentary dip on a chip running at 3.3 V can make it misread or reset. Whereas the 100 nF capacitor next to the pin, supplying the same burst for 10 ns, drops by 0.05 × 10 n ÷ 100 n = only 5 mV.
The fix: a small reservoir next to the pin
A 100 nF capacitor stuck right at the supply pin acts as a small nearby "reservoir": it supplies the momentary current at once, and recharges from the power supply at leisure.
The rules
- A 100 nF capacitor for every supply pin. A chip with 4 VCC pins gets 4 capacitors.
- As close to the pin as possible. Distance matters more than value. A capacitor 3 cm away may as well not be there.
- The shortest path to ground: a via to ground right next to the capacitor, or a ground plane underneath.
- The routing: the supply passes the capacitor first, then enters the chip's pin.
The idea behind all these rules: the momentary current flows in a loop: from the capacitor to the pin, and from the ground pin back to the capacitor. The area of that loop sets the inductance. A small loop = a clean supply.
Values and types
- 100 nF ceramic (X7R or X5R material): the standard value. Its printed code is 104; see capacitor codes.
- A bulk capacitor: 10–100 µF, one or two on the board where the supply enters, or next to big loads. This covers the slower changes.
- For very high frequencies a smaller capacitor (for example 10 nF or 1 nF) is sometimes added next to the 100 nF.
- The datasheet tells you exactly which values are needed in its typical application section. Always refer to it; see how to read a datasheet.
Don't use Y5V or Z5U
Ceramic capacitors of this type lose a great deal of capacitance with temperature and voltage. X7R and X5R are much more stable.
Voltage eats capacitance
Even with X5R: a 10 µF capacitor rated 6.3 V running at 5 V may really have only 3–4 µF. This is called DC bias. The fix: choose a capacitor rated at twice the voltage it runs at, or a larger size (0805 instead of 0603). With 100 nF the effect is smaller, so it's not a big problem.
Small sizes are better here
The capacitor body itself has a small inductance (ESL). An 0402 or 0603 capacitor is better than a 1206 for decoupling, and much better than a capacitor with long leads. And if you're using THT on a breadboard, cut the leads as short as you can.
Practical examples
- ATmega328P (the Uno): 100 nF on VCC, 100 nF on AVCC (the ADC supply), and 100 nF from AREF to ground. And if you want very clean ADC readings, AVCC takes its supply through a small inductor or a ferrite bead.
- ESP32: Wi-Fi draws pulses of up to 300–500 mA. It needs 10–22 µF next to the module + 100 nF, or you'll see brownouts and resets.
- Motor chips (A4988 and DC drivers): an electrolytic of 47–100 µF on the motor supply, close to the chip. The datasheet says so explicitly, and without it the chip can be destroyed by the spikes.
- Sensors on a long wire: 100 nF at the sensor itself.
Symptoms of missing decoupling
- The microcontroller resets by itself, especially when a relay or motor switches on.
- ADC readings jump around.
- Communication (I2C, SPI or UART) produces wrong data from time to time.
- The circuit works on the breadboard but not when made into a PCB, or vice versa.
You can see the problem with your own eyes on an oscilloscope: put the probe on the supply pin (with a very short ground lead), and you'll see dips when the capacitor is missing.
On the breadboard
Even in experiments: put a 100 nF capacitor between VCC and GND next to each chip. It's a basic part of reducing noise in general.
FAQ
Why not just put one big capacitor? A big capacitor (an electrolytic, for example) has a larger body inductance, so it's slow for very fast pulses. So we fit both: the big one for slow changes, and the small one next to the pin for fast ones.
Can I use 1 µF instead of 100 nF? Usually yes, in a small size, and many modern chips ask for it. What matters is that it's ceramic and close. And check the datasheet.