Capacitor for Arduino guide: decoupling values, crystal loading caps, reset circuits, motor noise filtering, and PCB layout rules every maker should know.
If you’ve ever had an Arduino randomly reset when you turned on a motor, seen an ADC reading jump all over the place for no obvious reason, or watched a sketch upload fail inconsistently โ congratulations, you’ve already experienced what happens when capacitors are missing or wrong. The capacitor for Arduino and microcontroller circuits isn’t a “nice to have.” It’s a fundamental part of making the circuit work reliably.
This guide walks through every practical role capacitors play in Arduino and microcontroller designs, from decoupling and bypass to crystal loading, reset circuits, and motor noise suppression. Whether you’re building on breadboard, designing a custom PCB, or troubleshooting a board that misbehaves under load, this is the reference you’ll want to hand.
Why Capacitors Are Critical in Microcontroller Circuits
Microcontrollers like the ATmega328P at the heart of Arduino Uno switch millions of logic states per second. Every time an output pin changes state or an internal logic block switches, it draws a brief spike of current from the supply rail. These spikes happen in nanoseconds โ far faster than any power supply or voltage regulator can respond to.
Power supplies, including good LDO regulators, have a bandwidth of roughly 10โ100 kHz. That means they take approximately 10 microseconds to react to a sudden change in load current. In that time, a 16 MHz ATmega328P has already executed 160 clock cycles. During that 10 ยตs window, the supply voltage droops as charge is pulled from the parasitic capacitance of the PCB traces alone. If that droop is deep enough, the microcontroller can misread an I/O pin, corrupt a register, or โ in extreme cases โ trigger a brown-out reset.
A capacitor placed physically close to the microcontroller’s power pins acts as a local energy reservoir. It supplies the burst of charge the IC demands during switching transients, keeping the local supply voltage stable until the regulator catches up. That is the core job. Everything else in this guide is a variation on the same idea applied to specific circuits.
Decoupling Capacitor for Arduino: The Foundation
What a Decoupling Capacitor Does
A decoupling capacitor sits between the VCC (or 3.3V) and GND pins of the microcontroller, as close to those pins as possible. When the microcontroller demands a burst of current, the capacitor discharges into the supply pin instead of pulling that current through the inductance of long supply traces. This prevents a voltage dip at the IC power pin, and it also prevents the current spike from propagating back along the supply rail and disturbing other components.
There is a second job running simultaneously: high-frequency noise on the supply rail โ generated by motors, switching regulators, relays, or RF transmitters on the same board โ is shunted to ground through the low-impedance path of the capacitor before it can enter the IC’s power pin. The capacitor acts as a low-pass filter with the trace inductance between the noisy supply and the IC forming the series element.
Recommended Values for ATmega328P and Arduino
The ATmega328P has two VCC pins (pins 7 and 20) and two GND pins (pins 8 and 22). Best practice, reflected in the official Arduino Uno schematic and most professional ATmega-based designs, is to place decoupling capacitors on both VCC pins:
- 100 nF (0.1 ยตF) ceramicย on each VCC pin โ handles high-frequency noise up to ~100 MHz
- 10 ยตF electrolytic or tantalumย on at least one VCC pin โ handles lower-frequency load transients and provides bulk charge storage
This two-tier approach covers a broad frequency range. The ceramic handles the fast, high-frequency switching transients. The larger electrolytic handles slower, larger current demands โ like when you turn on a relay, enable a servo, or start a wireless transmission.
Decoupling Capacitor Placement: The Rule That Actually Matters
The physical placement of decoupling capacitors determines how effective they are. Placing a 100 nF cap 5 cm from the IC with a thin trace to the power pin is almost useless โ the inductance of that trace (roughly 1 nH per mm) creates an impedance at high frequencies that negates the capacitor’s benefit.
The rule is: place decoupling capacitors as physically close to the IC power pins as possible, with the shortest possible traces to VCC and GND. On a PCB, this means within 1โ2 mm of the IC’s power pins. On a breadboard, place the capacitor in the power rail immediately adjacent to the rows containing the IC’s VCC and GND connections.
When routing the capacitor on a PCB, the capacitor should sit between the power trace and the IC pin โ not tapped off a long trace that first goes to the IC. The current path should be: supply trace โ capacitor โ IC power pin, with the ground side returning to the nearest ground plane via.
Decoupling Capacitor Values: Quick Reference Table
| Capacitor Value | Type | Frequency Coverage | Where It Goes |
| 10 pF โ 100 pF | C0G/NP0 ceramic | >100 MHz (RF/GHz range) | RF ICs, high-speed oscillators |
| 10 nF | X7R ceramic | ~10โ100 MHz | High-speed digital ICs, ADCs |
| 100 nF (0.1 ยตF) | X7R ceramic | ~1โ100 MHz | Every IC power pin โ the standard decoupling cap |
| 1 ยตF | X5R/X7R ceramic or tantalum | ~100 kHzโ10 MHz | Alongside 100 nF for better mid-frequency coverage |
| 10 ยตF | Electrolytic or polymer | ~1 kHzโ1 MHz | Bulk bypass, per supply rail or per power-hungry IC |
| 100 ยตF+ | Electrolytic | <1 kHz | Board-level bulk reservoir, motor supply filtering |
The 100 nF ceramic is the single most important capacitor in any microcontroller design. If you only add one capacitor per IC, make it a 100 nF ceramic placed as close to the power pin as possible.
Crystal Oscillator Capacitors: Why 22 pF Matters
Most Arduino-compatible designs using an external 16 MHz crystal require two small ceramic capacitors โ one from each crystal pin (XTAL1, XTAL2) to ground. The purpose is to set the correct load capacitance for the crystal, which determines its precise oscillating frequency.
The standard value specified for the ATmega328P with a 16 MHz crystal is 22 pF for each capacitor. This sets the effective load capacitance seen by the crystal at approximately 11 pF (two 22 pF caps in series), which matches the 18 pF typical load capacitance of standard HC-49 style crystals, accounting for stray PCB capacitance of around 5โ7 pF.
Getting this wrong causes the crystal to oscillate at a frequency slightly off from 16 MHz โ which matters if your sketch relies on accurate timing for UART communication, I2C, precise PWM, or real-time clock calculations. Using 0 pF (no capacitors) causes the crystal to run high; using excessively large capacitors (100 pF) causes it to run low or fail to start.
Use C0G/NP0 ceramic capacitors for crystal loading. Their capacitance is stable over temperature and voltage โ critical for a timing reference. X7R types will change slightly with temperature and could affect timing accuracy in precision applications.
Crystal Capacitor Selection Table
| Crystal Type | Nominal Load Cap | Recommended Capacitors | Notes |
| 16 MHz HC-49 (Arduino Uno) | 18 pF | 22 pF each (C0G) | Accounts for ~5 pF PCB stray |
| SMD crystal, low CL spec | 8โ10 pF | 12โ15 pF each (C0G) | Check crystal datasheet CL spec |
| Ceramic resonator | Built-in | Usually none needed | Resonator has integral caps |
| RTC crystal 32.768 kHz | 7โ12 pF | 12 pF each (C0G) | Very sensitive to PCB stray |
The Reset Pin Capacitor: What It Does and When to Use It
The 100 nF capacitor on the Arduino’s RESET pin is one of the most commonly misunderstood components in the circuit. It serves two different functions depending on where it’s placed.
Auto-Reset Circuit for Programming
On the standard Arduino Uno, a 100 nF capacitor connects between the DTR line of the USB-to-serial converter and the RESET pin of the ATmega328P. When the Arduino IDE uploads a sketch, it toggles the DTR line low, causing the capacitor to briefly pull the RESET pin low (active-low reset), which resets the ATmega328P and starts the bootloader. This is AC coupling โ the capacitor only passes the brief transient, then blocks the DC level, allowing the reset pin to float back to its HIGH idle state.
Without this capacitor, the RESET pin would follow the DTR line’s DC state, holding the ATmega in reset continuously when a serial connection is active, or failing to pulse it at the right moment for programming. The 100 nF value gives roughly a 1 ms pulse duration with the 10 kฮฉ pull-up resistor, which is sufficient to trigger the bootloader handshake.
Noise Filter on the RESET Pin
In custom ATmega designs operating in electrically noisy environments โ near motors, relays, or switching power supplies โ the RESET pin can pick up interference and cause unintended resets. A 100 nF capacitor from RESET to ground, combined with a 10 kฮฉ pull-up to VCC, creates an RC filter with a time constant of about 1 ms. This filters out brief noise spikes while still allowing intentional reset pulses from a pushbutton to work normally.
This capacitor is not part of the standard Arduino Uno auto-reset circuit. It is an addition for standalone ATmega circuits in noisy environments.
AREF Capacitor: Cleaning Up Analog Readings
The ATmega328P’s AREF pin is the reference voltage for the on-chip ADC. In the default configuration, AREF is internally connected to VCC through the microcontroller, giving a reference of 5V (or 3.3V on 3.3V Arduinos). Adding a 100 nF ceramic capacitor from AREF to GND filters noise on this reference voltage.
Why does this matter? The ADC measures input voltage as a fraction of VREF. Noise on VREF directly appears as noise on every ADC reading. If your analog readings are jumping around even with a stable input signal, a dirty AREF is often the culprit. Adding 100 nF to AREF is cheap, takes minimal board space, and typically reduces ADC noise significantly.
For precision analog measurements where 10-bit resolution needs to be usable, consider adding 10 ยตF in parallel with the 100 nF for better low-frequency filtering of the reference voltage.
Capacitors for Motor and Relay Noise Suppression
This is where many Arduino beginners first encounter noise problems. DC motors generate significant electrical interference when their brushes commutate โ the rapid making and breaking of current through the brush-commutator interface creates voltage spikes that propagate across the power supply and radiate as EMI. Relays create a similar inductive kickback spike when their coil is switched off.
Motor Bypass Capacitor
The standard motor noise suppression technique uses three ceramic capacitors placed directly at the motor terminals:
- One 100 nF ceramic capacitor between each motor terminal and the motor case (ground)
- One 100 nF ceramic capacitor between the two motor terminals
This creates a low-impedance path for high-frequency noise directly at the source, before it can travel along supply wires to the Arduino. Use ceramic capacitors rated for the motor supply voltage with some margin โ a 12V motor supply calls for 25V or 50V rated ceramics. Place the capacitors physically at the motor terminals, not at the Arduino end of the supply wires.
Power Supply Decoupling for Motor Circuits
When a motor shares a supply rail with an Arduino, its starting current surge causes a voltage dip that can reset the microcontroller. The fix is a large bulk capacitor (100 ยตF to 1000 ยตF electrolytic) on the motor supply rail, combined with a separate filtered supply for the Arduino if the interference is severe.
A practical approach for breadboard and prototyping builds: add a 100 ยตF electrolytic and a 100 nF ceramic in parallel directly at the motor driver module’s supply pins. This combination handles both the initial inrush and the ongoing high-frequency noise.
Relay Flyback and Snubber Capacitors
A relay coil is an inductor. When switched off, it generates a large reverse voltage spike (inductive kickback). The standard protection is a flyback diode in parallel with the coil. For applications sensitive to the brief spike that occurs before the diode conducts, a small RC snubber (typically 100 ฮฉ in series with 10 nF) in parallel with the relay coil contacts further reduces switching transients.
ESP32, ESP8266, and Other 3.3V Microcontrollers
The capacitor requirements for 3.3V microcontrollers like the ESP32 and ESP8266 are more demanding than for the ATmega328P, primarily because these modules draw substantial peak currents during WiFi and Bluetooth transmission โ 300โ600 mA peaks are common for ESP32 WiFi transmissions, compared to the 50โ200 mA typical for ATmega switching transients.
The ESP8266 is notorious for resetting when connected to an Arduino’s 3.3V output pin, which typically only supplies 50 mA. Even with an adequate supply, insufficient bulk capacitance causes the supply voltage to sag during transmission, triggering the brown-out detector and resetting the module.
Recommended capacitors for ESP32/ESP8266 power supply filtering:
- 100 ยตF electrolyticย across the 3.3V supply at the module
- 10 ยตF ceramic or tantalumย (if available at the package size)
- 100 nF ceramicย as close as possible to the VCC pin
This combination of capacitor values handles the wide range of transient frequencies from the module’s RF circuitry.
Full Reference: Capacitor Roles in Arduino/Microcontroller Circuits
| Role | Location | Recommended Value | Type | Notes |
| IC decoupling (high-frequency) | Each IC VCC pin | 100 nF | X7R ceramic | Maximum 1โ2 mm from pin |
| IC decoupling (bulk) | Main supply rail | 10โ100 ยตF | Electrolytic or polymer | One per board at minimum |
| Crystal loading | XTAL1, XTAL2 to GND | 22 pF (ATmega 16MHz) | C0G ceramic | Match to crystal datasheet |
| ADC reference filter | AREF to GND | 100 nF + 10 ยตF | Ceramic + electrolytic | Reduces ADC noise significantly |
| Auto-reset (DTR coupling) | DTR to RESET | 100 nF | Ceramic | Required for auto-programming |
| Reset noise filter | RESET to GND | 100 nF | Ceramic | Only in very noisy environments |
| Motor terminal noise | At motor terminals | 3ร 100 nF | Ceramic, rated for motor voltage | Physical placement is critical |
| Motor supply bulk | Motor supply rail | 100โ1000 ยตF | Electrolytic | Prevents reset from motor inrush |
| Relay snubber | Relay coil contacts | 10 nF + 100 ฮฉ | Ceramic + resistor | Reduces switching transient |
| ESP32/ESP8266 supply | Module VCC to GND | 100 ยตF + 100 nF | Electrolytic + ceramic | Prevents WiFi transmission resets |
| SMPS output filter | LDO/regulator output | 10โ100 ยตF | Polymer or electrolytic | Per regulator datasheet |
Common PCB Layout Mistakes with Microcontroller Capacitors
Getting the value right and the placement wrong is one of the most common causes of microcontroller noise problems that pass component-level inspection but fail in the field.
Mistake 1 โ Capacitor too far from the power pin. A 100 nF cap placed 20 mm from the IC pin is far less effective than one placed 1 mm away. The trace inductance between the capacitor and the power pin creates an impedance that negates the capacitor’s benefit at high frequencies. Keep decoupling caps within 1โ2 mm of the IC power pins whenever possible.
Mistake 2 โ Long, narrow supply traces. A 0.2 mm wide trace between the decoupling cap and the IC adds roughly 1โ2 nH per mm of inductance. For a 100 MHz switching transient, that’s a significant impedance. Use the minimum trace length and maximum trace width practical.
Mistake 3 โ Single via in a high-current ground path. A single small via can carry approximately 0.5โ1A before thermal issues arise. The ground return from a decoupling capacitor must be as low inductance as possible โ multiple vias or a direct connection to a ground plane immediately beneath the component.
Mistake 4 โ No ground plane. Through-hole prototype builds on perf board without a solid ground return are the most common cause of noise problems in beginner projects. The resistance and inductance of long GND wires is significant. A copper poured GND layer on a custom PCB reduces ground impedance by orders of magnitude compared to wired point-to-point grounds.
Mistake 5 โ Forgetting the second VCC pin on ATmega328P. The chip has VCC on both pin 7 and pin 20. Both pins need decoupling capacitors. Many beginner custom PCB designs add decoupling to only one VCC pin and then wonder why the chip has occasional glitches.
Useful Resources for Arduino and Microcontroller Capacitor Design
- ATmega328P Datasheet โ Microchip Technologyย โ The original source for recommended decoupling capacitor values, crystal loading caps, and AREF filtering for the ATmega328P. Required reading for any custom Arduino-compatible design.
- Arduino Uno R3 Schematicย โ Study the official schematic to see exactly where each capacitor is placed in a validated reference design.
- Sparkfun: Decoupling Capacitor Tutorialย โ Accessible introduction covering bypass, decoupling, and filter capacitor applications with circuit diagrams.
- Altium: Bypass and Decoupling Capacitor Placement Guidelinesย โ PCB-level guidance on capacitor placement, PDN impedance, and common layout errors.
- Murata SimSurfingย โ Simulate actual capacitance and impedance vs. frequency for specific Murata MLCC part numbers at your operating voltage.
- DigiKey Ceramic Capacitor Searchย โ Parametric search across all major suppliers for C0G, X7R, and X5R ceramics by value, package, and voltage rating.
- TI Application Report SLOA194: Decoupling Techniquesย โ Texas Instruments’ detailed engineering reference on power supply decoupling methodology, with impedance analysis and layout rules.
- ESP32 Hardware Design Guidelines โ Espressifย โ Official guidance including supply capacitor requirements for ESP32 modules, RF decoupling recommendations, and layout rules.
Frequently Asked Questions
1. Do I really need decoupling capacitors on a breadboard Arduino project?
Yes, even on a breadboard โ especially if your project uses motors, servos, relays, RF modules, or drives significant LED loads. Without decoupling capacitors, current spikes from switching loads cause brief supply voltage dips that can reset the Arduino or cause corrupted ADC readings. The fix is simple: add a 100 nF ceramic and a 10 ยตF electrolytic across the power rails of your breadboard, physically close to the ATmega or Arduino module. This alone resolves the majority of noise and reset problems that beginners encounter.
2. What happens if I use the wrong capacitor value for the crystal?
Using incorrect crystal load capacitors causes the oscillator to run at a slightly different frequency than nominal. For most sketch purposes โ blinking LEDs, reading sensors โ a few ppm of frequency error is undetectable. For UART serial communication at high baud rates (115200 bps), timing errors from a wrong crystal frequency can cause character corruption. For I2C in clock-stretching scenarios, or for real-time clock applications, frequency accuracy matters more. Always use the value specified in the ATmega328P datasheet (22 pF for the standard 16 MHz crystal) and choose C0G ceramic capacitors for temperature stability.
3. My ESP8266 or ESP32 keeps resetting randomly. Can capacitors fix this?
This is one of the most common issues with ESP modules on Arduino projects, and capacitors are almost always the answer. The WiFi radio draws 300โ600 mA peak current during transmission. If the 3.3V supply can’t deliver this without sagging below the brown-out threshold (approximately 2.5โ2.7V), the module resets. Add a 100โ470 ยตF electrolytic capacitor directly across the 3.3V and GND pins of the module. If using a 3.3V LDO regulator to power the module from a 5V supply, ensure the regulator is rated for at least 600 mA continuous and has adequate output capacitance per its datasheet.
4. Can I use electrolytic capacitors instead of ceramics for decoupling?
Electrolytic capacitors work reasonably well for low-frequency decoupling (bulk charge storage at tens of kHz and below) but have significant ESL (Equivalent Series Inductance) and ESR at high frequencies, which limits their effectiveness for the fast transients generated by microcontroller switching. At 16 MHz and above, an electrolytic capacitor’s impedance rises rather than falls, making it a poor choice as the primary decoupling element. The correct approach is ceramic for high-frequency decoupling (100 nF close to the pin) plus electrolytic for bulk charge storage (10โ100 ยตF at the supply rail). Using only electrolytics without ceramics is a common source of noise problems in beginner designs.
5. How do I know if my Arduino circuit needs more decoupling capacitors?
The signs are: random resets under load, inconsistent sketch uploads, erratic ADC readings that jump unpredictably, I2C or SPI communication errors that appear intermittently, or behavior that changes depending on what else is running in the circuit. The first diagnostic step is to add 100 nF ceramic capacitors to every IC’s VCC pin and 100โ470 ยตF electrolytic to the main supply rail, then observe whether the behavior improves. If you have an oscilloscope, probe the VCC rail at the ATmega power pins with a short probe ground lead and look for dips or spikes during load transitions โ these will tell you directly whether supply decoupling is the issue.
The Practical Takeaway
The capacitor for Arduino and microcontroller circuits isn’t exotic or complicated โ it’s a small number of well-understood components placed correctly to solve a fundamental problem of speed mismatch between fast ICs and slow power supplies. The 100 nF ceramic is the workhorse. The 10โ100 ยตF electrolytic is its partner for bulk energy. The 22 pF crystal cap sets accurate timing. The 100 nF on the RESET pin enables reliable auto-programming. And a 100 nF ceramic at each motor terminal prevents the noisiest component on your board from corrupting everything else.
Get these right from the start โ on both breadboard prototypes and final PCB designs โ and the class of hard-to-diagnose, intermittent failures that costs designers hours of debugging largely disappears.
Written from a PCB and embedded hardware engineering perspective, based on Microchip application notes, official Arduino schematics, and hands-on design experience.