Electronics & Circuits · Study deck
ADC and DAC: Conversion Calculations
An ADC count is useful only when it maps back to the measured voltage.
Voltage Vera is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- Calculate ADC Output: Compute digital values from analog voltage inputs using the ADC conversion formula
- Select Reference Voltages: Evaluate and match Vref to sensor output ranges for maximum resolution
- Quantify Quantization Error: Derive measurement precision limits across different ADC resolutions
- Determine Nyquist Sampling Rates: Compute minimum and practical sampling frequencies for specific signal types
Major section
Start Simple
The test engineer must show how one known input becomes both outputs without hiding a reference value, scale factor, unit change, or rounding choice.
- Reverse the calculation to see whether the reported value can recover the original within the stated limit.
- A distant chart may show the result, but it cannot restore resolution lost at conversion.
- This opening does not cover every converter design.
Major section
Phoebe's Field Notes: Where the Converter Numbers Come From
The mathematical gist.: A 10-bit, 3.3 V ADC has q=V_{ref}/2^{10}=3.22 mV.
- At 1.65 V, the chapter's endpoint rule gives \(D=\lfloor(1.65/3.3)1023\rfloor=511\), reconstructing 1.648 V within half an LSB.
Major section
ADC Conversion Formula
The visual is specifically about aDC conversion showing how continuous analog voltage is sampled and quantized into discrete digital steps.
- These visible labels explain aDC conversion showing how continuous analog voltage is sampled and quantized into discrete digital steps.
- They keep adc conversion formula tied to evidence that can be inspected on the schematic, part, or trace.
Major section
Quantization Error Example
Quantization error is the inherent inaccuracy introduced when converting continuous analog signals to discrete digital values.
- Where LSB (Least Significant Bit) is the smallest voltage change the ADC can detect.
- Any voltage between 1.650V and 1.653V will round to the same digital value (512).
- Effective bits increase by log2(N)/2.
Major section
ESP32 Soil Moisture Example
Scenario: A smart irrigation system uses a capacitive soil moisture sensor that outputs 1.2V (dry) to 2.8V (saturated).
- You need to determine optimal ADC configuration on an ESP32 to detect 1% moisture changes for water-efficient farming.
- Key Insight: Proper attenuation selection is critical.
- Using 0 dB attenuation (0-1.1V range) would clip the signal, while 11 dB provides headroom.
Major section
Ultrasonic Distance Example
Scenario: An autonomous robot uses an HC-SR04 ultrasonic sensor for obstacle detection.
- The echo pulse width (10us to 25 ms) must be measured accurately.
- You need to determine if ADC-based measurement or timer-based capture is appropriate.
- Key Insight: ADCs are for converting analog voltage levels to digital values.
Major section
For Kids: Meet the Sensor Squad!
Math helps the Sensor Squad turn real-world measurements into exact numbers!
- Temperature Terry was measuring the temperature of a fish tank. "It is 25 degrees Celsius!
- ADC Andy looked at the signal. "Okay, I need to turn that into a number Max can understand.
- One quarter of 1023 is about 255.
Major section
For Kids: Meet the Sensor Squad! (continued)
the microcontroller was curious. "How do you figure out which step number matches 0.250 volts?".
- So 0.250 volts is one quarter of the way.
- So I tell Max: the reading is 255!".
- the LED wanted to know more. "And how does Max turn 255 back into a temperature?".
Major section
For Kids: Meet the Sensor Squad! (continued)
That gives me about 25 degrees -- exactly what Sammy measured!".
- the battery chimed in. "But what if you only had 256 steps instead of 1024?".
- Andy nodded. "Then each step would be a bigger jump -- about 0.4 degrees instead of 0.1 degrees.
- I would be less precise.
Major section
ADC Input Impedance Pitfall
The circuit works in simulation but reads incorrectly in hardware.
- The ESP32 ADC has an internal sample-and-hold capacitor that draws charging current during conversion.
- High-impedance sources (like voltage dividers with large resistors) cannot supply enough current fast enough, causing the ADC to read lower voltages than expected.
- Result: readings are 5-10% low.
Deck summary
Key takeaways
The test engineer must show how one known input becomes both outputs without hiding a reference value, scale factor, unit change, or rounding choice.
- The mathematical gist.: A 10-bit, 3.3 V ADC has q=V_{ref}/2^{10}=3.22 mV.
- The visual is specifically about aDC conversion showing how continuous analog voltage is sampled and quantized into discrete digital steps.
- Quantization error is the inherent inaccuracy introduced when converting continuous analog signals to discrete digital values.
- Scenario: A smart irrigation system uses a capacitive soil moisture sensor that outputs 1.2V (dry) to 2.8V (saturated).
Retrieval practice
Recall check 1 of 2

Voltage Vera says: answer from memory, then check your reasoning.
Q1A 10-bit ADC has a 5V reference voltage. What is the voltage resolution (step size)?
Show answer
Answer: B Step Size = V_ref / 2^bits = 5V / 1024 = 0.00488V = 4.88mV. This is the smallest voltage change the ADC can detect. Arduino Uno uses this exact configuration with its 10-bit ADC.
Q2A 12-bit ADC with Vref = 3.3V measures 2.0V. What is the digital output?
Show answer
Answer: B Output = floor((2.0V / 3.3V) x (2^12 - 1)) = floor((2.0 / 3.3) x 4095) = floor(2481.8) = 2481. The 12-bit ADC divides the 0-3.3V range into 4096 steps (0-4095).
Retrieval practice
Recall check 2 of 2

Voltage Vera says: answer from memory, then check your reasoning.
Q3An 8-bit DAC with Vref = 3.3V receives digital input 192. What is the output voltage?
Show answer
Answer: B V_out = V_ref x (Digital_Input / (2^bits - 1)) = 3.3V x (192 / 255) = 3.3V x 0.753 = 2.48V. The 8-bit DAC can output 256 discrete voltage levels (0-255), and we scale the digital value proportionally.
Print reference
Answers 1 of 2
Answer key.
- B · Step Size = V_ref / 2^bits = 5V / 1024 = 0.00488V = 4.88mV. This is the smallest voltage change the ADC can detect. Arduino Uno uses this exact configuration with its 10-bit ADC.
- B · Output = floor((2.0V / 3.3V) x (2^12 - 1)) = floor((2.0 / 3.3) x 4095) = floor(2481.8) = 2481. The 12-bit ADC divides the 0-3.3V range into 4096 steps (0-4095).
Print reference
Answers 2 of 2
Answer key.
- B · V_out = V_ref x (Digital_Input / (2^bits - 1)) = 3.3V x (192 / 255) = 3.3V x 0.753 = 2.48V. The 8-bit DAC can output 256 discrete voltage levels (0-255), and we scale the digital value proportionally.