← Back to Roadmap

📈ADC & DAC — Bridging Analog & Digital

How real-world analog signals become digital data and vice versa — the key to sensing and control.

ADC Fundamentals

Resolution (bits): determines number of discrete levels. n bits = 2^n levels. 8-bit=256, 10-bit=1024 (Arduino), 12-bit=4096 (STM32), 16-bit=65536, 24-bit=16.7M (audio). LSB (Least Significant Bit): voltage per step = Vref / 2^n. For 5V, 10-bit ADC: LSB = 5/1024 = 4.88mV. Sample rate: conversions per second (Hz). Nyquist: sample at ≥ 2× highest frequency. Aliasing: sampling too slow creates false low frequencies.

ADC Architectures

SAR (Successive Approximation): binary search, most common in MCUs (10-16 bit, ≤5 Msps). Good balance of speed/accuracy. Sigma-Delta (ΣΔ): oversamples then averages, very high resolution (16-24 bit), slow (≤192 ksps). Used in audio. Flash: bank of comparators, fastest (Gsps), but 2^n-1 comparators needed — expensive above 8 bits. Dual-slope: integrates input then discharges — very accurate, very slow, used in multimeters.

DAC Basics

R-2R ladder: simple resistor network, each bit controls a switch. Output = Vref × (digital_value / 2^n). String DAC: chain of equal resistors, tap selected by switches. Monotonic by design. PWM + low-pass filter: cheapest "DAC" — filter averages the PWM signal. Ripple depends on PWM frequency vs filter cutoff. Adequate for LED dimming, poor for audio.

🎮 Interactive: ADC Resolution Visualizer

🎮 Interactive: ADC Resolution Visualizer
See how bit depth affects quantization of an analog sine wave.
Bits
10
Levels
1024
LSB (Step Size)
0.00mV

🛠️ Real-World: Reading a Temperature Sensor

🛠️ Real-World: Reading a Temperature Sensor
TMP36 analog sensor: 10mV/°C, offset 500mV at 0°C.
With 10-bit ADC, 5V ref:
1. Read ADC: 148
2. Voltage = 148 × 5/1024 = 0.723V
3. Temp = (0.723 - 0.5) / 0.01 = 22.3°C
Resolution: 4.88mV/step = 0.49°C/step. For better: use 12-bit ADC or amplify signal.