notesonly.in

One notebook for every subject — open it anywhere.

Log in

ADC and DAC Converters: Complete Beginner's Guide Guide.

An ADC (Analog-to-Digital Converter) turns a continuous real-world signal, such as a microphone voltage or a temperature sensor output, into a digital number a processor can store and compute with. A DAC (Digital-to-Analog Converter) does the reverse: it turns a digital number back into a smooth analog voltage, for example to drive a speaker or control a motor. Together they are the bridges between the analog physical world and digital electronics.

These converters matter because every sensor reads the world in analog and every microcontroller thinks in digital. Your phone records voice through an ADC and plays music through a DAC; a digital multimeter, an ECG monitor, a motor speed controller and a software-defined radio all depend on them. Choosing the right resolution and speed decides whether the system works or produces garbage.

Key Concepts

  • Resolution (n bits): the number of digital output levels is 2^n. An 8-bit ADC has 256 levels; a 12-bit ADC has 4096.
  • LSB step size: the smallest voltage change the converter can detect, Vref / 2^n.
  • Quantization error: the rounding error between the true analog value and the nearest digital level, at most plus or minus half an LSB.
  • Reference voltage (Vref): the full-scale voltage range of the converter; accuracy of Vref limits accuracy of everything.
  • Sampling rate: how many conversions per second the ADC performs; must satisfy the Nyquist rule (faster than twice the highest signal frequency).
  • Common ADC types: flash (fastest, most hardware), SAR — successive approximation (balanced, most common in microcontrollers), sigma-delta (slow but very high resolution, used in audio).

Formulas

  • Step size (1 LSB) = Vref / 2^n. Units: volts per count.
  • ADC output code D = round(Vin / Vref x (2^n - 1)). D is an integer from 0 to 2^n - 1.
  • Maximum quantization error = plus or minus LSB / 2.
  • DAC output voltage Vout = (D / (2^n - 1)) x Vref. Assumes an ideal linear DAC with no offset error.

Worked Example

Take an 8-bit ADC with Vref = 5 V, measuring Vin = 2.2 V:

  1. Step size = 5 / 256 = 0.01953 V, about 19.5 mV per count.
  2. Code D = round(2.2 / 5 x 255) = round(0.44 x 255) = round(112.2) = 112.
  3. In binary, 112 = 01110000. The ADC reports 112.
  4. Worst-case quantization error = 19.53 / 2 = 9.77 mV, so the true 2.2 V could read as anything from 2.190 V to 2.210 V.

Now feed code D = 200 into an 8-bit DAC with the same 5 V reference: Vout = (200 / 255) x 5 = 0.7843 x 5 = 3.92 V. The digital number 200 becomes a steady 3.92 V at the output pin.

Common Misconceptions

  • "More bits always means a better measurement." Not if noise is larger than one LSB. A 16-bit ADC on a noisy sensor still gives noisy data; extra bits below the noise floor are meaningless.
  • "The ADC output equals the exact input." It equals the nearest step. The half-LSB quantization error is unavoidable and is the reason dithering and oversampling exist.
  • "A DAC produces a perfectly smooth voltage." A raw DAC output is a staircase of steps. Real circuits add a reconstruction (low-pass) filter to smooth it into a clean analog waveform.

Real-World Applications

  • Audio recording and playback: microphones feed ADCs, speakers are driven by DACs.
  • Sensor interfacing: temperature, pressure, light and current sensors all need ADCs before a microcontroller can use them.
  • Motor control and power supplies: DACs (or PWM filtered like a DAC) set speed and voltage references.
  • Medical instruments: ECG and pulse oximeters digitize tiny analog body signals with high-resolution ADCs.
  • Test equipment: oscilloscopes and data loggers are built around fast ADCs.

ADCs translate the continuous physical world into digital numbers, and DACs translate numbers back into continuous voltages. Resolution sets the step size, the reference sets the range, and quantization error sets the fundamental accuracy limit. Pick these three correctly and the converter disappears into the background, doing its job invisibly.