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.

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

**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] 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.*

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