This machine sorts small candies (M&Ms and Skittles) by color. It was designed and built by Netherlands-based New Zealander Willem Pennings, who is studying Mechanical Engineering at Eindhoven University of Technology. He explains how the machine works on his blog:
The machine is able to sort M&M’s and Skittles by colour by performing optical measurements using the RGB sensor. It can be modified to sort any type of coloured object, as long as the individual pieces have a regular shape with even dimensions. It takes approximately 2-3 minutes to sort a 300 g bag of Skittles / M&M’s and sorts about 2 pieces per second. The machine is 250 mm in diameter and approximately 300 mm in height…
While in the hopper, candy pieces are constantly mixed to prevent clogging at the inlet of the upper scanner tube. The scanner consists of a small wheel with four slots which are 90 degrees apart. After a piece enters a slot, the wheel, which is powered by a stepper motor, rotates 90 degrees so a measurement can be performed. The RGB sensor takes three consecutive measurements, which take 30 milliseconds each. The Arduino controller then determines the item colour (based on reference data) and positions the exit tube (also using a stepper motor) to guide the piece to the correct container. Just before the exit tube reaches its target position, the wheel turns another 90 degrees to drop the piece. The process is then repeated. During the process, visual feedback is provided using the LED strip that encircles the machine
Pennings designed the original model below using CAD software so that he could get some parts 3D-printed and other parts laser cut in medium-density fiberboard (MDF). This image provides a good overview of the machine’s pieces, however he did print improved parts after conducting some initial testing.
See the step-by-step of how it was made, including more specifics on its four printed circuit boards, wiring, motors, etc at willemm.nl.