Machine sorts Skittles by color
Using a microcontroller and a color sensor, electrical engineer Brian Egenriether has created a machine that sorts Skittles and other candy by color.
Electrical engineer (and perhaps candy-enthusiast) Brian Egenriether has invented a machine that sorts Skittles and other similar sweets by color.
Now on his third revision, Egenreither says the machine is finally complete. The sorter features user-selectable inputs to choose the type of candy to sort. The small machine looks like a household appliance, but upon further investigation, it is a well-thought-out device that features a BASIC Stamp 2 microcontroller from Parallax and a color sensor from TAOS (now ams), which make up the imaging portion of the device. Egenreither made many of the housing/casing parts by hand from a machinable epoxy, including the outer case, inner housing, hopper mechanism, five-way chute and rotating disc.
The color sensor will look at a Skittle and take three color measurements of red, green and blue. The value of each is sent back to the microcontroller, which takes each 8-bit count and stores it. From there, it makes a decision on the actual color of the candy. Egenreither determined the RGB values through experimentation, he said in a Mechatronic article.
"The hardest part of color detection is that Skittles have a big white ‘S’ on one side (not both). So depending on what side lands up in the sensor, the readings are quite different," he said.
"So for example an orange Skittle with the ‘S’ facing up, looks a lot like a yellow Skittle with the ‘S’ facing down, to the sensor. I called this the ‘S Problem’ and only through very precise positioning of the turnstile and a lot of statistical sampling of each color did I get it right."
The machine sorts about 37 Skittles per minute and rarely makes a mistake.