Skip to main content

RC Circuit: Charging and Discharging a Capacitor

RC Circuit - discharging capacitor
Level 3 (with higher mathematics)
Level 3 requires the basics of vector calculus, differential and integral calculus. Suitable for undergraduates and high school students.
Updated by Alexander Fufaev on
Table of contents
  1. What is an RC circuit? Here you will learn how an RC circuit is built and how it works.
  2. Charging a capacitor Hier wird die Formel für die Spannung und Strom am Kondensator hergeleitet und erklärt und zwar während der Kondensator aufgeladen wird.
  3. Discharging a capacitor Here the formula for the voltage and current across the capacitor is derived and explained while the capacitor is discharging.

RC circuit is a useful component that you will often encounter in electronics. For example, they are used as a so-called low-pass filter, with which you can filter out high frequencies of the applied AC voltage. 'Low pass' basically means that low frequencies are allowed to pass and high frequencies of the AC voltage are blocked. Other applications of an RC circuit include:

  • Generation of a sawtooth-shaped voltage

  • Turn signal lights of a car

  • Artificial pacemaker

What is an RC circuit?

The 'R' stands for a Resistor and the 'C' stands for a Capacitor. So an RC circuit is a simple resistor-capacitor circuit. The resistor and capacitor are connected in series.

RC Circuit: Charging Capacitor
The switch is switched to the left. The capacitor is charged via a resistor.
RC Circuit: Discharging Capacitor
The switch is switched to the right. The capacitor is discharged via a resistor.

In illustration 1 or 2 you can see such an RC circuit. A capacitor connected with a resistor is of course useless without an applied voltage. Therefore the circuit also has a switch which can be switched to the left or to the right to turn off or on the source voltage.

  • When the switch is turned to the left, a constant voltage \(U_0\) is applied to the RC element (illustration 1). An electric current \(I(t)\) (a charging current) starts to flow through the resistor and capacitor. The current decreases over time. On the other hand, the voltage \(U_{\text C}(t)\) on the capacitor, which was zero at the beginning, increases with time until the capacitor is fully charged to the value \(U_0\).

  • If the switch is turned to the right, the capacitor is discharged again via the resistor (illustration 2). The flowing current \(I(t)\) (a discharge current) is maximum at the moment the switch has just been pushed and decreases with time until it becomes zero when the capacitor is completely discharged. The voltage \(U_{\text C}(t)\) across the capacitor also decreases with time.

Charging a capacitor

As soon as the switch is turned to the left, a constant voltage \(U_0\) (source voltage) is immediately applied to the resistor and the capacitor (RC element). This is the total voltage that is continuously applied to the RC element. But, what about the current flowing through the RC element? And, what about the voltage \( U_{\text R} \) across the resistor and the voltage \( U_{\text C} \) across the capacitor individually?

Formulate differential equation for the charging current

To examine these three quantities, we use the Kirchhoff's voltage law (2nd Kirchoff law). According to the Kirchhoff's voltage law, the sum of all signed voltages must be zero. In our case the source voltage \(U_0\) is the total voltage. That means the voltage \( U_{\text R} \) at the resistor and the voltage \( U_{\text C} \) at the capacitor together form the total voltage:

Total voltage is the sum of the individual voltages
Formula anchor

The source voltage \(U_0\) is known because we set it ourselves. The voltages \(U_{\text R}\) and \(U_{\text C}\) on the other hand are not known. Therefore we have to try to represent them in a different way.

According to Ohm's law, we can express the voltage \( U_{\text R} \) at the resistor \(R\) with the help of the current \(I\) flowing through the entire circuit:

U0 equals R times I plus Uc
Formula anchor

For the capacitor having the capacitance \(C\), the charge \(Q\) on its capacitor plates is given by: \(Q = C \, U_{\text C} \). If we rearrange this formula for \( U_{\text C} \) and substitute in 2, we get:

U0 equals R times I plus Q divided by C
Formula anchor

We haven't won much yet, since \(I\) and \(Q\) are also unknown. But now comes the crucial step: We see in the experiment that the current \(I\) is time dependent: \(I(t)\). Thus the charge \(Q\) on the capacitor plates must increase with time. The charge must therefore also be time-dependent in some way: \(Q(t)\). We just don't know how yet! To figure out this time dependence exactly, we need to turn the equation 3 we set up into a differential equation. For this purpose we differentiate the whole equation with respect to time \(t\):

Sum of voltages differentiated with respect to time
Formula anchor

Since the constant voltage \(U_0\) is time independent, its derivative is omitted. The resistance \(R\) is also constant, therefore we may move it before the time derivative. This is also true for the capacitance \(C\). The time derivative of the charge \(Q(t)\) is exactly the definition of the current \(I(t)\):

Zero equals resistance times time derivative of current plus 1 divided by capacitance times current
Formula anchor

Let's also divide the whole equation by \(R\) for a more compact representation and put the time derivative to the left side:

Differential equation for the charging current
Formula anchor

Wir haben durch die Zeitableitung eine sogenannte homogene lineare Differentialgleichung 1. Ordnung für den Strom \(I(t)\) erhalten. Wenn wir diese Differentialgleichung lösen, dann bekommen wir heraus, wie der Strom \(I(t)\) genau von der Zeit \(t\) abhängt. Wir können beispielsweise die Lösungsmethode 'Trennung der Variablen' aus der Mathematik benutzen, um diese Differentialgleichung zu lösen. Zu der Differentialgleichung brauchen wir noch eine sogenannte Anfangsbedingung, damit unsere Lösung für den Strom eindeutig wird. Der Strom \(I_0\) zum Zeitpunkt \(t = 0\) entsprach dem Wert, der durch unsere Quellspannung vorgegeben ist: \( I_0 ~=~ \frac{U_0}{R} \). Und das ist unsere Anfangsbedingung. We have obtained a so-called homogeneous linear differential equation of 1st order for the current \(I(t)\). If we solve this differential equation, we get how the current \(I(t)\) depends exactly on the time \(t\). For example, we can use the 'separation of variables' solution method from mathematics to solve this differential equation. In addition to the differential equation we need a so-called initial condition to make our solution for the current unique. The current \(I_0\) at time \(t = 0\) corresponded to the value given by our source voltage: \( I_0 ~=~ \frac{U_0}{R} \). And this is our initial condition.

Current during charging

Solving the differential equation 6 together with the associated initial condition, yields a formula for the current \(I(t)\), with \(I_0 ~=~ \frac{U_0}{R}\):

Formula anchor

This is the charging current that flows through the resistor and capacitor as soon as we turn the switch to the left, that is apply the voltage \(U_0\) to the RC element. The current decreases exponentially. You can see this directly from the minus sign in the exponential function. If you plot the function \(I(t)\) in a current-time diagram, you will get such a graph:

Current-Time Graph: Charging a Capacitor
The charging current decreases exponentially over time during charging.

From the graph we can get the following information about the current:

  • At the time \(t = 0\) (that is at the time of switching on) the current had its maximum value \( I_0 = \frac{U_0}{R} \). We can control this maximum value by choosing a different resistor \(R\) or a different voltage \(U_0\).

  • The current \(I(t)\) decreases exponentially with time to zero. Once the current is practically zero, we expect the capacitor to be fully charged.

If you look at the exponential equation 7 for the current, you will see that the factor \(\frac{1}{RC}\) occurs in the exponent. We call the product \(R\,C\) the time constant. It is so called because it has the unit of time and, because it is a constant, since both \(R\) and \(C\) are constant. For example, we can ask the following question:

What is the current when the time \( t = R\,C\) has passed?

Let's insert this time into the equation 7:

Formula for the charging current after time RC
Formula anchor

Answer: After the time \( t = R\,C\) the current decreases to 37% of the maximum value \(\frac{U_0}{R}\)

With this time constant \(R\,C\) we can practically experimentally adjust the slope of the exponential function to our needs.

  • If you want the capacitor to take longer to charge, then you must choose the resistance \(R\) or capacitance \(C\) as LARGE as possible, so that the time constant \(R\,C\) also becomes as large as possible. Due to a larger time constant, the exponential function becomes flatter and the current decreases more slowly to zero. The capacitor is therefore charged more slowly.

  • If you want the capacitor to be charged as fast as possible, then you have to choose the resistance \(R\) or capacitance \(C\) as SMALL as possible, so that the time constant \(R\,C\) is as small as possible. Due to a smaller time constant, the exponential function becomes steeper and the current drops to zero faster. The capacitor is therefore charged more quickly.

Example: Current after 0.01 seconds of charging

A source voltage \(U_0 = 1 \, \text{kV}\) is applied to resistor with resistance \(R = 2 \, \text{k}\Omega \) and capacitor of capacitance \( C = 1 \, \mathrm{\mu F} \). What is the charging current after \( t = 0.01 \, \text{s}\)?

The time constant is:

Example value for time constant RC
Formula anchor

Thus, the charging current after 0.01 seconds is:

Example value 3 microampere for charging current
Formula anchor

Voltage at the capacitor during charging

What about the voltage \( U_{\text C} \) across the capacitor when the capacitor is charged? To answer this question, we just need to use the equation 2 written down earlier for the total voltage:

Total voltage equals resistance times current plus capacitor voltage
Formula anchor

Here, Ohm's law \( R\, I(t) \) was used for \(U_{\text R}(t)\). Let's rearrange equation 11 for the capacitor voltage and insert the exponential function 7 for the current:

Capacitor voltage equals U0 minus resistance times exponentially decreasing current
Formula anchor

If we now only cancel the resistance \(R\) and factor out the source voltage (U_0\), we get the time-dependent voltage across the capacitor:

Formula anchor

We can illustrate the capacitor voltage in a voltage-time diagram:

Voltage-Time Graph: Charging Capacitor
The voltage across the capacitor increases over time as it charges and reaches a saturation value.

From the graph we can obtain the following information:

  • The capacitor voltage \(U_{\text C}(t)\) increases with time. This means that the applied source voltage \(U_0\) is not immediately present between the capacitor plates.

  • The capacitor voltage \( U_{\text C}(t)\) practically reaches a saturation value at some point, namely the given source voltage \(U_0\). Then the capacitor is fully charged.

Example: Capacitor voltage after 0.01 seconds of charging

A source voltage \(U_0 = 1 \, \text{kV}\) is applied to resistor with resistance \(R = 2 \, \text{k}\Omega \) and capacitor of capacitance \( C = 1 \, \mathrm{\mu F} \). What is the capacitor voltage after \( t = 0.01 \, \text{s}\) of charging?

We have already calculated the time constant in 9: \( R \, C = 0.002 \, \text{s} \). Thus, after 0.01 seconds the capacitor voltage is:

Example value 6.7V for capacitor voltage
Formula anchor

Voltage at the resistor during charging

What about the voltage \(U_{\text R}(t)\) across the resistor while the capacitor is charging? For this we only have to insert the found capacitor voltage 13 into the voltage equation 1:

Initial voltage equal to voltage at resistor Plus inserted capacitor voltage
Formula anchor

Rearrange for \(U_{\text R}(t)\) and bracket out \(U_0\):

Voltage at resistor equal to exponentially decreasing initial voltage
Formula anchor
Voltage-Time Graph of Resistor - Charging a Capacitor
The voltage across the resistor decreases exponentially with time during charging.

The 1 cancels out and you get:

Formula anchor
Charging process summarized
  • During charging, the current \( I(t)\) decreases exponentially from \(I_0 = \frac{U_0}{R}\) to zero.

  • The voltage \( U_{\text R}(t)\) across the resistor decreases exponentially from \(U_0\) to zero.

  • The voltage \( U_{\text C}(t)\) across the capacitor increases from zero to the saturation value \(U_0\) supplied by the source voltage.

Discharging a capacitor

RC Circuit: Discharging Capacitor
The switch is turned to the right. The previously charged capacitor is now discharged.

Now we come to the discharging process. After we have charged the capacitor, we can discharge it again by turning the switch to the right. Then the RC element is basically short-circuited. At the beginning, a discharge current \( I_0 ~=~ \frac{U_0}{R} \) flows in the opposite direction and this decreases exponentially, as during the charging process:

Formula anchor
Current-Time Graph: Discharging a Capacitor
The magnitude of the current \(|I(t)|\) when discharging a capacitor decreases exponentially to zero.

The current \(I(t)\) flows in the opposite direction during discharging to the current during charging. We take this into account with the minus sign in front of \(I_0\). (\(I_0\) is the magnitude of the initial current and is always positive here). Besides that,, the current behaves in the same way when discharging as when charging. Of course, we can omit the minus sign if we are not interested in the fact that the current now flows the other way around.

Voltage-Time Graph of a Series Resistor During Discharge of a Capacitor
Voltage at the resistor during discharge of a capacitor decreases from \(-U_0\) to 0.

To get the voltage \(U_{\text R}(t)\) across the resistor, all we have to do, according to Ohm's law, is multiply the equation 18 by the resistance \(R\), because \( U_{\text R}(t) ~=~ R \, I(t)\):

Voltage at the resistor during discharge
Formula anchor

Here is \( U_0 = R \, I_0 \). Also here we have a minus sign. This means that during discharging the polarity of the voltage at the resistor is exactly opposite to the voltage during charging. Otherwise nothing has changed for \(U_{\text R}(t)\): The voltage \(U_{\text R}(t)\) at the resistor decreases exponentially as during charging.

If we use the Kirchhoff's voltage law, then we get an equation for voltages during discharge:

Voltage at resistor Plus Capacitor voltage equal to zero
Formula anchor
Voltage-Time Graph: Discharging a Capacitor
Capacitor voltage during discharge decreases exponentially with time.

If we now insert the voltage \(U_{\text R}(t)\) and rearrange for \(U_{\text C}(t)\), we get:

Formula anchor

The difference to the capacitor voltage during the charging process is that the voltage at the beginning, that is at the time \(t = 0\), is not zero but has the value \(U_0\). The capacitor voltage decreases exponentially.

Discharging process summarized
  • During discharging, the current \( I(t)\) (opposite to the current during charging) decreases from the value \(-I_0\) to zero.

  • The voltage \( U_{\text R}(t)\) at the resistor decreases exponentially from the value \(-U_0\) to zero.

  • The voltage \( U_{\text C}(t)\) on the capacitor decreases exponentially from the value \(U_0\) to zero.

Now you know what happens to the voltage and current through the resistor and capacitor in time when the capacitor is charged or discharged.