---
title: Image sensors
heading: A camera chip as millions of tiny photodiodes, collecting electrons during an exposure, quantum efficiency and full-well capacity, the shot noise that makes dim images grainy, read noise and dynamic range, conversion gain to volts, color from a Bayer filter, and CMOS against CCD readout
eyebrow: D11 · Lesson 5 · Image sensors
xp: 40
---

::: hook
A phone's camera has about 50 million photodiodes, each a couple of micrometers across, each counting the electrons that light knocks loose during an exposure. A bright pixel might collect ten thousand; a dark one, a handful. Because photons arrive at random, a pixel that should collect 100 electrons actually collects 100 ± 10, and that graininess, not any flaw in the electronics, is what makes night photos noisy. Sensor design is about catching as many photons as possible and adding as little noise as possible while reading them out.
:::

::: play
- A pixel's signal-to-noise ratio against the number of signal electrons N, with photon shot noise $\sqrt N$ and read noise $\sigma_r$ electrons: $\text{SNR} = N/\sqrt{N + \sigma_r^2}$, up to its full-well capacity.
- In bright light, shot noise dominates and SNR grows as $\sqrt N$, 10 dB per decade. In dim light, read noise dominates and SNR grows in proportion to N, 20 dB per decade.
- The readout gives the **dynamic range**, full well over read noise.
:::

```sim plot
view: graph
x: N = 1..100000 log
y: S = -20..60
slider: r = 0.5..20 step 0.5 = 2
slider: F = 1000..100000 = 10000 log
plot: 20*log(N/sqrt(N + r^2))*step(F - N) | samples: 400 | label: SNR, dB (N in electrons)
plot: 20*log(sqrt(N)) | samples: 300 | dashed | color: ch3 | label: shot-noise limit
readout: dynamic range, dB = 20*log(F/r) | digits: 3
```

::: predict
## A pixel collects 100 electrons and has 2 electrons of read noise. What's its signal-to-noise ratio?

- [ ] 50
- [x] About 9.8
- [ ] 100
- [ ] 10,000

::: reveal
Shot noise is √100 = 10 electrons, and the read noise adds in quadrature: √(100 + 4) = 10.2, so SNR = 100/10.2 = 9.8, or 19.8 dB. Shot noise sets almost all of it: a perfect sensor would reach only 10.
:::
:::

::: nameit
## Collecting light

During an exposure, each pixel's photodiode (lesson 2) converts photons to electrons with **quantum efficiency** QE, storing them until readout. Its **full-well capacity** is the most it can hold, from a few thousand electrons in small phone pixels to 100,000 in large ones; beyond that, it saturates.

## Noise

- **Shot noise**: photon arrivals are random, so N expected electrons vary by $\sqrt N$.
- **Read noise** $\sigma_r$: the amplifier and ADC add a fixed noise per readout, 1 to 5 electrons in good sensors.
- **Dark current** adds electrons with no light, growing with temperature and exposure time.

These add as squares: $\text{SNR} = N/\sqrt{N + \sigma_r^2}$ (ignoring dark current). The **dynamic range** is full well over read noise, usually quoted as $20\log_{10}(FW/\sigma_r)$ dB.

## Readout

The pixel's charge is converted to voltage on a small capacitance, with a **conversion gain** of tens of microvolts per electron, then digitized. A **CCD** shifts every pixel's charge across the chip to one output amplifier; a **CMOS** sensor has an amplifier in every pixel and reads rows in turn, which is faster and cheaper, at the cost of a **rolling shutter** that exposes rows at slightly different times.

## Color

A **Bayer filter** puts red, green and blue filters over alternate pixels (twice as many green), and software interpolates full color at each pixel.
:::

::: example
## A sensor has a 10,000-electron full well and 2 electrons of read noise. What are its dynamic range and its best SNR? How many ADC bits cover the range?

::: solution
1. **Dynamic range.**
   $$\begin{aligned} \text{DR} &= 20\log_{10}\frac{10\,000}{2} \\ &= 74\ \text{dB} \end{aligned}$$
2. **Best SNR.** At full well:
   $$\begin{aligned} \text{SNR} &= \frac{10\,000}{\sqrt{10\,004}} \\ &\approx 100 \end{aligned}$$
   or 40 dB.
3. **ADC bits.** Covering a 5000:1 range needs
   $$\log_2 5000 = 12.3$$
   so 12 to 13 bits.

**Answer:** a dynamic range of 74 dB, a best SNR of about 100 (40 dB), and 12 to 13 ADC bits.
:::
:::

::: example
## At a conversion gain of 50 µV per electron, what voltage does a full well of 10,000 electrons produce?

::: solution
1. **Multiply by the conversion gain.**
   $$10\,000 \times 50\ \mu\text{V} = 0.5\ \text{V}$$
2. **Compare with the ADC.** That's a comfortable swing for the ADC.

**Answer:** 0.5 V.
:::
:::

::: example
## In dim light a pixel collects only 100 electrons, with 2 electrons of read noise. What is its SNR, and which noise dominates?

::: solution
1. **Shot noise.**
   $$\sqrt{100} = 10\ \text{electrons}$$
2. **Total noise.** Shot noise and read noise add in quadrature:
   $$\sqrt{100 + 4} = 10.2\ \text{electrons}$$
3. **SNR.**
   $$\frac{100}{10.2} = 9.8$$
   or 19.8 dB.
4. **Which noise dominates.** Shot noise dominates; reducing read noise further barely helps, while collecting more light (bigger pixels, longer exposure) does.

**Answer:** an SNR of 9.8 (19.8 dB), with shot noise dominating.
:::
:::

::: check
given: N = 25 | 100 | 1000; r = 1 | 3 | 10
answer: N/sqrt(N + r^2)
tolerance: 0.5%

## A pixel collects {N} electrons and has {r} electrons of read noise. What's its SNR?

::: right
Right. $N/\sqrt{N + \sigma_r^2}$ = {answer}.
:::

::: misses
- [N/r] The shot noise counts too, and the two add as squares.
- [any] Not yet. Combine shot and read noise.
:::
:::

::: check
given: F = 5000 | 30000 | 100000; r = 1.5 | 3 | 8
answer: 20*log(F/r)
unit: dB
tolerance: 0.5%

## A sensor's full well is {F} electrons and its read noise {r} electrons. What's its dynamic range?

::: right
Right. $20\log_{10}(FW/\sigma_r)$ = {answer} dB.
:::

::: misses
- [10*log(F/r)] Dynamic range for image sensors is quoted as 20 log.
- [any] Not yet. Full well over read noise.
:::
:::

::: check
given: q = 0.5 | 0.7 | 0.9; p = 200 | 5000
answer: q*p
tolerance: 0.5%

## A pixel with {q} quantum efficiency receives {p} photons. How many electrons does it collect, on average?

::: right
Right. QE × photons = {answer} electrons.
:::

::: misses
- [any] Not yet. Electrons per photon times photons.
:::
:::

::: check
given: N = 1000 | 10000 | 50000; g = 20 | 50 | 120
answer: N*g/1000
unit: mV
tolerance: 0.5%

## A pixel holds {N} electrons, read out at {g} µV per electron. What voltage does it produce?

::: right
Right. N × conversion gain = {answer} mV.
:::

::: misses
- [any] Not yet. Electrons times microvolts per electron.
:::
:::

::: check
kind: parts
given: W = 5000 | 10000 | 50000; r = 1 | 2 | 5

## A pixel's full well is {W} electrons, with {r} electrons of read noise.

::: part
answer: 20*log(W/r)
unit: dB
tolerance: 0.5%

### What is its dynamic range?

::: misses
- [any] $20\log_{10}(W/r)$.
:::
:::

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

### What is its best SNR, at full well?

::: misses
- [20*log(W/r)] At full well, shot noise $\sqrt W$ dominates.
- [any] $W/\sqrt{W + r^2}$.
:::
:::
:::

::: check
kind: parts
given: N = 25 | 100 | 400; r = 1 | 3 | 10

## A pixel collects {N} electrons in dim light, with {r} electrons of read noise.

::: part
answer: N/sqrt(N + r^2)
tolerance: 0.5%

### What is its SNR?

::: misses
- [any] $N/\sqrt{N + r^2}$.
:::
:::

::: part
answer: N/sqrt(N)
tolerance: 0.5%

### What would it be with no read noise at all?

::: misses
- [any] $\sqrt N$.
:::
:::
:::

::: check
kind: parts
given: W = 5000 | 20000; g = 20 | 50 | 100; r = 2 | 4

## A pixel with a {W}-electron full well has a conversion gain of {g} µV per electron and {r} electrons of read noise.

::: part
answer: W*g/1e6
unit: V
tolerance: 0.5%

### What voltage does a full well produce?

::: misses
- [any] Electrons × gain.
:::
:::

::: part
answer: ceil(log(W/r)/log(2))
unit: bits
tolerance: 0

### How many ADC bits cover the range from read noise to full well?

::: misses
- [any] $\lceil\log_2(W/r)\rceil$.
:::
:::
:::

::: explain
## Why are photos taken in dim light grainy even with a perfect camera?

::: model
Light arrives as individual photons at random times, so the number a pixel catches during an exposure fluctuates around its average, with a spread equal to the square root of that average. In bright light a pixel collects tens of thousands of electrons, and a spread of a hundred or so is a percent or less, invisible. In dim light it might collect a hundred, and the spread of ten is a tenth of the signal, so neighboring pixels that should match differ visibly, and the image looks grainy. No electronics can remove this shot noise; only collecting more light, through a bigger lens, larger pixels or a longer exposure, improves it.
:::
:::

::: practice

::: check
given: N = 1 | 100000; r = 0.5 | 20
answer: N/sqrt(N + r^2)
tolerance: 0.5%

## SNR: {N} electrons, {r} e⁻ read noise?

::: misses
- [any] $N/\sqrt{N + \sigma_r^2}$.
:::
:::

::: check
given: F = 1000 | 200000; r = 0.5 | 20
answer: 20*log(F/r)
unit: dB
tolerance: 0.5%

## Dynamic range: {F} e⁻ full well, {r} e⁻ read noise?

::: misses
- [any] $20\log(FW/\sigma_r)$.
:::
:::
:::
