We select and review products independently. When you purchase through our links we may earn a commission. Learn more.

Watch a Raspberry Pi Machine Sort Every LEGO Brick There Ever Was or Will Be

A mess of LEGO bricks moving up a conveyor belt.
Daniel West

If you have a lot of LEGO bricks, sorting them presents a problem. They come in all sizes, shapes, and colors. You could spend hours sifting, setting apart, and organizing, but what fun would that be? Why not turn to a Raspberry Pi machine instead? That’s what Daniel West decided, and he built a device that can sort any LEGO brick.

West’s machine can scan a LEGO brick, determine its nature, and then move it up a conveyor built into one of 18 buckets in its system. Appropriately, West made it out of 10,000 LEGO bricks. But while that provides the structure, a Raspberry Pi provides the brains and vision.

A sideview of a large LEGO sorting machine
Daniel West

First, the machine pushes the LEGO bricks along a vibration plate towards the camera. The vibration plate keeps LEGO bricks from stacking and ensures one brick passes in front of the Raspberry Pi camera module at a time.

The Raspberry Pi uses a convolutional neural network to scan the brick and identify it. In a departure from other LEGO sorters, West fed the neural network 3D model images of LEGO bricks, so he’s not limited just to the bricks he had on hand. That means it understands every LEGO brick ever made. And he could easily update it with future bricks.

Once the Raspberry Pi identifies the brick, it moves it through a series of belts and gates to spit it out into the appropriate bucket. According to West, it can sort one brick every two seconds. That may not sound fast, but sorting by hand can take a lot longer.

West even posted multiple videos to describe the design process and how the Artificial Intelligence aspect works. He followed that up with two explainer articles you can read as well. You should check them both out if you’re interested.

It may not be quite enough information to create one on our own, but we can dream!

via Raspberry Pi Blog

Josh Hendrickson Josh Hendrickson
Josh Hendrickson is the Editor in Chief of Review Geek and is responsible for the site's content direction. He has worked in IT for nearly a decade, including four years spent repairing and servicing computers for Microsoft. He’s also a smart home enthusiast who built his own smart mirror with just a frame, some electronics, a Raspberry Pi, and open-source code. Read Full Bio »