If you’ve been around Raspberry Pis for any length of time, you’ve likely heard of Raspberry Pi HATs. These add-on boards that sit on top of your Pi can add everything from simple sensors to AI acceleration capabilities via the Raspberry Pi AI Kit. But what exactly makes a HAT a HAT, and how have things changed with the introduction of the Raspberry Pi 5? Other than a lot of us incorrectly calling a HAB a HAT, because, you know, there’s Hardware on Bottom now..
Table of Contents
What is a Raspberry Pi HAT?
HAT stands for Hardware Attached on Top, and it’s more than just a cute acronym. For a board to officially be called a Raspberry Pi HAT, it needs to meet specific requirements set by the Raspberry Pi Foundation:
- A rectangular 65x56mm board that aligns with Pi mounting holes
- A 40-pin GPIO header that matches the Raspberry Pi’s pinout
- Support for auto-configuration via dedicated EEPROM pins
This auto-configuration is what sets true HATs apart from other add-on boards. When you connect a HAT, your Pi can identify it and automatically configure the necessary GPIO pins and drivers. This makes setup much simpler compared to manually configuring drivers and GPIO settings.
The above is a basic example of a Raspberry Pi HAT from Argon40. It offers the option to utilise the power over GPIO pins to spin a cooling fan over your precious Pi’s critical components to keep things nice and cool. It also comes with a script that runs on your Pi to manage the fan speed, and a power button (something that was only added officially on the Pi 5!)
Raspberry Pi HAT vs Raspberry Pi pHAT: Understanding the Differences
While browsing for HATs, you’ll likely come across pHATs (sometimes called Bonnets). The key differences are:
- Size: pHATs match the Raspberry Pi Zero’s smaller footprint
- Auto-configuration: pHATs typically don’t include the EEPROM for automatic setup
- Mounting: Hole positions may not align with standard HAT specifications
Both Raspberry Pi HATs and Raspberry Pi pHATs use the same 40-pin GPIO header, meaning they’re electrically compatible across Pi models. However, you may need to perform additional setup steps with pHATs since they lack auto-configuration. For a taster of what kind of “bonnets” exist, you can take a look at a Raspberry Pi-approved reseller such as The Pi Hut.
I actually reviewed a Raspberry Pi pHAT that offers USB and Ethernet on the Raspberry Pi Zero a while ago, and it’s still in use today!
Raspberry Pi 5 HATs: What’s New?
The Raspberry Pi 5’s introduction of PCIe has really changed what’s possible when it comes to HATs. While traditional GPIO-based HATs still work fine, we now have new categories of HATs that utilise the on-board PCIe connection:
- NVMe storage HATs for blazing-fast storage
- AI accelerator HATs for machine learning
- High-speed networking HATs
These PCIe HATs connect via a flexible flat cable (FFC) instead of traditional GPIO pins. It’s worth noting that the Pi 5’s increased power requirements mean some older Raspberry Pi HATs may need additional power considerations, especially when using multiple HATs or power-hungry accessories.
A lot of Raspberry Pi 5 M.2 / PCIe HATs offer a GPIO pass-through, so you may be able to use a combination of both should you really need to!
Frequently Asked Questions
Q: Do I need special drivers for PCIe HATs?
A: Most recent versions of Raspberry Pi OS include necessary drivers, though some HATs may require additional setup so do refer to your specific HAT’s product documentation to see if there are special drivers/configurations required.
Q: Can I use Pi 4 HATs with a Pi 5?
A: Yes, traditional GPIO-based HATs are compatible as the GPIO pin layout is the same. Just ensure that your power supply can handle the combined load of the more powerful Raspberry Pi 5 and whatever HAT & downstream devices you have connected.
Q: Can I stack multiple HATs?
A: While possible with GPIO pass-through headers, be mindful of power requirements and potential conflicts between HATs.
[Header photo courtesy of Raspberry Pi]