Normally the colour of M&M’s, Smarties or Skittles would not be bothering us here, but it is the technology that we are interested in with this machine that can sort out the colours of sweets. This is a machine that has been solely designed to work out the colours of M&M’s, Smarties or Skittles and them direct each one into a separate chute. So how does that work and how can it know the difference between each colour?
Well, built into the machine is a dock for an iPhone, it connects via Bluetooth with an Arduino unit in order to sort the colours it recognises as they fall past the smartphone. As each colour passes by the device it activates the Arduino, which in turn uses a magnet to open to hatch to the correct chute and thereby sorting them into colours.
M&M sorting machine. A high torque motor rotates a plate that sends M&M through a hole one at a time. As the M&Ms fall an iPhone distinguish the colours. The iPhone communicates with an Arduino via a bluetooth board, and the Arduino then uses a relay to fire off electromagnet controlled gates to send the M&Ms into the correct chute.
Source: Review My Life