---
title: Transimpedance amplifiers
heading: Turning a photodiode's current into a voltage without ringing
eyebrow: C6 · Lesson 24 · Transimpedance amplifiers
xp: 40
---

::: hook
A photodiode, a current-output sensor or an electrochemical cell produces a current, and the circuit that turns it into a voltage looks trivial: an op amp with a resistor from output to inverting input. Build it with a fast op amp and a big resistor, and it rings or oscillates. The sensor's capacitance at the input, together with the op amp's own roll-off, makes a second-order loop. This lesson shows why, how a fraction of a picofarad across the resistor fixes it, and how to trade bandwidth against noise.

::: play
- The curve is the amplifier's gain relative to $R_f$, in decibels, against frequency: a photodiode of capacitance $C_\text{in}$ into an op amp with gain-bandwidth GBW and feedback resistor $R_f$.
- With no feedback capacitor, a tall peak sits near the top of the band: the loop is barely stable. Add a fraction of a picofarad of $C_f$ and watch the peak flatten.
- Raise $R_f$: more gain and less noise per volt of output, but the bandwidth shrinks.
:::
:::

```sim plot
view: graph
x: f = 1k..10M Hz log
y: g = -40..30 dB
slider: R = 10k..10M = 1M Ω log
slider: Ci = 1..100 = 10 pF log
slider: Cf = 0..2 step 0.01 = 0 pF
slider: G = 1..100 = 10 MHz log
plot: 20*log(1/sqrt((1 - (2*pi*f)^2*R*(Cf + Ci)*1e-12/(2*pi*G*1e6))^2 + (2*pi*f*(R*Cf*1e-12 + 1/(2*pi*G*1e6)))^2)) | label: gain relative to Rf | samples: 500
readout: Q = sqrt(R*(Cf + Ci)*1e-12/(2*pi*G*1e6))/(R*Cf*1e-12 + 1/(2*pi*G*1e6)) | digits: 3
readout: natural frequency, kHz = 1/(2*pi*sqrt(R*(Cf + Ci)*1e-12/(2*pi*G*1e6)))/1000 | digits: 3
```

::: predict
## A 1 MΩ transimpedance amplifier uses a 10 MHz op amp and a photodiode with 10 pF of capacitance, and has no feedback capacitor. What does its frequency response look like?

- [ ] Flat to 10 MHz
- [ ] Flat to 16 kHz, set by 1 MΩ and 10 pF
- [x] A sharp peak about 28 dB high near 400 kHz: it's on the edge of oscillating
- [ ] Flat to about 400 kHz, then a smooth roll-off

::: reveal
A peak of about 25 times, 28 dB, near 400 kHz. The input capacitance and $R_f$ make the feedback fall with frequency, the op amp's gain falls too, and together they give a second-order loop with Q = 25. A real circuit would ring at every edge or oscillate outright. A feedback capacitor of about half a picofarad tames it.
:::
:::

::: nameit
## The ideal TIA

A current I into the inverting input flows through $R_f$, so $v_\text{out} = -IR_f$, and the input node sits at virtual ground: the sensor sees almost no voltage across it.

## Why it rings

With the input capacitance $C_\text{in}$, the feedback fraction falls above $\frac{1}{2\pi R_fC_\text{in}}$, so the noise gain rises, and it meets the op amp's falling gain at a steep angle. Modeling the op amp as $A = \frac{\omega_u}{s}$ and adding a feedback capacitor $C_f$,

$$\frac{v_\text{out}}{I} = \frac{-R_f}{1 + s\left(R_fC_f + \frac{1}{\omega_u}\right) + s^2\frac{R_f(C_f + C_\text{in})}{\omega_u}},$$

a second-order response with $f_0 = \frac{1}{2\pi}\sqrt{\frac{\omega_u}{R_f(C_f + C_\text{in})}}$ and Q set by the $s$ term. With $C_f$ = 0, Q is about $\sqrt{\omega_uR_fC_\text{in}}$, large.

## Compensation

A standard choice puts the feedback zero at the geometric mean of the corners:

$$C_f = \sqrt{\frac{C_\text{in}}{2\pi R_f\,\text{GBW}}},$$

which gives Q close to 1 (about 1 dB of peaking). For a flat, Butterworth response (Q = 0.707) use $\sqrt2$ times that. The bandwidth then sits near $\frac{1}{2\pi R_fC_f}$, roughly $\sqrt{\frac{\text{GBW}}{2\pi R_fC_\text{in}}}$: the geometric mean of the op amp's speed and the input corner.

## Noise

$R_f$ adds a current noise of $\sqrt{\frac{4kT}{R_f}}$; the photocurrent itself has shot noise $\sqrt{2qI}$. A larger $R_f$ makes its own noise smaller relative to the signal, which is why sensitive receivers use the largest $R_f$ their bandwidth allows. At high frequency the op amp's voltage noise is multiplied by the noise gain, $1 + \frac{C_\text{in}}{C_f}$, so a low input capacitance matters as much as a quiet op amp.
:::

::: example
## For the predict's amplifier ($R_f$ = 1 MΩ, $C_\text{in}$ = 10 pF, GBW = 10 MHz), find $f_0$ and Q with no feedback capacitor.

::: solution
1. **Coefficients.** With $C_f$ = 0,
   $$\begin{aligned} b &= \frac{R_fC_\text{in}}{\omega_u} \\ &= \frac{10^{-5}}{6.28 \times 10^7}\ \text{s}^2 \\ &= 1.59 \times 10^{-13}\ \text{s}^2 \end{aligned}$$
   and $a = \frac{1}{\omega_u}$ = 15.9 ns.
2. **Natural frequency.**
   $$\begin{aligned} f_0 &= \frac{1}{2\pi\sqrt b} \\ &= 399\ \text{kHz} \end{aligned}$$
3. **Q.**
   $$\begin{aligned} Q &= \frac{\sqrt b}{a} \\ &= 25.1 \end{aligned}$$
   The peak is Q times the low-frequency gain, 28 dB.
4. **What didn't matter.** The 16 kHz corner of $R_f$ and $C_\text{in}$ alone. The op amp's loop extends the bandwidth well past it, at the cost of stability.

**Answer:** $f_0$ = 399 kHz and Q = 25.1, a 28 dB peak.
:::
:::

::: example
## Compensate it. What feedback capacitor does the standard formula give, and what Q and bandwidth result? What capacitor gives Q = 0.707?

::: solution
1. **Standard formula.**
   $$\begin{aligned} C_f &= \sqrt{\frac{10\ \text{pF}}{2\pi \times 1\ \text{M}\Omega \times 10\ \text{MHz}}} \\ &= 0.40\ \text{pF} \end{aligned}$$
2. **What it gives.** Q = 0.98 and a −3 dB bandwidth of 493 kHz, with about 1 dB of peaking.
3. **For a flat response.** 0.56 pF gives Q = 0.707 and 388 kHz.
4. **In practice.** Both are smaller than a typical resistor's own parasitic capacitance, so the layout around $R_f$ is part of the design.

**Answer:** the formula gives 0.40 pF (Q = 0.98, 493 kHz), and 0.56 pF gives Q = 0.707 with 388 kHz.
:::
:::

::: example
## A photodiode delivers 1 µA. Compare its shot noise with the thermal current noise of a 1 MΩ and a 10 kΩ feedback resistor at 300 K.

::: solution
1. **Shot noise.**
   $$\begin{aligned} i_n &= \sqrt{2 \times 1.602 \times 10^{-19} \times 10^{-6}} \\ &= 0.57\ \text{pA}/\sqrt{\text{Hz}} \end{aligned}$$
2. **The 1 MΩ resistor.** It adds $\sqrt{4kT/R_f}$ = 0.13 pA/√Hz, a quarter of the signal's own noise: the receiver is limited by the light, the best it can be.
3. **A 10 kΩ resistor.** It would add 1.29 pA/√Hz, more than twice the shot noise, and the output would be 100 times smaller as well.

**Answer:** the shot noise is 0.57 pA/√Hz; a 1 MΩ resistor adds only 0.13 pA/√Hz, while a 10 kΩ one adds 1.29 pA/√Hz.
:::
:::

::: check
kind: parts
given: R = 0.1 | 1 | 10; C = 3 | 10 | 30; G = 5 | 20 | 100

## A TIA has $R_f$ = {R} MΩ, $C_\text{in}$ = {C} pF and an op amp with GBW = {G} MHz.

::: part
answer: sqrt(C*1e-12/(2*pi*R*1e6*G*1e6))*1e12
unit: pF
tolerance: 0.5%

### What feedback capacitor does the standard formula give?

::: misses
- [sqrt(C*1e-12/(R*1e6*G*1e6))*1e12] Include the $2\pi$.
- [any] $C_f = \sqrt{\frac{C_\text{in}}{2\pi R_f\,\text{GBW}}}$.
:::
:::

::: part
answer: 1/(2*pi*R*1e6*sqrt(C*1e-12/(2*pi*R*1e6*G*1e6)))/1000
unit: kHz
tolerance: 0.5%

### About what bandwidth does that give, $\frac{1}{2\pi R_fC_f}$?

::: misses
- [1/(2*pi*R*1e6*C*1e-12)/1000] That's the input corner; the loop extends far beyond it.
- [any] $\frac{1}{2\pi R_fC_f}$.
:::
:::
:::

::: check
given: R = 0.1 | 1 | 10; C = 2 | 20; G = 1 | 10 | 50
answer: sqrt(2*pi*G*1e6*R*1e6*C*1e-12)
tolerance: 0.5%

## A TIA with $R_f$ = {R} MΩ, $C_\text{in}$ = {C} pF and GBW = {G} MHz has no feedback capacitor. About what's its Q?

::: right
Right. $Q \approx \sqrt{\omega_uR_fC_\text{in}}$ = {answer}: far too high.
:::

::: misses
- [any] With $C_f$ = 0, $Q = \frac{\sqrt b}{a}$ with $a = \frac{1}{\omega_u}$ and $b = \frac{R_fC_\text{in}}{\omega_u}$.
:::
:::

::: check
kind: parts
given: I = 0.1 | 1 | 10; R = 10 | 1000 | 10000

## A photodiode delivers {I} µA into a TIA with $R_f$ = {R} kΩ, at 300 K.

::: part
answer: sqrt(2*1.602e-19*I*1e-6)*1e12
unit: pA/√Hz
tolerance: 0.5%

### What's its shot noise?

::: misses
- [sqrt(1.602e-19*I*1e-6)*1e12] Shot noise is $\sqrt{2qI}$.
- [any] $\sqrt{2qI}$.
:::
:::

::: part
answer: sqrt(4*1.380649e-23*300/(R*1000))*1e12
unit: pA/√Hz
tolerance: 0.5%

### What current noise does $R_f$ add?

::: misses
- [any] $\sqrt{\frac{4kT}{R_f}}$.
:::
:::
:::

::: check
given: I = 0.5 | 2 | 10; R = 10 | 100 | 1000
answer: -I*R/1000
unit: V
tolerance: 0.5%

## A {I} µA photocurrent flows into a TIA with $R_f$ = {R} kΩ. What's the output?

::: right
Right. $-IR_f$ = {answer}.
:::

::: misses
- [I*R/1000] The current flows into the inverting input, so the output goes negative.
- [any] $v_\text{out} = -IR_f$.
:::
:::

::: check
given: Ci = 5 | 20 | 30; Cf = 0.5 | 1 | 2
answer: 1 + Ci/Cf
tolerance: 0.5%

## A TIA has $C_\text{in}$ = {Ci} pF and $C_f$ = {Cf} pF. By what factor is the op amp's voltage noise multiplied at high frequency?

::: right
Right. The noise gain there is $1 + \frac{C_\text{in}}{C_f}$ = {answer}.
:::

::: misses
- [Ci/Cf] Add 1.
- [any] $1 + \frac{C_\text{in}}{C_f}$.
:::
:::

::: check
kind: choice

## A transimpedance amplifier rings badly. Which change helps most?

- [ ] A faster op amp
- [x] A small capacitor across the feedback resistor
- [ ] A larger feedback resistor
- [ ] A larger photodiode

::: right
Right. $C_f$ adds a zero that restores phase margin.
:::

::: misses
- [1] A faster op amp raises $\omega_uR_fC_\text{in}$ and with it Q, unless $C_f$ is added too.
- [3] A larger $R_f$ also raises Q.
- [4] More input capacitance makes it worse.
:::
:::

::: check
kind: derivation
vars: R = 1000..100000000, c = 0.000000000001..0.0000000001, f = 0..0.00000000001, w = 1000000..1000000000

## A TIA with $R_f$ = R, input capacitance c, feedback capacitance f, and an op amp $A = \frac{w}{s}$.

::: step
answer: R*f + 1/w

### What's the coefficient a of s in the denominator?
:::

::: step
answer: R*(f + c)/w

### What's the coefficient b of s²?
:::

::: step
answer: sqrt(R*(f + c)/w)/(R*f + 1/w)

### What's Q?
:::

::: right
Right. A small $C_f$ makes $R_fC_f$ comparable with $\sqrt b$ and brings Q near 1.
:::
:::

::: explain
## Why does a transimpedance amplifier ring when its feedback resistor has no capacitor across it?

::: model
The photodiode's capacitance at the inverting input and the feedback resistor form a divider whose feedback fraction falls with frequency, so the amplifier's noise gain rises above the corner they set. The op amp's own gain falls with frequency at the same time. The loop gain is the ratio of the two, so it falls twice as fast, at 40 dB per decade, and its phase approaches 180 degrees where it crosses unity. With almost no phase margin, the closed loop has a high-Q resonance, which shows as a peak in the response and ringing on edges. A small capacitor across the resistor stops the noise gain from rising forever, flattening it before the crossover and restoring the phase margin.
:::
:::

::: practice

::: check
given: R = 0.5 | 5; C = 5 | 50; G = 2 | 20
answer: sqrt(C*1e-12/(2*pi*R*1e6*G*1e6))*1e12
unit: pF
tolerance: 0.5%

## $R_f$ = {R} MΩ, $C_\text{in}$ = {C} pF, GBW {G} MHz. Feedback capacitor?

::: misses
- [any] $\sqrt{\frac{C_\text{in}}{2\pi R_f\,\text{GBW}}}$.
:::
:::

::: check
given: I = 0.2 | 5; R = 50 | 5000
answer: -I*R/1000
unit: V
tolerance: 0.5%

## {I} µA into $R_f$ = {R} kΩ. Output?

::: misses
- [any] $-IR_f$.
:::
:::
:::
