**The sampling rate of the Raspberry Pi ADC is 500 kilo samples per second (kSPS). **

In this post we explain the sampling rate numbers of the Raspberry Pi Pico’s Analog-to-Digital Converter (ADC). The data sheet for the RP2040 is used for reference [1]

Contents

**What is an ADC?**

An analog-to-digital converter (abbreviated **ADC**, **A/D**, or **A-to-D**) is a component that converts an analog signal to its digital equivalent. Use this tool to convert analog to digital value. Once this conversion is performed, the digital signal can be processed by the Raspberry Pi.

Every digital system that interfaces with the real world requires an ADC. The Pi has this capability built into it so it doesn’t require a separate ADC. The exception is if the application requires a higher sampling rate.

**What is Sampling Rate?**

The sampling rate of an Analog-to-digital converter is the speed at which it samples an Analog waveform or signal. If it is sampled 10 times every second then the sampling rate is 10 Hz.

Calculate the sampling rate of an ADC from its sample and hold and conversion time

**Why is Sampling Rate important?**

Knowing this rate is useful as it determines the highest input signal frequency (also called the Nyquist frequency) that can be sampled without aliasing. In the case of the Arduino it is half the sampling rate or 250 kHz. In other words the maximum analog input signal should not exceed this number.

Increasing the sampling frequency will not damage the device. It will however cause aliasing. This post explains the concept and also includes a tool to find the corresponding signal components.

**ADC parameters**

**ADC Sampling Rate**

The **RP2040** has four ADC’s.

The RP2040 ADC samples at **500 kilo-samples-per-second (kSPS).**

The ADC requires a 48 MHz clock input. Capturing and converting [1] a sample takes **96 clock cycles** (96 Ã— 1/48 MHz) = **2Î¼s** per sample. This equates to a sampling rate of **500 kSPS**.

The ADC input pins are shared with the GPIO pins. An analog multiplexer is used to select either.

At a sampling rate of 500 kSPS, the Nyquist frequency is 250 kHz. This is the maximum frequency of an input sinusoidal signal to avoid aliasing. Frequencies higher than 250 kHz will have aliased components (use this calculator to find the output frequency).

If the input signal is a square wave, the maximum frequency to avoid aliasing is 50 kHz as the signal bandwidth would be 250 kHz.

**What is the Maximum Analog Input Voltage?**

The maximum ADC input voltage is determined by the digital IO supply voltage (**IOVDD**). It is not a function of the ADC supply voltage (**ADC_AVDD**).

In the following implementation of the RP2040 (complete schematic), IOVDD is +3.3V.

As a result the maximum input voltage on the ADC pins is **+3.3 V**.

Use this tool to build a voltage divider if your input signal exceeds this max level.

**What is the number of bits in the Raspberry Pi ADC?**

The ADC has **12 bits**.

This means that the digital output is a number from 0 to 4095. Use this calculator to find the ADC resolution.

**The Effective Number of Bits (ENOB) of the ADC is 8.7 bits. **

ENOB is calculated from the Signal-to-Noise and Distortion Ratio (SINAD). The data-sheet lists it as 54 dB. The ENOB is 8.7.

**Which ADC is better – Arduino or Raspberry Pi?**

The following table compares the key specifications of the two products

Raspberry Pi | Arduino | |
---|---|---|

Sampling Rate | 500 kSPS | 15 kSPS |

Number of Bits | 12 | 10 |

Number of ADCs | 4 | 8 |

The Raspberry Pi has fewer ADC’s compared with the Arduino. However,

**Both the sampling rate and the resolution of the Raspberry Pi ADCs are higher and therefore better quality. **

**Notes**

[1] Raspberry Pi data sheet

[2] From the application note: Understanding ADC parameters *The combination of the sampling time and the hold time, is called conversion time. This is usually represented in number of clock cycles. The conversion time is the primary parameter in deciding the speed of the ADC.*

[3] The representation of the sampling rate number as 500 kSPS means that it** includes the sample-hold and conversion time**.

**Related Posts**

- Sampling rate of the ESP8266 ADC
- Sampling rate of Arduino Uno ADC
- Sampling rate of the Arduino Due ADC
- MSP432 ADC Sampling Rate