Raspberry Pi β Add-on Boards (HATs & Extensions) (2025 Expansion Guide)
Introduction β Unlock New Features with Raspberry Pi HATs
Add-on boardsβcommonly known as HATs (Hardware Attached on Top)βextend the capabilities of your Raspberry Pi far beyond the GPIO pins. These stackable hardware modules allow for plug-and-play access to sensors, displays, motors, audio, power control, and moreβwithout complex wiring.
In this guide, youβll learn:
- What HATs and pHATs are and how they work
- Popular categories of Raspberry Pi extensions
- How to install and configure HATs
- Project examples using common HATs and expansion boards
What Is a HAT (Hardware Attached on Top)?
A HAT is an officially recognized add-on board that:
- Connects via the 40-pin GPIO header
- Includes an EEPROM to auto-configure drivers
- Matches the Raspberry Pi’s form factor
Related Terms:
| Term | Description |
|---|---|
| HAT | Full-size board for standard Pi models |
| pHAT | βPartial HATβ for Pi Zero form factor |
| Bonnet | Adafruitβs name for compact add-on boards |
| Shim | Thin boards with minimal soldering needed |
Installing HATs β Quick Steps
- Power off your Raspberry Pi
- Carefully align the HAT pins with the 40-pin GPIO header
- Press the HAT firmly onto the GPIO header
- Power on the Raspberry Pi
- If it has an EEPROM, it may auto-load required drivers
Some boards require additional librariesβcheck the HAT’s documentation.
Popular Types of Raspberry Pi Add-on Boards
| Category | Example HATs | Use Case |
|---|---|---|
| Motor Control | Adafruit DC & Stepper HAT, Pimoroni Automation HAT | Control DC/stepper motors, relays |
| Displays | PiTFT, OLED Bonnet, Unicorn HAT HD | Add touchscreens, RGB matrices |
| Sensors | Enviro+, Sense HAT, BME688 HAT | Environmental data, temp, humidity |
| Sound/Audio | DAC HAT, Audio Injector, HiFiBerry | Audio output, recording, speaker control |
| Networking | PoE HAT, LTE/NB-IoT HAT | Add LTE, 4G, PoE Ethernet |
| Power Management | PiJuice HAT, UPS HAT, LiFePO4wered/Pi | Battery, UPS, solar-powered systems |
| Prototyping | GPIO Extender HAT, Cobbler, Proto HAT | Easier GPIO testing and custom circuits |
| AI & Vision | Google Coral Edge TPU, Pi AI Kit, ReSpeaker Mic HAT | On-device AI, voice processing, ML tasks |
Example 1: Sense HAT (Sensors + LED Matrix)
Features:
- Temperature, pressure, humidity, gyroscope
- 8Γ8 RGB LED matrix
- Joystick input
Python Example:
from sense_hat import SenseHat
sense = SenseHat()
sense.show_message("Hello!", scroll_speed=0.08)
temp = sense.get_temperature()
print(f"Temperature: {temp:.2f} Β°C")
Ideal for educational projects, data logging, and space simulation.
Example 2: Motor HAT with Stepper Motor
Python Example:
from adafruit_motorkit import MotorKit
import time
kit = MotorKit()
# Run motor forward
kit.stepper1.onestep()
time.sleep(0.5)
# Reverse
kit.stepper1.onestep(direction=kit.stepper1.BACKWARD)
Control robotics, smart cars, conveyor systems.
Power HAT β UPS or PiJuice Setup
| Feature | Use |
|---|---|
| Battery backup | Prevent SD card corruption on power loss |
| Safe shutdown | Auto-off when battery is low |
| I2C interface | Monitor battery level |
| Solar charging support | Sustainable power for outdoor IoT setups |
Add pijuice software for battery monitoring via Python.
Tips for Using Multiple HATs
- Use GPIO stacking headers if you need more than one board
- Check for GPIO pin conflicts (e.g., I2C, SPI, UART usage)
- Consider I2C multiplexers for multiple sensors of the same type
- Use Proto HATs to combine custom electronics with standard boards
Summary β Recap & Next Steps
HATs and add-on boards allow Raspberry Pi to grow into specialized rolesβfrom IoT sensors to motor controllers, audio hubs, and vision systems.
Key takeaways:
- HATs connect via GPIO and expand your Piβs hardware capabilities
- Sense HAT, DAC HAT, Motor HAT, and PoE HAT are popular examples
- Always check for GPIO conflicts when stacking boards
- Many HATs come with Python libraries for easy programming
Real-world relevance: Power your robot, build a weather station, run a UPS, or control motorsβall with the right add-on.
FAQs β Raspberry Pi Add-on Boards (HATs)
Can I stack multiple HATs on one Raspberry Pi?
Yes, but only if thereβs no pin conflict and you use stacking headers or I2C expansion logic.
Whatβs the difference between HAT and pHAT?
HATs follow the full-size Raspberry Pi form factor; pHATs are smaller and designed for Pi Zero models.
Do all HATs require software drivers?
Most come with Python libraries or kernel modules. Some (like Proto HATs) are passive.
Can I create my own HAT?
Yes. Use a Proto HAT board or custom PCB, and optionally include an EEPROM for driver auto-detection.
Will HATs work on Pi 5 and Pi Zero?
Yesβmost HATs use standard 40-pin GPIO headers, compatible across all modern Raspberry Pi boards.
Share Now :
