Opens in a new tab

Raspberry Pi 5 GPIO Pinout

The Raspberry Pi 5 has the same 40-pin GPIO header as older models, but inside it’s different: the header isn’t handled by the main processor but by a separate RP1 chip from Raspberry Pi. It offers more peripherals – on the header you’ll find up to 5× UART, 4× I2C, 6× SPI, 4 PWM channels and I2S.

The diagram shows all alternate functions of each pin. The layout of power, GND and the default buses is the same as on other models, so HATs keep working.

Specifications

  • 28 GPIO with 3.3 V logic (GPIO0–27) handled by the RP1 chip
  • UART0–4 (UART0 console on GPIO14/15), I2C0–3, SPI0–5
  • PWM0 with 4 channels (GPIO12–15 and GPIO18/19), I2S on GPIO18–27
  • PIO (programmable I/O) on all header pins
  • power: 2× 5 V and 2× 3.3 V, 8× GND
  • separate 3-pin UART connector for debugging, and a power button

Enable additional buses in config.txt via dtoverlay (e.g. dtoverlay=uart2-pi5 or dtoverlay=i2c3-pi5). dtoverlay -h lists the overlays and their parameters.

Control GPIO with the gpiozero or libgpiod library – the popular RPi.GPIO doesn’t work because of the RP1 chip; the rpi-lgpio package is a replacement. The layout common to all models is on the Raspberry Pi GPIO Pinout page.

Pinout and pin table

How to read the diagram: it shows the functions of the RP1 chip. On older models only the default buses apply (UART0 on GPIO14/15, I2C1, SPI0/1). The additional buses are numbered differently than on the Pi 4 – UART2 is on GPIO4/5 here, but on GPIO0/1 on the Pi 4. Choose the overlay by the number in this diagram, with the -pi5 suffix. Hover over a pin in the diagram or a table row; use the filter to highlight a bus. You can download the pinout as PNG or SVG.

Raspberry Pi 5 – GPIO pinout (40 pins, RP1)Raspberry Pi 5 – GPIO pinout (40 pins, RP1)chiptron.eu · CC BY 4.0Raspberry Pi is a trademark of Raspberry Pi Ltd. 1 3V3 ← 3.3 V output – only for smaller loads (sensors) 3 GPIO2 I2C1 SDA SPI2 MOSI 5 GPIO3 I2C1 SCL SPI2 SCLK 7 GPIO4 I2C2 SDA UART2 TX SPI3 CE0 GPCLK0 9 GND 11 GPIO17 SPI1 CE1 13 GPIO27 SPI1 CE1 15 GPIO22 I2C3 SDA 17 3V3 ← 19 GPIO10 I2C1 SDA SPI0 MOSI / SPI4 MISO 21 GPIO9 I2C0 SCL UART3 RX SPI0 MISO / SPI4 MOSI 23 GPIO11 I2C1 SCL SPI0 SCLK / SPI4 SCLK 25 GND 27 GPIO0 ID_SD UART1 TX SPI2 CE0 29 GPIO5 I2C2 SCL UART2 RX SPI3 MISO GPCLK1 31 GPIO6 I2C3 SDA SPI3 MOSI GPCLK2 33 GPIO13 I2C2 SCL UART4 RX PWM0 CH1 SPI5 MISO 35 GPIO19 PWM0 CH3 I2S WS SPI1 MISO 37 GPIO26 SPI5 CE1 39 GND 2 5V ↔ 5 V directly from the Pi's power supply – can also power the Pi (unprotected) 4 5V ↔ 6 GND 8 GPIO14 I2C3 SDA UART0 TX PWM0 CH2 SPI5 MOSI 10 GPIO15 I2C3 SCL UART0 RX PWM0 CH3 SPI5 SCLK 12 GPIO18 PWM0 CH2 I2S SCLK SPI1 CE0 GPCLK1 14 GND 16 GPIO23 I2C3 SCL 18 GPIO24 SPI2 CE1 20 GND 22 GPIO25 SPI3 CE1 24 GPIO8 I2C0 SDA UART3 TX SPI0 CE0 / SPI4 CE0 26 GPIO7 I2C3 SCL SPI0 CE1 / SPI3 SCLK 28 GPIO1 ID_SC UART1 RX SPI2 MISO 30 GND 32 GPIO12 I2C2 SDA UART4 TX PWM0 CH0 SPI5 CE0 34 GND 36 GPIO16 SPI1 CE2 38 GPIO20 I2S DIN SPI1 MOSI GPCLK0 40 GPIO21 I2S DOUT SPI1 SCLK GPCLK1 GPIO UART I2C SPI PWM I2S (PCM) Power Ground (GND)
Download:PNGSVG
Pin table – Raspberry Pi 5 (GPIO)
PinNameDirectionUARTI2CSPIPWMI2S (PCM)Note
13V3output3.3 V output – only for smaller loads (sensors)
25Vinput/output5 V directly from the Pi's power supply (unprotected). The Pi 5 needs a 5 V / 5 A supply to deliver the full 1.6 A to USB; with a weaker supply it limits USB to 600 mA.
3GPIO2input/outputI2C1 SDASPI2 MOSII2C1 SDA; 1.8 kΩ pull-up on the board
45Vinput/output5 V directly from the Pi's power supply (unprotected). The Pi 5 needs a 5 V / 5 A supply to deliver the full 1.6 A to USB; with a weaker supply it limits USB to 600 mA.
5GPIO3input/outputI2C1 SCLSPI2 SCLKI2C1 SCL with a 1.8 kΩ pull-up on the board. Unlike the Pi 4 and earlier, a powered-off Pi 5 does not turn on when GPIO3 is shorted to GND – use the power button (or the J2 pads) to turn it on.
6GND–
7GPIO4input/outputUART2 TXI2C2 SDASPI3 CE0GPCLK0; default 1-Wire pin (dtoverlay=w1-gpio)
8GPIO14input/outputUART0 TXI2C3 SDASPI5 MOSIPWM0 CH2UART0 TX. On the Pi 5 it is enabled in config.txt (dtparam=uart0, or enable_uart=1). The serial console is on a separate 3-pin UART connector next to HDMI, so the GPIO header stays free.
9GND–
10GPIO15input/outputUART0 RXI2C3 SCLSPI5 SCLKPWM0 CH3UART0 RX (dtparam=uart0)
11GPIO17input/outputSPI1 CE1
12GPIO18input/outputSPI1 CE0PWM0 CH2I2S SCLKPWM0 channel 2; I2S SCLK; SPI1 CE0
13GPIO27input/outputSPI1 CE1
14GND–
15GPIO22input/outputI2C3 SDA
16GPIO23input/outputI2C3 SCL
173V3output3.3 V output – only for smaller loads (sensors)
18GPIO24input/outputSPI2 CE1
19GPIO10input/outputI2C1 SDASPI0 MOSI / SPI4 MISO
20GND–
21GPIO9input/outputUART3 RXI2C0 SCLSPI0 MISO / SPI4 MOSI
22GPIO25input/outputSPI3 CE1
23GPIO11input/outputI2C1 SCLSPI0 SCLK / SPI4 SCLK
24GPIO8input/outputUART3 TXI2C0 SDASPI0 CE0 / SPI4 CE0
25GND–
26GPIO7input/outputI2C3 SCLSPI0 CE1 / SPI3 SCLK
27GPIO0input/outputUART1 TXID_SDSPI2 CE0I2C0 SDA for the HAT EEPROM – do not use
28GPIO1input/outputUART1 RXID_SCSPI2 MISOI2C0 SCL for the HAT EEPROM – do not use
29GPIO5input/outputUART2 RXI2C2 SCLSPI3 MISOGPCLK1
30GND–
31GPIO6input/outputI2C3 SDASPI3 MOSIGPCLK2
32GPIO12input/outputUART4 TXI2C2 SDASPI5 CE0PWM0 CH0PWM0 channel 0
33GPIO13input/outputUART4 RXI2C2 SCLSPI5 MISOPWM0 CH1PWM0 channel 1
34GND–
35GPIO19input/outputSPI1 MISOPWM0 CH3I2S WSPWM0 channel 3; I2S WS; SPI1 MISO
36GPIO16input/outputSPI1 CE2
37GPIO26input/outputSPI5 CE1
38GPIO20input/outputSPI1 MOSII2S DINI2S DIN; SPI1 MOSI
39GND–
40GPIO21input/outputSPI1 SCLKI2S DOUTI2S DOUT; SPI1 SCLK

What to watch out for

  • GPIO are not 5V tolerant. 5 V on an input can destroy the Raspberry Pi.
  • You can’t power on a shut-down Pi 5 by connecting GPIO3 to GND as on older models – use the power button instead.
  • For full USB current (1.6 A), the Pi 5 needs a 5 V / 5 A power supply; with a regular 3 A supply it limits USB to 600 mA.
  • GPIO2/3 (I2C1) have 1.8 kΩ pull-ups on the board.
  • GPIO0/1 (ID_SD/ID_SC) are reserved for the HAT EEPROM.
  • A pin can have only one function at a time – the Linux kernel checks for conflicts based on the enabled overlays.

Raspberry Pi on chiptron.eu/

Projects and guides on chiptron.eu/:

More pinouts

See all pinouts on the Pinouts page.

Related Articles