Sorting It Out

This machine takes the pain out of sorting LEGOs — just throw piles of bricks on the conveyor and it will do the rest of the work.

nickbild
29 minutes ago Robotics
This machine sorts piles of LEGO bricks (📷: LegoSpencer)

Ever since 3D printers came along, at-home manufacturing of random parts has become exponentially easier. The kinds of quick and dirty hacks people used in the past are no longer necessary. There is no need for an elaborate LEGO build to make a case for a DIY electronic gadget when a 3D printer can produce one that is a perfect fit and precisely tailored to the application in every way.

But while LEGOs are no longer needed for at-home manufacturing, they are objectively cooler than 3D prints. It is safe to say that people with a love for engineering will not stop buying LEGOs any time soon. As such, there are many businesses that have sprung up over the years to supply these individuals with the exact parts they need — no matter how exotic or rare.

These vendors have to sort and classify LEGO bricks by the ton so that everything is in its proper place when it comes time to fill a customer’s order. But as everyone that has ever played with LEGOs knows, cleaning up is not the fun part. In fact, with that kind of volume, it is a nightmare.

Computer vision helps control the flow of bricks (📷: LegoSpencer)

YouTuber LegoSpencer realized there was an opportunity for improvement in this area. Manual sorting of bricks is a huge pain, but with a machine to do the work, it would take no effort at all. So he set out to build a machine with a design that is both reproducible and extensible, such that anyone could use it to sort an arbitrarily large number of random LEGO bricks.

Getting to that goal would require perfecting three main components: a feeder to separate piles of bricks, an identification system to classify each brick, and a distribution system to put each unique brick type in its own storage bin.

For the feeder, LegoSpencer used a slowly-moving conveyor belt to help separate pieces as they dropped onto a vibrating channel. The vibrations help to further separate the pieces, but this alone was not enough to do the job. A drop onto a second vibrating channel was introduced to totally separate the bricks, but in some cases, it was found that the flow from the first channel needed to be delayed to prevent parts from piling up. To get around this problem, a computer vision algorithm was developed to detect LEGO bricks sitting at the start of the second channel. Using this information, parts are only allowed to drop when the area below is clear.

A look at the control circuit (📷: LegoSpencer)

Building the identification system was the easiest part of all, because it is already a solved problem. An API for a service called Brickognize was leveraged. When supplied with a brick image, it returns the name of the part.

To make the distribution system scalable, parts were dropped into a two-dimensional grid of storage containers. Each identified part is dropped into a chute leading to its container. Each container in that chute has a servo-controlled door that it can close to direct that part to the right location. PWM boards were daisy-chained together such that the system’s single Arduino board can control over 700 doors.

When all was said and done, the LEGO sorter proved to be quite reliable. It could be left alone for hours happily sorting parts on its own. However, at a rate of only 2 pieces per minute, it may not be ready for commercial use yet. Oh well, that's nothing that a few upgrades can’t fix!


nickbild

R&D, creativity, and building the next big thing you never knew you wanted are my specialties.

Latest Articles