ADC, DAC וחיישנים
הוצגבשיעור הזה
| English | משמעות |
|---|---|
| resolution/ˌrezəˈluːʃn/ | רזולוציה |
| LSB/ˌel es ˈbiː/ | ביט בעל ערך מינימלי (LSB) |
| ADC/ˌeɪ diː ˈsiː/ | ממיר אנלוגי-דיגיטלי |
| DAC/ˌdiː eɪ ˈsiː/ | ממיר דיגיטלי-אנלוגי (DAC) |
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.

An 8-bit ADC uses a 3.3 V reference. What is one LSB, in mV? Give 1 decimal place.
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
$3.3/2^{8} = 3.3/256 = 12.9$ mV. כל ביט נוסף מחצית את הגודל של הצעד.
From voltage to code
- The code is $\left\lfloor \dfrac{V_{\text{in}}}{V_{\text{ref}}} \times 2^{N} \right\rfloor$, 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.
ממיר ADC בעל 12 ביטים עם מתח ייחוס של 3.3 V קורא מתח של 0.5 V. מהו הקוד שיופץ?
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
$0.5/3.3 \times 4096 = 620.6$, והקוד הוא המספר השלם הבא: 620.
כתיבת הערך 1024 לממיר DAC בעל 12 ביטים עם מתח ייחוס של 3.3 V. מהו המתח היוצא ב-V? תן 3 ספרות עשרוניות.
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
$1024/4096 \times 3.3 = 0.825$ V, רביע ממתח הייחוס.
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 mV לכל °C וצריך לזהות הפרש של 0.1 °C על רקע מתח ייחוס של 3.3 V. מהו ה-ADC הקטן ביותר שעובד?
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
0.1 °C שווה ל-1 mV, ולכן הגודל של הצעד חייב להיות מקסימום 1 mV. 11 ביטים נותן 1.61 mV ומכשל; 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 kΩ מופעל על ממיר ADC בעל 12 ביטים עם קבל דגימה של 7 pF. מהו זמן הדגימה הקצר ביותר ב-µs? השתמש בנוסחה ln(2^13) = 9.01 ותן 2 ספרות עשרוניות.
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
$10\,000 \times 7 \times 10^{-12} \times 9.01 = 0.63$ µs. מקור בעל התנגדות של 50 kΩ דורש חמישה פעמים יותר זמן.
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$ ביטים. ממוצע אינו יכול להסיר הסטה קבועה.
מכשיר ADC בעל 12 ביט תמיד מדוד בדיוק של 0.806 mV, ללא תלות במתח ההפניה.
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
ערכו של LSB אחד הוא $V_{\text{ref}}/4096$. ערך של 0.806 mV מתקיים רק ב-3.3 V; ב-2.5 V גודל הצעד הוא 0.61 mV.
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.
מה השתבש? רק צוות האתר רואה זאת.