An amplifier multiplies a signal by a fixed number. An integrator does something stranger: its output is the running total of everything the input has done since the circuit was switched on. Feed it a steady DC voltage and the output climbs (or falls) in a straight ramp; feed it a square wave and the output comes out as a triangle wave. That is why integrators sit at the heart of triangle-wave generators, ramp generators, PID controllers and the analog computers that once solved differential equations with wires. This article builds one with a single op-amp, a resistor and a capacitor, and works out the numbers step by step.
Figure 1: An op-amp integrator (a) — one resistor in, one capacitor in the feedback path. With +1 V in, the output ramps down at 1,000 V/s until it hits the op-amp's saturation limit of −13 V at 13 ms (b). (Schematic, not to scale.)
How it works — the formula
The op-amp's non-inverting (+) input is grounded, so the inverting (−) input is a virtual earth at 0 V. The input current can only be I = Vin / R, and because the op-amp's input draws (almost) no current, all of that current must flow into the feedback capacitor. A capacitor's voltage changes at a rate of I / C, so the output voltage changes at:
dVout / dt = −Vin / (RC)
or, over a time t with a constant input:
Vout(t) = Vout(0) − Vin × t / (RC)
The minus sign is the inverting input at work: a positive input drives the output down. The product RC is the integrator's time constant — it sets how fast the ramp moves. A larger RC means a slower ramp; a smaller RC means a faster one.
Worked example — a +1 V input and a 1 ms time constant
Choose R = 10 kΩ and C = 100 nF. The time constant is:
RC = 10,000 × 100 × 10−9 = 1.0 × 10−3 s = 1 ms
With Vin = +1 V DC and the output starting at 0 V, the slope is:
slope = −1 V / 1 ms = −1,000 V/s
So the output falls by 1 V every millisecond: −1 V after 1 ms, −5 V after 5 ms, −10 V after 10 ms. It cannot fall forever — a 741 op-amp on ±15 V supplies saturates at about ±13 V. The ramp reaches −13 V after:
t = 13 V / 1,000 V/s = 13 ms
and then stays pinned at −13 V, as Figure 1(b) shows. A negative input would ramp the output upward instead, saturating at +13 V after the same 13 ms. The input current is only I = 1 V / 10 kΩ = 0.1 mA, and the charge the capacitor must hold at saturation is Q = C × V = 100 nF × 13 V = 1.3 µC.
Square wave in, triangle wave out
Now feed the same integrator a ±2.5 V square wave at 1 kHz. Each half-cycle lasts 0.5 ms, and the slope flips sign with the input: +2.5 V in gives a slope of −2,500 V/s, −2.5 V in gives +2,500 V/s. In one half-cycle the output moves by:
ΔV = 2,500 V/s × 0.5 ms = 1.25 V
so the output is a triangle wave of ±1.25 V peak (2.5 V peak-to-peak) at the same 1 kHz. This is exactly how a function generator makes its triangle wave: a square-wave oscillator feeding an integrator. A sine wave works too, but with a twist — the output is a cosine (shifted by 90°) whose peak is Vin / (2Ï€fRC). A 1 V peak sine at 100 Hz gives 1 / (2Ï€ × 100 × 0.001) = 1.59 V peak out, while a 0.5 V peak sine at 1 kHz gives only 0.080 V peak — the integrator's gain falls as frequency rises, which is why it also works as a low-pass filter.
Designing for a 1 V peak triangle wave
Suppose you want a ±1 V triangle wave from a ±5 V square wave at 1 kHz (period T = 1 ms). In each half-cycle the output must move 2 V, so the slope must be 2 V / 0.5 ms = 4,000 V/s, and:
RC = Vin / slope = 5 V / 4,000 V/s = 1.25 ms
With C = 100 nF that needs R = 12.5 kΩ; the nearest standard value is 12 kΩ, giving RC = 1.2 ms and a triangle of 5 V × 1 ms / (4 × 1.2 ms) = 1.04 V peak — close enough. One practical warning: a real op-amp's input offset voltage (about 1 mV for a 741) is itself a tiny DC input, and the integrator will ramp on it at 1 mV / 1 ms = 1 V/s, saturating in 13 seconds even with no signal. Real integrators therefore add a large resistor (for example 1 MΩ) across the capacitor, which limits the DC gain to −RF / R = −100 and stops the drift, or a switch that shorts the capacitor to reset the output to zero.
Key points to remember
- An op-amp integrator puts a capacitor in the feedback path: Vout(t) = Vout(0) − Vin × t / (RC), with the time constant RC setting the ramp speed.
- Worked example: R = 10 kΩ, C = 100 nF → RC = 1 ms; +1 V in gives a slope of −1,000 V/s, reaching the −13 V saturation limit after 13 ms.
- A ±2.5 V square wave at 1 kHz becomes a ±1.25 V peak triangle wave; a 1 V peak sine at 100 Hz becomes a 1.59 V peak output, shifted by 90°.
- Design rule: for a ±1 V triangle from a ±5 V square wave at 1 kHz use R = 12 kΩ with C = 100 nF, giving 1.04 V peak.
- Watch out for offset drift: 1 mV of input offset ramps the output at 1 V/s — add a 1 MΩ resistor across the capacitor (or a reset switch) to stop it saturating.
