АЦП, ЦАП и датчики
ВведеноВ этом уроке
| English | Значение |
|---|---|
| resolution/ˌrezəˈluːʃn/ | Разрешение |
| LSB/ˌel es ˈbiː/ | младший значащий разряд |
| ADC/ˌeɪ diː ˈsiː/ | АЦП |
| DAC/ˌdiː eɪ ˈsiː/ | цифро-аналоговый преобразователь (ЦАП) |
Volts in, numbers out
- The world speaks in volts; the CPU speaks in numbers. The node's temperature reading is only as good as its converter and its wiring.
- Errors here are quiet: the code runs, the number looks fine, and it is wrong.
Resolution: one LSB
- An ADC 模数转换器 turns a voltage into a code. An N-bit converter on a reference $V_{\text{ref}}$ has a resolution 分辨率 of one LSB 最低有效位: $V_{\text{ref}}/2^{N}$.
- Each code stands for a band of inputs one LSB wide. Reconstructing the input at the band midpoint gives at most half an LSB of ideal quantisation error within the input range. More bits means finer steps.

8-битный АЦП использует опорное напряжение 3.3 В. Чему равен один младший значащий разряд в мВ? Укажите ответ с точностью до 1 знака после запятой.
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
$3.3/2^{8} = 3.3/256 = 12.9$ мВ. Каждый дополнительный бит уменьшает шаг вдвое.
From voltage to code
- The code is $\min\!\left(2^{N}-1,\left\lfloor \dfrac{V_{\text{in}}}{V_{\text{ref}}} \times 2^{N} \right\rfloor\right)$ for inputs from 0 to $V_{\text{ref}}$, so half of $V_{\text{ref}}$ reads $2^{N-1}$.
- A DAC 数模转换器 works in reverse: writing 2048 to a 12-bit DAC on 3.3 V gives 1.650 V.
На вход 12-битного АЦП с опорным напряжением 3.3 В подаётся 0.5 В. Какой код он выдаст?
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
$0.5/3.3 \times 4096 = 620.6$, а код — целое число ниже: 620.
Вы записываете 1024 в 12-битный ЦАП с опорным напряжением 3.3 В. Какое напряжение в В будет на выходе? Укажите ответ с точностью до 3 знаков после запятой.
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
$1024/4096 \times 3.3 = 0.825$ В, четверть опорного напряжения.
Worked example: the 12-bit sensor
- At $V_{\text{ref}} = 3.3$ V, one LSB is $3.3/4096 = 0.806$ mV, and 1.65 V reads 2048.
- To resolve 0.1 °C at 10 mV per °C the node needs 1 mV steps. 12 bits (0.806 mV) pass; 10 bits (3.22 mV) fail.
Датчик выдаёт 10 мВ на °C; необходимо различать изменения температуры на 0.1 °C при опорном напряжении 3.3 В. Какова минимальная разрядность подходящего АЦП?
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
0.1 °C соответствует 1 мВ, поэтому шаг должен быть не более 1 мВ. 11 бит дает шаг 1.61 мВ и не подходит; 12 бит — первый, который подходит.
The sampling capacitor
- Inside the ADC, a small capacitor (about 7 pF) charges through the source resistance before each conversion.
- The error left on the capacitor falls as $e^{-t/RC}$. A full-scale step must shrink to half an LSB, a factor of $2^{N+1}$, so the sampling time must be at least $R_{\text{source}}\,C \ln(2^{N+1})$.
Worked example: the source-impedance trap
- For a 50 kΩ source on 12 bits: $50\,000 \times 7\text{ pF} \times 9.01 \approx 3.2$ µs. This is a full-scale-step estimate for this simple RC model.
- With a 1 µs window, the same bound allows only 16 kΩ. Choose the longer window, or lower the divider resistors.
Fine ADC steps need time for the sample to settle
$V_{error}=\Delta V e^{-t_s/(RC)},\quad t_s\ge RC\max[0,\ln(2^{N+1}\Delta V/V_{ref})]$
Start with the worked 50 kΩ source and 7 pF sampling capacitor on a 12-bit ADC. A 3.2 µs acquisition window meets the half-LSB settling budget; a 1 µs window misses it. Lower the source resistance or lengthen acquisition, then compare 16 bits to see why finer voltage steps demand a smaller remaining error. Separate acquisition error from quantisation.
Источник с сопротивлением 10 кОм подключён к 12-битному АЦП с конденсатором выборки ёмкостью 7 пФ. Каково минимальное время выборки в мкс? Используйте ln(2^13) = 9.01 и укажите ответ с точностью до 2 знаков после запятой.
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
$10\,000 \times 7 \times 10^{-12} \times 9.01 = 0.63$ мкс. Источнику с сопротивлением 50 кОм требуется в пять раз больше времени.
Three common slips
- Bits without the reference. 0.806 mV is true only at 3.3 V.
- ADC as a voltmeter. Its sampling current loads a high-impedance sensor, as the RC bound shows.
- Averaging to buy bits. 16 samples of random noise gain about 2 bits, but no average removes a fixed offset.
Среднее по N выборкам случайного шума дает прибавку в полбита за каждое удвоение N. Сколько бит получают 64 выборок?
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
64 является $2^{6}$, шестью удвоениями, следовательно, $6 \times 0.5 = 3$ бит. Усреднение не может устранить фиксированное смещение.
АЦП на 12 бит всегда измеряет с точностью до 0.806 мВ, независимо от опорного напряжения.
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
Один МЛБ равен $V_{\text{ref}}/4096$. Значение 0.806 мВ верно только при напряжении 3.3 В; при напряжении 2.5 В шаг составляет 0.61 мВ.
Recap
- One LSB $= V_{\text{ref}}/2^{N}$; the requirement picks N. On a 3.3 V reference:
| Bits N | 8 | 10 | 12 | 16 |
|---|---|---|---|---|
| One LSB (mV) | 12.9 | 3.22 | 0.806 | 0.050 |
- A code identifies a one-LSB input band; midpoint reconstruction has a half-LSB error bound.
- Sampling time $\ge R C \ln(2^{N+1})$ trades source resistance against speed.
Что пошло не так? Это увидит только команда сайта.