Tag Archives: Skittles Sorting Machine

Taste the rainbow one color at a time with this sorting machine

What’s better than a mouthful of Skittles, right? When it comes to various-colored candies, such as Skittles and Starburst, there’s always those one or two flavors you’re secretly wishing are heavily favored inside the pack. It would seem that many of us tend to love the red, tolerate the orange, and simply leave behind the yellow. Well, a group of Cornell engineering students recently devised a final project that will surely solve that quandary.

image025

With their ECE4760 class coming to an end, the Maker trio devised an ATmega1284 powered Skittle-sorting miniature factory that actually bags and seals same-colored candies into little pouches of flavor. Problem solved!

How it works is relatively simple. The Skittles are loaded into a plastic funnel at the top, where they are fed through a color-detection module one candy at a time — either automatically or manually. Red, green, blue and white light are reflected off the Skittle, while the color is deciphered using an RGB LED and OPT101 photodiode driven by an ATmega1284.

image030

“The LED is directed onto the Skittle with a small light block between it and the photodiode. As light hits the Skittle, certain wavelengths are reflected. The wavelength of the Skittle’s color is reflected most strongly. For example, shining a green light onto the green Skittle will reflect more light than shining a green light onto a red Skittle.”

Once a color is detected, a solenoid shoots the Skittle down a cardboard ramp which leads the piece of candy through a hole and into its appropriate bag. The ramp’s position is controlled by a servo and changes depending on the color. Once a bag has reached its preconfigured capacity, the packaging wheel rotates through a heat sealer to seal and cut the pouch.

image036

“We chose this project because we liked the multidisciplinary approach it required. There were challenging elements from both an electrical and manufacturing engineering perspective. We needed accurate color sensing, precise servo control, and repeatable timing to ensure the Skittles would sort correctly. In addition, we had to build a mechanical structure capable of passing a single Skittle within fairly strict tolerances. As an added benefit, we acknowledge that many people have Skittle flavor preferences which our mini-factory caters to,” the team writes.

Watch it in action below!

Candy lovers interested in learning more can hurry over to the team’s official project page here. Meanwhile, you may also enjoy this Atmel | SMART SAM D21 based Skittles sorter which was recently on display this year at Electronica.

ATmega328 is under the hood of this sweet candy sorting machine



If you’re like most people when it comes to Skittles, chances are you love red and purple, tolerate green and orange, and strongly dislike yellow. Sound familiar? Instead of tediously sifting through bowls full of candy, a Maker by the name of Torsten has created a slick sorting machine that arranges sweets by color. Essentially, the machine separates different colored Skittles (and M&Ms, too) and puts them into their respective individual cups.

According to the project’s official Wiki page, the fully-automated platform is capable of sorting an entire 1.5kg/56oz bag in approximately five minutes. Powered by an ATmega328 microcontroller (Arduino Uno), the candy sorting machine also features an RGB color sensor, IR distance sensor, two servos, plastic frame tubes and a few custom designed 3D-printed parts.

“The processing is structured around pseudo-realtime programming which makes the system responsive and keeps it running smoothly. Each process in the system is designed around the notion of event driven finite-state machine (FSM) execution,” Torsten explained.

“Central in the system is Atmel’s ATmega328 AVR MCU — integrated nicely on an Arduino Uno platform. All the sensors and servo actuators connect to this board. An external 9V power supply keeps the system running. 5V and 3V3 power for the servos and board is supplied by the 5V power supply. The programming mimics a real time system where each of the four processes are state driven, which means only a short instruction performed before the system jumps to the next process.”

The machine is equipped with a pair of GWS servos for loading and sorting the pieces, while a continuous rotation servo with a variable rotation speed loads pieces into predefined slots in the feed wheel. After the pieces are placed in individual slots, a white LED illuminates the piece and an ADJD-S311-CR999 CMOS IC with integrated RGB filters captures three color profiles at different angles.

“For the piece to be successfully identified and pass control, at least two profiles have be within three standard deviation (three-sigma rule) of the pre-calibrated data set for Skittles or M&Ms. A RGB LED next to the feed wheel will illuminate to give a visual indication of the detected color,” Torsten continued. “The feed wheel rotation is governed by a QRE1113 IR distance sensor which detects the slot depth change. This transition is used to change process state and start the color analysis at the right moment.”

When the color has been identified, the piece is dropped from the feed wheel and onto a 360-degree servo with a feeding tube attachment which guides the piece into the right cup. The piece is release from the feeding wheel just before the feeding tube is within range of the cup.

“This [method offers] increased performance as the system does not need to hang around and can move to the next cup straight away. This is done by timing the expected rotational velocity and no feedback is provided by the servo,” Torsten added.

Interested in learning more about the Atmel powered candy sorter? Check out the sweet project’s official Wiki page here.