Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Raspberry Pi

Raspberry Pi HAT vs pHAT: Differences and Compatibility

Raspberry Pi HAT vs pHAT: Differences and Compatibility

March 11, 2026 /Posted byJayesh Jain / 0

If you’ve spent any time in the Raspberry Pi ecosystem, you’ve likely come across two terms that often cause confusion: HAT and pHAT. Both are add-on boards that plug into the GPIO header of a Raspberry Pi, but they differ in size, functionality, and compatibility. Understanding these differences will save you hours of frustration and help you pick the right expansion board for your project.

In this guide, we’ll break down everything you need to know about Raspberry Pi HATs and pHATs — what the acronyms mean, the physical and electrical differences, how the ID EEPROM works, and how to choose the right form factor for your specific use case.

What Is a Raspberry Pi HAT?

HAT stands for Hardware Attached on Top. It is a specification defined by the Raspberry Pi Foundation in 2014, designed to standardize add-on boards and make them truly plug-and-play. A proper HAT must comply with a specific set of rules:

  • Must be exactly 65mm × 56mm in size, matching the footprint of the Raspberry Pi 2/3/4 boards.
  • Must include a 40-pin GPIO connector that aligns with the Pi’s GPIO header.
  • Must include an ID EEPROM — a small electrically erasable programmable read-only memory chip that stores board information (vendor, product ID, GPIO usage map, and device tree overlay).
  • The EEPROM is connected to the dedicated I2C ID pins (GPIO 0/1), allowing the Pi to automatically detect and configure the HAT at boot time.
  • Must have mounting holes at the four corners that align with the Pi’s standoffs.

The ID EEPROM is the key differentiator. When the Raspberry Pi boots, it reads the EEPROM over I2C ID bus and can automatically load device tree overlays, configure GPIOs, and set up drivers — all without any manual configuration from the user. This makes HATs genuinely plug-and-play.

Common examples of full HATs include motor driver boards, PoE (Power over Ethernet) HATs, AI accelerator boards, and audio DAC HATs designed for the full-size Raspberry Pi.

Recommended: HAT DIY PCB Prototyping Board for Raspberry Pi ZERO — perfect for designing your own custom pHAT-sized expansion boards with a proper prototyping layout.

What Is a Raspberry Pi pHAT?

pHAT stands for partial HAT. The term was popularized by Pimoroni, a UK-based electronics company, to describe add-on boards that target the smaller Raspberry Pi Zero form factor. A pHAT is essentially a HAT that has been trimmed down:

  • Size: 65mm × 30mm — roughly half the height of a full HAT.
  • Uses a 40-pin GPIO connector (same pin count as a full HAT).
  • No ID EEPROM required — pHATs are not required to follow the full HAT specification.
  • Designed primarily for the Raspberry Pi Zero, Zero W, and Zero 2 W, but they are physically and electrically compatible with full-size Pis as well.
  • They do NOT need to have mounting holes at all four corners.

Because pHATs don’t carry an ID EEPROM, they won’t auto-configure on boot. You’ll typically need to manually enable the required interface (I2C, SPI, etc.) via raspi-config or by editing /boot/config.txt. Despite this minor inconvenience, pHATs are enormously popular because they keep the total project footprint tiny.

Physical Size and Form Factor Differences

The most immediately obvious difference is physical size. Here’s a quick comparison:

Feature HAT pHAT
Size 65mm × 56mm 65mm × 30mm
Target Pi Pi 2, 3, 4, 5 (full size) Pi Zero, Zero W, Zero 2 W
ID EEPROM Mandatory Not required
Mounting Holes 4 corners required Optional
Auto-configuration Yes (via EEPROM) Manual setup required
GPIO Pins Used 40-pin full header 40-pin full header
Recommended: Raspberry Pi 5 Model 4GB RAM — the latest full-size Pi with HAT support, upgraded GPIO connector, and dramatically faster performance for HAT-based projects.

The ID EEPROM: How Auto-Configuration Works

One of the most powerful (and least understood) features of the HAT specification is the ID EEPROM. Here’s how it works in practice:

The Raspberry Pi reserves GPIO pins 0 and 1 exclusively for the ID EEPROM bus (I2C ID). These pins must NOT be used for any other purpose on a HAT. The EEPROM sits at a fixed I2C address (0x50) and stores a structured data format defined by the HAT specification:

  • Header: Magic number, version, reserved bytes
  • Atom 1: Vendor info — manufacturer name, product name, serial number
  • Atom 2: GPIO map — declares which GPIO pins the HAT uses and their default functions
  • Atom 3: Device tree blob — a compiled overlay that the kernel loads automatically
  • Atom 4+: Custom data (manufacturer-defined)

At boot, the Pi’s firmware reads the EEPROM, validates the magic number, and if valid, loads the device tree overlay automatically before the kernel starts. This means drivers are configured, I2C/SPI/UART interfaces are enabled, and GPIO functions are set — all before your Python script or application even starts.

For pHATs without an EEPROM, you need to manually add the relevant overlay to /boot/config.txt. For example, if your pHAT uses I2C:

dtparam=i2c_arm=on
dtoverlay=your-overlay-name

Cross-Compatibility: Can You Mix HATs and pHATs?

This is where many beginners get confused. The good news: electrical compatibility is essentially universal across all 40-pin GPIO Pis. The caveats are physical.

Using a pHAT on a full-size Pi: Works fine. The pHAT plugs into the 40-pin header. It won’t overhang the board cleanly (the pHAT is shorter), but it will function correctly. You just won’t have mounting hole alignment at the far end.

Using a full HAT on a Pi Zero: Electrically compatible, but the HAT physically extends well beyond the Pi Zero’s footprint. You may not have screws to secure it properly. It will work, but it’s mechanically awkward.

Raspberry Pi 5 note: The Pi 5 introduced a new HAT+ specification. HAT+ boards have a revised EEPROM format and allow the board to communicate power requirements to the Pi 5’s PMIC (power management IC). Older HATs are still compatible with Pi 5’s 40-pin GPIO, but they won’t use the HAT+ features like power negotiation.

Key compatibility rule: Any add-on board designed for the 40-pin GPIO header will physically and electrically work on any Raspberry Pi with a 40-pin GPIO connector (Pi 2B, 3B, 3B+, 4B, Zero, Zero W, Zero 2 W, Pi 5). The differences are purely in auto-configuration and physical mounting.

Recommended: Raspberry Pi 5 Model 2GB RAM — an excellent entry point for HAT+ compatible projects, offering the new connector and PMIC integration at an accessible price.

GPIO Pin Usage and Stacking

Both HATs and pHATs use the same 40-pin GPIO header. The pins are identical:

  • Pins 1, 17: 3.3V power
  • Pins 2, 4: 5V power
  • Pin 6, 9, 14, 20, 25, 30, 34, 39: Ground
  • Pins 3, 5: I2C (SDA/SCL) — also GPIO 2/3
  • Pins 19, 21, 23, 24, 26: SPI — also GPIO 9/10/11/8/7
  • Pins 8, 10: UART TX/RX — also GPIO 14/15
  • Remaining pins: General-purpose I/O

Stacking HATs/pHATs: Some manufacturers sell stackable GPIO headers that let you mount multiple add-on boards. However, you must verify that the boards don’t conflict on the same GPIO pins, I2C addresses, or SPI chip selects. GPIO 0/1 (reserved for EEPROM) should never be used by application logic even on pHATs — following this convention avoids conflicts when mixing boards.

A common stacking scenario is combining an RTC (real-time clock) pHAT using I2C address 0x68 with a sensor HAT using I2C address 0x77. As long as addresses don’t collide, both work simultaneously.

How to Choose: HAT vs pHAT for Your Project

The decision comes down to three factors: your Pi model, your project’s space constraints, and whether auto-configuration matters to you.

Choose a HAT when:

  • You’re using a full-size Raspberry Pi (3B+, 4B, Pi 5).
  • You need the board to self-configure without manual setup — great for products or kits for beginners.
  • You need the mechanical rigidity of four mounting points.
  • You’re building something that will run unattended and needs reliable, hands-off initialization.

Choose a pHAT when:

  • You’re using a Raspberry Pi Zero, Zero W, or Zero 2 W.
  • Size and weight are critical (wearables, drones, compact enclosures).
  • You’re comfortable doing one-time manual configuration.
  • You want a lower-cost option (pHATs are often cheaper due to smaller PCB area).
Recommended: Raspberry Pi 5 Model 16GB RAM — the flagship Pi for demanding HAT-based applications like AI inference, multi-sensor data logging, or high-throughput motor control.

Building Your Own HAT or pHAT

If you want to design a custom add-on board, the Raspberry Pi Foundation publishes the full HAT mechanical and electrical specification on GitHub (raspberrypi/hats repository). Key requirements for a compliant HAT:

  1. Use the correct 40-pin right-angle or vertical GPIO connector with a 2.54mm pitch.
  2. Place an M205 EEPROM (or compatible chip like CAT24C32) at I2C address 0x50, connected to GPIO 0 (SDA) and GPIO 1 (SCL) through 3.9kΩ pull-up resistors to 3.3V.
  3. Add a write-protect pin on the EEPROM connected to a jumper or button (so you can program it, then write-protect).
  4. Use the EEPROM Utils tool to compile and flash your vendor info and device tree overlay.
  5. Maintain the specified board dimensions and mounting hole positions.

For prototyping, a DIY HAT prototyping PCB lets you wire up your own circuit on a stripboard-style layout while maintaining the correct form factor and connector placement.

Recommended: 18650 Battery Holder Development Board V3 with Overcharge Protection — pairs perfectly with a HAT or pHAT project requiring portable 5V power for Raspberry Pi 3B/4B.

Frequently Asked Questions

Can I use a pHAT on a Raspberry Pi 4?

Yes, absolutely. A pHAT is electrically compatible with any 40-pin Raspberry Pi, including the Pi 4. It will physically plug in and function correctly. The only difference is that the pHAT won’t cover the full board footprint — it extends only about halfway across. You’ll need to enable the required interfaces (I2C, SPI, etc.) manually since pHATs don’t carry an ID EEPROM for auto-configuration.

Does a HAT work on Raspberry Pi Zero?

Electrically yes — the GPIO header is identical. However, a full HAT (65mm × 56mm) is significantly larger than the Pi Zero (65mm × 30mm), so it will physically overhang the board and you won’t have proper mechanical mounting. If space isn’t a concern, it will function. For proper mechanical fit, use a pHAT-sized board on the Pi Zero.

What is the difference between HAT and HAT+?

HAT+ is the updated specification introduced alongside the Raspberry Pi 5. The key additions in HAT+ are: a revised EEPROM format, the ability for the HAT to communicate its power consumption requirements to the Pi 5’s PMIC (allowing the Pi to adjust its power budget), and a slightly updated PCB design. Older HATs remain electrically compatible with Pi 5 but won’t use HAT+ power negotiation features.

Do all HATs require an EEPROM?

According to the official HAT specification from the Raspberry Pi Foundation, yes — a properly compliant HAT must include an ID EEPROM. However, in practice many boards sold as “HATs” skip the EEPROM to reduce cost. These are technically non-compliant HATs but still work fine — you just need to configure them manually, similar to a pHAT.

What GPIO pins are reserved and should not be used?

GPIO 0 and GPIO 1 (physical pins 27 and 28) are reserved for the HAT ID EEPROM I2C bus. These should never be used for application logic on any HAT or even pHAT, to maintain compatibility and avoid conflicts. All other GPIO pins are available for use unless a specific HAT’s GPIO map claims them.

Conclusion

The HAT vs pHAT distinction comes down to form factor, auto-configuration, and target platform. Full HATs follow the official Raspberry Pi Foundation specification with mandatory EEPROM-based auto-configuration and are sized for full-size Pi boards. pHATs are the compact, Pi Zero-friendly sibling — same 40-pin electrical interface, smaller PCB, no EEPROM requirement, and minor manual setup needed.

For most makers, the choice is simple: pHAT for Pi Zero projects, HAT for full-size Pi projects. Both are widely available, well-supported, and part of the thriving Raspberry Pi add-on board ecosystem.

Ready to expand your Raspberry Pi? Browse our full range of Raspberry Pi accessories and expansion boards at Zbotic — from prototyping HATs to camera modules and sensors.

Tags: add-on boards, GPIO, HAT, pHAT, Raspberry Pi, raspberry pi accessories
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Arduino I2C Tutorial: Wire Lib...
blog arduino i2c tutorial wire library scanner multiple devices 594971
blog ws2812b neopixel 60 led strip projects with fastled 594975
WS2812B NeoPixel: 60+ LED Stri...

Related posts

Svg%3E
Read more

Raspberry Pi Benchmarks: Performance Testing All Models

April 1, 2026 0
Table of Contents Introduction and Use Cases Hardware Requirements Software Installation Configuration and Setup Testing and Validation Advanced Features Troubleshooting... Continue reading
Svg%3E
Read more

Raspberry Pi PoE: Power Over Ethernet Setup Guide

April 1, 2026 0
Table of Contents Introduction and Use Cases Hardware Requirements Software Installation Configuration and Setup Testing and Validation Advanced Features Troubleshooting... Continue reading
Svg%3E
Read more

Raspberry Pi GSM HAT: SMS and Cellular IoT

April 1, 2026 0
Table of Contents Introduction and Use Cases Hardware Requirements Software Installation Configuration and Setup Testing and Validation Advanced Features Troubleshooting... Continue reading
Svg%3E
Read more

Raspberry Pi RS485: Industrial Sensor Network

April 1, 2026 0
Table of Contents Introduction and Use Cases Hardware Requirements Software Installation Configuration and Setup Testing and Validation Advanced Features Troubleshooting... Continue reading
Svg%3E
Read more

Raspberry Pi CAN Bus: Vehicle OBD2 Data Reader

April 1, 2026 0
Table of Contents Introduction and Use Cases Hardware Requirements Software Installation Configuration and Setup Testing and Validation Advanced Features Troubleshooting... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now