RC Filter Calculator: Cutoff Frequency, Picking R or C, and How Much Signal Gets Through
One resistor and one capacitor make the simplest filter there is: a low-pass that smooths a noisy sensor or a PWM output, or a high-pass that blocks DC and passes the signal. This calculator gives the cutoff frequency from R and C, or picks a standard resistor (E24) or capacitor (E6) for a target cutoff. Enter a signal frequency too, and it tells you how much of that signal gets through.
The formula
fc = 1 ÷ (2π × R × C)
At the cutoff frequency, the output is 70.7% of the input (−3 dB), with a 45° phase shift. Example: R = 10 kΩ and C = 100 nF give fc ≈ 159 Hz. That low-pass passes 50 Hz almost untouched (95% of the amplitude) but cuts 1.6 kHz down to about 10%.
The rolloff of a single RC stage is gentle: 20 dB per decade. Ten times past the cutoff, the signal is down to about 10%. A hundred times past, about 1%. If you need a sharper edge, cascade two stages (with a buffer between them, or make the second stage's R about 10 times larger), or use an active filter.
Low-pass or high-pass?
- Low-pass: R in series, C from the output to ground. Passes slow changes and blocks fast ones. Typical uses: smoothing an analog sensor before an ADC, turning PWM into an analog voltage, removing switching noise.
- High-pass: C in series, R from the output to ground. Blocks DC and slow drift. Typical uses: AC-coupling an audio signal, removing a DC offset before an amplifier.
Practical notes
- PWM to analog: put the cutoff well below the PWM frequency. Arduino Uno PWM on most pins runs at about 490 Hz. A 10 kΩ / 10 µF low-pass (fc ≈ 1.6 Hz) gives a smooth voltage with little ripple, but takes a few hundred milliseconds to settle. That trade-off between ripple and response time is what you're tuning.
- Settling time: after a step, the output reaches about 63% in one time constant (RC) and about 99% in five.
- Mind the load. Whatever you connect to the output sits in parallel with the capacitor (low-pass) or the resistor (high-pass) and shifts the cutoff. Keep the load impedance at least ten times higher than R, or buffer the output with an op-amp.
- ADC inputs: a small capacitor from an analog pin to ground, together with a resistor or the resistance of a voltage divider, forms exactly this low-pass. The divider's effective R is R1 and R2 in parallel.
- Capacitor tolerance is usually ±5–20%, so the real cutoff can easily be off by that much. That's also why the calculator only picks capacitors from the coarse E6 series: it's what you can actually buy everywhere.
More calculators: Tools page.
Worked examples
Smoothing a 490 Hz Arduino PWM signal
Assume an Arduino PWM signal has a carrier frequency of 490 Hz. Choose a low-pass target cutoff of 10 Hz and a 1 µF capacitor. Use the target-cutoff-and-capacitor mode; its capacitor field takes nanofarads, so enter 1000 nF.
First solve R = 1 / (2π × 10 × 1 × 10⁻⁶) ≈ 15,915.49 Ω. The widget compares E24 candidates by logarithmic distance and selects 16 kΩ.
Recalculate with that standard resistor: fc = 1 / (2π × 16,000 × 10⁻⁶) ≈ 9.947184 Hz. The widget displays 9.947 Hz. Cutoff error is (9.947184 / 10 − 1) × 100 ≈ −0.528%. The time constant is RC = 16,000 × 10⁻⁶ = 0.016 s, displayed as 16 ms.
For the carrier, calculate x = 490 / 9.947184, then gain = 1 / √(1 + x²) ≈ 0.0202962. The widget reports 2.0% amplitude and −33.9 dB.
Practical caveat: that gain applies to a sinusoidal component at the carrier frequency. PWM contains harmonics, so this percentage is not a direct prediction of peak-to-peak output ripple.
AC-coupling an audio signal
Suppose an amplifier input needs a high-pass cutoff near 100 Hz, with R fixed at 10 kΩ, an E24 value. Choose the target-cutoff-and-resistor mode and select high-pass response.
The ideal capacitor is C = 1 / (2π × 100 × 10,000) ≈ 159.1549 nF. The widget selects 150 nF from its E6 capacitor list. This is also a valid E12 value.
With that capacitor, fc = 1 / (2π × 10,000 × 150 × 10⁻⁹) ≈ 106.1033 Hz, displayed as 106.1 Hz. The cutoff error is approximately +6.10%. The time constant is 10,000 × 150 × 10⁻⁹ = 0.0015 s, or 1.5 ms.
At 1000 Hz, x = 1000 / 106.1033 and gain = x / √(1 + x²) ≈ 0.994418. The widget displays 99.4% amplitude (about −0.05 dB).
Practical caveat: a coupling capacitor blocks DC but does not establish the amplifier's required input bias; provide the appropriate bias connection separately.
Common mistakes
- Entering angular frequency in radians per second into a field labeled Hz.
- Reading amplitude percentage as power percentage; the widget calculates voltage amplitude ratio.
- Expecting capacitor-selection mode to search E24; it searches E6 even when finer values are available.
- Using the low-pass response equation for an AC-coupling high-pass circuit.
Comments
Post a Comment