Build HAT
By Ben Everard. Posted
This article was originally published as part of HackSpace magazine, which has since been incorporated into Raspberry Pi Official Magazine.

LEGO® has introduced generations of children to making. The little blocks slot together in almost endless possibilities and, if you add in mechanical components from Technic sets, you can create some complex builds.
Through the years, LEGO® has built a few different programmable electronics systems for adding silicon brains to your builds. MINDSTORMS® and SPIKE Prime Sets have given users an interface for controlling their plastic bricks with code and, through this, have introduced countless children to physical computing.
Advertisement
Starter electronics: how to build and program circuits with a Raspberry Pi or Raspberry Pi Pico.
Of course, LEGO® is not the only organisation helping children learn physical computing, so perhaps it’s inevitable that LEGO® and Raspberry Pi have worked together to create the Build HAT. This add-on to Raspberry Pi computers lets you control the latest generation of LEGO® motors and sensors from Python code running on your Raspberry Pi. Here, of course, you have access to the full range of modules and hardware that you can usually connect to your Raspberry Pi. With extended headers, you can connect additional HATs, or other components, to the GPIO pins as long as they don’t use the UART connection (14 and 15).
To make it easy to mount your Raspberry Pi, LEGO® has created the Maker Plate. This lets you attach your Raspberry Pi securely to your build.
More power
While you can power the Build HAT directly from Raspberry Pi, the motors run at 7.5 V, so you’ll need an additional power connection to the barrel jack on the Build HAT if you want to run motors. Raspberry Pi has also launched an official power supply for this.
There are four connections on the Build HAT that can talk to sensors and motors from the SPIKE Prime kits, or the most recent generation of LEGO® Technic. The available options include motors with integrated sensors for precise control, distance sensors, force sensors, colour sensors, LED matrices, and more.
The Build HAT and power supply are available now from all the usual Raspberry Pi suppliers, for $25 and $15 respectively.
While the Build HAT was designed for education, there’s plenty for makers to get their teeth into. Want to live-stream video from your LEGO® car? Add a Raspberry Pi camera. Want to trigger your LEGO® build from data on the internet? If you can get the data onto your Raspberry Pi, you can send it to your LEGO® build. Want a platform to quickly prototype an idea for a project? There aren’t many quicker ways of building than plugging LEGO® bricks together.

Ben is the Editor of HackSpace magazine. When not wrangling words, he enjoys cycling, gardening, and attempting to identify wild mushrooms.
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles

Starter Electronics in Raspberry Pi Official Magazine 157
After you’ve built your own simple circuit, why not think a little bit bigger – like building a product, and getting that product verified as officially Powered By Raspberry Pi? We take a look at some of the brilliant gadgets with Raspberry Pi at their heart. If you want to build a submarine, you might […]
Read more →

Win one of three Raspberry Pi 500 desktop kits
Everything you need for a PC, add your own monitor
Read more →

Picocomputer 6502
The Picocomputer 6502 is truly open-source hardware.
Read more →
Sign up to the newsletter
Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.