Skip to main content

Automatic Sorting of Skittles or M&Ms by Colour

Do you sort M&Ms or Skittles by colour before eating them?  For example, eat all the yellow ones first, then the red ones, then the blue and so on. Brian Egenriether, an electrical engineer, decided to make a small machine that looked like an appliance, which could perform these tasks automatically. This mechatronics project took him about 5 weekends to make. The use of the machine is very simple: pour Skittles or M&Ms into it, push a button and have candies sorted. Let us look at the construction.

The machine is well thought out, starting from its colour which is quite intentional. Brian said,

This is so the eye is not distracted by a colorful machine that would take away from the aesthetic of the perfectly sorted candy at the bottom.  They appear as solid "pops" of color at the base, all ordered and neat in white bowls--the opposite state of what you can see at the top.

The author formed many parts out of a machinable and paintable epoxy including the casing, the turnstile, the 5 tubes through which the candies fall to the bottom of the hopper.  The base is of wood and the bowls are ceramic (they are attached to the base). The control is done with a BASIC Stamp 2, and was written in PBASIC code. It sorts about 37 Skittles per minute.  The colour detection is done with a sensor made from TAOS (now out of production). The turnstile and all other parts inside the colour detection stage are black to avoid confusing the sensor. There are 3 servo motors, that perform defined tasks: rotate the hopper, rotate the turnstile and angle the chute to the proper hole.

The colour sensor looks at a Skittle and takes 3 measurements, red, green and blue. The value of each is sent back to the controller. The controller takes each 8-bit count and stores it.  Then it makes a decision on the actual colour of the candy. The RGB values were all determined experimentally for each Skittle colour. As the author said, it was not without problems:

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.  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.

Noteworthy is the candy "drive". One rotation does 3 things. When the turnstile rotates it takes one candy from the bottom of the tube (other sorting machines work on a similar principle) that comes from the hopper and rotates it to the colour sensor. At the same time, it takes the one that was analised by the sensor before and drops it into the hole that leads to the chute. Brian also briefly described the algorithm:

An infrared LED and Phototransistor look at small holes in the outer diameter of the turnstile.  These tell the servo motor when to stop turning.  In the code I have the servo move at a fast speed, then based on a timer it goes into slow speed.  This is right about the time when the hole will pass over the LED/transistor pair.  I make it go slow in the last tenth of a second so that it does not overshoot the stopping point.

It sorts about 37 Skittles per minute and rarely makes an error.

Update:

Skittles Sorting Machine 3

The video below shows the Skittles Sorting Machine with final modifications, and it was shown on television show "World's Smartest Inventions" on Tru tv. It is the 3rd revision of the original machine. The inside of this mechatronics project is now complete and features user-selectable inputs to choose which type of candy to sort. Types not shown include Reese's Pieces and other types of Skittles.

Comments

You might also like

    Popular posts

    What is Mechatronics?

    Mechatronics definition Mechatronics is a synergistic combination of precision engineering, electronic control and mechanic systems. It is the science, that exists at the interface among the other five disciplines: mechanics, electronics, informatics, automation, robotics. It is one of the most dynamically developing fields of technology and science. The word 'mechatronics' appeared for the first time in Japan in 1969. mechatronics = mecha nics + elec tronics + computing

    Ascento - The Two-Wheeled Jumping Robot

    All-terrain capabilities are required to extend beyond flat surfaces the application range of wheeled robots. First think is four or six-legged robots which have been well known for years. Nowadays, thanks to more and more perfect gait algorithms, the two-legged (bipedal) robots appears more and more often. ETH Zürich students combine the advantages of wheeled robot and two-legged robot.

    Mechatronic Systems Applications [e-book pdf]

    Mechatronics is the synergistic blend of mechanics, electronics, and computer science. This book is concerned with applications of mechatronic systems in various fields, like robotics, medical and assistive technology, human-machine interaction, unmanned vehicles, manufacturing, and education.

    How Automated Parking System Works

    An automated car parking system is a mechatronic system designed to transport and park cars automatically. The first semi-automated parking system was used in Paris, France in 1905 at the Garage Rue de Ponthieu (the car was transported to selected level using an internal elevator and the vehicle was parked by attendants). An automated storage and retrieval system for cars is a solution to cities' parking problems, such as the space wasting in a multi-story parking.

    Where to Download 3D CAD Models? Online Libraries, Collection, Community

    Each novice designer may have a problem with obtaining 3D CAD models for their projects. Preparing models on your own is time consuming and often unnecessary. To save your time when choosing the components, check if the distributor or manufacturer does not offer on their websites available ready-made 3D CAD models to download. By downloading models directly from the manufacturer we can have a greater chance that the model reproduces 100% of the actual product. 

    Intro to Mechatronics [e-book pdf]

    Intro to Mechatronics - lecture by Professor Vikram Kapila, New York University Mechatronics Defined Mechatronics: Working Definition for us Product Realization Paradigm Disciplinary Foundations of Mechatronics Multi-/Cross-/Inter-Disciplinary Sequential/Concurrent Product Realization Mechatronics-based Product Realization Mechatronic Design Process

    DIY Low Cost 6-Axis Desktop Robot

    Learning how to build a robot is a long way. It is the way by mechanics, electronics and programming. Such a mechatronics project is associated with problems such as stiffness (mechanics), overvoltage (electronics) or bug (software). Of course, if something is wrong, we always say 'it's not a bug, it's a feature', but finally a robot has to start working properly.

    Mechatronics System as the Future of Cooking at Home

    Do you get up in the morning and don't feel like making breakfast? One of the solutions is food delivery service, which leaves your takeout order outside of your front door. Other solution is a private chef who is responsible for shopping for food, menu planning, preparing and cooking meals for you. But if you love mechatronics systems, your solution is a mechatronic kitchen. It allows you to save time, free up your day from routine cooking, plan and adapt your menu according to different diets and lifestyles.

    Three Wheels Balancing Robot

    The three wheels balancing robot is similar to a ballbot from the point of view of the goal. In comparison to ballbot which balance itself on a single ball, three wheels balancing robot is designed to balance itself on a single rod. The common characteristics of this kind of robots is that there’s one sole contact point to the ground.