Analog-to-digital conversion (ADC) is the process of translating a continuous, real-world voltage signal into a discrete binary number that a microcontroller or computer can process. While the physical world operates in smooth, infinite gradients—like the rising voltage from a thermistor as it heats up or the fluctuating current from a solar panel—digital logic only understands distinct states: 1s and 0s. The ADC acts as the bridge between these two domains, fundamentally changing a circuit by allowing physical measurements to trigger logical, software-driven decisions, such as a charge controller cutting off a load when battery voltage drops below 11.5V.
The Core Math: Resolution, Reference Voltage, and Step Size
To understand what is analog to digital conversion in a practical sense, you must look at the math governing quantization. An ADC measures an input voltage ($V_{in}$) against a known reference voltage ($V_{ref}$). The "resolution" of the ADC, measured in bits, determines how many discrete slices (or steps) it divides that reference voltage into. Think of it like a staircase: an 8-bit ADC gives you a staircase with 256 steps to reach the top, while a 16-bit ADC gives you 65,536 much smaller steps. The smaller the step, the closer your digital reading matches the true analog voltage.
The formula for the voltage step size (also called the Least Significant Bit, or LSB) is:
Step Size = $V_{ref}$ / ($2^n$ - 1) (where n is the bit resolution)
| ADC Resolution | Total Steps ($2^n$) | Step Size @ 5.0V $V_{ref}$ | Step Size @ 3.3V $V_{ref}$ | Common Hardware Example |
|---|---|---|---|---|
| 8-bit | 256 | 19.60 mV | 12.94 mV | PCF8591 I2C Module, PIC10F |
| 10-bit | 1,024 | 4.89 mV | 3.23 mV | Arduino Uno R3 (ATmega328P) |
| 12-bit | 4,096 | 1.22 mV | 0.81 mV | ESP32-WROOM-32, STM32F103 |
| 16-bit | 65,536 | 76.3 µV | 50.4 µV | ADS1115 I2C ADC, Arduino Due |
| 24-bit | 16,777,216 | 0.298 µV | 0.196 µV | HX711 (Load Cells), Audio Interfaces |
Source: Analog Devices Data Conversion Handbook
Worked Example: Reading a Temperature Sensor on an Arduino Uno
Let us apply this to a real circuit. You are building a greenhouse monitor using an Arduino Uno R3 (10-bit ADC, 5.0V default reference) and a TMP36 analog temperature sensor. The TMP36 outputs 750 mV (0.75V) at exactly 25°C, with a scale factor of 10 mV per degree Celsius.
- Calculate the Step Size: With a 10-bit ADC and a 5.0V reference, the step size is 5.0V / 1023 = 4.887 mV per step.
- Determine the Digital Value: Divide the sensor's output voltage by the step size. 0.75V / 0.004887V = 153.46.
- Read the Result: The ADC rounds to the nearest integer, returning a raw digital value of 153 to your code via
analogRead(A0). - Convert Back in Code: To display the temperature, your code multiplies 153 by 4.887 mV to get 0.747V, subtracts the 500mV offset, and divides by 10mV/°C, yielding 24.7°C.
Notice the quantization error: the true temperature was 25.0°C, but the ADC's limited resolution forced a reading of 24.7°C. If you need exact 25.0°C precision, you must upgrade to a 12-bit or 16-bit ADC.
Where You Meet ADCs in Practice
You interact with analog-to-digital conversion constantly, whether on the workbench or in a finished installation:
- Microcontroller GPIO: Reading potentiometers, light-dependent resistors (LDRs), and NTC thermistors for DIY automation.
- Digital Multimeters (DMMs): High-end bench DMMs use 5.5-digit or 6.5-digit integrating ADCs to measure millivolt drops across shunt resistors for current calculations.
- Solar Charge Controllers: MPPT controllers use high-speed ADCs to sample panel voltage and current thousands of times per second, executing perturb-and-observe algorithms to find the maximum power point.
- Audio Interfaces: 24-bit Sigma-Delta ADCs capture microphone signals at 48 kHz or 96 kHz sample rates for digital mixing consoles.
For a deep dive into how different ADC architectures (SAR vs. Sigma-Delta) handle these tasks, the TI Precision Labs ADC video series is the industry-standard reference.
Common Confusions and Edge Cases
When specifying an ADC for a project, hobbyists and junior engineers frequently trip over three specific misconceptions.
1. Resolution vs. Sample Rate
A 24-bit ADC offers incredible resolution (microvolt-level step sizes), but it is typically very slow, sampling perhaps 10 to 80 times per second. Conversely, an 8-bit ADC in an oscilloscope might sample at 1 Gigasample per second (GS/s) to capture high-frequency RF transients, but it can only resolve voltages into 256 crude chunks. Rule of thumb: High resolution is for slow-moving DC signals (battery voltage, temperature); high sample rate is for fast-moving AC waveforms (audio, motor back-EMF).
2. The ESP32 Internal ADC Trap
The ESP32 boasts a 12-bit internal ADC, which sounds great on paper. However, due to silicon-level non-linearities, the ESP32's internal ADC is notoriously inaccurate near the 0V and 3.3V rails. A true 3.1V input might read as 3.1V, but a 3.25V input will saturate and read the exact same maximum value. The fix: If you are building a precision battery monitor or sensor array with an ESP32, bypass the internal ADC entirely and wire an external I2C ADC like the Texas Instruments ADS1115 (16-bit, highly linear, ~$3 on breakout boards).
3. ADC vs. DAC
ADC (Analog-to-Digital) reads the physical world into code. DAC (Digital-to-Analog) pushes code back into the physical world. If you need to drive a 0-10V industrial motor controller or generate a sine wave for a function generator, you need a DAC (like the MCP4725), not an ADC.
Frequently Asked Questions
Q: Do I need an anti-aliasing filter before my ADC?
A: Yes, if you are measuring AC signals or audio. According to the Nyquist-Shannon sampling theorem, you must filter out any frequencies higher than half your ADC's sample rate. If you sample at 10 kHz, put a low-pass filter set to 5 kHz in front of the ADC pin, or high-frequency noise will fold back into your data as phantom low-frequency signals.
Q: Why does my analogRead() value fluctuate by 2 or 3 digits even when the input is tied to ground?
A: This is thermal noise and electromagnetic interference (EMI) being picked up by your PCB traces or jumper wires. To stabilize the reading, add a 100nF ceramic bypass capacitor physically close to the ADC pin, and use a software moving-average filter to smooth the remaining 1-LSB jitter.






