Today we have huge smiles on our faces as we announce the Raspberry Pi Build HAT, a brand-new product that for the first time makes it easy to integrate LEGO® Technic™ motors and sensors with Raspberry Pi computers. We’ve designed it to enable fun and creative learning experiences for young people, teachers, and makers.
Raspberry Pi Build HAT
The Build HAT is part of an exciting new collaboration between Raspberry Pi and LEGO® Education to increase the impact and reach of STEAM learning. We’re really thrilled about the possibilities this new team-up will bring, as is the LEGO Education team. “We are excited to work with Raspberry Pi to provide tools for students, teachers and makers all over the world to expand their creative digital skills and discover hands-on learning experiences,” said Andrew Sliwinski, Head of Product Experience, LEGO Education.
Raspberry Pi meets LEGO® Education
The Build HAT (Hardware Attached on Top), priced at $25, is a new add-on board for your Raspberry Pi. It connects to the 40-pin GPIO header and can be used to control up to four LEGO® Technic™ motors and sensors from the LEGO® Education SPIKE™ Portfolio.
The new HAT works with all 40-pin GPIO Raspberry Pi boards, including Raspberry Pi 4 and Raspberry Pi Zero. With the addition of a ribbon cable or other extension device, you can also use it with Raspberry Pi 400.
The cool design of the Build HAT means that all the components are on the bottom, leaving room on the top of the board for LEGO Minifigures to hitch a ride, or for a mini breadboard. You can connect the HAT directly to your Raspberry Pi with the attached header, using 9mm spacers to ensure a stable fit, or you can add an extra-tall header to keep the unused GPIO pins accessible. Whichever method you choose, make sure you position the Build HAT the right way round when installing it on your Raspberry Pi!
Like Raspberry Pi Pico, the Raspberry Pi Build HAT uses the RP2040 chip developed right here at Raspberry Pi.
The power of LEGO® bricks with Raspberry Pi
The LEGO Technic motors are really powerful. And like most motors, to drive them you’ll need an external 7.5V power supply. Fortunately, the Build HAT isn’t the only new product we are launching today: we’ve also created a brand-new power supply for the Build HAT that’s reliable, rugged, and perfect for making the most of those motors. It’s priced at $15.
If you just want to read from motor encoders and the SPIKE force sensor, you can power your Raspberry Pi and Build HAT the usual way, via your Raspberry Pi’s USB power socket. The SPIKE colour and distance sensors, like the motors, require an external power supply.
LEGO® Education SPIKE™ Prime
The LEGO Technic devices included in the SPIKE Portfolio are perfect for rapidly prototyping your next robotics or physical computing project. The available sensors include a distance sensor, a colour sensor, and an incredibly versatile force sensor. The angular motors, which come in a range of sizes, include integrated encoders you can query in order to find their position. That means you can precisely control your creation’s movement, or use the encoders as input devices in their own right.
You can get LEGO Technic devices as individual items, or together with a collection of really useful stuff in the SPIKE Prime and SPIKE Prime Expansion sets. The latter includes an exclusive LEGO element, the first-ever designed to connect to something that isn’t another piece of LEGO: the Maker Plate. The Maker Plate is designed to make it super easy to add a Raspberry Pi to your LEGO construction. But don’t worry, there are plenty of other creative ways to mount your Raspberry Pi if you don’t have a Maker Plate.
We’ve compiled a list of all the compatible LEGO elements you can use with the Build HAT, so you can check what will work best for your project.
New Build HAT Python library
To make it really easy to build prototypes that combine Raspberry Pi’s computing power with your LEGO brick collection, we’ve created a Python library for the Build HAT that should feel familiar to anyone who has used other Raspberry Pi libraries like gpiozero or the one for the Sense HAT.
The Build HAT library already supports all the LEGO Technic devices included in the SPIKE Portfolio, along with those from the LEGO® MINDSTORMS® Robot Inventor kit and other devices that use an LPF2 connector.
Brand-new Build HAT projects
There are loads of amazing educational projects available using SPIKE Prime. Adding Raspberry Pi and a Build HAT into the mix gives learners more options for creativity and flexibility in their projects, enabling them to go even further and take their making adventure to the next level: now they can have a programmable, networked computer with access to online data sources at the heart of their build, plus they can easily add more electronic components via Raspberry Pi’s GPIO pins.
To support learners to get started using the Build HAT and programming their LEGO Education builds, we’ve got five brand-new online Build HAT project guides that will help them gain confidence as makers. You’ll find the projects fun, accessible, and engaging! Follow them to make your own DIY game controller and get hands-on with some retro-gaming action, or to create a robot buggy that you steer with your phone via Bluetooth.
Then explore the topics of computer vision and machine learning by building an expressive robot face, and look at new ways of representing local and online data by creating a plotter or data dashboard.
We’re already working on more Build HAT project guides for learners. In the meantime, we’d love to see what you will make with your Raspberry Pi computer, Build HAT, and your much loved collection of LEGO bricks. Share your favourite creation using the hashtag #BuildHAT.
Credits and thank yous
It’s fair to say that creating the Build HAT and everything that supports it has been a massive project over the last couple of years. Here’s a necessarily incomplete list of people we want to thank for contributing to the Build HAT and the Raspberry Pi Build HAT projects:
Lauren Hancock, Anthony Morton, Mark Owen, Dominic Plunkett, Simon West, Carrie Anne Philbin, George Boukeas, James Robinson, Marc Scott, Mark Calleja, Greg Annandale, Chris Richardson, Martin O’Hanlon, Rik Cross, Faye Magellan, Sam Alder, Helen Lynn, Jack Willis, Brian O Halloran, Jan Ander, Olympia Brown, Sarah Millar, Rhodri James, Gawain Edwards
Plus our friends at LEGO Education: Marianne Nytoft Bach, Jane Damgaard, Jesper Elling, Eva Guldmann, Arthur Sacek, Peter Thesbjerg, Ralph Hempel, Tobias Thyrrestrup, Zoe Bergeal, Gitte Grønborg, Andrew Sliwinski