Summary

A Raspberry Pi “HAT” orHardware Attached on Topis a simple upgrade component you’re able to add to compatible models of Raspberry Pi computers to expand what they can do and make many different projects far easier than they were before.

What Is a HAT?

A HAT is a type of expansion board designed specifically for the Raspberry Pi family of systems and will work with most models. It fits directly onto the 40-pinGPIOheader, which is where you’d usually connect to custom hardware you’ve made yourself. In essence, HATs are professionally-made custom boards that cover the most common things people have used their Pis for over the years.

HATs wereintroduced all the way back in 2014and there was a good reason the Pi Foundation needed to establish this standard. The old Pi models A and B had a 26-pin GPIO connector, and the way it worked was very basic. This isn’t like USB or PCIe, where there’s a codified standard and anything that fits in the connector should work.

Raspberry Pi SSD hat.

With a GPIO connector, it’s all in your hands. You have to write (or procure) the driver for the hardware you plug into the interface. The Pi doesn’t know what the board you’ve plugged in does or even whether it’s plugged in at all.

From the Pi B+ and later, the HAT standard went a long way to rectifying this. Most HATs have anEEPROM(Electrically Erasable Programmable Read-Only Memory) that stores configuration information for the Pi. At boot time, this tells the Pi what the board is and how to interface with it.

The Raspberry Pi AI HAT Plus on a Raspberry Pi 5 SBC.

How Do HATs Work?

HATs connect using the aforementioned GPIO header, and usually get power from the Pi itself, or from an external power supply if there isn’t enough juice to spare from the computer. Data pulses travel between the Pi and the HAT via the pins in the header. HATs are usually plug-and-play, and you can immediately control them after booting with one attached.

Different HAT Types

There are more HATs than I could mention here, but to give you some examples of the most common ones:

These are some prime examples, but you should get the idea. There are HATs for AI, networking, high-end audio, and more.

The newerHAT+ standardhas a few neat tricks including the HAT+s board that lets you stack and use two of them at once. One of the first HAT+ modules is thePi M.2 HAT+

Cool Uses for HATs

With the right HAT, a Pi can be transformed into something special, and there are plenty of neat things you can do. You can make your own weather station using the sensor HAT. Build a robot, create a media center with ahigh-quality audio HAT, and even add powerful AI hardware using theAI HAT+module.

While there are only so many HATs, the number of things you can do with them and your Pi are only limited by your imagination and your budget. This is especially cool if you’re upgrading to the latestRaspberry Pi 5models, and aren’t sure what to do with your older Pi. Well, you might want to throw a compatible HAT into the basket with your new Pi so that the old one can live on as a cool DIY project.