What is a HAT on Raspberry Pi?
On Raspberry Pi, a HAT is basically an add-on board that fits onto the Raspberry Pi GPIO pins. HAT stands for Hardware Attached on Top.
If you look at this picture of the Sense HAT, which is one of the most popular, you can better understand where the name comes from:
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now
The purpose of these HATs is to easily add extra functionality to Raspberry Pi. For example, the Sense HAT has different sensors (thermometer, hygrometer, …), a LED matrix and even a joystick on it. Other hats can add additional ports (e.g. PoE Ethernet or SATA), better components (digital audio) and things like that.
Some are used as an alternative to more complex electronic circuits because they are plug and play, automatically recognized by Raspberry Pi OS, and sometimes easier to use in programs. For example, using the Sense HAT’s temperature sensor is much easier than creating a small circuit to get it from a traditional sensor.
If you want a better idea of what is possible, you should definitely check out my list of the best Raspberry Pi HATs here.
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now
And for a beginner’s tutorial, I highly recommend getting a Sense HAT and following this two-part guide:
- Part 1: Getting started with the Sense HAT.
- Part 2: Programming in Python with a Sense HAT.
Whenever you’re ready, here are other ways I can help you:
The RaspberryTips Community: If you want to hang out with me and other Raspberry Pi fans, you can join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads.
Master your Raspberry Pi in 30 days: If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.
The Raspberry Pi Bootcamp: Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.
Master Python on Raspberry Pi: Create, understand, and improve any Python script for your Raspberry Pi. Learn the essentials step-by-step without losing time understanding useless concepts.
You can also find all my recommendations for tools and hardware on this page.