π 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 :