The capacitor is one of the ideal circuit elements. Let’s put a capacitor to work to see what happens to the voltage when we put in a current.

Written by Willy McAllister.

### Contents

A constant current driven into a capacitor creates a voltage with a straight ramp. This behavior is predicted by the integral form of the capacitor $i$-$v$ equation.

The two forms of the capacitor’s $i$-$v$ equation are:

$i = \text C \,\dfrac{dv}{dt}\qquad$ and $\quad\displaystyle v = \dfrac1{\text C}\, \int_{\,0}^{\,T} i\,\text dt + v_0$

$\text C$ is the capacitance, a physical property of the capacitor.
$\text C$ is also the scale factor between $i$ and $dv/dt$.
$\text C$ tells you how much $i$ gets generated for a given amount of $dv/dt$.
$v_0$ is the initial voltage across the capacitor, at $t=0$.

calculus notation: $di/dt$

$i = \text C\,\dfrac{dv}{dt}$

$d$ is calculus notation for 'differential', or "a tiny change in ...". For example, $dt$ means 'a tiny change in time'. When you see it in a ratio, like $dv/dt$, that means, "a tiny change in $v$ (voltage) for each tiny change in time" An expression like $dv/dt$ is called a derivative. The derivative is the slope of voltage as it changes with time.

calculus notation: $\int$

$\displaystyle v = \dfrac1{\text C}\, \int_{\,0}^{\,T} i\,\text dt + v_0$

The loopy $\int$ symbol is also from calculus. It is an integral sign. It's meaning is similar to the summation symbol $\Sigma$. In the capacitor equation, the integral sign means you add up the products of the current times a tiny interval of time, $dt$, starting at time $t=0$ and stopping at time $t=T$. Integration is the opposite of taking the derivative.

In this article we’ll work with the integral form of the capacitor equation. Our example circuit is a current source connected to a $1\,\mu\text F$ capacitor.

## Voltage response to a current pulse

Suppose we apply a $2 \text{ mA}$ pulse of current to the $1 \,\mu\text F$ capacitor. the pulse lasts $3\,\text{msec}$, $(3 \times 10^{-3}$ seconds$)$. The initial voltage across the capacitor is zero.

If the capacitor current looks like this, what does the capacitor voltage look like?

Find the capacitor voltage, $v(t)$

To find voltage in terms of current, we use the integral form of the capacitor equation.

$\displaystyle v(T) = \dfrac1{\text C}\, \int_{\,0}^{\,T} i\,\text dt + v_0$

The current pulse has abrupt changes, so we’re going to solve for $v(t)$ in three separate chunks: before, during, and after the current pulse.

### Before the pulse

Before the current pulse $(t < 0)$, no current is flowing, so no charge accumulates on $\text C$. Therefore, $v_{(t<0)} = 0$. We didn’t even have to use the equation.

### During the pulse

For any time $T$ during the current pulse $(0 \lt t \lt 3\,\text{ms})$, current flows and charge accumulates on $\text C$, and the voltage rises. We apply the capacitor equation to find what the voltage does,

$\displaystyle v(T) = \dfrac1{\text C}\, \int_{\,0}^{\,T} i\,\text dt + v_0$

The $t$ and $T$ notation is a little tricky. Little $t$ is time, the variable that gets integrated. Big $T$ is the amount of time we wait for charge to accumulate. The integral sweeps time $t$ from $0$ up to some accumulation time, big $T$. The biggest big $T$ can be is $3\,\text{msec}$ because that’s the duration of the pulse.

$i$ is constant (the top of the pulse is flat) during this time so we can take it outside the integral. Since $v_0$ is zero, we can leave it out.

$\displaystyle v(T) = \dfrac{i}{\text C}\, \int_{\,0}^{\,T} \text dt$

$\displaystyle v(T) = \dfrac{i}{\text C}\,\, t\bigg |_{\,0}^{\,T}$

$v(T) = \dfrac{i}{\text C} \,T\qquad\text{volts}$

This is an equation for $v$ as a function of pulse duration $T$, for a given pulse height $i$. The equation has the shape of a line, with slope $i/\text C$. The slope is:

$\dfrac{i}{\text C} =\dfrac{2\times 10^{-3}\,\text A}{1 \times 10^{-6}\,\text F} = 2000\,\text{volts/second}$

For any pulse width, the voltage is,

$v(T) = 2000 \,\text{volts/s} \,\cdot T$

Our pulse width is $T = 3\,\text{ms}$, so the voltage across the capacitor rises to,

$v_{(T=3\,\text{ms})} = 2000 \,\text{volts/s} \,\cdot \,0.003 \,\text s= 6\,\text{volts}$

With a constant current of $2\,\text{mA}$, the voltage on the capacitor rises in a straight line with a slope of $2000 \,\text{volts/sec}$. The voltage started at $0\,\text V$ and rises to $6\,\text{volts}$ after $3\,\text{ms}$.

### After the pulse

This part is rather interesting if you haven’t thought about it before. After the pulse the current falls to $0$, so that means charge stops accumulating on the capacitor. Since no charge is moving, we should expect the voltage not to change. We can see how the math represents this by writing the capacitor equation at starting time $t=3\,\text{ms}$. We plug in the starting voltage at that time, $v_{3\,\text{ms}} = 6 \,\text V$.

$\displaystyle v(T) = \dfrac1{\text C}\, \int_{\,3\,\text{ms}}^{\,T} 0\,\text dt + 6$

The integral evaluates to $0$ and we get,

$v(T) = 6\,\text V\quad$ for any value of $T$.

Once the current stops, the charge stays put, so the capacitor voltage remains at $6\,\text V$.

$q = \text C\,v$

$v = \dfrac{q}{\text C}$

Assembling the three chunks together gives us $v(t)$ in the lower graph,

This circuit configuration (a current source driving a capacitor) has a nickname. It is called an integrator it accumulates or integrates charge. the amount of charge integrated is indicted by the voltage appearing across the capacitor.

## Simulation model

Simulate the current and voltage with this circuit model. Open the link and click on TRAN in the upper menu bar to perform a transient simulation. The current source is modeled as a single PULSE. (Double-click on the current source to see how it is defined.) The zoom controls are on the left side of the window, in light gray.

### Challenge

Here’s another model with the current source defined a different way, as a PWL (piece-wise-linear) waveform. The time and current are entered as a list of comma-separated [time, current] pairs, like this: -1s,0,0s,0,1ns,2m,3ms,2m,3ms,0,5s,0.

See if you can modify the current waveform to get the capacitor voltage to ramp down to $0\text V$ in another $3\,\text{ms}$. You are going for something that looks like this,

The current source pours in charge for $3\,\text{ms}$ and the voltage ramps up. Then it reverses direction to pull out charge for another $3\,\text{ms}$. The voltage is another ramp, this time with negative slope as charge is removed.
A constant current driven into a capacitor produces a voltage shaped like a straight ramp. We used the integral form of the capacitor $i$-$v$ equation to predict this.