The Direct Answer: Calculating and Picking Your RC Cutoff

The cutoff frequency of an RC circuit is the point where the output signal power drops by half (-3 dB), calculated using the formula f_c = 1 / (2 π R C). If you need a reliable, general-purpose low-pass filter for audio anti-aliasing or smoothing a microcontroller PWM signal into a pseudo-analog DC voltage, do not overthink the initial prototype.

Default Bench Pick: For a target cutoff frequency around 2 kHz, use a 10 kΩ resistor (1% tolerance) and an 8.2 nF capacitor (C0G/NP0 dielectric). This yields an actual cutoff of 1.94 kHz, providing a low output impedance that won't easily load down when connected to an ADC or op-amp.

While the math is straightforward, the physical realities of component parasitics, source impedance, and load impedance dictate whether your breadboard circuit will actually match your simulation. Below is the decision-forward guide to selecting your topology, picking standard E12/E24 values, and knowing exactly when a passive RC network will fail you.

Topology Showdown: Low-Pass vs. High-Pass Configurations

An RC filter relies on the frequency-dependent reactance of a capacitor (X_c = 1 / (2 π f C)). Depending on which component shunts the signal to ground, you get fundamentally different behaviors.

Node Definitions

  • Node 1 (V_in): The signal source.
  • Node 2 (V_out): The junction between the two components, where the filtered signal is extracted.
  • Node 3 (GND): The common return path.
Topology Series Element (N1 to N2) Shunt Element (N2 to N3) Primary Use Case
Low-Pass (LPF) Resistor (R) Capacitor (C) Smoothing PWM, removing high-frequency noise, anti-aliasing before an ADC.
High-Pass (HPF) Capacitor (C) Resistor (R) AC coupling, blocking DC offsets, removing low-frequency hum (e.g., 50/60Hz mains).

Why choose LPF over HPF? You choose a low-pass topology when your signal of interest is near DC or low-frequency, and you want to reject high-frequency switching noise (like a 20 kHz PWM carrier). You choose a high-pass topology when your signal is AC (like audio) and you need to strip away a DC bias voltage that would otherwise offset your amplifier's operating point. They are not interchangeable; they solve opposite problems.

Component Behavior & Extreme Failure Modes

Before soldering, you must understand how component drift and catastrophic failures affect the node voltages. A shorted capacitor in a low-pass filter doesn't just change the cutoff frequency; it kills the signal entirely.

Behavior Matrix: What Changes When You Alter a Value

Change Effect on Cutoff Frequency (f_c) Effect on Circuit Behavior
Increase R Decreases f_c Increases thermal noise; raises output impedance (makes it susceptible to loading by the next stage).
Decrease R Increases f_c Lowers output impedance; increases current draw from the source (can overload weak GPIO pins).
Increase C Decreases f_c Increases physical board footprint; introduces higher parasitic inductance (ESL) which ruins high-frequency rejection.
Decrease C Increases f_c Makes the circuit highly susceptible to stray breadboard capacitance (usually 2-5 pF per node), causing unpredictable cutoff shifts.

Failure Mode Contrast: What Breaks at the Extremes?

Assuming a Low-Pass Filter topology (R in series, C to ground):

  • R Opens: V_out floats to 0V. No signal passes. The circuit is dead.
  • R Shorts: V_out equals V_in. The filter is bypassed entirely; full high-frequency noise passes to your load.
  • C Opens: V_out equals V_in. The shunt path is broken, turning the filter into a simple pass-through wire.
  • C Shorts: V_out is hard-grounded to 0V. The signal is destroyed, and if the source lacks current limiting, the resistor or source pin will burn up.

Design Walkthrough: Smoothing a 20 kHz ESP32 PWM Signal

Let's design a low-pass filter to convert a 20 kHz PWM signal from an ESP32 LEDC peripheral into a clean DC voltage for a motor controller or analog meter.

Step 1: Define the Target Cutoff
The PWM carrier is at 20,000 Hz. To achieve a reasonably smooth DC output with minimal ripple, the cutoff frequency should be at least one decade (10x) below the carrier frequency. Target f_c = 2,000 Hz.

Step 2: Pick the Resistor
We need an output impedance low enough to drive an ADC but high enough not to exceed the ESP32's GPIO current limits (typically 40mA max, but 12mA is safe). A 10 kΩ resistor limits current to 0.33mA at 3.3V, which is perfectly safe and provides a reasonable impedance.

Step 3: Calculate the Capacitor
Rearranging the formula: C = 1 / (2 π R f_c)
C = 1 / (2 * 3.14159 * 10,000 * 2,000) = 7.957 nF

Step 4: Select the Real-World Component
7.957 nF is not a standard value. Looking at the E12 series, the closest standard capacitor is 8.2 nF.
Recalculating the actual cutoff: f_c = 1 / (2 * π * 10,000 * 8.2e-9) = 1,940 Hz. This is close enough to our 2 kHz target.

Dielectric Matters: Do not just grab any 8.2 nF capacitor. For PWM smoothing or audio, specify a C0G/NP0 ceramic dielectric. Standard X7R or Y5V capacitors exhibit severe voltage coefficients (capacitance drops as voltage increases) and microphonic piezoelectric effects that will inject noise into your "clean" DC signal.

Breadboard Testing & Verification Steps

Do not trust the math until you verify it on the bench. Stray capacitance on a solderless breadboard can easily add 5 pF to your node, shifting a high-frequency cutoff. Here is how to validate your 1.94 kHz LPF.

  1. Wire the Source: Connect the ESP32 PWM output (e.g., GPIO 25) to one leg of the 10 kΩ resistor.
  2. Wire the Junction: Connect the other leg of the resistor to one leg of the 8.2 nF C0G capacitor. This junction is your V_out.
  3. Wire Ground: Connect the second leg of the capacitor to the breadboard's common ground rail. Tie the ESP32 GND to this same rail.
  4. Probe V_out: Connect your oscilloscope probe (set to 10x attenuation to minimize probe capacitance loading) to the V_out junction. Connect the probe ground clip to the ground rail.
  5. Measure Ripple: Set the ESP32 PWM duty cycle to 50% (1.65V nominal DC). Observe the AC ripple on the scope. A properly functioning 1.94 kHz filter against a 20 kHz carrier should show a peak-to-peak ripple of less than 50 mV.
  6. Sweep Test (Optional): If you have a function generator, replace the ESP32 with a 3.3Vpp sine wave. Sweep from 100 Hz to 20 kHz. Verify that the amplitude at 1.94 kHz is exactly 2.33Vpp (-3 dB down from 3.3Vpp).

The Final Verdict: When to Upgrade to an Active Filter

A 1st-order passive RC filter rolls off at a gentle -20 dB/decade. It is cheap, requires no power, and is impossible to miswire into oscillation. However, it has hard physical limits. Use the decision tree below to know exactly when to abandon the passive RC and switch to an active topology.

If your application requires... The Passive RC Problem The Concrete Active Solution
A load impedance lower than 50 kΩ The load acts as a parallel resistor, shifting your cutoff frequency higher and ruining the attenuation. Buffer the RC output with a MCP6001 rail-to-rail op-amp configured as a unity-gain voltage follower.
A steep roll-off to completely eliminate a nearby frequency (e.g., 60Hz hum near a 50Hz signal). -20 dB/decade is too shallow; the interfering signal will still pass through at significant amplitude. Build a 2nd-order Sallen-Key Butterworth filter using a TL072 dual op-amp, yielding -40 dB/decade.
Gain greater than 1 (amplifying the filtered signal simultaneously). Passive RC networks are strictly attenuators; they can only reduce signal amplitude. Use a non-inverting active low-pass topology with an OPA2340 to filter and apply +6dB gain in one stage.

For 90% of hobbyist and prototyping tasks—like reading a slow-moving sensor, smoothing a DAC, or basic audio coupling—the 10 kΩ / 8.2 nF passive RC pair is the undisputed starting point. It balances source loading, component availability, and stray capacitance immunity. Only move to active op-amp topologies when the load impedance or roll-off slope forces your hand. For deeper theoretical analysis on filter Q and damping, refer to the comprehensive guides on All About Circuits and Electronics Tutorials.