New Part Day: Raspberry Pi LEGO HAT

The Raspberry Pi Foundation have been busy little bees for the last couple of years producing their own silicon, new boards and now in collaboration with the LEGO Education team a new HAT to connect to the LEGO SPIKE education platform. This new HAT board will work with every Raspberry Pi board with a 40-pin GPIO header.

Based on the RPI2040 microcontroller, it makes an interesting detour away from dumb slave boards, although it looks like the firmware is closed (for now) so you’ll have to make do with the pre-baked capabilities and talk to it with the supplied python library.

According to the documentation, the communication between the Pi and the RPI2040 nestled beneath the HAT PCB is plaintext-over-serial, freeing up the majority of the GPIO pins for other uses. The board uses a surface mount pass-through type header which allows pins from the Pi to protrude through the PCB, allowing stacking more HATs on top. Curiously they decided to mount the PCB with active parts facing down, giving a flat rear surface to park things on. We suspect that decision was made to improve access to the LPF2 connectors, especially if they were surface mount parts.

Compatibility with LEGO hardware is also fully documented, including the Spike Education portfolio, which comprises motors, a colour sensor, force sensor, and a distance sensor amongst others. Some parts from the mindstorms robot inventor kit as are also supported. LEGO have also introduced a new part, that they are calling the ‘maker plate’ which is specifically designed for mounting ‘SBCs’ but doesn’t specify which ones. Clearly it looks like it will take Pi3/4 board, but we’ll leave it to them to clarify other support.

A new higher-power power supply brick is also introduced, which feeds 8V into that barrel jack you may have noticed, as you may be aware, LEGO motors can pack quite a punch and trying to power those from the Raspberry Pi GPIO header will only end in frustration.

We’ve seen an enormous array of LEGO hacks over the years, and this new product is not the first hackable solution we’ve seen. Just checkout this Open Source Evlōno One for starters. This new product however is a nice example of a reasonably open company getting into bed with an established player and producing something cool and that is a good thing.

Thanks [Qes] for the tip!

18 thoughts on “New Part Day: Raspberry Pi LEGO HAT

    1. It’s made by a big corporation (Lego), and corporations tend to only think about making money through monopolies of the things they design. It doesn’t look like it would be so terribly hard to reproduce. You just need to find someone dedicated enough to do it.

      Personally, I find that the Lego Mindstorm stuff is just dumbed down versions of standard modules that you pay more money for. Since I don’t need the dumbing down of RJ-whatever jacks and plastic enclosures on everything, I avoid it all. I’d rather just wire up a module and avoid the hat.

      1. Lego have with the Mindstorms range usually put up more than enough details on the how it all works, much as I love open source like the Pi itself this Lego board doesn’t need to be fully open, or even any of it open firmware wise, is not actually needed for its purpose in life… It is just simpler for them to keep everyone on the same ‘official’ firmware for the support team – though with how good Lego were about the RIS and all its various alternative firmwares hopefully this will work out the same…

        In this age of things like the Arduino and Pi maybe Lego Mindstorms stuff is now rather pricey for what it contains electronically, though like the first Pi the early RIS Mindstorms were very very cheap for what they were as a hobbyist such potent and useable for the day little chips were not at all easy to get in affordable quantities or at all even with all the NDA type bollocks.

        And you have to remember the price isn’t really about the electronics, its about it being Lego – so safe, well made, so tough enough to give to your kids, hugely reconfigurable parts, won’t go letting out the magic smoke anywhere near as easily and the plastic enclosures you are down on are part of the magic of Lego Mindstorms – something you can build, and rebuild as much as you like, all without needing to play with the power tools, and sharp cutting devices…

        I actually bought a heap of the early Mindstorms RCX units when I saw a stack of them cheap – simple barrel jack or battery powered, decent little motor driving capability, and sensors – its a good board for many things in a nice all in one package, with sturdy enclosure as well… Plus its Lego, and despite moving on to the more dangerous self-amputation if you make an error devices in building stuff and more complex electronics now its still great fun, and can do a great deal.

        The only thing I wish LEGO had done is used standard RJ jack rather than offset clip ones for the NXT and EV3 Mindstorms range – moved away from those fun but fiddly expensive electric bricks to something that should have be easy to get in any length you liked… Though as its for kids making it impossible to plug your Lego into the phone socket it was probably a good idea…

        Probably nobody reading this webpage is really the intended audience for the product, its for your children, so they can learn and play with something like mum/dad/uncle does in a way that will work out quite cheap for their earlier years, no magic smoke from expensive bits, no static worries. And with the integration into a Pi it opens up a whole world of further expansion as they get older. The fact the adult fans of Lego will probably make magic with it is just a bonus…

        1. The only thing I wish LEGO had done is used standard RJ jack rather than offset clip ones for the NXT and EV3 Mindstorms range

          the *really* annoying thing they did was use offset jacks that are offset in the opposite direction as the ones DEC used for their RS-423 ports back in the day.

    1. When I was a kid, the ultimate lego was a brick with a lightbulb in it. Used with some odd battery that I think wasn’t available in North America.

      I don’t remember motors, but maybe that was out of my price range. This was the sixties, and much of it bought the year we spent in Denmark

      1. When I was a kid, I remember when LEGO introduced a block with a motor inside, probably in the late 60’s or early 70’s; hard to exactly remember now, except that they had a Christmas display with it featured. They had one at the local store where my grandmother shopped, and on one trip, I took her to the toy department to ask if I could get it. When she saw the price, US $13-15 (which I think was the equivalent of maybe ~$100 today), I was turned down (and quite sad).

        1. I was a child in the 90s and received as a gift a Lego motor add on to a Lego kit I’d received previously, it was great except that it needed 6 or 8 AA cells so I could realistically never play with it.

  1. I would like to think this is a precursor to having the RP2040 ‘integrated’ as part of the RPI board. To me it is a logical next step to get some real-time capability, analogs, and other capability onboard the RPI. You might say the ‘missing link’. Sure right now you can just use a Pico via USB to the RPI and get the capability, but it would cleaner to have on board with another row or rows of pins. Talk either USB or serial ‘internal’ for communications and program loading. I’d even be happy with a generic 2040 hat without the USB connection and power the whole thing with the above jack. Other than this Lego board, I don’t see such a hat out there yet.

    With that off my chest, I don’t have a need/want for the above product as is.

    1. > I would like to think this is a precursor to having the RP2040 ‘integrated’ as part of the RPI board. To me it is a logical next step to get some real-time capability, analogs, and other capability onboard the RPI

      We could call it a Beagle Bone :)

      1. Thanks for the reminder. Not sure ‘why’ my mind always goes to the RPIs (and now RP2040 boards, Arduinos, Metro….) to do anything. The Arm Beagle Bone(s) are there already with analogs and PRUs onboard. I have a Black but I found (a couple years ago now?) that is was harder to setup and get going. Might have to dig that out again. I see they have Green, Blue, Pocket, AI, etc. Beagles to play with. Lots of ‘choices’! Hmmm. Might have to investigate/evaluate these boards again.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.