Learn how a resistor and a capacitor together create time. Calculate the time constant, see the charging curve on the oscilloscope and design a low-pass filter that removes noise.
When you press a button, the contact bounces for a few milliseconds and the microcontroller may count one press as five. A sensor cable runs next to motor cables and picks up noise on top of the signal. A device should start working a short while after power arrives. The common cure for all three is the same pair of parts: a resistor and a capacitor. The RC circuit is the simplest way to control time and frequency in electronics.
Theory: the time constant
When you charge a capacitor through a resistor, the voltage does not jump up at once; it approaches the source fast at first, then more and more slowly. One number sets that speed: the time constant, tau = R x C. Ohms times farads gives seconds.
Charge : Vc(t) = V x (1 - e^(-t/tau))
Discharge: Vc(t) = V x e^(-t/tau)
1 tau -> 63.2% 2 tau -> 86.5%
3 tau -> 95.0% 5 tau -> 99.3% ("full" in practice)
Example: V = 12 V, R = 10 kOhm, C = 100 uF
tau = 10 000 x 0.0001 = 1 s
t = 1 s: Vc = 12 x 0.632 = 7.58 V
t = 3 s: Vc = 12 x 0.950 = 11.40 V
t = 5 s: Vc = 12 x 0.993 = 11.92 V
The rule to remember: after 5 tau the capacitor is considered full. The same logic applies to discharge; after 1 tau the voltage falls to 36.8% of where it started.
Seeing the charging curve in Proteus
You could watch a 1-second tau live, but to see it clearly on the oscilloscope let's build a faster circuit. With R = 1 kOhm and C = 100 nF, tau = 0.1 ms.
- Press P and add a RES and a CAP (ceramic capacitor). There is also CAP-ELEC for electrolytics; remember it is polarised.
- Set the resistor to 1k and the capacitor to 100n.
- Choose PULSE from Generator Mode: low level 0 V, high level 5 V, period 2 ms, pulse width 1 ms. The capacitor then charges for 1 ms (10 tau) and discharges for 1 ms.
- Wiring: PULSE output → resistor → top of the capacitor; bottom of the capacitor → GROUND.
- Connect oscilloscope channel A to the PULSE output and channel B to the top of the capacitor. Set both channels to 1 V per division and the time base to 0.2 ms per division.
- Start the simulation.
Channel A: sharp square wave between 0 and 5 V
Channel B: wave with rounded edges
0.1 ms after the rising edge about 3.16 V (63.2%)
0.5 ms after it about 4.97 V (almost 5 V)
0.1 ms after the falling edge about 1.84 V (36.8%)
Now reduce the period to 0.2 ms (pulse width 0.1 ms). The capacitor no longer has time to charge fully; on channel B you see a small, roughly triangular wave. An RC circuit "swallows" pulses shorter than its time constant. That is exactly the idea behind suppressing button bounce.
The low-pass filter
If you apply a sine wave to the same RC circuit, low frequencies pass almost unchanged and high frequencies are attenuated. The frequency at which the output falls to 70.7% of the input (i.e. -3 dB) is the cut-off frequency:
fc = 1 / (2 x pi x R x C)
R = 1 kOhm, C = 100 nF:
fc = 1 / (6.283 x 1000 x 0.0000001) = 1592 Hz
Output for a 2 V input amplitude:
100 Hz -> about 2.00 V
1592 Hz -> about 1.41 V (70.7%)
10 kHz -> about 0.31 V
In Proteus replace PULSE with a SINE generator, set the amplitude to 2 V and change the frequency to 100 Hz, 1592 Hz and 10 kHz in turn. Each time, adjust the oscilloscope time base to the signal and read the peak on channel B. You will also notice that the output lags slightly behind the input (phase shift).
In the field, sensor signals usually change very slowly (temperature, pressure, level). Pulling the cut-off frequency down to a few hertz removes most of the noise from motors and drives before it reaches the ADC.
Try it with the mini simulator
In the mini simulator below, change R and C and watch the time constant and the charging curve update live. Double R and see tau double; cut C to a tenth and watch the curve speed up ten times. Then build the same values in Proteus and compare where 63% falls on the oscilloscope.
Common mistakes
Mixing up unit prefixes: 100 uF = 0.0001 F, not 100 F. 10 kOhm x 100 uF = 1 s; forget the prefixes and you get hours.
Connecting an electrolytic backwards: the positive lead of CAP-ELEC must go to the higher potential. In real life a reversed electrolytic heats up and can burst.
Thinking it is full after 1 tau: after 1 tau it is only at 63%. Wait 5 tau before calling it full.
Exercise
A temperature sensor signal carries 50 Hz noise from the mains. Design an RC low-pass filter with a cut-off around 5 Hz; you have a 10 uF capacitor. Pick R from standard values, find the actual cut-off frequency and estimate the attenuation at 50 Hz. Verify it in Proteus with a 50 Hz sine of 1 V amplitude.
Hint: solve the fc formula for R. At ten times the cut-off frequency the output falls to about one tenth.
Solution
R = 1 / (2 x pi x fc x C) = 1 / (6.283 x 5 x 0.00001) = 3183 ohm
Standard: 3.3 kOhm
fc = 1 / (6.283 x 3300 x 0.00001) = 4.82 Hz
At 50 Hz: |H| = 1 / sqrt(1 + (50/4.82)^2) = 1 / 10.42 = 0.096
1 V noise amplitude -> about 0.096 V at the output
In Proteus set the SINE generator to 1 V, 50 Hz and build the filter with 3.3 kOhm and 10 uF. On the oscilloscope the output drops to about 0.1 V. The slowly changing DC signal of the sensor, on the other hand, passes almost without loss.
In short: tau = R x C sets time, fc = 1/(2 pi RC) sets the frequency limit. In the next lesson you will meet the legendary chip that uses exactly this charge-discharge behaviour: the 555 timer.
// Mini simulator
Move the sliders; the circuit and the values update instantly. Build the same circuit in Proteus and compare.
// Spot the bug +10 XP
Exactly one line below is wrong. Click the faulty line.
At 2 tau the capacitor is only 86.5% charged. In practice "fully charged" means 5 tau: t = 5 x 1 s = 5 s, Vc about 11.92 V (99.3%).
// Mini quiz
Click an option; you will see right away, with the reason, whether it is correct or not.
Mark it when you finish: your progress is saved and you earn +20 XP.
Tip: ← → keys let you move between lessons.


