Raspberry Pi introduces HAT for Lego
Raspberry Pi has introduced a new ‘Build HAT’ add-on. This makes it possible to program LEGO’s Spike robot components via the Pi. Certain other Lego sets, such as Mindstorm’s Robot Inventor, are now so programmable.
With the Build HAT, all Lego robot components that use an LPF2, or LEGO Power Functions version 2 connector can be programmed with the Raspberry Pi. This includes at least the Spike sets from LEGO Education, for which this HAT was specifically made. Raspberry Pi itself reports that the Robot Inventor set from the LEGO Mindstorms collection is also compatible. The Build HAT costs $25. It is not yet known when the board will be released.
The Spike sets already come with a hub with which Python programs can be stored and run. Other than that hub, the Raspberry also includes GPIO pins. While the Build HAT itself needs to be wired with those pins, the unused pins allow users to add more components, which should give extra flexibility when creating projects, according to Raspberry.
The Build HAT consists of an RP2040 microcontroller. It also has ‘only’ four LPF2 connectors, as opposed to the six on LEGO’s own Spike hubs, which operate the LEGO motors and sensors. The HAT can be connected to all Raspberry Pi boards with a 40-pin GPIO header, although an additional GPIO extension cable is required for connection to the Raspberry Pi 400. To program connected Lego components with the Build HAT, Raspberry Pi has created a corresponding Python library.
Raspberry Pi separately sells a 48W power supply for this expansion board, which, according to the company, can supply power to the HAT, the connected Lego motors and the Raspberry Pi itself. This power supply will cost fifteen dollars.