Ugenz Academy/IoT Tutorial

Adc And Dac

10 min read1,847 words

Reading progress

Keep learning

ADC and DAC in Electronics

1. Introduction

ADC and DAC are important electronic circuits used to convert signals between analog and digital formats.

ADC (Analog-to-Digital Converter) converts an analog signal into digital data that a computer or microcontroller can process.

DAC (Digital-to-Analog Converter) converts digital data into an analog signal that can be used by devices such as speakers, control systems, and analog circuits.

These converters connect the physical world, which commonly produces analog signals, with digital electronic systems.

Examples include temperature sensors, microphones, audio systems, digital measuring instruments, and IoT devices.

2. Analog and Digital Signals

Before understanding ADC and DAC, it is important to understand the difference between analog and digital signals.

Analog signal

An analog signal varies continuously over time and can take a range of values within its operating limits.

Examples:

  • Temperature measured by an analog sensor
  • Sound captured by a microphone
  • Light intensity measured by a photodiode
  • Voltage produced by a potentiometer

Digital signal

A digital signal represents information using discrete values. In binary digital systems, these values are represented using 0 and 1.

Examples:

  • Binary data stored in a computer
  • Digital readings from a microcontroller
  • Audio samples stored in a digital file

Analog vs. Digital Signals

Analog signal

A continuously varying waveform.

Digital signal

A waveform with discrete logic levels.

3. ADC (Analog-to-Digital Converter)

An Analog-to-Digital Converter (ADC) is an electronic circuit that converts an analog input voltage into a digital number.

For example, a temperature sensor may produce an analog voltage corresponding to the measured temperature. An ADC converts that voltage into a numerical value that a microcontroller can read and process.

Working principle of an ADC

The conversion process generally involves three steps:

  1. Sampling: Measures the input signal at specific time intervals.
  2. Quantization: Maps each sampled value to one of a finite number of available levels.
  3. Encoding: Represents the selected level as a binary number.

These operations allow a digital system to process information originally represented by an analog signal.

4. Block Diagram of an ADC

Analog Input

Sensor voltage or audio signal

ADC Circuit

Sampling, quantization and encoding

Digital Output

Binary data for a processor

An ADC typically produces an integer code representing the measured voltage. The exact relationship depends on its resolution, reference voltage, input range, and transfer characteristics.

5. ADC Resolution

ADC resolution describes the number of bits used to represent the converted input value.

An nn-bit ADC provides:

N=2n\boxed{N=2^n}

possible digital output codes.

Examples:

ADC resolutionNumber of codesTypical code range
8-bit2560–255
10-bit1,0240–1,023
12-bit4,0960–4,095
16-bit65,5360–65,535

A higher resolution allows an ADC to distinguish smaller changes in input voltage, assuming the rest of the system supports that performance.

6. ADC Voltage Resolution

For an ideal unipolar ADC with input range from 0 V to a reference voltage V_refV\_{\text{ref}}, the nominal voltage step is often approximated by:

Step size=V_ref2n\boxed{\text{Step size}=\frac{V\_{\text{ref}}}{2^n}}

Where:

  • V_refV\_{\text{ref}} = reference voltage
  • nn = ADC resolution in bits

Example

Suppose a 10-bit ADC uses a 5 V reference.

Step size=5210\text{Step size}=\frac{5}{2^{10}} =51024=\frac{5}{1024} Step size≈4.88 mV\boxed{\text{Step size}\approx4.88\text{ mV}}

This is the nominal voltage represented by one code step under the stated convention. The actual conversion error also depends on quantization, circuit accuracy, noise, and the ADC's transfer characteristics.

7. ADC Conversion Example

Suppose an ideal 8-bit ADC has an input range of 0–5 V and measures 2.5 V.

Using the approximate conversion formula:

D≈V_inV_ref(2n−1)D\approx\frac{V\_{\text{in}}}{V\_{\text{ref}}}(2^n-1)

Substituting the values:

D≈2.55(255)D\approx\frac{2.5}{5}(255) D≈127.5D\approx127.5

The resulting digital code will be approximately 128, depending on the converter's quantization and coding convention.

In 8-bit binary, 128 is:

10000000\boxed{10000000}

Thus, an analog voltage can be represented by a binary number.

8. Types of ADCs

Several ADC architectures are used in electronic systems.

8.1. Flash ADC

A flash ADC uses multiple comparators to compare the input voltage against different reference levels simultaneously.

Features:

  • Very high conversion speed
  • Requires many comparators as resolution increases
  • Generally consumes more hardware and power

Applications: High-speed data acquisition, radar systems, and some video or communication circuits.

8.2. Successive Approximation Register (SAR) ADC

A SAR ADC determines the digital output by testing bits in sequence, from the most significant bit toward the least significant bit.

Features:

  • Good balance of speed, resolution, and power
  • Commonly used in microcontrollers
  • Requires a comparator, internal DAC, and successive-approximation logic

Applications: Embedded systems, sensor interfaces, and industrial measurement.

8.3. Sigma-Delta ADC

A sigma-delta ADC uses oversampling and noise-shaping techniques to obtain high-resolution digital measurements.

Features:

  • High resolution
  • Often suitable for low-frequency precision signals
  • May have greater conversion latency than faster architectures

Applications: Audio equipment, precision measurement instruments, and weighing systems.

8.4. Dual-Slope ADC

A dual-slope ADC measures an input by integrating it over time and comparing the result with a known reference.

Features:

  • Good noise rejection
  • High accuracy in suitable designs
  • Generally slower than high-speed ADC architectures

Applications: Digital multimeters and precision measurement equipment.

9. Applications of ADC

ADCs are used wherever an electronic system needs to measure or process an analog signal digitally.

  • Temperature measurement
  • Light and humidity sensing
  • Audio recording
  • Digital multimeters
  • Medical instrumentation
  • Industrial monitoring
  • Robotics and automation
  • IoT devices
  • Battery-voltage monitoring
  • Data acquisition systems

For example, an ESP32 can read analog sensor voltages through its ADC and use the resulting digital values to monitor environmental conditions.

10. DAC (Digital-to-Analog Converter)

A Digital-to-Analog Converter (DAC) is an electronic circuit that converts a digital number into a corresponding analog output, usually a voltage or current.

For example, a computer stores audio as digital samples. A DAC converts those samples into an analog electrical signal that can be sent to an amplifier and speaker.

Working principle of a DAC

  1. The digital input provides a binary code.
  2. The DAC interprets the code as a numerical value.
  3. The internal circuit generates a corresponding analog voltage or current.
  4. A filter may smooth the output to reduce unwanted high-frequency components.

The resulting signal represents the digital data in analog form.

11. Block Diagram of a DAC

Digital Input

Binary data from a processor

DAC Circuit

Digital code to analog level

Analog Output

Voltage or current signal

The output voltage depends on the input code, reference voltage, circuit design, and output configuration.

12. DAC Resolution

Like an ADC, a DAC's resolution is commonly specified by the number of input bits.

An nn-bit DAC supports:

N=2n\boxed{N=2^n}

possible digital input codes.

For an ideal unipolar DAC with output codes from zero to full scale, the nominal output step is often:

Step size=V_ref2n−1\boxed{\text{Step size}=\frac{V\_{\text{ref}}}{2^n-1}}

This formula applies to the common convention in which the maximum code 2n−12^n-1 corresponds to V_refV\_{\text{ref}}. Other DACs use different full-scale conventions.

Example

Suppose an ideal 8-bit DAC has a 5 V full-scale output corresponding to code 255.

Step size=5255\text{Step size}=\frac{5}{255} Step size≈19.61 mV\boxed{\text{Step size}\approx19.61\text{ mV}}

Each increase of one digital code increases the ideal output by approximately 19.61 mV under this convention.

13. DAC Conversion Example

Suppose an ideal 8-bit DAC has a 5 V full-scale output and receives the digital value 128.

Using the full-scale convention above:

V_out=D2n−1V_refV\_{\text{out}}=\frac{D}{2^n-1}V\_{\text{ref}}

Substituting:

V_out=128255×5V\_{\text{out}}=\frac{128}{255}\times5 V_out≈2.51 V\boxed{V\_{\text{out}}\approx2.51\text{ V}}

The DAC converts the digital code into a corresponding analog output voltage.

14. Types of DACs

14.1. Binary-Weighted Resistor DAC

A binary-weighted resistor DAC uses resistors with different values based on binary bit weights to generate an analog output.

Features:

  • Simple operating principle
  • Can provide fast conversion
  • Requires accurate resistor ratios
  • Resistor values can become impractical for high resolutions

Applications: Basic DAC demonstrations and some specialized circuits.

14.2. R-2R Ladder DAC

An R-2R ladder DAC uses a network containing only two resistor values: RR and 2R2R.

Features:

  • Uses a repeating resistor structure
  • Easier to scale than a conventional binary-weighted network
  • Requires suitable resistor matching for good accuracy

Applications: Embedded electronics, audio circuits, and digital control systems.

14.3. PWM-Based DAC

A microcontroller can generate a pulse-width-modulated (PWM) signal whose duty cycle represents a digital value. A low-pass filter can smooth the signal into an approximate analog voltage.

Features:

  • Can be implemented without a dedicated DAC peripheral
  • Requires filtering for a smooth output
  • Output ripple and response time depend on the design

Applications: LED control, simple analog control voltages, and low-cost embedded projects.

A filtered PWM signal is not the same as a true DAC output, although it can serve a similar purpose in suitable applications.

15. Applications of DAC

DACs are used in:

  • Audio playback systems
  • Speakers and sound equipment
  • Waveform generators
  • Motor-control systems
  • Industrial automation
  • Analog instrumentation
  • Communication equipment
  • Programmable power supplies
  • Embedded systems
  • Signal-generation circuits

For example, a digital controller can use a DAC to generate a control voltage for an analog circuit or external device.

16. Difference Between ADC and DAC

FeatureADCDAC
Full formAnalog-to-Digital ConverterDigital-to-Analog Converter
ConversionAnalog to digitalDigital to analog
InputAnalog voltage or currentDigital code
OutputDigital numberAnalog voltage or current
Main purposeMeasure or digitize analog signalsReconstruct analog levels from digital data
ExampleReading a temperature sensorProducing an audio output
Common applicationSensor measurementAudio and analog control

17. ADC and DAC in an IoT System

An IoT system often uses an ADC to measure the physical environment and a DAC or equivalent output circuit to control an analog device.

For example, an environmental monitoring system can measure temperature and light intensity, process the readings digitally, and then generate an analog control signal for a compatible external device.

Physical Sensor

Temperature, light, or pressure

ADC

Converts sensor voltage into digital data

Microcontroller

Processes data and makes decisions

DAC or Output Circuit

Generates an analog control signal when required

External Device

Receives the control signal

Not every IoT project requires both converters. For example, a digital sensor may provide digital readings directly, and a relay can be controlled using a digital output without a DAC.

18. Summary

An ADC converts analog signals into digital data, while a DAC converts digital data into corresponding analog signals.

ADC resolution determines the number of available digital codes, while DAC resolution determines the number of available output levels. Both converters are essential in systems that connect sensors, processors, audio equipment, and analog control devices.

Keep learning. Keep building. Keep growing.

© 2026 Ugenz Academy