The Raspberry Pi AI HAT+ is a PCIe add-on board that moves neural-network inference off the Arm Cortex-A76 cores of the Raspberry Pi 5 and onto a dedicated Hailo accelerator. A bare Pi 5 runs object detection at a few frames per second. With the AI HAT+, it runs the same model at real-time frame rates and leaves the CPU free for your application logic. This guide covers the hardware, pinout and PCIe details, installation, working commands, and a practical project.
Quick Takeaways
- Two variants: 13 TOPS (Hailo-8L) and 26 TOPS (Hailo-8), both on one HAT+ form factor.
- Interface: PCIe through the Pi 5’s FFC connector, not USB or GPIO bit-banging.
- Pi 5 only: the board needs the Pi 5’s PCIe connector.
- Software: install the
hailo-allpackage andrpicam-appsandPicamera2pick up the accelerator automatically.
| Spec | AI HAT+ (13 TOPS) | AI HAT+ (26 TOPS) |
|---|---|---|
| Accelerator | Hailo-8L | Hailo-8 |
| Performance | 13 TOPS | 26 TOPS |
| Host interface | PCIe x1 (Gen 2 default, Gen 3 optional) | PCIe x1 (Gen 2 default, Gen 3 optional) |
| Compatible host | Raspberry Pi 5 | Raspberry Pi 5 |
| Form factor | HAT+ with EEPROM auto-detect | HAT+ with EEPROM auto-detect |
| Best for | Single-stream detection, classification | Multi-stream, larger models, pose + segmentation |
| Launch price | Around $70 | Around $110 |
Prices are launch figures. Check current retail listings before you buy.
What the Raspberry Pi AI HAT+ Actually Does
A neural-network accelerator (NPU) is a chip built around one workload: multiply-accumulate operations on quantized tensors. A CPU runs these operations serially or through narrow NEON SIMD lanes. An NPU runs thousands of them in parallel in a dataflow architecture, at a fraction of the power.
The Hailo chips on the AI HAT+ execute INT8 quantized models. You compile a trained model (ONNX, TensorFlow Lite, or PyTorch exported to ONNX) with the Hailo Dataflow Compiler. The result is a HEF file. The Pi streams input tensors to the chip over PCIe, and the chip returns output tensors.
TOPS in Practice
TOPS means tera-operations per second, or one trillion integer operations per second. It is a peak figure. Real throughput depends on model architecture, memory bandwidth, and pre/post-processing on the CPU. Use TOPS to rank boards, and use a frames-per-second benchmark on your own model to size a project.
How It Differs from the Original AI Kit
The earlier Raspberry Pi AI Kit paired the M.2 HAT+ with a separate Hailo-8L M.2 module. The AI HAT+ puts the accelerator directly on the board. That brings three practical changes:
| Feature | AI Kit (M.2 HAT+ + module) | AI HAT+ |
|---|---|---|
| Accelerator mounting | Separate M.2 2242 module | Soldered on board |
| Top performance | 13 TOPS | 26 TOPS available |
| Assembly | Module install, then HAT mount | Single board mount |
| Storage option | M.2 slot shared with NVMe use cases | Dedicated to AI |
| Power delivery | Via M.2 slot | Via HAT+ connector and Pi 5 supply |
Raspberry Pi has since released a newer AI HAT+ 2 built around a Hailo-10H, aimed at generative workloads. It has a different spec and price, so confirm its details separately. Everything below targets the original AI HAT+.
Hardware Overview and Pinout Configuration
What Is in the Box
- The AI HAT+ board with the Hailo chip and a pre-fitted heatsink
- A 16 mm stacking GPIO header
- Spacers and screws
- A short FFC (flat flexible cable) for the PCIe link
PCIe and GPIO Connections
Two connections matter:
- PCIe FFC cable: carries the PCIe x1 lane between the Pi 5’s PCIe connector and the HAT. This is the data path.
- 40-pin GPIO header: supplies 5V and GND and lets the HAT+ EEPROM be read over I2C (ID_SD and ID_SC, pins 27 and 28), so the OS identifies the board.
Because the stacking header passes all 40 pins through, your GPIO12, GPIO17, and other pins remain usable for sensors, relays, or LEDs above the HAT.
Pi 5 PCIe Speed
The Pi 5 PCIe port defaults to Gen 2 (5 GT/s, about 500 MB/s per lane). The Hailo accelerator supports Gen 3 (8 GT/s). Gen 3 is not certified on the Pi 5, but it works reliably for most users and increases throughput on high-frame-rate pipelines.
Hardware Assembly: Step by Step
- Power off the Pi 5 and remove the supply.
- Fit the 16 mm stacking header onto the Pi’s 40-pin GPIO.
- Screw the spacers into the Pi’s mounting holes.
- Lift the PCIe connector latch on the Pi 5 and insert the FFC with contacts facing the board.
- Press the HAT onto the header and secure it with the screws.
- Connect the other FFC end to the HAT and close the latch.
Cooling note: the Hailo chip and the Pi 5’s BCM2712 both run warm under sustained load. If you add the official Active Cooler, check clearance with the stacking header first. A case with airflow beats a closed enclosure.
Software Setup
Step 1: Update the OS
Use Raspberry Pi OS (Bookworm or newer, 64-bit) and update everything first.
sudo apt update && sudo apt full-upgrade -y
sudo rpi-eeprom-update -a # Update Pi 5 bootloader/firmware
sudo reboot
Step 2: Optional Gen 3 PCIe
Edit the boot config for faster PCIe transfers.
sudo nano /boot/firmware/config.txt
Add this line, then save:
dtparam=pciex1_gen=3 # Force PCIe x1 to Gen 3 (8 GT/s)
Step 3: Install the Hailo Packages
sudo apt install hailo-all -y # Installs HailoRT driver, firmware, and rpicam post-process assets
sudo reboot
Step 4: Verify the Accelerator
lspci | grep Hailo # Should list a Hailo AI processor on the PCIe bus
hailortcli fw-control identify # Prints device ID, firmware version, and architecture
A healthy Hailo-8L reports the HAILO8L architecture, and a Hailo-8 reports HAILO8. If lspci shows nothing, reseat the FFC cable first. This fixes most detection failures.
Here is a small Python script to automate the check in your own projects:
#!/usr/bin/env python3
"""Verify the Raspberry Pi AI HAT+ is visible before launching a pipeline."""
import subprocess
import sys
def run(cmd):
# Capture output as text; do not raise so we can print a clean error
return subprocess.run(cmd, capture_output=True, text=True)
# Step 1: Is the Hailo device on the PCIe bus?
pci = run(["lspci"])
if "Hailo" not in pci.stdout:
sys.exit("No Hailo device on PCIe. Reseat the FFC cable and reboot.")
# Step 2: Can HailoRT talk to it?
info = run(["hailortcli", "fw-control", "identify"])
if info.returncode != 0:
sys.exit(f"HailoRT error:\n{info.stderr}")
print(info.stdout) # Shows firmware version and device architecture
Running Your First Neural-Network Demo
Object Detection with rpicam-apps
With a Raspberry Pi camera attached, run a YOLOv8 detection demo using the installed post-processing JSON:
rpicam-hello -t 0 \
--post-process-file /usr/share/rpi-camera-assets/hailo_yolov8_inference.json \
--lores-width 640 --lores-height 640 # Low-res stream feeds the 640x640 model input
The main preview shows the full-resolution image. The lores stream goes to the Hailo chip, and bounding boxes are drawn back on the preview. The CPU stays mostly idle.
Pipelines with Hailo’s Example Repository
For Python pipelines, use Hailo’s Raspberry Pi 5 examples. They are built on GStreamer and cover detection, pose estimation, and instance segmentation.
git clone https://github.com/hailo-ai/hailo-rpi5-examples.git
cd hailo-rpi5-examples
./install.sh # Installs dependencies and downloads models
source setup_env.sh # Activates the virtual environment
python basic_pipelines/detection.py --input rpi # Use the Pi camera as input
Swap --input rpi for a video file path to test without a camera.
Supported Model Types
| Task | Example model | Typical use |
|---|---|---|
| Object detection | YOLOv6 / YOLOv8 / YOLOx | Counting, intrusion alerts |
| Pose estimation | YOLOv8-pose | Fitness tracking, gesture control |
| Instance segmentation | YOLOv5-seg | Pick-and-place, defect outlines |
| Classification | ResNet / MobileNet | Sorting, quality inspection |
AI HAT+ vs. Other Edge-AI Options
| Option | Performance | Interface | Power draw | Trade-off |
|---|---|---|---|---|
| Raspberry Pi AI HAT+ (26 TOPS) | 26 TOPS | PCIe | Low (few watts) | Pi 5 only, needs model compilation |
| AI HAT+ (13 TOPS) | 13 TOPS | PCIe | Low | Lower ceiling, cheaper |
| Google Coral USB | 4 TOPS | USB 3.0 | Very low | Older toolchain, limited model support |
| Pi 5 CPU only | Not rated | n/a | Moderate | Slow on video, ties up all cores |
| Jetson Orin Nano | Up to 40 TOPS (varies by kit) | Standalone board | Higher | Costs more, runs its own OS stack |
The AI HAT+ sits in a useful middle: more capable than USB sticks, cheaper and simpler than a full Jetson, and tightly integrated with the Pi camera stack.
Real-World Project: Person-Detection Alert Light
This build turns a detection into a physical output. A Pi 5 watches a doorway, and when the Hailo chip detects a person, a GPIO17-driven relay switches a light.
Parts List
- Raspberry Pi 5 with AI HAT+
- Raspberry Pi Camera Module 3
- 5V relay module (opto-isolated)
- 330 Ω resistor and status LED (optional indicator)
- Jumper wires
Wiring
| Relay module pin | Pi 5 pin |
|---|---|
| VCC | 5V (pin 2 or 4) |
| GND | GND (pin 6) |
| IN | GPIO17 (pin 11) |
Use an opto-isolated relay board. It separates the Pi’s 3.3V logic from the relay coil and protects the BCM2712 from inductive spikes.
Logic Flow
- The camera streams frames to the Hailo-8L or Hailo-8.
- A YOLOv8 model returns bounding boxes with class labels.
- Your callback checks for the
personclass above a confidence threshold, for example 0.6. - On a match, set GPIO17 high for a few seconds.
Start from the detection.py example in the Hailo repository. Its callback function receives each frame’s detections, which is the right place to add your gpiozero output call. Hold the output on for a fixed delay so a single missed frame does not flicker the light.
Troubleshooting Checklist
| Symptom | Likely cause | Fix |
|---|---|---|
lspci shows no Hailo device |
Loose FFC or latch not closed | Reseat cable, reboot |
hailortcli not found |
hailo-all not installed |
Run sudo apt install hailo-all |
| Frame rate lower than expected | PCIe at Gen 2, CPU-bound post-processing | Enable Gen 3, reduce preview resolution |
| Random disconnects under load | Power or thermal limits | Use the official 27W supply, add airflow |
| Model fails to load | Wrong HEF for device (8L vs. 8) | Match the HEF to your chip’s architecture |
Frequently Asked Questions
Does the Raspberry Pi AI HAT+ work with the Raspberry Pi 4?
No. The AI HAT+ requires the PCIe connector found on the Raspberry Pi 5. The Pi 4 has no exposed PCIe lane, so the board cannot connect to it.
What is the difference between the 13 TOPS and 26 TOPS AI HAT+?
The 13 TOPS version uses the Hailo-8L, and the 26 TOPS version uses the Hailo-8. The 26 TOPS board runs larger models and multiple camera streams at higher frame rates. For a single camera and a YOLOv8 detection model, the 13 TOPS version is usually enough.
Can I run ChatGPT-style language models on the AI HAT+?
Not on the original AI HAT+. The Hailo-8L and Hailo-8 target vision workloads such as detection, pose, and segmentation. Generative and language workloads are the focus of the newer AI HAT+ 2, so check that product’s specs if you need them.
Can I use the AI HAT+ with an NVMe SSD?
Both devices want the Pi 5’s single PCIe lane, so you need a PCIe switch or multiplexer board to share it. Without one, choose between an NVMe boot drive and the AI HAT+, or boot from a microSD card or USB SSD and keep the PCIe lane for the accelerator.




