# What is the ADC Sampling Rate of the Raspberry Pi?

In this post we clarify 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.

Here is a summary of the ADC parameters:

[ez-toc]

## What is Sampling Rate?

The sampling rate of an Analog-to-Digital Converter is the speed at which it samples an Analog input waveform or signal and converts it to digital bits. There are two operations: Sampling and Conversion.

If it is sampled 1000 times every second then the sampling rate is 1000 Hz or 1 kHz.

This rate determines the highest input signal frequency that can be sampled.

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

The ADC requires a 48 MHz clock input. Capturing and converting  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.

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.3V.

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

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

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

 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.

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