The Raspberry Pi 5 maintains the physical 40-pin (2x20) GPIO header layout of its predecessors, but the underlying architecture has shifted. GPIO routing is now handled by the dedicated RP1 I/O controller rather than the main BCM2712 SoC. Pin 1 is 3.3V, Pin 2 is 5V, and Pin 6 is Ground. Below is the complete hardware reference.

The Complete Raspberry Pi 5 Datasheet Pinout Table

This table maps the physical pin numbers on the 40-pin header to the Broadcom/RP1 GPIO names and their default alternate functions. Always reference physical pin numbers when wiring; software GPIO numbers differ.

PinFunctionGPIO/LabelPinFunctionGPIO/Label
13.3V Power3V325V Power5V
3I2C1 SDAGPIO 245V Power5V
5I2C1 SCLGPIO 36GroundGND
7GPCLK0GPIO 48UART0 TXGPIO 14
9GroundGND10UART0 RXGPIO 15
11SPI1 SCLK / UART0 RTSGPIO 1712I2S CLK / PWM0GPIO 18
13SPI1 MOSI / PWM1GPIO 2714GroundGND
15SPI1 MISO / UART1 TXGPIO 2216GeneralGPIO 23
173.3V Power3V318GeneralGPIO 24
19SPI0 MOSIGPIO 1020GroundGND
21SPI0 MISOGPIO 922GeneralGPIO 25
23SPI0 SCLKGPIO 1124SPI0 CE0GPIO 8
25GroundGND26SPI0 CE1GPIO 7
27I2C0 SDA (HAT ID)ID_SD28I2C0 SCL (HAT ID)ID_SC
29GeneralGPIO 530GroundGND
31GeneralGPIO 632GPCLK0 / PWM0GPIO 12
33PWM1GPIO 1334GroundGND
35I2S FS / SPI1 MISOGPIO 1936SPI1 CE2 / UART1 RXGPIO 16
37GeneralGPIO 2638I2S DIN / SPI1 MOSIGPIO 20
39GroundGND40I2S DOUT / SPI1 SCLKGPIO 21

Rows People Get Wrong & Faded Silkscreen Recovery

Even experienced builders fry boards or cause boot loops by misinterpreting specific rows in the Raspberry Pi 5 datasheet pinout. Here are the most common pitfalls and how to verify your board if the markings are compromised.

The High-Risk Pins

  • Pins 3 & 5 (I2C1 SDA/SCL): The Pi 5 includes 1.5kΩ hardware pull-up resistors to 3.3V on these lines. If you connect a 5V I2C sensor directly here without a bidirectional logic level shifter, you will back-feed 5V into the RP1 chip's 3.3V logic, potentially destroying the I/O bank.
  • Pins 8 & 10 (UART0 TX/RX): By default, these are mapped to the Linux serial console. If Pin 10 (RX) is pulled low or shorted to ground during boot, the bootloader will hang waiting for serial input. Always disconnect UART devices when powering on the Pi 5 for the first time.
  • Pins 27 & 28 (ID_SD / ID_SC): These are strictly reserved for reading the HAT EEPROM via I2C0. Do not use them for general-purpose sensors; doing so will cause HAT auto-configuration to fail and may corrupt the EEPROM if driven incorrectly.
Warning: Safe Interpretation of Faded or Missing Markings
If you are using a third-party clone board, a custom PCB, or a Pi where the silkscreen has rubbed off, never guess Pin 1. Look for the square solder pad on the underside of the header—Pin 1 always has a square pad, while all others are round. If the pads are obscured, set your multimeter to continuity mode. Probe the metal USB port shield with one lead, and sweep the header with the other. Pins 6, 9, 14, 20, 25, 30, 34, and 39 will read < 1 ohm (Ground). Pin 1 is the 3.3V pin located immediately adjacent to Pin 6 (GND) and on the outer edge of the board.

Regional Wiring Standards for GPIO Pigtails

When wiring external relays, sensors, or terminal blocks to the Pi 5 GPIO, the wire color codes you choose should match your regional electrical standards to prevent lethal confusion if the low-voltage DC wiring ever shares a conduit or enclosure with mains AC wiring.

Standard / RegionDC Positive (VCC)DC Negative (GND)Signal / DataNotes
IEC 60446 (EU / Global)BrownBlueBlack or WhiteStandard for modern industrial control panels.
NEC (US / North America)RedBlackWhite or YellowCommon in US hobbyist and automotive crossovers.
Old UK (Pre-2004)RedBlackYellowDeprecated. Never mix with IEC on the same bench; Red is now Live (AC).

Which standard applies to you? If your Pi 5 is mounted inside an industrial DIN-rail enclosure or a commercial product, strictly follow IEC 60446 (Brown/Blue) or your local equivalent. If it is a standalone hobby project on a bench, NEC-style (Red/Black) is acceptable, provided you clearly label the 3.3V, 5V, and GND rails at the terminal block to avoid injecting 5V into a 3.3V GPIO.

Pi 5 Specific Connectors Beyond the 40-Pin Header

The Raspberry Pi 5 datasheet pinout extends beyond the standard GPIO header. For high-speed or debug applications, you must use the new dedicated JST connectors introduced on this board revision:

  • PCIe Gen 2.0 FPC Connector: A 16-pin JST SH connector located near the SoC. Used for NVMe SSD HATs. Pin 1 is marked with a small triangle on the silkscreen. Requires a specific PCIe ribbon cable; do not force standard FPC cables here.
  • Debug UART Connector: A 3-pin JST SH connector (Pin 1: GND, Pin 2: TX, Pin 3: RX) located near the power button. This bypasses the 40-pin header UART and is strictly for low-level bootloader debugging.
  • RTC Battery Connector: A 2-pin JST SH connector for a lithium coin cell or supercapacitor to maintain the real-time clock when main power is lost. Polarity is critical: Pin 1 is VBAT (+), Pin 2 is GND (-).

Frequently Asked Questions

Is the Raspberry Pi 5 datasheet pinout backward compatible with Pi 4 HATs?

Physically, yes. The 40-pin header layout is identical, and 95% of Pi 4 HATs will mount and function correctly. However, because the Pi 5 routes GPIO through the RP1 southbridge chip rather than the main BCM2712 SoC, some low-level bare-metal C code or custom device tree overlays written specifically for the Pi 4's memory-mapped GPIO registers will fail. For standard Python (RPi.GPIO, gpiozero) or Linux I2C/SPI usage, compatibility is seamless. For more on HAT compatibility, refer to the official Raspberry Pi hardware documentation.

What is the maximum current draw per GPIO pin on the Raspberry Pi 5?

Each individual GPIO pin on the Pi 5 can safely source or sink up to 8mA, with a strict absolute maximum of 16mA before risking silicon damage. The total combined current draw across all 3.3V GPIO pins should not exceed 50mA. If you need to drive a 5V relay coil or a high-power LED, you must use a logic-level N-channel MOSFET (like the 2N7000) or an optocoupler. Never drive inductive loads directly from the header.

Why does my Raspberry Pi 5 I2C bus show 0x00 or hang when I follow the standard pinout?

If i2cdetect -y 1 shows 0x00 across the board or hangs indefinitely, you likely have a pull-up resistor conflict or a logic-level mismatch. The Pi 5's I2C1 lines (Pins 3 and 5) already have 1.5kΩ pull-ups to 3.3V. If your sensor breakout board also has 4.7kΩ pull-ups to 5V, the combined parallel resistance pulls the line out of spec, or the 5V back-feeds into the Pi. Remove the pull-up resistors from the sensor board, or use a dedicated I2C level shifter module. Consult the Pinout.xyz interactive database to verify alternate pin functions if you suspect a wiring error.

How do I safely map the Raspberry Pi 5 pinout to an industrial PLC wiring diagram?

Industrial PLCs typically use 24V DC logic (sinking or sourcing). The Pi 5 uses 3.3V CMOS logic. You cannot wire them directly. To map the Pi 5 pinout to a PLC, use a 24V-to-3.3V opto-isolator module for inputs, and a 3.3V-to-24V relay bank or ULN2003 driver array for outputs. Ensure the 24V power supply's ground is completely isolated from the Pi's 5V/3.3V ground, connecting them only through the opto-isolator's galvanic barrier to prevent ground loops from destroying the RP1 chip.