Lego Sorting - automating
- Rockets and Robots

- Aug 15, 2019
- 3 min read
Updated: May 25, 2020
Once upon a time, we tried to build a Lego Cooking Icing Machine. We just had to find the right parts, hiding among the tens-of-thousands of parts spread out on a 4' x 8' table. After several hours trying to find those parts, we gave up.
Fast forward, after part sorting (manually, by me)...
Once upon a time - we BUILT a Lego Cookie Icing Machine. We found the parts easily and built it quickly. The kids had fun and the iced cookies were delicious!

I've taught Lego clubs with Mindstorms EV3 and WeDo (1.0 and 2.0). Kids love Legos and parents like the idea that their kids can learn programming and robotics at a relatively young age. When you have limited time each week and parts aren't sorted, it SIGNIFICANTLY increases how long it takes to build robots that they can program, which decreases how much time they have left for programming. It can be demoralizing. Having the parts sorted to find things easily helps immensely.
Sorting takes a lot of time and you might need a massage therapist or a chiropractor to work the kinks out of your neck. Even worse, in many cases parts don't stay sorted for very long. In a controlled environment, like at The Maker Spot, where I used to volunteer to teach EV3 programming, the kits are checked out and in, so the parts stay pretty organized. It was easy for kids to find parts for a simple bot. Everywhere else, where there's not strict kit isolation like that, sorted Legos are magnets: like parts repelling from each other in order to connect to other parts. But that's the point of Legos! They are supposed to be messy, connecting with each other in infinite different ways. The possibilities are not limited by a person's imagination; Legos help EXPAND the person's imagination to new possibilities. So let the play be messy (just don't let a human who sorted them see their hours of work get undone into that lovely creative mess).
Robots aren't like petty meat bags though. A bot, endowed by its creators to sort Legos, is serving its purpose when it's has more Legos to sort. The kids are really doing it a favor by messing them up it's a win-win. Ladvien and I are working on a Lego sorting bot. It's not the first time it's been done; but we're doing it and we're going to tell others about it. So follow us on our journey.
---
First off, there are A LOT of different Lego parts. We're going to jump start our project by inviting other projects people have made available to our party (or inviting ourselves to their parties, whichever way you see it).
Lego database: Rebrickable has already done the legwork on this one, and does monthly updates, so we'll let them keep doing that and use their downloads to save ourselves a bunch of work. Thanks Rebrickable!
Lego CAD files: LDraw is the place to be for these files. Look around and you'll find that many other sites and software that render Lego parts, including Rebrickable, use LDraw's .dat files. They have downloads and regular updates too, so they're in.
Generating images for Machine Learning: Since we're going to be working in Python, and pyldraw can handle LDraw's .dat files, we're going to give it a go.

Comments