When someone has the competence and skill to be able to build a complex machine out of Lego‘s Mindstorms kit, you would think they would use their genius to solve some sort of legitimate problem. That’s exactly what Nxt1engineer did, and built a machine to sort M&Ms by color, placing them into neatly-packed columns.
The machine pools unsorted M&Ms up at the top, then via an automated tray, dumps them into two, single-file rows underneath, which then send the M&Ms in either direction. Once the candy reaches the end, a sorting arm grabs an individual piece of candy, identifies it, then dumps it into its appropriate column.
Nx1engineer didn’t reveal how exactly the rig detects the colors, but if this skittle-sorting machine is any indication, the rig could use a combination of an infrared LED and a phototransistor to determine the candy’s color. The machine doesn’t have a perfect detection rate, but that doesn’t mess up the pristine single-color columns, because the rig dumps the unidentifiable candies into the middle bin.
After the columns fill up, the machine dumps the candy into receptacles below, allowing it to continue its very important work. Unfortunately, despite how well the machine can sort the colors into the columns, it has a bit of an issue dumping the separated colors into separate bins, as the candies occasionally hit a barrier and bounce into a the wrong container. However, that seems to just be a simple problem with the size of the bins and their alignment, rather than a permanent design flaw