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 PCB Manufacturing

Raspberry Pi HAT PCB Design Tutorial

Raspberry Pi HAT PCB Design Tutorial

April 1, 2026 /Posted by / 0

Designing a Raspberry Pi HAT PCB follows the official HAT (Hardware Attached on Top) specification that ensures mechanical compatibility, automatic configuration, and a professional finish. Whether you are building a custom sensor board, motor controller, or industrial interface, this tutorial covers the complete HAT design process from dimensions to ID EEPROM.

Table of Contents

  • HAT Specification Overview
  • Mechanical Dimensions
  • GPIO Header Layout
  • ID EEPROM (Optional)
  • Design Guidelines
  • Example: Sensor HAT Design
  • Frequently Asked Questions
  • Conclusion

HAT Specification Overview

The Raspberry Pi HAT specification defines:

  • Board dimensions (65×56.5mm) matching the Pi’s mounting holes
  • 40-pin GPIO header location and keep-out zones
  • Mounting hole positions for the 4 standoff pillars
  • Optional ID EEPROM for automatic driver loading
  • Power requirements and GPIO usage rules

Following the HAT spec ensures your board physically fits, does not interfere with ports, and can optionally auto-configure when plugged in.

Mechanical Dimensions

  • Board size: 65 x 56.5mm (can be shorter in Y direction but not wider)
  • Mounting holes: 4x M2.5 at positions (3.5, 3.5), (3.5, 52.5), (61.5, 3.5), (61.5, 52.5) mm from bottom-left corner
  • GPIO header: 2×20 pin, 2.54mm pitch, positioned at (29, 50.5) mm centre of pin 1
  • Height: Components on top should be under 12mm to allow stacking
  • Corner radius: 3mm rounded corners
🛒 Recommended: Waveshare PCIe to M.2 Adapter HAT for Pi 5 — Example of a well-designed HAT following the official specification with proper dimensions and mounting.

GPIO Header Layout

The 40-pin GPIO provides access to power, I2C, SPI, UART, and general-purpose I/O:

  • Power pins: 5V (pins 2,4), 3.3V (pins 1,17), GND (pins 6,9,14,20,25,30,34,39)
  • I2C: SDA (pin 3, GPIO2), SCL (pin 5, GPIO3). Also used for ID EEPROM
  • SPI: MOSI (pin 19), MISO (pin 21), SCLK (pin 23), CE0 (pin 24), CE1 (pin 26)
  • UART: TX (pin 8, GPIO14), RX (pin 10, GPIO15)
  • ID EEPROM: Dedicated I2C bus on ID_SD (pin 27) and ID_SC (pin 28)

ID EEPROM (Optional)

The HAT ID EEPROM stores device tree overlay information that automatically configures the Pi when your HAT is plugged in. This is optional for hobby projects but required for official HAT compliance. Use a CAT24C32 or similar 32Kbit I2C EEPROM connected to the dedicated ID_SD and ID_SC pins (GPIO0 and GPIO1).

Design Guidelines

  • Use KiCad or EasyEDA HAT templates for correct dimensions
  • Place the 40-pin header first and lock its position
  • Keep the area around the Pi’s camera and display connectors clear
  • Route I2C and SPI traces with appropriate pull-ups
  • Add status LEDs connected to spare GPIO pins
  • Include reverse polarity protection if the HAT provides external power to the Pi

Example: Sensor HAT Design

A basic sensor HAT might include:

  • BME280 temperature/humidity/pressure sensor (I2C)
  • ADS1115 16-bit ADC for analog inputs (I2C)
  • Status LED on GPIO17
  • Screw terminal for external sensor connections
  • ID EEPROM for auto-configuration

This design uses only 4 GPIO pins (I2C + LED + ID EEPROM), leaving the rest available for other purposes or stacked HATs.

🛒 Recommended: Waveshare DIN Rail Case for Pi 5 — Industrial enclosure that accommodates Pi with HAT for professional deployment.

Frequently Asked Questions

Can I make a HAT for the Raspberry Pi 5?

Yes, the Pi 5 uses the same 40-pin header layout and mounting holes. The HAT specification is backward compatible across Pi 2/3/4/5.

Do I need the EEPROM for my HAT to work?

No, the EEPROM is optional. Without it, you manually configure device tree overlays in config.txt. The EEPROM just automates this process.

Can I power the Pi from my HAT?

Yes, you can back-power the Pi through the 5V GPIO pins. Include a fuse and reverse polarity protection. Do not exceed 3A total for Pi 5.

Conclusion

Designing a Raspberry Pi HAT is an excellent PCB project that combines mechanical precision, digital design, and the satisfaction of creating a professional-grade add-on board. Start with the official dimensions, add your circuit, and follow the HAT specification for a board that fits perfectly and works reliably.

Find Raspberry Pi accessories and HAT references in our Waveshare collection.

Tags: Design, HAT, PCB, Raspberry Pi, tutorial
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
ESP32 Custom PCB: From Breadbo...
blog esp32 custom pcb from breadboard to production board 612885
blog voltage regulator guide lm7805 ams1117 and ldo selection 612889
Voltage Regulator Guide: LM780...

Related posts

Svg%3E
Read more

PCB Industry India: Market Size, Players, and Trends 2026

April 1, 2026 0
India’s PCB industry is at an inflection point. Driven by government initiatives like Make in India and PLI (Production Linked... Continue reading
Svg%3E
Read more

PCB Certification: UL, CE, and RoHS Compliance India

April 1, 2026 0
Electronics products sold commercially in India and internationally must meet safety, environmental, and electromagnetic compatibility standards. Understanding which certifications your... Continue reading
Svg%3E
Read more

PCB Storage: Moisture Sensitivity and Shelf Life

April 1, 2026 0
Improper PCB storage leads to moisture absorption, copper oxidation, and solderability degradation — all of which cause assembly defects and... Continue reading
Svg%3E
Read more

PCB Depaneling: Router, Laser, and Punch Methods

April 1, 2026 0
Depaneling separates individual PCBs from the manufacturing panel after assembly. The method you choose affects board edge quality, component stress,... Continue reading
Svg%3E
Read more

PCB Pick and Place: Component Feeder Setup

April 1, 2026 0
Pick and place machines are the workhorses of SMT assembly, placing hundreds to thousands of components per hour with sub-millimetre... 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