Raspberry Pi 5 HAT Board: What It Is & How to Choose
In this article
A Raspberry Pi 5 HAT board is a hardware add-on that follows the official HAT+ specification, designed to plug directly onto the 40-pin GPIO header of the Raspberry Pi 5 to add specific functions like motor control, audio, or M.2 storage. The Raspberry Pi 5 uses the same 40-pin header as earlier models, but it introduces a new HAT+ standard with an EEPROM, a single power-enable pin, and stricter electrical requirements, so not every older HAT works without modification.
Background: From HAT to HAT+
HAT stands for Hardware Attached on Top. The original HAT specification was introduced with the Raspberry Pi B+ in 2014 to standardize add-on boards. A HAT board includes a small EEPROM chip that stores board identity, manufacturer, and configuration data. When the Pi boots, it reads this EEPROM to automatically set up GPIO pins, device tree overlays, and power limits.
The Raspberry Pi 5, released in late 2023, brought a revised spec called HAT+. The key changes are:
- Single power enable pin – GPIO 12 now controls power to the HAT, allowing the Pi to switch the add-on on or off safely.
- Increased current capacity – the 5V pins can supply up to 5A total, but HAT+ boards must negotiate current draw via the EEPROM.
- Stricter EEPROM requirements – the EEPROM must use a specific format (v1.2 or later) and include a unique ID.
- Backward compatibility – older HATs without EEPROMs still work, but they only get default power and no automatic configuration.
How a HAT Board Works with the Pi 5
When you attach a HAT+ board to a Raspberry Pi 5, the following happens:
- The board's EEPROM is read over the I2C bus at boot time.
- The Pi loads the appropriate device tree overlay, which tells the Linux kernel which drivers to enable.
- GPIO pins are assigned according to the overlay, preventing conflicts with other peripherals.
- Power is applied to the HAT only after the EEPROM is successfully read, protecting the board from overcurrent.
This automatic detection is what makes HATs easier to use than generic GPIO breakouts. You don't need to manually configure pin mappings or load modules; the Pi does it for you.
Choosing a HAT Board for Your Pi 5
Before buying a HAT, consider what function you need. Common categories include:
- M.2 storage HATs – add NVMe SSD support via the PCIe connector (not the GPIO header). These are the most popular for Pi 5 because they dramatically improve disk speed.
- Motor driver HATs – control DC motors, steppers, or servos for robotics.
- Audio HATs – provide better DACs and amplifiers than the built-in 3.5mm jack.
- Relay HATs – switch high-voltage AC/DC loads for home automation.
- Battery/PMIC HATs – add a real-time clock or power management.
Key factors to check:
- HAT+ compliance – look for “HAT+” branding or a mention of Pi 5 compatibility.
- Physical size – some HATs are larger than the Pi board and may block access to the USB or Ethernet ports.
- Stacking ability – if you plan to use multiple HATs, check if they use different GPIO pins or support stacking headers.
- Power requirements – a HAT that draws more than 1A from the 5V rail may need a separate power input.
Common Problems and Misconceptions
“Will my old HAT work on the Pi 5?” – Usually yes, but with caveats. HATs that rely on the old 3.3V power enable or use I2C addresses that conflict with the new EEPROM may fail. Some older HATs draw too much current from the 3.3V rail, which the Pi 5 limits to 500mA.
“Why isn't my HAT detected?” – Check that the EEPROM is programmed correctly. Many cheap clones skip the EEPROM entirely, so the Pi treats them as a generic GPIO board. You can force a device tree overlay in /boot/firmware/config.txt if needed.
“Can I connect a HAT to the PCIe port?” – No. The PCIe port is for M.2 HATs specifically. A standard GPIO HAT cannot use PCIe.
“Do I need a special case?” – Yes, many cases designed for the Pi 5 have cutouts for M.2 HATs, but a standard case may not fit a taller HAT. Check the case's clearance.
Comparison: HAT vs. HAT+ vs. Generic GPIO Board
Here's a quick comparison to clarify the differences:
- HAT (original) – has EEPROM, uses the 40-pin header, auto-configures, but power management is simpler and less safe for high-current boards.
- HAT+ (new standard) – improved EEPROM format, single power enable pin, supports up to 5A on 5V, and is designed for the Pi 5's more powerful capabilities.
- Generic GPIO board – no EEPROM, no auto-configuration. You must manually wire and configure everything. Often cheaper and more flexible for custom projects.
For most users, a HAT+ board is the best choice because it's plug-and-play. Generic boards are better if you need to repurpose pins in unusual ways or if you're making a one-off prototype.
Cost Considerations and Alternatives
HAT boards range from about $10 for simple relay boards to $50 or more for M.2 NVMe adapters with active cooling. The price reflects the EEPROM, PCB quality, and components. If you're on a budget, you can buy a bare M.2 adapter without the EEPROM, but you'll lose auto-detection and may need to manually configure the PCIe link.
Alternatives to a HAT board include:
- Breadboard and jumper wires – for simple circuits, no PCB needed.
- USB peripherals – for audio, storage, or networking, USB dongles are often cheaper and easier.
- GPIO expansion boards – these use I2C or SPI to add more pins without occupying the whole header.
If you only need one function, a USB device might be simpler. But if you want a clean, permanent, low-profile solution, a HAT is usually better.
Safety and Electrical Notes
When using any HAT board with a Raspberry Pi 5, keep these safety points in mind:
- Never connect or disconnect a HAT while the Pi is powered on. This can cause voltage spikes that damage the GPIO pins or the HAT.
- Check current draw. The Pi 5 can supply up to 5A on the 5V pins, but only if you use a 5V/5A USB-C power supply. A standard 3A supply may cause brownouts with a power-hungry HAT.
- Mind the 3.3V rail. It is limited to 500mA. Many HATs use 3.3V logic, but powering motors or relays from 3.3V will damage the Pi.
- Use proper ESD precautions. Ground yourself before touching the board, especially in dry environments.
If a HAT gets hot during operation, consider adding a heatsink or fan. The Pi 5 itself runs hotter than previous models, so stacking a HAT can reduce airflow.
Frequently Asked Questions
Can I use a HAT designed for Pi 4 on a Pi 5? – Yes, most HATs are electrically compatible because the 40-pin header is identical. However, some may not be recognized as HAT+ and will fall back to manual configuration. Check the manufacturer's website for Pi 5 support.
How do I know if my HAT has an EEPROM? – Look for a small 8-pin chip (often a CAT24C32 or similar) on the board. You can also run sudo apt install i2c-tools and then i2cdetect -y 1 to see if an EEPROM appears at address 0x50.
What is the difference between a HAT and a pHAT? – pHAT stands for “partial HAT” and is a smaller board that uses the same EEPROM but only occupies a portion of the GPIO header. They work the same way, but pHATs are usually for simple functions like LED matrices or small sensors.
Can I stack multiple HATs? – Yes, if they use different GPIO pins and you have stacking headers. However, the Pi 5's HAT+ spec only supports one EEPROM on the I2C bus at a time, so only the bottom HAT will be auto-detected. The others must be configured manually.
Do I need to update my Pi's firmware to use HAT+? – It's recommended to run the latest Raspberry Pi OS, which includes the necessary device tree overlays and EEPROM handling. You can update firmware with sudo rpi-eeprom-update.