---
title: Image sensors
heading: Millions of photodiodes that count electrons: conversion gain, full well, read noise and dark current
eyebrow: S1 · Lesson 19 · Image sensors
xp: 50
---

::: hook
A phone camera is an array of tens of millions of the photodiodes from lesson 18, each a few micrometers across, each collecting the electrons its light frees during an exposure. What makes one camera better than another is mostly device physics: how many electrons a pixel can hold before it overflows, how small a voltage each electron makes on the sense node, how many electrons of noise the readout adds, and how many the dark current leaks in. Those four numbers set the camera's dynamic range and its performance in dim light, and they're all things this course can calculate.
:::

::: play
- The signal-to-noise ratio of a pixel against the number of signal electrons, with photon shot noise $\sqrt N$ and a fixed read noise. The dashed line is shot noise alone, which rises as $\sqrt N$: 10 dB per decade.
- At low light the read noise dominates and the SNR rises 20 dB per decade; at high light shot noise dominates. The curve ends at the full-well capacity.
:::

```sim plot
view: graph
x: N = 1..100000 log
y: SNR = -20..60
slider: r = 0.5..20 step 0.5 = 2
plot: 20*log(N/sqrt(N + r^2)) | label: SNR, dB
plot: 20*log(sqrt(N)) | dashed | color: ch2 | label: shot-noise limit, dB
readout: dynamic range with a 10 000 e⁻ full well, dB = 20*log(10000/r)
```

::: predict
## A pixel's sense node has 1.6 fF of capacitance. How much voltage does each collected electron produce?

- [ ] 1 µV
- [ ] 10 µV
- [x] 100 µV
- [ ] 1 mV

::: reveal
$q/C = 1.602 \times 10^{-19}/1.6 \times 10^{-15}$ = 100 µV per electron: the **conversion gain**. A small sense node makes each electron a large, easily measured voltage, which is why modern pixels transfer their charge from the photodiode onto a separate tiny floating diffusion before reading it.
:::
:::

::: nameit
## A pixel

A photodiode integrates photocurrent during the exposure; incoming photons free electrons with **quantum efficiency** η, typically 50 to 80% in visible light for silicon. In a modern CMOS pixel, the charge is then transferred to a small **floating diffusion** of capacitance $C_{FD}$, buffered by a source follower and read out row by row.

- **Conversion gain:** $CG = q/C_{FD}$, in microvolts per electron.
- **Full-well capacity:** the most electrons a pixel holds, set by the photodiode's capacity or the sense node's voltage swing, $N_{fw} \approx C\,\Delta V/q$.

## Noise

- **Photon shot noise:** light arrives randomly, so $N$ signal electrons carry $\sqrt N$ of noise. It's in the light itself; no sensor can avoid it.
- **Read noise:** the readout chain adds a fixed noise, quoted in electrons: a few for a good CMOS sensor, below one electron in the best.
- **Dark current:** thermally generated electrons (lesson 3's generation), which roughly double every 6 to 8 °C, and whose number has its own shot noise.

$$\text{SNR} = \frac{N}{\sqrt{N + N_{dark} + r^2}}$$

The **dynamic range** is the full well over the read noise: $20\log_{10}(N_{fw}/r)$.

## Counting photons

The photons reaching a pixel of area $A$ in time $t$ under irradiance $E$ at wavelength λ number $N_{ph} = EAt\lambda/(hc)$, of which $\eta N_{ph}$ become electrons.

## CCD and CMOS

A CCD shifts every pixel's charge across the chip to one output amplifier, with excellent uniformity. A CMOS sensor puts an amplifier in every pixel and reads rows in parallel, with lower power and higher speed. Reading rows one after another gives CMOS sensors a **rolling shutter**: each row is exposed at a slightly different time, which skews fast-moving objects.
:::

::: example
## A pixel has $C_{FD}$ = 1.6 fF and a 1 V usable swing at the sense node, with 2 electrons of read noise. Find its conversion gain, full well, dynamic range, and SNR at 1000 electrons.

::: solution
1. **Conversion gain.**
   $$\begin{aligned} CG &= \frac{q}{C} \\ &= 100\ \mu\text{V/e}^- \end{aligned}$$
2. **Full well.**
   $$\begin{aligned} N &= \frac{1.6\ \text{fF} \times 1\ \text{V}}{q} \\ &= 9990 \\ &\approx 10\,000\ \text{electrons} \end{aligned}$$
3. **Dynamic range.**
   $$\begin{aligned} DR &= 20\log_{10}\frac{10\,000}{2} \\ &= 74\ \text{dB} \end{aligned}$$
4. **SNR at 1000 electrons.**
   $$\begin{aligned} \text{SNR} &= \frac{1000}{\sqrt{1000 + 4}} \\ &= 31.6 \end{aligned}$$
   or 30.0 dB: almost exactly the shot-noise limit, $\sqrt{1000}$.
5. **Read noise.** The read noise matters only in the last few tens of electrons.

**Answer:** a conversion gain of 100 µV/e⁻, a full well of about 10,000 electrons, 74 dB of dynamic range, and an SNR of 31.6 (30.0 dB) at 1000 electrons.
:::
:::

::: example
## A 3 µm pixel with 60% quantum efficiency is exposed for 10 ms to 1 µW/cm² of 550 nm light. How many electrons does it collect, and what is its shot-noise-limited SNR?

::: solution
1. **Energy on the pixel.** The irradiance is 0.01 W/m² and the area $9 \times 10^{-12}$ m², so in 10 ms the energy is
   $$9 \times 10^{-16}\ \text{J}$$
2. **Photons.** Each 550 nm photon carries
   $$\frac{hc}{\lambda} = 3.61 \times 10^{-19}\ \text{J}$$
   so 2490 photons arrive.
3. **Electrons collected.**
   $$0.6 \times 2490 = 1494$$
4. **Shot-noise SNR.**
   $$\begin{aligned} \text{SNR} &= \sqrt{1494} \\ &= 38.7 \end{aligned}$$
   or 31.7 dB.
5. **Smaller pixels.** Halving the pixel's side quarters the electrons and halves the SNR: small pixels are noisier in dim light, whatever the electronics.

**Answer:** about 1494 electrons, for a shot-noise-limited SNR of 38.7 (31.7 dB).
:::
:::

::: example
## A sensor has 5 electrons per second of dark current per pixel at 25 °C, doubling every 6 °C. In a 1 s exposure at 55 °C, how much dark noise does it add?

::: solution
1. **Dark electrons at 55 °C.** Thirty degrees is five doublings, so in a second
   $$5 \times 2^5 = 160\ \text{electrons}$$
2. **Dark noise.** The shot noise is
   $$\sqrt{160} = 12.6\ \text{electrons rms}$$
   six times the 2-electron read noise.
3. **Why cameras are cooled.** Long exposures in a warm camera are limited by dark current, which is why astronomical cameras are cooled, often below −20 °C.

**Answer:** 12.6 electrons rms of dark noise, from 160 dark electrons.
:::
:::

::: check
given: C = 0.8 | 1.6 | 3 | 8
answer: 1.602e-19/(C*1e-15)*1e6
unit: µV
tolerance: 0.5%

## A pixel's floating diffusion has {C} fF. What is its conversion gain, in µV per electron?

::: right
Right. $q/C$ = {answer} per electron.
:::

::: misses
- [C*1e-15/1.602e-19*1e6] Conversion gain is charge over capacitance inverted: $q/C$.
- [any] Not yet. $CG = q/C_{FD}$.
:::
:::

::: check
kind: parts
given: N = 6000 | 10000 | 30000; r = 1 | 2 | 5; S = 100 | 1000

## A pixel has a full well of {N} electrons and {r} electrons of read noise.

::: part
answer: 20*log(N/r)
tolerance: 0.5%

### What is its dynamic range in dB?

::: misses
- [10*log(N/r)] Image-sensor dynamic range uses 20 log, as an amplitude ratio.
- [any] Not yet. $20\log_{10}(N_{fw}/r)$.
:::
:::

::: part
answer: 20*log(S/sqrt(S + r^2))
tolerance: 0.5%

### What is its SNR in dB at {S} signal electrons, with no dark current?

::: misses
- [20*log(S/r)] Include the signal's own shot noise, $\sqrt S$.
- [any] Not yet. $S/\sqrt{S + r^2}$.
:::
:::

::: right
Right. Shot noise usually dominates; read noise matters only in the darkest parts of an image.
:::
:::

::: check
given: E = 0.1 | 1 | 10; a = 1.5 | 3 | 6; t = 1 | 10 | 33; q = 0.4 | 0.7
answer: E*1e-6/1e-4*(a*1e-6)^2*t*1e-3*550e-9/(6.626e-34*2.998e8)*q
tolerance: 0.5%

## A {a} µm pixel with quantum efficiency {q} is exposed for {t} ms to {E} µW/cm² of 550 nm light. How many electrons does it collect?

::: right
Right. Photons $= EAt\lambda/(hc)$, times the quantum efficiency: {answer}.
:::

::: misses
- [E*1e-6*(a*1e-6)^2*t*1e-3*550e-9/(6.626e-34*2.998e8)*q] Convert the irradiance to W/m²: 1 µW/cm² is 0.01 W/m².
- [E*1e-6/1e-4*(a*1e-6)^2*t*1e-3*550e-9/(6.626e-34*2.998e8)] Multiply by the quantum efficiency.
- [any] Not yet. $\eta EAt\lambda/(hc)$ in SI units.
:::
:::

::: check
given: I0 = 1 | 5 | 20; dT = 18 | 24 | 30; d = 6 | 7 | 8
answer: I0*2^(dT/d)
tolerance: 0.5%

## A sensor's dark current is {I0} e⁻/s at 25 °C and doubles every {d} °C. What is it {dT} °C warmer, in e⁻/s?

::: right
Right. $I_0 \cdot 2^{\Delta T/d}$ = {answer}.
:::

::: misses
- [I0*2*dT/d] It doubles repeatedly: an exponential, not a multiple.
- [any] Not yet. $2^{\Delta T/d}$ doublings.
:::
:::

::: check
kind: parts
given: n = 1000 | 3000 | 4000; t = 5 | 10 | 20; v = 5 | 20

## A rolling-shutter sensor reads {n} rows, one every {t} µs. A vertical edge moves sideways at {v} pixels per millisecond.

::: part
answer: n*t*1e-3
unit: ms
tolerance: 0.5%

### How long after the top row is the bottom row exposed?

::: misses
- [n*t] Give it in milliseconds.
- [any] Not yet. Rows × time per row.
:::
:::

::: part
answer: n*t*1e-3*v
tolerance: 0.5%

### By how many pixels is the edge skewed between top and bottom?

::: misses
- [n*t*v] Use the delay in milliseconds.
- [any] Not yet. Skew time × speed.
:::
:::

::: right
Right. A global shutter, which exposes every row at once, avoids the skew at the cost of a more complex pixel.
:::
:::

::: check
kind: choice

## In bright light, a camera's image noise is dominated by which source?

- [x] Photon shot noise, $\sqrt N$, which is in the light itself
- [ ] Read noise
- [ ] Dark current
- [ ] Quantization in the ADC

::: right
Right. At thousands of electrons, $\sqrt N$ is tens of electrons, far above a few electrons of read noise. A better sensor can't reduce it; only collecting more light can.
:::

::: misses
- [2] Read noise is fixed and small; it dominates only in dim light.
- [3] Dark current matters in long or hot exposures, not bright ones.
- [4] A well-designed camera's ADC step is below the noise floor.
:::
:::

::: check
kind: python
given: g = 1.5 | 4 | 10; r = 2 | 5; seed = 1 | 2

## Measure a sensor's conversion gain by the photon transfer method. Simulate 20 illumination levels with mean signals `mu = numpy.linspace(100, 20000, 20)` electrons. For each level, draw 5000 pixels as `rng.poisson(mu)` electrons plus `rng.normal(0, r, 5000)` electrons of read noise (with `rng = numpy.random.default_rng(seed)`, poisson first then normal at each level), and convert to digital numbers by dividing by the gain `g` = {g} e⁻/DN. Fit a straight line to the variance (DN²) against the mean (DN) over all levels with `numpy.polyfit`; its slope is 1/gain. Set `g_est` and `r_est` (read noise in electrons, from the intercept as $\sqrt{\text{intercept}} \times$ `g_est`; use 0 if the intercept is negative).

```python starter
import numpy as np
g_est, r_est = 1.0, 0.0
```

```python solution
import numpy as np
rng = np.random.default_rng(seed)
mu = np.linspace(100, 20000, 20)
means, varis = [], []
for m in mu:
    e = rng.poisson(m, 5000) + rng.normal(0, r, 5000)
    dn = e / g
    means.append(dn.mean()); varis.append(dn.var())
slope, icpt = np.polyfit(means, varis, 1)
g_est = 1 / slope
r_est = float(np.sqrt(icpt) * g_est) if icpt > 0 else 0.0
```

```python tests
import numpy as np
rng = np.random.default_rng(seed)
mu = np.linspace(100, 20000, 20)
M, V = [], []
for m in mu:
    dn = (rng.poisson(m, 5000) + rng.normal(0, r, 5000)) / g
    M.append(dn.mean()); V.append(dn.var())
s, c = np.polyfit(M, V, 1)
assert abs(g_est - 1 / s) < 1e-9, "g_est is the inverse slope of variance against mean."
assert abs(g_est / g - 1) < 0.03, "The photon transfer method should recover the gain within a few percent."
```

::: right
Right. Shot noise makes the variance in electrons equal the mean, so in digital numbers the slope is the inverse gain: a camera can be calibrated using nothing but light and statistics.
:::
:::

::: explain
## Phone makers shrank pixels from about 2 µm to under 1 µm while keeping the megapixel count rising. Explain why small pixels suffer in dim light, and why combining four small pixels into one ("binning") helps.

::: model
A pixel's signal in dim light is the number of photons landing on it times the quantum efficiency, and that scales with its area: halving the pixel's side quarters the electrons. Photon shot noise is $\sqrt N$, so the signal-to-noise ratio falls in proportion to the side, and read noise, fixed per pixel, eats into an already small signal, so dim scenes look grainy. Binning four pixels into one adds their electrons, four times the signal, and the shot noise adds as $\sqrt4$ = 2, doubling the SNR to what a pixel of twice the side would give. If the binning is done in the charge domain before readout, the read noise is paid once instead of four times, which helps further. The camera trades resolution for SNR when the light is poor.
:::
:::

::: practice

::: check
given: C = 1 | 2.5 | 5
answer: 1.602e-19/(C*1e-15)*1e6
unit: µV
tolerance: 0.5%

## What conversion gain does a {C} fF sense node give, in µV/e⁻?

::: misses
- [C*1e-15/1.602e-19*1e6] It's $q/C$.
- [any] $q/C$.
:::
:::

::: check
given: N = 4000 | 20000; r = 1.5 | 3
answer: 20*log(N/r)
tolerance: 0.5%

## What dynamic range does a {N}-electron full well with {r} e⁻ read noise give, in dB?

::: misses
- [10*log(N/r)] Use 20 log.
- [any] $20\log_{10}(N/r)$.
:::
:::
:::
