# RC Circuit Formula Derivation Using Calculus

*Eugene is a qualified control/instrumentation engineer Bsc (Eng) and has worked as a developer of electronics & software for SCADA systems.*

## What are Capacitors Used For?

Capacitors are used in electrical and electronic circuitry for a variety of reasons. Typically these are:

- Smoothing of rectified AC, pre-regulation in DC power supplies
- Setting the frequency of oscillators
- Bandwidth setting in low pass, high pass, band pass and band reject filters
- AC coupling in multistage amplifiers
- Bypassing transient currents on power supply lines to ICs (decoupling capacitors)
- Starting of induction motors

## Time Delays in Electronic Circuits

Whenever capacitance and resistance occurs in an electronic or electrical circuit, the combination of these two quantities results in time delays in transmission of signals. Sometimes this is the desired effect, other times it may be an unwanted side effect. Capacitance may be due to an electronic component, i.e a real physical capacitor, or stray capacitance caused by conductors in proximity (e.g. tracks on a circuit board or cores in a cable). Similarly resistance may be the result of actual physical resistors or inherent series resistance of cables and components.

## Transient Response of an RC Circuit

In the circuit below, the switch is initially open, so before time t = 0, there is no voltage feeding the circuit. Once the switch closes, the supply voltage V_{s} is applied indefinitely. This is known as a *step input. *The response of the RC circuit is called a *transient response*, or *step response* for a step input.

## Time Constant of an RC Circuit

When a step voltage is first applied to an RC circuit, the output voltage of the circuit doesn't change instantly. It has a time constant due to the fact that current needs to charge the capacitance. The time taken for the output voltage (the voltage on the capacitor) to reach 63% of its final value is known as the time constant, often represented by the Greek letter tau (τ). The time constant = RC where R is the resistance in ohms and C is the capacitance in farads.

## Stages in the Charging of the Capacitor in an RC Circuit

In the circuit above V_{s} is a DC voltage source. Once the switch closes, current starts to flow via the resistor R. Current begins to charge the capacitor and voltage across the capacitor V_{c}(t) starts to rise. Both V_{c}(t) and the current i(t) are functions of time.

Using Kirchhoff's voltage law around the circuit gives us an equation:

V

_{s}- i(t)R - V_{c}(t) = 0 ............Eqn(1)

**Initial Conditions:**

If the capacitance of a capacitor in farads is C, the charge on the capacitor in coulombs is Q and the voltage across it is V, then:

C = Q/V

therefore

V = Q/C ..............................Eqn (2)

Since there is initially no charge Q on the capacitor C, the initial voltage V_{c}(t) is

V

_{c}(0) = Q/C = 0/C = 0

The capacitor behaves initially like a short circuit and current is limited only by the series connected resistor R.

We check this by examining KVL for the circuit again:

V

_{s}- i(t)R - V_{c}(t) = 0V

_{c}(t) at time t = 0 is V_{c}(0) = 0 so substituting into Eqn (1) for V_{c}(t) gives us:V

_{s}- i(0)R - 0 = 0so V

_{s}- i(0)R = 0and rearranging V

_{s}= i(0)Rtherefore i(0) = V

_{s}/R ...................Eqn (3)

So the initial conditions of the circuit are time t = 0, Q = 0, i(0) = V_{s}/R and V_{c}(0) = 0

**Current through the resistor as the capacitor charges**

As the capacitor charges, voltage across it increases since V = Q/C and Q is increasing. Let's look at what happens current.

Examining KVL for the circuit we know V_{s} - i(t)R - V_{c}(t) = 0

Rearranging the equation gives us the current through the resistor:

i(t) = ( Vs - V

_{c}(t) ) / R

Vs and R are constants, so as the capacitor voltage V_{c}(t) increases , i(t) decreases from its initial value V_{s}/R at t = 0.

Since R and C are in series, i(t) is also the current through the capacitor.

**Voltage across the capacitor as it charges**

Again KVL tells us that V_{s} - i(t)R - V_{c}(t) = 0

Rearranging the equation gives us the capacitor voltage:

V

_{c}(t) = V_{s}- i(t)R

Initially V_{c}(t) is 0, however as current decreases, the voltage dropped across the resistor R decreases and V_{c}(t) increases. After 4 time constants, it has reached 98% of its final value. After 5 times constants, i.e 5τ = 5RC, for all practical purposes, i(t) has decreased to 0 and V_{c}(t) = V_{s} - 0R = Vs.

So the capacitor voltage equals the supply voltage V_{s}.

## Transient Analysis of An RC Circuit

**Working Out an Equation for the Voltage Across the Capacitor in an RC Circuit**

Working out the response of a circuit to an input that puts it in an unsteady state is known as *transient analysis*. Determining an expression for the voltage across the capacitor as a function of time (and also current through the resistor) requires some basic calculus.

**Analysis Part 1 - Working Out the Differential Equation for the Circuit:**

From KVL we know that:

V

_{s}- i(t)R - V_{c}(t) = 0

From Eqn (2) we know that for the capacitor C:

V

_{c}= Q/C

Multiplying both sides of the equation by C and rearranging gives us:

Q = CV

_{c}

If we now take the derivative of both sides of the equation wrt time, we get:

d/dt(Q) = d/dt(CV

_{c}) = C d/dt(V_{c})or

dQ/dt = C dV

_{c}/dt

But dQ/dt or the rate of change of charge is the current through the capacitor = i(t)

So:

i(t) = C dV

_{c}/dt ..................... Eqn (4)

We now substitute this value for current into eqn (1), giving us a differential equation for the circuit:

V

_{s}- i(t)R - V_{c}(t) = 0Substituting:

V

_{s}- C dVc/dt R - V_{c}(t) = 0Rearranging:

RC dV

_{c}/dt + V_{c}(t) = Vs

Now divide both sides of the equation by RC, and to simplify the notation, replace dVc/dt by Vc' and Vc(t) by V_{c} - This gives us a differential equation for the circuit:

V

_{c}' + 1/RC V_{c}= V_{s}/ RC ..................... Eqn (5)

**Analysis Part 2 - Steps to Solving the Differential Equation**

We now have a first order, linear, differential equation in the form y' + P(x)y = Q(x).

This equation is reasonably straightforward to solve using an integrating factor.

For this type of equation we can use an integrating factor μ = e^{∫Pdx}

**Step 1: **

In our case if we compare our equation, eqn (5) to the standard form, we find P is 1/RC and we're also integrating wrt t, so we work out the integrating factor as:

μ = e

^{∫Pdt }= e^{∫1/RCdt}= e^{t/RC}

**Step 2:**

Next multiply the left side of eqn (5) by μ giving us:

e

^{t/RC }V_{c}' + e^{t/RC}(1/RC) V_{c}

But e^{t/RC}(1/RC) is the derivative of e^{t/RC} (function of a function rule and also because of the fact the derivative of exponential e raised to a power is itself. I.e. d/dx(e^{x }) = e^{x}

Therefore:

e

^{t/RC }V_{c}' + e^{t/RC}(1/RC) V_{c }can be rewritten as:e

^{t/RC }V_{c}' + Vc d/dt (e^{t/RC})

However knowing the product rule of differentiation:

e

^{t/RC }V_{c}' + Vc d/dt(e^{t/RC}) = d/dt (e^{t/RC}Vc)

So the left side of eqn (5) has been simplified to:

d/dt (e

^{t/RC}Vc)

Equating this to the right side of eqn (5) (which we also need to multiply by the integrating factor e^{t/RC }) gives us:

d/dt (e

^{t/RC}Vc) = e^{t/RC }(V_{s }/ RC)

**Step 3:**

Now integrate both sides of the equation wrt t:

∫ d/dt (e

^{t/RC}Vc) dt = ∫ (e^{t/RC}(V_{s }/ RC) ) dt = V_{s}∫ (e^{t/RC}(1/ RC) ) dt

The left side is the integral of the derivative of e^{t/RC} Vc, so the integral resorts to e^{t/RC} Vc again.

On the right hand side of the equation, by taking the constant V_{s }outside the integral sign, we're left with e^{t/RC }multiplied by 1/RC. But 1/RC is the derivative of the exponent t/RC. So this integral is of the form ∫ f(u) u' dt = ∫f(u) du and in our example u = t/RC and f(u) = e^{t/RC} Therefore we can use the reverse chain rule to integrate.

So let u = t/RC and f(u) = e^{u} giving:

∫ f(u) u' dt = ∫ (e

^{t/RC}(1/ RC) )dt =∫ f(u) du = ∫ e^{u}du = e^{u}= e^{t/RC}

So the right side of the integral becomes:

V

_{s}∫ (e^{t/RC}(1/ RC) ) dt = V_{s}e^{t/RC}

Putting the left and right halves of the equation together and including the constant of integration:

e

^{t/RC}Vc = V_{s}e^{t/RC}+ C

Divide both sides by e^{t/RC} to isolate Vc:

Vc = V

_{s }+ Ce^{-t/RC }................. Eqn(6)

**Step 4:**

Evaluation of the constant of integration:

At time t = 0, there is no voltage on the capacitor. So Vc = 0. Substitute V_{c} = 0 and t = 0 into eqn (6):

0 = V

_{s }+ Ce^{-0/RC}= V_{s}+ Ce^{0}= V_{s }+ C 1 = Vs + CSo C = - V

_{s}

Substitute for C back into Eqn (6):

Vc = V

_{s }- V_{s}e^{-t/RC}= V_{s }(1 - e^{-t/RC})

So this gives us our final equation for the voltage on the capacitor as a function of time:

V

_{c}(t) = V_{s }(1 - e^{-t/RC}) .....................Eqn (7)

Now that we know this voltage, it's a simple matter to work out the capacitor charging current also. As we noticed earlier, the capacitor current equals the resistor current because they're connected in series:

i(t) = (V

_{s}- V_{c}(t)) / R

Substituting for V_{c}(t) from eqn (6):

i(t) = (Vs - V

_{s }(1 - e^{-t/RC}) ) / R= ( V

_{s }_{e-t/RC}) / R = V_{s}/R ( e^{-t/RC})

So our final equation for current is:

i(t) = V

_{s}/R ( e^{-t/RC}) ................... Eqn (8)

## Transient Response of an RC Circuit

## Discharge Equations and Curves for an RC Circuit

Once a capacitor is charged, we can replace the supply by a short circuit and investigate what happens capacitor voltage and current as it discharges. This time current flows out of the capacitor in the reverse direction. In the circuit below, we take KVL around the circuit in a clockwise direction. Since current flows anticlockwise, the potential drop across the resistor is positive. The voltage across the capacitor "points the other way" to the clockwise direction we're taking KVL, so its voltage is negative.

So this gives us the equation:

i(t)R - V

_{c}(t) = 0

*Note that we could have taken KVL anti-clockwise around the loop, then the equation would be: V _{c}(t) - i(t)R = 0 . The important thing is that we assume a current direction first, then stay consistent. So voltage sources "pointing" and more positive in the direction we take KVL are positive and current flowing in the direction we take KVL cause negative PD across resistors. *

Again the expression for voltage and current can be found by working out the solution to the differential equation for the circuit.

**Example:**

An RC circuit is used to produce a delay. It triggers a second circuit when it's output voltage reaches 75% of it's final value. If the resistor has a value of 10k (10,000 ohms), and triggering must occur after an elapsed time of 20ms, calculate a suitable value of capacitor.

**Answer:**

We know the voltage on the capacitor is V_{c}(t) = V_{s }(1 - e^{-t/RC})

The final voltage is V_{s}

75% of the final voltage is 0.75 V_{s}

So triggering of the other circuit occurs when:

V_{c}(t) = V_{s }(1 - e^{-t/RC}) = 0.75 V_{s}

Dividing both sides by V_{s} and replacing R by 10 k and t by 20ms gives us:

(1 - e^{-20 x 10^-3/(10^4 x C)}) = 0.75

Rearranging

e^{-20 x 10^-3/(10^4 x C)} = 1 - 0.75 = 0.25

Simplifying

e^{-2 x 10 ^ -7 / C} = 0.25

Take the natural log of both sides:

ln(e^{-2 x 10 ^ -7 / C} ) = ln (0.25)

But ln (e^{a}) = a

So:

-2 x 10^{-7} / C = ln (0.25)

Rearranging:

C = (-2 x 10^{-7}) / ln (0.25)

= 0.144 x 10^{-6 } F or 0.144 μF

## The 555 Timer IC

The 555 timer IC (integrated circuit) is an example of an electronic component that makes use of an RC circuit to set timing. The timer can be used as an astable multivibrator or oscillator and also a one-shot monostable multivibrator (it outputs a single pulse of varying width every time its input is triggered).

The time constant and frequency of the 555 timer are set by varying the values of a resistor and capacitor connected to the discharge and threshold pins.

Datasheet of the 555 timer IC from Texas Instruments.

## Recommended Books

*Introductory Circuit Analysis* by Robert L Boylestad covers the basics of electricity and circuit theory and also more advanced topics such as AC theory, magnetic circuits and electrostatics. It's well illustrated and suitable for high school students and also first and second year electric or electronic engineering students. This hardcover 10th edition is available from Amazon with a "good - used" rating. Later editions are also available.

## References

Boylestad, Robert L, *Introductory Circuit Analysis* (1968) published by Pearson

ISBN-13: 9780133923605

**© 2020 Eugene Brennan**