Sorting Two Tonnes Of Lego

Have you ever taken an interest in something, and then found it’s got a little out of hand as your acquisitions spiral into a tidal wave of bags and boxes? [Jacques Mattheij] found himself in just that position with Lego. His online purchases had run away with him, and he had a garage packed with “two metric tonnes” of the little coloured bricks.

Disposing of Lego is fairly straightforward, there is a lively second-hand market. But to maximise the return it is important to be in control of what you have, to avoid packaging up fake, discoloured, damaged, or dirty parts. This can become a huge job if you do it by hand, so he built a Lego sorting machine to do the job for him.

The machine starts with a hopper for the loose Lego, with a slow belt that tips individual parts down a chute to a faster belt derived from a running trainer. On that they run past a camera whose images are analysed through a neural net, and based on its identification the parts are directed into appropriate bins with carefully timed jets of compressed air.

The result is a surprisingly fast way to sort large amounts of bricks without human intervention. He’s posted some videos, one of which we’ve placed below the break, so you can see for yourselves.

Lego has appeared so many times on these pages that it’s difficult to pick links, but automated sorters it’s a bit easier. How about sorting M&Ms and Skittles, or maybe automatic resistor sorting.

Thanks [Robert] for the tip.

28 thoughts on “Sorting Two Tonnes Of Lego

    1. When making potato chips they use a cam and multiple solenoid to pulse jets of air, blow away the burned ones. This has been around a while, and from what I see here is becoming quite improved!

  1. Of course, he should have made the machine itself out of Technic, that programmable brick thing they have, and some old Lego pneumatic parts. But it’s probably more practical this way. Amazing that he’s got it working, well done. I might keep hold of it after he’s done, Lego has a way of getting mixed back up again.

    1. Or something that looks like those programmable bricks, maybe a Gameboy with a custom cartridge containing a ROM and some GPIO chips (e.g. 6522 or 8255). BTW, interfacing to Lego Technic stuff is easy if you can get the proprietary (Lego-based) connector or don’t mind cutting cables.

        1. Use the Arduino to run a 3d printer that creates an enclosure box for the Raspberry Pi that you use as a desktop environment to write the code that procedurally generates the plans for the Lego Lego sorter which are then sent out to an on-demand Lego building service.

    1. Looks like it currently is separating large lego from small logo, and then parts that are either not lego, blocks stuck together, or special blocks, make it to the last bin.

      1. Neat idea. If the machine is versatile enough and if there’s an easy way to input the kit BOM then he could store all pieces in one big unsorted container and only do “sort on demand” for just the pieces needed for this or that kit.

        I’d love to have a GENERAL PURPOSE ON DEMAND SORTING MACHINE. Instead of keeping nuts, bolts, screws, nails and so on in separate compartments just toss them in a big bin and let the machine sort things out on request. Same for resistors and other electronics components.


          Working on it. Will eventually be on .io.
          I’ve got a lot of learning to do. Will start with Arduino or Propeller or something that holds my hand (because I’m a noob with too many ideas) and then eventually port to a “real” language.

          My goal is to be able to bring a bolt or nut to an optical scanner, scan item, and be able to select the same exact thread and length or larger, smaller, washers that would fit, similar thread, nuts/bolts that match, ect…
          It is a life-goal to at least try, even though it would be reinventing a wheel IMO.

  2. The start sentence reminds me of the one time i was talking with a coworker of how one calls severed body parts and ended up giving a presentation about conservation of dead tissue for display purposes with a conserved human toe as example

  3. I would think that sorting by piece function would be more useful than sorting by color,never ceases to amaze me,
    the things people think up,although an obsessive person like me would have sorted them a long time ago.

    1. Completely agree. It’s easy for you to find red ones in a group of different colored legos even at a glance, not as easy identifying a 1×4 in a mix of different shapes of all the same color. @_@

      1. I think it’s easy to sort using both hands. At the first pass you only pick (with both hands) only a certain category of bricks (all 2×3, 2×4, 2x….), what is not in this category, goes into a temporary bin, from where you start the second sorting pass. Of course, you should start with the most abundant type, then continue with the second most abundant and so on.
        After sorting all bricks in several big buckets/heaps, you can start sorting each one further by size, color, degradation, etc.

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.