Overview

The MCP3008 is a low-cost 10-bit Analog-to-Digital Converter (ADC) IC manufactured by Microchip Technology. Featuring 8 single-ended input channels (programmable as 4 pseudo-differential pairs), an internal successive-approximation register (SAR) architecture, and a 4-wire SPI serial interface, it is the standard component recommended across Raspberry Pi ecosystem tutorials for reading analog sensors (such as potentiometers, photoresistors, thermistors, and joysticks).

Capable of sampling up to 200 kSPS at 5.0 V supply (and 75 kSPS at 2.7 V), the MCP3008 provides a reliable, low-power bridge between analog signals and digital microprocessors.

Quick reference

Supply voltage (VDD)2.7 V to 5.5 V DC
Resolution10-bit (1,024 discrete levels)
Input channels8 single-ended or 4 pseudo-differential pairs
Max sampling rate200 kSPS (at VDD=5.0VV_{DD}=5.0\text{V}) / 75 kSPS (at VDD=2.7VV_{DD}=2.7\text{V})
InterfaceSPI (Mode 0,0 and Mode 1,1)
Reference voltage (VREF)0.25 V0.25\text{ V} to VDDV_{DD}
Active supply current425 μA425\ \mu\text{A} typical (at 5V) / 500 nA500\text{ nA} standby

Pinout (DIP-16 Package)

text
             ┌───┴───┐
       CH0 ──┤ 1   16├─ VDD
       CH1 ──┤ 2   15├─ VREF
       CH2 ──┤ 3   14├─ AGND
       CH3 ──┤ 4   13├─ CLK
       CH4 ──┤ 5   12├─ DOUT
       CH5 ──┤ 6   11├─ DIN
       CH6 ──┤ 7   10├─ CS/SHDN
       CH7 ──┤ 8    9├─ DGND
             └───────┘
PinNameTypeDescription
1–8CH0CH7Analog InputAnalog input channels 0 to 7
9DGNDPowerDigital Ground reference
10CS/SHDNDigital InputActive-Low Chip Select & Shutdown
11DINDigital InputSPI Data Input (MOSI)
12DOUTDigital OutputSPI Data Output (MISO)
13CLKDigital InputSPI Serial Clock
14AGNDPowerAnalog Ground reference
15VREFAnalog InputVoltage Reference input (0.25 V0.25\text{ V} to VDDV_{DD})
16VDDPowerPower supply input (+2.7 V to +5.5 V DC)

Specifications

ParameterSymbolMinTypMaxUnitConditions
Supply VoltageVDDV_{DD}2.73.3 / 5.05.5VDC
Reference VoltageVREFV_{REF}0.25VDDV_{DD}VAnalog reference
Integral NonlinearityINLINL-1±0.5\pm 0.5+1LSBVDD=VREF=5.0 VV_{DD} = V_{REF} = 5.0\text{ V}
Differential NonlinearityDNLDNL-1±0.25\pm 0.25+1LSBNo missing codes
Clock Frequency (VDD=5VV_{DD}=5\text{V})fCLKf_{CLK}0.013.6MHz200 kSPS rate
Clock Frequency (VDD=2.7VV_{DD}=2.7\text{V})fCLKf_{CLK}0.011.35MHz75 kSPS rate

SPI Command Framing

To read an analog channel, the host MCU pulls CS Low and transmits 3 bytes over SPI (DIN):

  1. Byte 1: 0x01 (Start Bit).
  2. Byte 2: 0x80 | (channel << 4) (0x80 = single-ended mode; bits 6–4 specify channel 0–7).
  3. Byte 3: 0x00 (Dummy byte to clock out remaining data).

The MCP3008 returns 10 data bits on DOUT:

Vin=ADC Reading1023×VREFV_{in} = \frac{\text{ADC Reading}}{1023} \times V_{REF}

Wiring

MCP3008 PinRaspberry Pi GPIOArduino UnoNotes
16 (VDD)3.3V5V0.1 μF0.1\ \mu\text{F} bypass capacitor required
15 (VREF)3.3V5VTied to VDDV_{DD} rail
14 (AGND)GNDGNDAnalog ground
9 (DGND)GNDGNDDigital ground
13 (CLK)GPIO 11 (SPI0_SCLK)D13SPI Clock
12 (DOUT)GPIO 9 (SPI0_MISO)D12SPI MISO
11 (DIN)GPIO 10 (SPI0_MOSI)D11SPI MOSI
10 (CS)GPIO 8 (SPI0_CE0)D10Active-Low Chip Select

Example (Python gpiozero on Raspberry Pi)

python
from gpiozero import MCP3008
from time import sleep

# Read analog potentiometer on Channel 0
pot = MCP3008(channel=0)

while True:
    print(f"Potentiometer Value: {pot.value:.3f} (Voltage: {pot.value * 3.3:.2f} V)")
    sleep(0.5)

Common mistakes

  • Powering VDD with 5V when interfacing with 3.3V Raspberry Pi GPIOs: Supplying 5V to VDD causes DOUT (MISO) to output 5V logic signals, which will damage 3.3V-unbuffered Raspberry Pi GPIO pins. Power VDD from the 3.3V rail on Raspberry Pi setups.
  • Floating VREF pin: Leaving Pin 15 un-connected causes ADC outputs to fluctuate randomly or max out at 1023. Connect VREF to 3.3V or 5V.

Notes

  • MCP3008 vs MCP3208: MCP3008 is 10-bit (1,024 steps); MCP3208 is 12-bit (4,096 steps). Both use the identical 16-pin DIP footprint.

Assets & downloads