AI agents & screen readers: for a machine-readable, text-only catalogue, start at /llms.txt. Products are available as Markdown (/products.md, /products/{handle}.md) and JSON (/products.json, /products/{handle}.json).
Store

What makes a HAT

The HAT and HAT+ rules in plain terms (board size, mounting holes, the ID EEPROM, power and stacking), how pHATs and Bonnets fit in, and what to check before you buy a HAT for your Pi.

What "HAT" means

HAT stands for Hardware Attached on Top: an add-on board that plugs onto the 40-pin GPIO header and sits over the Pi. Only boards that follow Raspberry Pi's specification can be called a HAT. The rules make sure a HAT fits, can't harm the Pi through its power pins, and tells the Pi what it is so the right software loads by itself.

There have been two versions of the rules:

Original HAT (2014) HAT+ (2023 onwards)
Status Retired; existing boards still work The current standard for new boards
Board shape Fixed outline and four corner holes Looser: must reach the header and line up with at least one Pi mounting hole
ID EEPROM Required; holds a pin map and the board's setup data Required; holds just the name of the setup file to load
More than one at once Not covered Up to three, one of each class
Power-saving standby Not covered Must cope with the 3.3 V supply switching off while 5 V stays on (Pi 4 and later)

A HAT+ is electrically compatible with older Pis, though they may need a software and firmware update first. Boards that meet the new rules are meant to carry a HAT+ logo.

Board size and mounting holes

The classic full-size HAT is the same width as a Raspberry Pi and a bit shorter:

  • 65 × 56.5 mm, with 3 mm rounded corners;
  • four M2.5 mounting holes, one in each corner, 58 mm apart along the header and 49 mm apart across the board, each 3.5 mm in from the edges. These line up with the holes on a Pi 5, 4, 3 or B+;
  • an optional slot and cutout so camera and display ribbon cables can pass through.

HAT+ keeps those holes but drops the fixed outline. It asks instead that a HAT+ keeps clear of the PoE pins and the camera, display and PCIe connectors.

Spacing. The original rule was at least 8 mm between the Pi and the HAT. To clear a Pi 5's Active Cooler, HAT+ recommends at least 15 mm spacers (16 mm is ideal). A HAT+ should come with its own header, spacers and screws.

The ID EEPROM

Every HAT has a small memory chip, the ID EEPROM, wired to physical pins 27 and 28 (GPIO0 and GPIO1). Nothing else is allowed on those two pins. When the Pi starts, its firmware reads the chip to find out:

  • who made the board and what it's called;
  • which device tree overlay to load. That's the small configuration file that sets up the pins and loads the right driver.

On a HAT+, the chip only stores the overlay's name; the overlay itself ships with Raspberry Pi OS in /boot/firmware/overlays. The upshot for you: a proper HAT usually just works after a reboot, with no editing of config.txt.

To see whether your Pi has recognised a HAT:

cat /proc/device-tree/hat/product

If the file isn't there, no HAT EEPROM was found. Boards without one can still work; follow the maker's setup steps, which often means adding a dtoverlay= line to /boot/firmware/config.txt.

Stacking more than one

Under HAT+ you can fit up to three at once, one of each class:

  • a standard HAT+ (or an older HAT): anything that uses the ordinary GPIO pins;
  • a stackable HAT+: one that doesn't connect to GPIO 2 to 27 at all, only the ID pins, so it can sit alongside a standard one;
  • a power HAT+: one that feeds power into the Pi.

Two boards may still want the same pins or I2C address, so check both against our GPIO header guide, and you'll need a stacking header (extra-long pins that pass through the lower board). Boards without an ID EEPROM, including Raspberry Pi's own PoE and PoE+ HATs, sit outside this scheme; check their documentation before combining them.

Power and back-powering

Most HATs draw power from the Pi's 5 V and 3.3 V pins, so it comes out of your Pi's power supply. Anything driving motors or long LED strips should have its own.

Some HATs work the other way and power the Pi through the 5 V pins (PoE HATs, for example). The rules for those are strict:

  • the HAT must be safe even if a USB-C power supply is also plugged into the Pi, which usually means a protection diode on the HAT;
  • a HAT+ that powers a Pi must supply at least 3 A at 5.1 V, and 5 A is strongly recommended (a 13 W PoE HAT+ is the one allowed exception). Under the original rules the minimum was 1.3 A;
  • never connect a power source to the 3.3 V pins.

Unless your own circuit has that kind of protection, power the Pi through its USB-C socket rather than the 5 V pins.

pHATs, Bonnets and uHATs: the Zero-sized boards

The official Zero-sized format is the uHAT (micro HAT): the same electrical rules as a full HAT on a smaller board:

  • 65 × 30 mm, with 3 mm rounded corners;
  • at least three mounting holes: the two beside the header, plus one in another corner, on the Zero's 58 × 23 mm pattern;
  • a full 40-pin connector.

pHAT (Pimoroni's name) and Bonnet (Adafruit's) are brand names for boards of this size. The header is the same, so they fit full-size Pis too. Not all of them carry an ID EEPROM, so check the setup instructions.

Before you buy a HAT

  • Which Pi is it made for? A board-specific HAT+ must say which models it supports. Anything using PCIe, such as the M.2 HAT+ and AI HAT+, needs a Raspberry Pi 5. The PoE pins are in a different place on the Pi 4 and Pi 5, so a PoE HAT made for one won't fit the other.
  • Does your Pi have header pins? A Zero, Zero W or Zero 2 W needs a header soldered on, or buy the WH version.
  • Will it clear your cooler? On a Pi 5 with the Active Cooler, check that the HAT comes with tall enough spacers (15–16 mm).
  • Is the software up to date for your board? Python code written for the RPi.GPIO library won't run on a Pi 5. See Controlling GPIO from Python with gpiozero.

Parts in this guide

Maddy from the Pi Australia team

Need help? We're here for you!

Hi, I'm Maddy. My team and I are ready to help with your order or any questions.