Skip to content

Pinout / Raspberry Pi 5

Raspberry Pi 5 Pinout

Complete pinout reference for the Raspberry Pi 5 40-pin GPIO header. Learn about GPIO, power, ground, and special function pins.

Pinout DiagramGPIOBy Vilros

40-pin GPIO overview

The Raspberry Pi 5 has a 40-pin GPIO (General Purpose Input/Output) header that lets you connect the Pi to the physical world. This header is compatible with the same layout used on Pi 3 and Pi 4, making many existing projects portable to Pi 5.

What you can do with GPIO:

  • Control LEDs, motors, relays, and other actuators
  • Read sensors (temperature, motion, light, distance)
  • Communicate with other devices via I2C, SPI, or UART
  • Power small accessories directly from the Pi
  • Build interactive electronics projects

Pin types

The 40-pin header includes several types of pins:

GPIO Pins: These can be programmed to send or receive signals. They're used to turn things on or off or detect if a button has been pressed. GPIO pins operate at 3.3V logic levels.

Power Pins: Provide constant 3.3V or 5V power to components like sensors or displays. The Raspberry Pi 5 has two 5V pins (2 and 4), and two 3.3V pins (1 and 17).

Ground (GND) Pins: These complete the circuit by connecting your components to the Pi's ground. The ground pins are 6, 9, 14, 20, 25, 30, 34, and 39.

Special Function Pins: Some GPIO pins also support communication protocols like I2C, SPI, and UART, which are used for more advanced components like displays or GPS modules.

Special function pins

Many GPIO pins have alternate functions beyond simple input/output:

I2C (Inter-Integrated Circuit):

  • A simple two-wire connection used to communicate with sensors, displays, and other low-speed devices
  • Great for connecting multiple devices using just two pins

SPI (Serial Peripheral Interface):

  • A faster connection used for high-speed communication with things like touchscreens, SD cards, and sensors
  • Uses multiple pins but is very reliable for data-heavy devices

UART (Universal Asynchronous Receiver/Transmitter):

  • A basic serial connection, often used to communicate with GPS modules, other microcontrollers, or for debugging
  • Uses just two pins: one for sending and one for receiving

Communication protocols

The RP1 GPIO bank (IO_BANK0) on Raspberry Pi 5 supports the following functions:

  • 5 UART interfaces
  • 6 SPI interfaces
  • 4 I2C interfaces
  • 2 I2S interfaces (including Clock Producer and Clock Consumer instances)
  • Registered IO (RIO) interface
  • 24-bit DPI output
  • 4-channel PWM output
  • Stereo PWM audio output (AUDIO_OUT)
  • General-purpose clock input and output (GPCLK)
  • eMMC/SDIO bus with a 4-bit interface
  • Interrupt generation from pin level or edge transitions

Pinout command

A reference guide to pinouts can be accessed directly on the Raspberry Pi including the Pi 5. Open the command terminal and type:

pinout

Then press Enter. This displays a visual pinout diagram in the terminal, showing pin numbers, GPIO numbers, power/ground pins, and special function labels.

Getting started with GPIO: See our introduction to Raspberry Pi GPIO guide for wiring basics and safety. For Pi 5-specific features, see our Raspberry Pi 5 guide.

Sources

Based on the Raspberry Pi 5 pinout page from Vilros. Updated October 26, 2026 with GPIO pin descriptions and communication protocol details.