Pinout & GPIO

Ensure precise hardware integration with the complete AI HAT pinout and GPIO mapping for Raspberry Pi 5, covering interface definitions, GPIO passthrough, and PCIe connectivity for reliable signal routing.

Hardware Reference

Pinout & GPIO

Pin-by-pin map of how the Sixfab AI HAT+ for Raspberry Pi 5 connects to the host: the 40-pin GPIO header consumption, the 16-pin FFC PCIe link, the HAT+ EEPROM bus, and the electrical limits that apply to every signal on the board. Intelligented by DEEPX. Built on Raspberry Pi.

Raspberry Pi 5 PCIe Gen 3 x1 16-pin FFC HAT+ compliant 12 of 40 pins used
AI HAT+ · Hardware Reference · Pinout & GPIO · Updated 2026-05-09
Which Pi 5 GPIO pins does AI HAT+ use?

The Sixfab AI HAT+ consumes only 12 of the 40 pins on the Raspberry Pi 5 GPIO header: 5 V power (pins 2 and 4), 3.3 V logic (pins 1 and 17), eight ground returns, and the HAT+ EEPROM bus on BCM 0 / BCM 1 (pins 27 and 28). The high-speed PCIe Gen 3 x1 link to the NPU runs over a separate 16-pin FFC cable, so every GPIO, SPI, I²C, UART, and PWM pin on the header stays free for your application or a stacked HAT.

40-pin GPIO header

AI HAT+ consumes only power and HAT+ EEPROM pins on the Raspberry Pi 5 GPIO header. Every GPIO, SPI, I²C (other than the ID bus), UART, and PWM pin remains free for your application or stacked HATs.

Power · 5 V / 3.3 V Ground HAT+ EEPROM · BCM 0 / 1 Free · available to user
40-pin GPIO header · Raspberry Pi 5 Hover any pin to read its full description Pi 5 side Pi 5 side 3.3V Power Pin 1 · 3.3 V power · USED by AI HAT+ 1 Pin 2 · 5 V power · USED by AI HAT+ (primary supply) 2 5V Power SDA1 (I²C) Pin 3 · SDA1 · BCM 2 · I²C1 data · FREE 3 Pin 4 · 5 V power · USED by AI HAT+ (primary supply) 4 5V Power SCL1 (I²C) Pin 5 · SCL1 · BCM 3 · I²C1 clock · FREE 5 Pin 6 · GND · USED 6 GND GPCLK0 Pin 7 · GPCLK0 · BCM 4 · FREE 7 Pin 8 · TXD0 · BCM 14 · UART0 TX · FREE 8 TXD0 (UART) GND Pin 9 · GND · USED 9 Pin 10 · RXD0 · BCM 15 · UART0 RX · FREE 10 RXD0 (UART) BCM 17 Pin 11 · BCM 17 · GPIO · FREE 11 Pin 12 · PWM0 · BCM 18 · FREE 12 PWM0 BCM 27 Pin 13 · BCM 27 · GPIO · FREE 13 Pin 14 · GND · USED 14 GND BCM 22 Pin 15 · BCM 22 · GPIO · FREE 15 Pin 16 · BCM 23 · GPIO · FREE 16 BCM 23 3.3V Power Pin 17 · 3.3 V power · USED by AI HAT+ 17 Pin 18 · BCM 24 · GPIO · FREE 18 BCM 24 SPI0 MOSI Pin 19 · SPI0 MOSI · BCM 10 · FREE 19 Pin 20 · GND · USED 20 GND SPI0 MISO Pin 21 · SPI0 MISO · BCM 9 · FREE 21 Pin 22 · BCM 25 · GPIO · FREE 22 BCM 25 SPI0 CLK Pin 23 · SPI0 CLK · BCM 11 · FREE 23 Pin 24 · SPI0 CE0 · BCM 8 · FREE 24 SPI0 CE0 GND Pin 25 · GND · USED 25 Pin 26 · SPI0 CE1 · BCM 7 · FREE 26 SPI0 CE1 ID_SD Pin 27 · ID_SD · BCM 0 · HAT+ EEPROM data · USED 27 Pin 28 · ID_SC · BCM 1 · HAT+ EEPROM clock · USED 28 ID_SC BCM 5 Pin 29 · BCM 5 · GPIO · FREE 29 Pin 30 · GND · USED 30 GND BCM 6 Pin 31 · BCM 6 · GPIO · FREE 31 Pin 32 · BCM 12 · GPIO · FREE 32 BCM 12 PWM1 Pin 33 · PWM1 · BCM 13 · FREE 33 Pin 34 · GND · USED 34 GND SPI1 MISO Pin 35 · SPI1 MISO · BCM 19 · FREE 35 Pin 36 · BCM 16 · GPIO · FREE 36 BCM 16 BCM 26 Pin 37 · BCM 26 · GPIO · FREE 37 Pin 38 · SPI1 MOSI · BCM 20 · FREE 38 SPI1 MOSI GND Pin 39 · GND · USED 39 Pin 40 · SPI1 CLK · BCM 21 · FREE 40 SPI1 CLK
Figure 1. 40-pin GPIO header pinout for AI HAT+ on Raspberry Pi 5. Hover any pin to read the full signal description.
Minimal GPIO footprint
12 of 40 pins consumed · 28 pins remain free for your application
2
5 V power
Pins 2, 4
2
3.3 V power
Pins 1, 17
8
Ground
8 GND pins
2
HAT+ EEPROM
Pins 27, 28
28
Free GPIO
SPI · I²C · UART · PWM

Electrical characteristics

Voltage levels, supply limits, and protection that apply across the AI HAT+ interface to the Raspberry Pi 5.

3.3 V logic supply
3.3 V DC
Drawn through pins 1 and 17. Powers onboard logic ICs and the HAT+ EEPROM pull-up network.
Recommended PSU
27 W USB-C · 5 V / 5 A
The official Raspberry Pi 27 W supply. 15 W chargers trigger under-voltage warnings under inference load.
HAT+ ID bus pull-ups
3.9 kΩ
Fitted on BCM 0 (ID_SD) and BCM 1 (ID_SC), as required by the Raspberry Pi HAT+ specification.
PCIe differential signaling
0.8–1.0 V peak-to-peak
High-Speed Differential Signaling on the 16-pin FFC. No active level-shifting sits between Pi 5 SoC and the NPU on the data lanes.
ESD protection
SoC-level on PCIe
Handled by the BCM2712 on the Pi 5 side and by the DEEPX NPU on the AI HAT+ side. GPIO peripherals rely on Pi 5 clamping diodes.
GPIO max drive current
16 mA per pin (Pi 5 limit)
Set by the BCM2712 SoC, not by AI HAT+. The free pins listed below pass through unmodified, so the Pi 5's per-pin source/sink limit of 16 mA applies. Drive logic, not motors or LEDs above this limit, directly from GPIO.
GPIO total current budget
50 mA combined (Pi 5 limit)
Sum of current across all simultaneously driven pins, per the Pi 5 design guideline. AI HAT+ itself does not consume any GPIO current outside the HAT+ EEPROM bus, so the full budget remains available to your application.

Pin assignment by function

Pins grouped by what they do on the AI HAT+ interface: power rails, the HAT+ EEPROM bus, ground, and the 28 GPIO that pass through unused.

Power rails

Physical pin(s)
Rail
Status
Function
2, 4
5 V
Used
Primary supply for the NPU and onboard DC-DC regulators. Rated 3 A.
1, 17
3.3 V
Used
Logic supply for onboard ICs and the HAT+ EEPROM pull-up network.

HAT+ EEPROM (I²C ID bus)

Physical pin
Signal
BCM
Status
Function
27
ID_SD
BCM 0
Used
I²C data line for the HAT+ EEPROM. Raspberry Pi OS reads the EEPROM at boot to auto-load the device tree overlay for the NPU. 3.9 kΩ pull-up fitted.
28
ID_SC
BCM 1
Used
I²C clock line for the HAT+ EEPROM. Used during boot identification only, not held during runtime. 3.9 kΩ pull-up fitted.
BCM 0 and BCM 1 are reserved by the HAT+ specification

Pins 27 and 28 (BCM 0 / BCM 1) are reserved by the Raspberry Pi HAT+ specification as the EEPROM identification bus on every HAT+ board, including AI HAT+. Do not connect user peripherals to these pins while AI HAT+ (or any other HAT+ device) is mounted.

Ground

Physical pin(s)
Signal
Status
Function
6, 9, 14, 20, 25, 30, 34, 39
GND
Used
Common ground reference. All eight GND pins tie into the AI HAT+ ground plane.

Free GPIO available to the user

Every pin not listed above passes through unused. AI HAT+ does not break out or consume any UART, SPI, PWM, or I²C 1 line; the 28 pins below remain fully available for your peripherals or stacked HATs.

Physical pin
Signal
BCM
Status
Function
3
SDA1
BCM 2
Free
I²C 1 data. Available for sensors, displays, or other I²C peripherals.
5
SCL1
BCM 3
Free
I²C 1 clock. Pairs with SDA1 on pin 3.
7
GPCLK0
BCM 4
Free
General-purpose clock or digital I/O.
8
TXD0
BCM 14
Free
UART0 transmit. AI HAT+ does not use any UART pins.
10
RXD0
BCM 15
Free
UART0 receive.
11
GPIO 17
BCM 17
Free
General-purpose digital I/O.
12
PWM0
BCM 18
Free
Hardware PWM channel 0; also PCM_CLK / I²S clock.
13
GPIO 27
BCM 27
Free
General-purpose digital I/O.
15
GPIO 22
BCM 22
Free
General-purpose digital I/O.
16
GPIO 23
BCM 23
Free
General-purpose digital I/O.
18
GPIO 24
BCM 24
Free
General-purpose digital I/O.
19
SPI0 MOSI
BCM 10
Free
SPI 0 master out / slave in.
21
SPI0 MISO
BCM 9
Free
SPI 0 master in / slave out.
22
GPIO 25
BCM 25
Free
General-purpose digital I/O.
23
SPI0 CLK
BCM 11
Free
SPI 0 clock.
24
SPI0 CE0
BCM 8
Free
SPI 0 chip enable 0.
26
SPI0 CE1
BCM 7
Free
SPI 0 chip enable 1.
29
GPIO 5
BCM 5
Free
General-purpose digital I/O.
31
GPIO 6
BCM 6
Free
General-purpose digital I/O.
32
GPIO 12
BCM 12
Free
General-purpose digital I/O; alt PWM0.
33
PWM1
BCM 13
Free
Hardware PWM channel 1.
35
SPI1 MISO
BCM 19
Free
SPI 1 master in / slave out.
36
GPIO 16
BCM 16
Free
General-purpose digital I/O.
37
GPIO 26
BCM 26
Free
General-purpose digital I/O.
38
SPI1 MOSI
BCM 20
Free
SPI 1 master out / slave in.
40
SPI1 CLK
BCM 21
Free
SPI 1 clock.

BCM GPIO quick reference

Summary of which Broadcom (BCM) GPIO numbers AI HAT+ touches, and which it doesn't.

BCM pin
Physical pin
Status
Notes
BCM 0 (ID_SD)
27
Used
HAT+ EEPROM data. 3.9 kΩ pull-up fitted. Read-only at boot, not held during runtime.
BCM 1 (ID_SC)
28
Used
HAT+ EEPROM clock. 3.9 kΩ pull-up fitted. Read-only at boot, not held during runtime.
BCM 2 to 27
All others
Free
No connection to AI HAT+. Fully available for user GPIO, I²C, SPI, UART, PWM, and other functions.

PCIe FFC connector

AI HAT+ communicates with the Raspberry Pi 5 through a dedicated 16-pin FFC (Flexible Flat Cable) connector, separate from the 40-pin GPIO header. This cable carries the high-speed PCIe Gen 3 x1 data link to the NPU.

Signal classes on the cable

The 16 conductors split into four functional groups. Differential pairs carry the high-speed data and the reference clock; control lines manage link bring-up and power; ground returns sit between every signal group for return-current integrity.

Signal class Differential Clock Control Ground

Pin-by-pin assignment

Pin
Signal
Class
Description
1
PERST#
Control
PCIe fundamental reset, active-low. Asserted by the Raspberry Pi 5 at boot and during link reinitialization to hold the NPU in reset.
2
GND
Ground
Reference ground; return path for adjacent control and differential signals.
3
PETp0 (TX+)
Differential
PCIe Gen 3 transmit, positive polarity. Pi 5 → NPU data lane. Paired with PETn0 on pin 4.
4
PETn0 (TX−)
Differential
PCIe Gen 3 transmit, negative polarity. Routed as a 100 Ω length-matched pair with PETp0.
5
GND
Ground
Isolates the transmit pair from the receive pair to control crosstalk.
6
PERp0 (RX+)
Differential
PCIe Gen 3 receive, positive polarity. NPU → Pi 5 data lane. Paired with PERn0 on pin 7.
7
PERn0 (RX−)
Differential
PCIe Gen 3 receive, negative polarity. Routed as a 100 Ω length-matched pair with PERp0.
8
GND
Ground
Isolates the receive pair from the reference clock pair.
9
REFCLK+
Clock
100 MHz PCIe reference clock, positive polarity. Sourced by the Pi 5; consumed by the NPU's PCIe PHY.
10
REFCLK−
Clock
100 MHz PCIe reference clock, negative polarity. Length-matched with REFCLK+.
11
GND
Ground
Reference ground; isolates the reference clock pair from the control lines that follow.
12
CLKREQ#
Control
PCIe clock request, active-low. The NPU asserts this line to request that the Pi 5 enable REFCLK after an L1 power-saving state.
13
WAKE#
Control
PCIe wake, active-low. Allows the NPU to bring the link out of a low-power state. Unused in typical inference workflows.
14
PWR_EN
Control
PCIe power enable from the Raspberry Pi 5 to AI HAT+. The board uses this signal for power management; there is no dedicated HAT_PWR_OFF pin on the 40-pin header.
15
PRSNT#
Control
Board presence detection, active-low. Pulled to ground on the AI HAT+ side so the Pi 5 can confirm a board is connected before enabling the link.
16
GND
Ground
Reference ground; closes the return path for the control signals on pins 12–15.
Cable orientation matters, and never hot-plug

The 16-pin FFC cable has two clearly labeled ends. Connect the end marked Raspberry Pi 5 to the Raspberry Pi 5's PCIe FFC port, and the end marked HAT to the AI HAT+ connector. Inserting the cable backwards prevents NPU detection on lspci and may damage the connector latch.

Always power off the Pi 5 before connecting or disconnecting the cable. AI HAT+ does not support hot-plug. The full mount, cable, and power-on sequence is documented in the Quickstart.

Fan connector

A dedicated 2-pin JST connector on AI HAT+ accepts a 3.3 V micro fan for active NPU cooling. The fan is optional and not included in the box.

Polarity matters — wrong polarity will damage the fan

The 2-pin JST connector on AI HAT+ is not reverse-polarity protected. Connecting a fan with the wires swapped will reverse-bias the motor and can permanently damage it, the fan controller, or both. Before plugging in any fan, confirm:

  • Pin 1 = 3.3 V (positive supply, red wire on most micro fans).
  • Pin 2 = GND (ground return, black wire on most micro fans).

Pin 1 is the pin nearest the silkscreen + marker on the AI HAT+ PCB. If your fan came with a non-keyed connector, check the wire colors against the manufacturer's datasheet before applying power.

Pin
Signal
Notes
1
3.3 V (+)
Positive supply for the fan motor. Marked with + on the AI HAT+ silkscreen.
2
GND (−)
Ground return.
When to add a fan

Passive cooling via the included thermal pad is sufficient for typical workloads. For deployments running sustained 100 % NPU utilization, especially in enclosed or warm environments, connect a 3.3 V micro fan via this header. Thermal limits and recommended cooling are documented in Hardware Reference.

HAT stacking

AI HAT+ can be physically stacked with other HATs. Because it consumes almost no GPIO, conflicts are rare, but you need the right hardware and should check EEPROM addressing.

Other HAT (optional, on top)
Requires AI HAT+ to be fitted with extra-long pass-through stacking headers.
Optional
Sixfab AI HAT+
Uses BCM 0 / BCM 1 only (HAT+ EEPROM ID bus). All other GPIO pass through unused.
This board
Raspberry Pi 5
Host platform. Provides the 40-pin GPIO header and the PCIe FFC port.
Host

Stacking requirements

  • Extra-long pass-through stacking headers required. AI HAT+ ships with standard headers. To stack another HAT on top, replace the headers with extra-long pass-through headers, or use a header extender between the two boards. Not included in the box.
  • Minimum header height — clearance above the NPU. The stacking headers must lift the upper HAT clear of every tall component on AI HAT+. The dominant constraint is the DEEPX NPU package and its thermal pad, which together set a board Z-height of 6.56 mm above the AI HAT+ PCB (no heatsink). After accounting for the 40-pin header mate depth on the upper HAT, the practical minimum stacking-header height is therefore in the range of standard 14–17 mm pass-through headers commonly used for Pi HATs.
  • Check HAT+ EEPROM coexistence. BCM 0 and BCM 1 are the HAT+ ID bus. If the stacked HAT also has an EEPROM on this bus, verify the device tree fragments do not conflict. The AI HAT+ EEPROM is configured for stackable coexistence on the ID bus.
  • Keep the PCIe FFC routed clear. The 16-pin FFC cable runs between AI HAT+ and the Raspberry Pi 5 regardless of what is stacked above. Route it so it is not pinched by the upper HAT.

Stacking compatibility

HAT or accessory
Compatible
Notes
Sixfab Base HAT
Yes
Base HAT communicates over USB; AI HAT+ over PCIe. No GPIO overlap. Minor EEPROM coexistence consideration only.
Raspberry Pi Active Cooler
Yes
AI HAT+ is designed to sit above the official Active Cooler using the included M2.5 standoffs. Sufficient airflow clearance.
Official Raspberry Pi 5 case
Partial
The footprint fits, but the case lid will not close because AI HAT+ and the NPU are too tall. Remove the internal fan insert and leave the top open, or use a third-party enclosure.
Other HATs (general)
Check GPIO
Likely compatible since AI HAT+ uses almost no GPIO. Verify the other HAT's pinout against BCM 0 / BCM 1, and ensure stacking headers are installed.