Every robot you build has to deal with the real world. Light levels shift, battery voltage sags, motor current spikes, and distance sensors pick up walls that move. All of those signals are analog — smooth, continuous, and impossible for a microcontroller to read directly. That is where an ADC analog to digital converter comes in. It translates the messy analog world into the neat digital numbers your microcontroller actually understands.
Our team has spent years wiring sensors into Arduino boards, Raspberry Pi computers, and custom robot controllers. Along the way we have hit every ADC-related problem you can imagine: noisy readings, flaky reference voltages, aliasing artifacts that made our distance sensors lie to us. This guide distills what we learned so you do not have to repeat those mistakes.
By the end of this article you will understand exactly what an ADC is, how it converts analog signals to digital data, what the different ADC types are, and how to pick the right one for your next robotics project. We will keep the math light and the practical examples heavy — exactly the way we wish someone had explained it to us when we built our first line-following robot.
Table of Contents
What Is an ADC (Analog to Digital Converter)?
An ADC, short for analog to digital converter, is an electronic circuit that takes a continuous analog voltage and converts it into a discrete digital number. Think of it as a translator between two languages: the analog language of the physical world and the digital language of binary code that processors speak.
Every sensor on a robot — a potentiometer measuring a joint angle, a thermistor reading motor temperature, a photocell detecting ambient light, a current sensor monitoring battery drain — produces an analog output. The ADC grabs that voltage at a specific moment and assigns it a number your code can act on.
Without an ADC analog to digital converter, your microcontroller would be blind to the physical environment. It could run calculations and drive digital outputs, but it would have no way to measure anything real. The ADC is the bridge that makes sensor-driven robotics possible.
You will find ADCs built into almost every modern microcontroller. The ATmega328P on an Arduino Uno has a 10-bit ADC. The STM32 series packs 12-bit ADCs. ESP32 chips include dual 12-bit ADCs. When the built-in converter is not enough, you can add an external ADC chip like the MCP3008 or ADS1115 for higher resolution or more channels.
Why Do We Need ADCs?
The fundamental problem is that the real world is analog but computers are digital. Temperature does not jump from 20 degrees to 21 degrees in a single step — it glides smoothly through every value in between. Sound waves, light intensity, pressure, and position all work the same way. They are continuous.
A microcontroller, on the other hand, processes everything as binary. Its pins read either HIGH or LOW. Its registers hold integers. There is no native way to represent an infinitely variable analog voltage. The ADC solves this by chopping the continuous range into a finite set of steps and assigning each step a binary number.
Imagine trying to build an autonomous robot without ADCs. You could not read battery voltage to know when to head back to a charging dock. You could not measure distance with an infrared sensor. You could not tell how much current a stalled motor was drawing before it burned out. Every smart, sensor-driven behavior that makes a robot autonomous depends on analog to digital conversion happening somewhere in the system.
How Does an ADC Work? The Conversion Process
Every ADC, regardless of its internal architecture, follows the same three-step process: sample, quantize, and encode. Understanding these three steps is the key to understanding what is an ADC and how does it work at a fundamental level.
Step 1: Sampling
The ADC grabs a snapshot of the analog input voltage at a specific instant. This is called sampling. The sample and hold circuit freezes the voltage value so the converter has a stable signal to work with during conversion. The rate at which these snapshots are taken is the sampling rate, measured in samples per second.
Step 2: Quantization
The ADC compares the sampled voltage against a set of discrete voltage steps determined by its resolution and reference voltage. It figures out which step the sampled voltage falls into. This is quantization — the process of assigning a continuous value to the nearest discrete level. Because the analog value rarely lands exactly on a step, a small error called quantization error is introduced.
Step 3: Encoding
Finally, the ADC converts the quantized level into a binary number. A 10-bit ADC produces a 10-bit binary value. A 12-bit ADC produces 12 bits. This binary code is what your microcontroller reads from the ADC data register.
For example, with a 10-bit ADC and a 5V reference, the full voltage range divides into 1,024 steps. A sampled voltage of 2.5V — exactly half the reference — produces a digital value of approximately 512. Your code reads that 512 and can calculate back to roughly 2.5V using the formula we cover in the resolution section below.
Understanding ADC Resolution: Bits and Discrete Levels
Resolution is the number of discrete values an ADC can produce across its input range, and it is determined by the number of bits. More bits means more steps, which means finer voltage measurement. This is one of the most important ADC specifications you will encounter on datasheets.
The formula is straightforward. An N-bit ADC produces 2 to the power of N discrete levels. A 10-bit ADC gives 1,024 levels. A 12-bit ADC gives 4,096. A 16-bit ADC gives 65,536. Each additional bit doubles the number of steps, which halves the voltage represented by each step and improves precision.
To calculate the actual voltage from an ADC reading, use this formula:
Voltage = (ADC Reading / 2 to the power of N) times Reference Voltage
On an Arduino Uno with a 10-bit ADC and 5V reference, each step represents about 4.88 millivolts. If analogRead returns 512, the voltage is (512 / 1024) times 5V = 2.5V. This is the exact calculation forum users tell us they struggle with most often.
One common trap: resolution is not the same as accuracy. A 12-bit ADC has 4,096 levels, but if the reference voltage is noisy or the ADC itself has linearity errors, your readings will not be accurate to 1 part in 4,096. We have seen builders assume their 12-bit ADC gives them sub-millivolt precision only to discover their voltage regulator was introducing 10 millivolts of noise.
Sampling Rate and the Nyquist Theorem
Sampling rate determines how often the ADC takes snapshots of the input signal. It is measured in samples per second, sometimes written as Hz or ksps (kilosamples per second). A higher sampling rate lets you capture faster-changing signals but generates more data to process.
The Nyquist theorem states that to accurately reconstruct a signal, your sampling rate must be at least twice the highest frequency present in that signal. If your analog signal contains components up to 1 kHz, you need to sample at 2 kHz or faster. Sample slower than that and you get aliasing — a phenomenon where high-frequency signals fold back into the data as fake low-frequency artifacts.
Aliasing in robotics can cause real problems. We once saw a distance sensor on a wheeled robot report phantom obstacles every time the motor PWM frequency aliased into the ADC readings. The fix was an anti-aliasing filter — a simple RC circuit that blocks high frequencies before they reach the ADC input.
For most robotics sensor applications like reading potentiometers or thermistors, the signal changes slowly and a modest sampling rate is fine. For motor current sensing or audio capture, you need much faster sampling. Always match your ADC sampling rate to the actual frequency content of your signal.
Types of ADCs: Which Architecture Fits Your Project?
There are several ADC architectures, each with trade-offs in speed, resolution, complexity, and cost. The four most common types you will encounter are flash, successive approximation, delta-sigma, and dual slope.
Flash ADC (Direct Conversion)
A flash ADC uses a bank of comparators to convert the input voltage in a single step. For an N-bit flash converter, you need 2 to the power of N minus 1 comparators. An 8-bit flash ADC needs 255 comparators. This makes flash converters extremely fast — they can digitize signals at hundreds of megasamples per second — but expensive and power-hungry at higher resolutions.
Flash ADCs are used in oscilloscopes, radar systems, and high-speed video processing. You will rarely see one on a typical robot, but they are the architecture behind the fastest data acquisition systems in existence.
Successive Approximation Register (SAR) ADC
The SAR ADC is the workhorse of embedded systems. It uses a single comparator and a digital-to-analog converter to perform a binary search on the input voltage. It tests each bit from most significant to least significant, comparing the trial value against the input and keeping or rejecting each bit.
This makes SAR converters a great balance of speed, resolution, power consumption, and cost. Most microcontroller ADCs — including those in Arduino, STM32, and PIC chips — are SAR converters. They typically offer 8 to 16 bits at sampling rates from tens of kilosamples to a few megasamples per second.
Delta-Sigma ADC
A delta-sigma ADC uses oversampling and noise shaping to achieve very high resolution — often 16 to 24 bits. It samples the input much faster than the target output rate, then filters and decimates the results to produce a high-resolution, lower-rate output. This architecture trades speed for precision.
Delta-sigma converters are ideal for precision measurement: weigh scales, temperature sensors, strain gauges, and audio applications. The popular ADS1115 module that many builders add to Raspberry Pi projects is a delta-sigma ADC offering 16-bit resolution.
Dual Slope ADC
A dual slope ADC integrates the input voltage for a fixed time, then integrates a reference voltage in the opposite direction and measures how long it takes to return to zero. This integration process averages out noise and rejects specific interference frequencies, making dual slope converters very accurate for slow, stable measurements.
You will find dual slope ADCs in digital multimeters and industrial instrumentation where accuracy matters more than speed. They are too slow for most robotics control loops but excellent for calibration and monitoring applications.
Quick comparison for choosing: pick SAR for general-purpose robotics and microcontroller projects, delta-sigma when you need high precision, flash when you need extreme speed, and dual slope for high-accuracy low-speed measurements.
ADC Applications in Robotics
Robotics is where ADC technology truly shines. Nearly every sensor that makes a robot autonomous produces an analog signal that needs conversion. Understanding how ADCs fit into your robot is one of the most practical things you can learn as a builder.
Joint position sensing is a classic application. Potentiometers mounted on servo joints produce an analog voltage proportional to the joint angle. The ADC reads that voltage and your control code knows exactly where the arm is positioned. This is how most hobby servo feedback systems work behind the scenes.
Battery monitoring is another critical use. Lithium polymer batteries in robots need careful voltage monitoring to avoid over-discharge damage. An ADC reads the battery voltage through a voltage divider and your code triggers a low-battery warning or auto-return to the charging station before the cell drops below a safe threshold.
Motor current sensing protects your drivetrain. A current sense resistor in series with the motor produces a small voltage proportional to current draw. The ADC reads that voltage, and if current spikes beyond a threshold — indicating a stall or mechanical jam — your code cuts power before the motor or driver chip burns out.
Environmental sensing lets autonomous robots react to their surroundings. Infrared distance sensors, analog ultrasonic modules, photocells for light detection, and analog accelerometers all feed through ADCs. A line-following robot reads multiple analog photoresistors through ADC channels to determine its position relative to the line.
Force and tactile sensing enables grippers and manipulators. Force-sensitive resistors change resistance based on pressure, producing an analog voltage through a voltage divider. The ADC tells your robot how hard the gripper is squeezing, so it can hold an egg without crushing it or grip a wrench without dropping it.
Using ADCs With Arduino and Raspberry Pi
The Arduino Uno makes ADC access trivial. It has a built-in 10-bit SAR ADC with 6 channels on pins A0 through A5. Reading a sensor is a single line of code: int value = analogRead(A0); That call returns a number from 0 to 1023 representing the voltage on pin A0 relative to the reference voltage.
To convert that reading to an actual voltage, multiply by the reference voltage and divide by 1024. On a standard 5V Arduino, the formula is float voltage = value * (5.0 / 1024.0); Forum users tell us this is the single most useful formula they learn, and getting the divisor right (1024, not 1023) eliminates a common off-by-one error.
The Raspberry Pi has no built-in ADC, which surprises many builders coming from Arduino. To read analog sensors on a Pi, you need an external ADC chip. The MCP3008 is the most popular choice for beginners — it is an 8-channel 10-bit SAR ADC that communicates over SPI. The ADS1115 is a step up, offering 16-bit resolution and I2C communication with four channels.
Wiring an MCP3008 to a Raspberry Pi takes about ten minutes. Connect VDD to 3.3V, VREF to 3.3V for a 3.3V reference range, AGND and DGND to ground, CLK to a SPI clock pin, Dout and Din to SPI data pins, and CS to a chip select pin. Then use a library like Adafruit’s MCP3008 Python driver to read channels in a single function call.
One tip we always give builders: if you need more ADC channels than your microcontroller provides, use an analog multiplexer like the CD4051 to route multiple sensor signals through a single ADC pin. This is how we expanded an Arduino’s 6 analog channels to handle 14 sensors on a hexapod robot without adding an external ADC chip.
Common ADC Problems and How to Fix Them
Noisy readings are the number one complaint we hear from builders. If your ADC values jump around by several counts even when the sensor input is stable, noise is the culprit. The most common cause is an unstable or noisy reference voltage. The ADC compares the input against the reference, so any noise on the reference directly corrupts every reading.
The fix starts with power supply quality. Use a dedicated, well-filtered voltage reference instead of tapping the main supply rail. Add a 0.1 microfarad ceramic capacitor close to the ADC’s reference pin. For critical measurements, consider a precision voltage reference IC like the LM4040 instead of the supply voltage.
Another noise source is high source impedance on the analog input. If your sensor or voltage divider has high resistance, the ADC’s sample and hold capacitor does not have time to charge fully during the sampling window. Keep source impedance below 10 kilohms for SAR ADCs, or add a buffer op-amp between the sensor and the ADC input.
Quantization error is inherent to the conversion process and cannot be eliminated, only minimized. A 10-bit ADC with a 5V reference has steps of 4.88 millivolts each, so any measurement is only accurate to plus or minus 2.44 millivolts. If you need finer resolution, use a higher-bit ADC or oversample and average multiple readings to gain extra effective bits.
Averaging is a simple and effective technique. Take 16 readings, sum them, and divide by 16. This reduces random noise and can gain you about 2 extra effective bits of resolution. Many experienced builders average 4 to 16 samples by default on any analog sensor read.
Inconsistent readings across channels often point to multiplexer settling time issues. When the ADC switches from one channel to another, the sample and hold capacitor needs a brief moment to charge to the new voltage. Add a small delay or discard the first reading after switching channels, especially if the two sensors have very different voltage levels or source impedances.
Beginners sometimes confuse ADC pins with digital pins and try to use analogRead on a digital-only pin or digitalWrite on an analog pin expecting sensor behavior. Always check your microcontroller’s pinout diagram — analog-capable pins are labeled with an A prefix on Arduino and explicitly called out in datasheets for other platforms.
ADC vs DAC: What Is the Difference?
The ADC and DAC are mirror images of each other. An ADC converts analog signals to digital, and a DAC — digital to analog converter — does the reverse, converting digital numbers back into analog voltages. They often appear together in complete signal chains.
Consider audio on a robot. A microphone picks up analog sound waves, an ADC digitizes them, the processor analyzes or records the digital data, then a DAC converts the processed digital audio back to an analog signal that drives a speaker. The ADC handles the input path and the DAC handles the output path.
In robotics motor control, the relationship is similar. A current sensor produces an analog voltage that an ADC reads for feedback monitoring. The motor driver itself often uses PWM — a quasi-digital output — but some analog motor controllers accept a DAC-generated voltage to set speed or position commands.
The key takeaway: ADCs are for reading the world, DACs are for influencing it in analog form. Most microcontrollers include built-in ADCs but far fewer include DACs, which is why external DAC chips like the MCP4725 are common add-ons for projects that need true analog output.
How to Choose the Right ADC for Your Robotics Project
Selecting an ADC comes down to four factors: resolution, sampling rate, number of channels, and interface type. Match these to your specific sensor requirements and you will narrow the field quickly.
For resolution, ask how small a voltage change you need to detect. A potentiometer reading a servo arm position may only need 8 to 10 bits. A strain gauge measuring grams of force on a robotic gripper might need 16 bits. A battery voltage monitor on a 12V pack divided down to 3V at the ADC only needs 10 bits to detect a 0.1V change.
For sampling rate, consider how fast your signal changes. A temperature sensor that drifts over seconds needs maybe 10 samples per second. A current sensor on a spinning motor that you want to sample for control loop feedback might need thousands of samples per second. Audio capture needs 40,000 or more samples per second.
For channels, count your analog sensors. A small differential drive robot might need 4 to 6 channels for line sensors, battery voltage, and one or two distance sensors. A multi-joint robotic arm could need 6 to 12 channels for joint potentiometers alone. Pick an ADC with at least one or two spare channels for future expansion.
For interface, match the ADC to your microcontroller. Arduino works easily with SPI ADCs like the MCP3008 or I2C ADCs like the ADS1115. Raspberry Pi works well with the same chips over its hardware SPI and I2C peripherals. If you need maximum speed, SPI is faster than I2C for ADC data transfer.
Start simple. Use the built-in ADC on your microcontroller before buying an external chip. When you outgrow it, the MCP3008 is the most cost-effective upgrade for general-purpose robotics, and the ADS1115 is the right step up when you need precision.
FAQ
What does an ADC actually do?
An ADC (analog to digital converter) takes a continuous analog voltage from a sensor or signal source and converts it into a discrete digital number that a microcontroller or computer can read and process. It bridges the gap between the analog physical world and digital processing systems.
What are the three steps of ADC?
The three steps of analog to digital conversion are sampling, quantization, and encoding. First, the ADC samples the analog input voltage at a specific instant. Second, it quantizes the sampled value by matching it to the nearest discrete voltage level. Third, it encodes that level as a binary number that the microcontroller reads.
What are the disadvantages of an ADC?
ADCs introduce quantization error because they must round continuous analog values to the nearest discrete step. They have limited resolution based on bit depth, finite sampling rates that can cause aliasing, conversion time delays, and sensitivity to noise on the reference voltage. Higher-resolution and faster ADCs also cost more and consume more power.
What is an example of an ADC?
The ADC built into the Arduino Uno microcontroller is a common example — it is a 10-bit successive approximation ADC with 6 input channels. Other examples include the MCP3008 external SPI ADC chip popular with Raspberry Pi projects, the 16-bit ADS1115 I2C module used for precision sensing, and the ADC in your smartphone that digitizes voice from the microphone.
How does ADC resolution affect accuracy?
Higher ADC resolution means more discrete levels across the input range, so each step represents a smaller voltage increment. A 10-bit ADC with a 5V reference has steps of about 4.88 millivolts, while a 12-bit ADC has steps of about 1.22 millivolts. More bits gives finer voltage detection, but actual accuracy also depends on reference voltage stability and ADC linearity.
What is the difference between ADC and DAC?
An ADC converts analog signals into digital numbers, letting a microcontroller read real-world sensors. A DAC does the opposite, converting digital numbers back into analog voltages. ADCs are used for sensor input and measurement, while DACs are used for generating analog output signals like audio or analog control voltages.
Conclusion
Understanding what an ADC is and how it works unlocks the ability to give your robots real awareness of their environment. The ADC analog to digital converter is the single most important interface between the physical world your robot operates in and the digital brain that controls it. Every sensor reading, every battery check, every motor current measurement flows through this conversion process.
We covered the three-step conversion process — sampling, quantization, and encoding — and saw how resolution in bits determines measurement precision. We explored the four major ADC architectures and when to use each. We walked through practical Arduino and Raspberry Pi examples, common problems and their fixes, and a selection framework for choosing the right ADC for your project.
If you take away one thing, let it be this: start with the built-in ADC on your microcontroller, keep your reference voltage clean, average your readings, and match your ADC resolution and sampling rate to what your sensor actually needs. Most robotics projects work fine with a 10-bit SAR converter and a bit of averaging.
When you are ready to go deeper, explore external ADCs like the MCP3008 or ADS1115, experiment with oversampling for extra effective bits, and look into anti-aliasing filters for high-frequency signals. The concepts in this guide give you the foundation to tackle all of it. Now go build something that senses the world.