How Can You Attach a HAT or Expansion to a Raspberry Pi 400?

2022-08-26 08:37:23 By : Mr. james jia

Use a ribbon cable or breakout adaptor to connect a HAT or expansion board to the Raspberry Pi 400.

A complete personal computer built into a compact keyboard, the Raspberry Pi 400 is an excellent low-cost option for desktop computing. With a wide range of applications available in Raspberry Pi OS, you could even use it as a Linux-based replacement for an old Windows PC or Mac.

Based on a custom version of the Raspberry Pi 4 board, the Pi 400 has the same processing power and most of the same ports on the rear. These include a 40-pin GPIO header for connecting electronics including add-on boards. Can you attach a HAT to the Pi 400? Yes you can.

The only problem is that, while they should still work (with a header booster), standard Raspberry Pi add-on boards will face toward the rear when connected. So how can you best connect a HAT or other expansion board to the Raspberry Pi 400? We explore the options.

The first method for using standard HATs and expansion boards with the Raspberry Pi 400 is to connect them to its GPIO header via a 40-pin ribbon cable.

You’ll want to ensure that your ribbon cable has female connectors on one end, to fit onto the Pi 400’s GPIO pins, and male pins on the other end so you can attach your HAT.

The other important thing to check is that the cable is connected the right way up on the GPIO header, and also that the HAT is positioned the right way round at the other end. Otherwise you may get a short circuit that could potentially damage the Pi 400 and/or the HAT.

The Pi Hut HAT Ribbon Cable for Raspberry Pi 400 has special notches on its male and female connectors to help you get the orientation right for the Pi 400 and the HAT.

The other main option for connecting a HAT or expansion board to your Pi 400 is an adaptor that breaks out the computer’s 40 GPIO pins onto a board for easy connection.

The Raspberry Pi 400 GPIO Header Adapter from Waveshare is a particularly good example as it features helpful labelling and color-coding for its two sets of GPIO pins. So you could connect two smaller ‘pHAT’ boards to it, or one pHAT and a full-size HAT, or one board and some individual electronic components.

Other similar breakout boards are available, including the SB Components Raspberry Pi 400 Dual HAT Expansion available from The Pi Hut.

Related: Accessories to Get the Most Out of Your Raspberry Pi

In addition, there are a few HATs and boards that have been designed specifically to work with the Raspberry Pi 400. These include the following.

Related: What Can You Do With a Raspberry Pi 400

Using a ribbon cable or a breakout adaptor, it is possible to connect any standard HAT or other add-on expansion board to your Raspberry Pi 400 without it facing the wrong way. This is crucial for HATs with an LCD display or LED matrix which would otherwise point to the rear of the Raspbery Pi 400.

Once connected correctly, the HAT should then work exactly as on a standard Raspberry Pi model, using the same software. As always, check the HAT manufacturer’s website for details on how to install the software and use it.

We hope you like the items we recommend and discuss! MUO has affiliate and sponsored partnerships, so we receive a share of the revenue from some of your purchases. This won’t affect the price you pay and helps us offer the best product recommendations.

Phil is the Junior Editor for DIY projects at MUO and a freelance writer and editor with 20+ years of experience. He has edited numerous official Raspberry Pi books and is a regular contributor to The MagPi magazine.

Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!