Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

RC time constant calculator

Resistor and capacitor in → τ, time to reach a voltage and the low-pass corner. Plus the capacitor a debounced push-button needs.

Time constant

V
V
τ = 1 mscharge 0 → 2.5 V 1.42 msdischarge 3.3 → 2.5 V 278 µslow-pass corner 159 Hz
Voltage after 1 to 5 time constants
AfterTimeChargedV chargingV discharging
1 τ1 ms63.2 %2.09 V1.21 V
2 τ2 ms86.5 %2.85 V0.45 V
3 τ3 ms95.0 %3.14 V0.16 V
4 τ4 ms98.2 %3.24 V0.06 V
5 τ5 ms99.3 %3.28 V0.02 V

Button debounce RC

Pull-up R from the pin to VCC, capacitor from the pin to GND, button across the capacitor (through 100–470 Ω to limit the discharge spike).

ms
kΩ
C ≥ 721 nFfit 1 µF (next E6 value)release delay with it 13.9 msτ 10 ms

Slow edge, no guaranteed hysteresis. The classic ESP32 datasheet gives no input hysteresis figure, so a slow RC edge on an interrupt pin can still fire more than once. Put a 74HC14 Schmitt inverter after the RC, or keep a short software debounce as well.

How it works

τ = R × C    charging: V(t) = Vs(1 − e−t/τ)    discharging: V(t) = V0·e−t/τtime to reach V: t = −τ·ln(1 − V/Vs)    fc = 1 ÷ (2π·R·C)

10 kΩ × 100 nF = 1 ms. After 1 τ a charging capacitor is at 63.2 % of the supply, after 3 τ at 95 %, after 5 τ at 99.3 %. The same pair is a low-pass filter with its −3 dB corner at fc — 159 Hz here, handy for smoothing a PWM or a noisy ADC input.

Sizing a debounce capacitor

When the button closes it empties the capacitor. While the contacts bounce open, the capacitor refills through the pull-up — and the pin must not climb past its HIGH threshold VIH before the bouncing stops:

C ≥ tbounce ÷ (R × −ln(1 − VIH/VCC))

Most tactile switches settle within 5–10 ms; cheap or worn ones can bounce for 20 ms. The tool rounds the capacitor up to the next E6 value (1.0, 1.5, 2.2, 3.3, 4.7, 6.8) — ceramic capacitors drift ±10–20 %, so a little margin helps.

FAQ

How long does a capacitor take to charge fully?

About 5 time constants (5 × R × C) gets it to 99.3 % of the supply, which is "fully charged" for practical purposes. After 1 τ it is at 63.2 %.

Can I use the ESP32 internal pull-up for an RC debounce?

Yes, but it is roughly 45 kΩ and varies a lot between chips, so the delay is only approximate. An external 10 kΩ pull-up gives a predictable time; size the capacitor for it here.

Hardware or software debounce?

Software debounce (ignore changes for 20–50 ms) is free and fine for most buttons polled in loop(). Use an RC when the button drives an interrupt or wakes the board from deep sleep, where every bounce would fire the handler.

↑↓ to move · Enter to open