This post is my notes for attaching a raspberry pi to Lego to run power functions / powered up motors and hopefully start by build a train!
- Ive got the track - purchased ✅
- Train motor - purchased ✅
- A pi 3 B+ - lying around should I swap for a 0 W2?
- A power supply ❌
- A builder hat or BrickPi if still available and compatible ❌
- A method of attaching a pi to base plate without glue or modifications to either or.
Thinking outside of the brick
I raided my sons Lego today to try and find some suitable standoffs. You may have wondered about bars, all bar like elements have a diameter of 3.18mm (Lego has crazy tolerances and intentions beyond accident) that means that all hands, clips, bricks with holes, jumpers you name it they all fit around that size. Not only do I find that fascinating I thought maybe the pi’s standoff holes may fit a bar… sadly I was mistaken they are a hair to large.
As far as I know there aren’t many things smaller in lego as I mentioned, after many desperate attempts (including bananas) to find some Lego, I searched deep in my brain, and thought > What about minifigures? I took off the hands and used the reverse end and it fits! It fits so well I built a hole scaffolding around it.
As you can see the severed hands of minifigure stumps wearing the pi like a bracelet 😬, the “bone” of the wrists serve as compression fittings and the bar underneath is now supporting the pi with full adjustment in all directions! it’s good to know that the plate size (ice blue) is perfect but the pi needs to be on 2x2 jumpers to offset its position, this isn’t stressing any parts which is crazy!
I’m going to change the design a little, adding cross bars underneath and 1x1 clips mounted straight onto the base, I will continue to use those pieces with the skinny tiles wall as they allow the pi to fit.
I’m also thinking about making this even smaller if the pi zero w 2 can drive the motors and run code fast enough!
Many thanks 🙏
I’m an AFOL now it seems