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.
| Pin | Name | Direction | UART | I2C | SPI | PWM | I2S (PCM) | Note |
|---|---|---|---|---|---|---|---|---|
| 1 | 3V3 | output | 3.3 V output – only for smaller loads (sensors) | |||||
| 2 | 5V | input/output | 5 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. | |||||
| 3 | GPIO2 | input/output | I2C1 SDA | SPI2 MOSI | I2C1 SDA; 1.8 kΩ pull-up on the board | |||
| 4 | 5V | input/output | 5 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. | |||||
| 5 | GPIO3 | input/output | I2C1 SCL | SPI2 SCLK | I2C1 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. | |||
| 6 | GND | – | ||||||
| 7 | GPIO4 | input/output | UART2 TX | I2C2 SDA | SPI3 CE0 | GPCLK0; default 1-Wire pin (dtoverlay=w1-gpio) | ||
| 8 | GPIO14 | input/output | UART0 TX | I2C3 SDA | SPI5 MOSI | PWM0 CH2 | UART0 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. | |
| 9 | GND | – | ||||||
| 10 | GPIO15 | input/output | UART0 RX | I2C3 SCL | SPI5 SCLK | PWM0 CH3 | UART0 RX (dtparam=uart0) | |
| 11 | GPIO17 | input/output | SPI1 CE1 | |||||
| 12 | GPIO18 | input/output | SPI1 CE0 | PWM0 CH2 | I2S SCLK | PWM0 channel 2; I2S SCLK; SPI1 CE0 | ||
| 13 | GPIO27 | input/output | SPI1 CE1 | |||||
| 14 | GND | – | ||||||
| 15 | GPIO22 | input/output | I2C3 SDA | |||||
| 16 | GPIO23 | input/output | I2C3 SCL | |||||
| 17 | 3V3 | output | 3.3 V output – only for smaller loads (sensors) | |||||
| 18 | GPIO24 | input/output | SPI2 CE1 | |||||
| 19 | GPIO10 | input/output | I2C1 SDA | SPI0 MOSI / SPI4 MISO | ||||
| 20 | GND | – | ||||||
| 21 | GPIO9 | input/output | UART3 RX | I2C0 SCL | SPI0 MISO / SPI4 MOSI | |||
| 22 | GPIO25 | input/output | SPI3 CE1 | |||||
| 23 | GPIO11 | input/output | I2C1 SCL | SPI0 SCLK / SPI4 SCLK | ||||
| 24 | GPIO8 | input/output | UART3 TX | I2C0 SDA | SPI0 CE0 / SPI4 CE0 | |||
| 25 | GND | – | ||||||
| 26 | GPIO7 | input/output | I2C3 SCL | SPI0 CE1 / SPI3 SCLK | ||||
| 27 | GPIO0 | input/output | UART1 TX | ID_SD | SPI2 CE0 | I2C0 SDA for the HAT EEPROM – do not use | ||
| 28 | GPIO1 | input/output | UART1 RX | ID_SC | SPI2 MISO | I2C0 SCL for the HAT EEPROM – do not use | ||
| 29 | GPIO5 | input/output | UART2 RX | I2C2 SCL | SPI3 MISO | GPCLK1 | ||
| 30 | GND | – | ||||||
| 31 | GPIO6 | input/output | I2C3 SDA | SPI3 MOSI | GPCLK2 | |||
| 32 | GPIO12 | input/output | UART4 TX | I2C2 SDA | SPI5 CE0 | PWM0 CH0 | PWM0 channel 0 | |
| 33 | GPIO13 | input/output | UART4 RX | I2C2 SCL | SPI5 MISO | PWM0 CH1 | PWM0 channel 1 | |
| 34 | GND | – | ||||||
| 35 | GPIO19 | input/output | SPI1 MISO | PWM0 CH3 | I2S WS | PWM0 channel 3; I2S WS; SPI1 MISO | ||
| 36 | GPIO16 | input/output | SPI1 CE2 | |||||
| 37 | GPIO26 | input/output | SPI5 CE1 | |||||
| 38 | GPIO20 | input/output | SPI1 MOSI | I2S DIN | I2S DIN; SPI1 MOSI | |||
| 39 | GND | – | ||||||
| 40 | GPIO21 | input/output | SPI1 SCLK | I2S DOUT | I2S 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/:
- Raspberry Pi prices go up – current Pi 5 and Pi 4 prices and availability at retailers
More pinouts
See all pinouts on the Pinouts page.