Analog-To-Digital Converters (ADCs)

Created:  
Updated:   06Aug2024   21:37:08   UTC 2024-08-06T21:37:08Z
Rating:   (0 reviewsThis article has not been rated yet)

An Analog-to-Digital Converter (ADCAnalog-to-Digital Converter (ADC, A/D, or A-to-D)) is an electronic component that converts analog signals into digital data. An ADC is an essential component in data acquisition systems, where analog signals from sensors need to be captured, processed, and analyzed by digital devices.

Analog to Digital Conversion Diagram

This introduction to ADCs covers hardware specifications, ADCs in microcontrollers, ADC ICs, and ADC modules.


The goal of the ADC is to accurately represent analog signals as digital data, a process that involves sampling, quantization, and encoding. There are a few different ways to achieve this, but the most common technique uses the analog input voltage to charge up an internal capacitor that is held to measure the time it takes to discharge across an internal resistor. The discharge time, determined by counting the number of clock cycles, is converted into a digital representation of the original analog input sampled.

Many low cost microcontrollers (MCUMicrocontroller Units) have ADCs built into them. The voltage ranges of these ADCs are typically the supply range of 0V to 3.3V or 0V to 5V and resolutions are usually 10-bit or 12-bit. There are also external ADCs that are packaged in ICIntegrated Circuits or breakout board modules with similar input voltage ranges, but with more resolution options to choose from (10-bit, 12-bit, 16-bit, and 24-bit).

ADC Specs

ADC Sampling Rate

The sampling rate quantizes the analog signal in the time domain. How fast of an ADC sampling rate is needed depends on your application. Some applications require high sampling rates while others can use a low sampling rate. For example, high sampling rates are needed with the conversion of an audio signal: the human voice signal contains frequency components that span from 20Hz to 4kHz. Low sampling rates are used where samples are taken at intervals of several seconds, minutes, hours, or even days. For example, measuring the temperature of your house or monitoring a battery level.

The general approach is to choose a minimum sampling rate that is at least double the highest frequency content of the signal from the Nyquist Theorem in order to render a faithful reconstruction of the original signal. In practice, as a rule of thumb, a minimum sampling rate of at least 5x to 10x the highest frequency content is chosen to give a decent representation of the original signal.

ADC Resolution

An analog signal is quantized in amplitude by its discrete digital representation. The resolution of an ADC indicates the number of different discrete values it can produce over the allowed range of analog input values. This defines the smallest step size change that can be measured by the ADC, often referred to as quantization error.

Resolution can be expressed as the bit depth n where the number of discrete values available is 2n. For example, an ADC with a resolution of 10-bits can encode an analog input to one of 210 different levels from 0 to 1023.

Resolution can also be defined electrically in Volts. The change in voltage required to guarantee a change in the output level is called the Least Significant Bit (LSBThe Least Significant Bit (LSB) in a binary number is the bit that represents the smallest place value carrying the lowest weight. It is also sometimes referred to as the low-order bit or right-most bit due to the convention in positional notation of writing less significant digits further to the right.) voltage. The resolution of an ADC is equal to the LSB voltage as given in the figure below.

ADC Resolution in Volts Equation

Channels

A single ADC can read from 2, 4, 6, or 8 channels through a multiplexer (MUXA Multiplexer (MUX) is a device that selects between several analog or digital input signals and forwards the selected input to a single output line.), a kind of switch that operates on any one of these inputs at a time. Some channels may be used to read its voltage reference, the ground potential, an internal temperature sensor, or differential inputs (where the quantity measured is the difference between two inputs). When programming a microcontroller or SBCSingle Board Computer to read an ADC, you must tell it which channel to convert from and only one channel can be used in the conversion at a time.

MCU ADCs

Most microcontrollers include an internal ADC with subset of GPIOGeneral Purpose Input Output pins that you can use to interface with the ADC. The GPIO ADC input pins are typically labeled with an 'A' in front of their label. For example, the analog input pins for the Arduino Uno R3 are labeled A0 through A5, the Arduino Nano pins are labeled A0 through A7, and the RPiRaspberry Pi Pico pins are labeled ADC0 through ADC2.

The most common ADC in MCUMicrocontroller Units is a SARSuccessive Approximation Register where an internal sample and hold (S/HSample and Hold) capacitor is charged to the input voltage (sample) and then disconnected (hold) to measure the time in number of clock cycles it takes to discharge across an internal resistor and zoom in on the correct ADC output.

The resolution of MCU ADCs typically range from 8-bit to 12-bit. For instance, the Arduino Uno R3 and Nano has a 10-bit ADC, whereas the RPiRaspberry Pi Pico ADC is 12-bit. Both of these MCUs will be covered below.

ATmega328P ADC in Arduino Uno and Nano

The ATmega328P MCU used in the Arduino Uno R3 and Nano has a built in 10-Bit ADC. The specs for this ADC from ATmega328P Datasheet (PDF) are given in the table below.

ATmega328P ADC Specs
Parameter Spec
Voltage Supply (Vs) 1.8V to 5.5V
Resolution 10-Bit
Number of Channels 8 single-ended inputs
Sampling frequency
@ 5V operation and 125KHz ADC sampling clock
9.6kHz
Sampling frequency
@ 5V operation and 200KHz ADC sampling clock
15kHz
Conversion time 13 ADC clock cycles,
65μs - 260μs
ADC clock range for good results 50kHz to 200kHz
Absolute Accuracy
(INLIntegral Non-Linearity + DNLDifferential Non-Linearity + quantization error + gain & offset error)
2 LSBThe Least Significant Bit (LSB) in a binary number is the bit that represents the smallest place value carrying the lowest weight. It is also sometimes referred to as the low-order bit or right-most bit due to the convention in positional notation of writing less significant digits further to the right.

Note that although the ATmega328P ADC has 8 channels, the Arduino Uno R3 only makes use of 6 channels (A0 - A5) to interface with, but the Arduino Nano board makes use of all the channels (A0 - A7). A block diagram of the ATmega328P ADC with all of its channels is shown in the figure below.

ATmega328P ADC Block Diagram (source ATmega328P Datasheet)

RP2040 ADC in RPi Pico

The RPi Pico has internal 12-Bit ADC with 4 channels and a sampling rate up to 500ksps using an independent 48MHz clock (RP2040 Datasheet).

RP2040 ADC Specs
Parameter Spec
Voltage Supply (Vs) 1.8V to 3.3V
Resolution 12-Bit with 8.7 ENOBEffective Number Of Bits is a measure of the dynamic range of an ADC
Number of Channels 4
Sampling Frequency 500kSPSKilo Samples Per Second (1000 samples/s)
Conversion time 96 clock cycles, 2μs
ADC clock 48MHz
DNLDifferential Non-Linearity 8.9 LSBThe Least Significant Bit (LSB) in a binary number is the bit that represents the smallest place value carrying the lowest weight. It is also sometimes referred to as the low-order bit or right-most bit due to the convention in positional notation of writing less significant digits further to the right.
INLIntegral Non-Linearity 7.85 LSBThe Least Significant Bit (LSB) in a binary number is the bit that represents the smallest place value carrying the lowest weight. It is also sometimes referred to as the low-order bit or right-most bit due to the convention in positional notation of writing less significant digits further to the right.
RP2040 ADC Block Diagram (source RP2040 Datasheet)

ADC ICs & Modules

There are many external ADCs that are packaged in ICIntegrated Circuits or breakout board modules. A few common ADCs are covered in the following subsections.

MCP3008 10-Bit ADC

The MCP3008 10-Bit ADC ICIntegrated Circuit shown in the figure below is a popular choice for converting analog signals from sensors to the digital SPISerial Peripheral Interface communication protocol. It has 8 channels of 10-bit analog input and only 4 pins are required for the SPI digital output. The device operates with a supply voltage over a broad range of 2.7V to 5.5V with low power consumption (5nA typical standby, 425µA typical active). The maximum sampling rate is 200kspsKilo Samples Per Second (1000 samples/s) when supplied with a voltage of 5V and 75kspsKilo Samples Per Second (1000 samples/s) with a supply voltage of 2.7V. This ADC has a SARSuccessive Approximation Register architecture. More details about this IC can be found in the MCP3008 Datasheet (PDF).

Microchip MCP3008-I/P 10-Bit ADC with SPI

MCP3202 12-Bit ADC

The MCP3202 12-Bit ADC IC shown in the figure below is another well known chip used for converting analog signals from sensors to the digital SPISerial Peripheral Interface communication protocol. It has 2 channels of 12-bit analog input and only 3 pins are required for the digital output. The device operates with a supply voltage over a broad range of 2.7V to 5.5V with low power consumption (500nA typical standby, 550µA typical active). The maximum sampling rate is 100kspsKilo Samples Per Second (1000 samples/s) when supplied with a voltage of 5V and 50kspsKilo Samples Per Second (1000 samples/s) with a supply voltage of 2.7V. This ADC has a SARSuccessive Approximation Register architecture. More details about the IC can be found in the MCP3202 Datasheet (PDF).

Microchip MCP3202-CI/P 12-Bit ADC with SPI

MCP3208 12-Bit ADC

The MCP3208 12-Bit ADC IC shown in the figure below is similar to the MCP3202, but has a larger package size with 8-channels instead of only 2-channels. The device operates with a supply voltage over a broad range of 2.7V to 5.5V with low power consumption (500nA typical standby, 400µA typical active). The maximum sampling rate is 100kspsKilo Samples Per Second (1000 samples/s) when supplied with a voltage of 5V and 50kspsKilo Samples Per Second (1000 samples/s) with a supply voltage of 2.7V. This ADC has a SARSuccessive Approximation Register architecture. More details about the IC can be found in the MCP3208 Datasheet (PDF).

Microchip MCP3208-CI/P 12-Bit ADC with SPI

ADS1015 12-Bit ADC

The Texas Instruments ADS1015 is a small low power 12-Bit ADC with an I2CInter-Integrated Circuit. Also referred to as IIC or I2C. interface that has a programmable sample rate from 128SPSSamples Per Second to 3300SPSSamples Per Second. This ADC can be configured as 4 single-ended input channels, or two differential channels, and includes a programmable gain amplifier up to x16 to help boost up smaller single/differential signals to the full range. It can operate from a voltage range of 2V to 5.5V power/logic. It has low power consumption with only 150µA in continuous mode and a single-shot mode that automatically powers down after conversion. More details about this IC can be found in the ADS1015 Datasheet (PDF).

The SparkFun (DEV-15334) ADS1015 12-Bit ADC module can provide four channels of I2C controlled ADC input through Qwiic connectors or 0.1in spaced pins in case you prefer to use a breadboard. This ADC board includes screw pin terminals on the four channels of input, allowing for solderless connection to voltage sources in your setup. It also has an address jumper that lets you choose one of four unique addresses (0x48, 0x49, 0x4A, 0x4B), so you can connect up to four of these on the same I2C bus and have sixteen channels of ADC. Also included is an onboard 10kΩ trimpot connected to channel A3. This is handy for initial setup testing and can be used as a simple variable input to your project (an isolation jumper is included so you can use channel A3 however you like). More details about this breakout board can be found in the SparkFun Hookup Guide.

SparkFun ADS1015 12-Bit ADC

The Adafruit (PID 1083) ADS1015 12-Bit ADC breakout module board has 0.1in pin separation and comes with a standard header in case you want to use it with a breadboard or perfboard. Four mounting holes are on each corner of the board for easy attachment and both ends of the board have a JSTJapan Solderless Terminal SH 1.0mm pitch connector allowing solderless connections between the board and external devices. More details about this breakout board can be found in the Adafruit Guide.

Adafruit ADS1015 12-Bit ADC

Adafruit ADS1115 16-Bit ADC Module

The Texas Instruments ADS1115 is a small low power 16-Bit ADC with a programmable sample rate from 8SPSSamples Per Second to 860SPSSamples Per Second over I2CInter-Integrated Circuit. Also referred to as IIC or I2C.. This module can be configured as 4 single-ended input channels, or two differential channels, and includes a programmable gain amplifier up to x16 to help boost up smaller single/differential signals to the full range. It can operate from a voltage range of 2V to 5V power/logic. It has low power consumption with only 150µA in continuous mode and a single-shot mode that automatically powers down after conversion. More details about this IC can be found in the ADS1115 Datasheet (PDF).

The Adafruit (PID 1085) ADS1115 16-Bit ADC breakout board has 0.1in pin separation and comes with a standard header in case you want to use it with a breadboard or perfboard. Four mounting holes are on each corner of the board for easy attachment and both ends of the board have a JSTJapan Solderless Terminal SH 1.0mm pitch connector allowing solderless connections between the board and external devices. More detials about this breakout board can be found in the Adafruit Guide.

Adafruit ADS1115 16-Bit ADC

Conclusion

When deciding on an ADC to use in an application, the main factors to consider are the sampling rate, resolution, number of channels, and voltage range. Microcontrollers typically have an ADC built into them, but they may be limited in performance where an external ADC may be needed. Most SBCs do not have an ADC and require an external ADC that communicates over I2C or SPI. A few common external ADCs were mentioned here, but a more comprehensive list is covered in the ADC ICs and Modules article in the link below. How to interface with an ADC, such as input buffering and signal attenuation/amplification, is covered in the Interfacing Analog Inputs article in the link below.

Related Content


Analog-to-Digital Converter (ADC) ICs and Modules

Created:   12Jan2024   04:03:25   UTC 2024-01-12T04:03:25Z
Updated:   26Aug2024   20:20:56   UTC 2024-08-26T20:20:56Z
Rating:  (0 reviewsThis article has not been rated yet)

Overview of the different kinds of Analog-to-Digital Converter (ADC) ICs and Modules.


Interfacing Analog Inputs

Created:   13Oct2022   04:06:22   UTC 2022-10-13T04:06:22Z
Updated:   07Aug2024   00:28:40   UTC 2024-08-07T00:28:40Z
Rating:  (0 reviewsThis article has not been rated yet)

How do you reduce the analog voltage input within the ADC range? How do you shift negative voltages to the positive ADC range? How can you amplify small signals to increase your ADC resolution? This article covers analog input attenuation with voltage dividers, impedance buffers, and signal amplification.

Products

Article Rating

Sign in to rate this article

Sign In


(0) Comments

Sign in to leave a comment

Sign In