Tag Archives: Arduino Candy Sorting Machine

Sort through M&M’s in speed with this iPhone-controlled machine

While we’ve seen plenty of candy-sorting machines in recent months, an anonymous reviewmylife blogger has devised a pretty sweet creation that’ll have you sifting through treats faster than ever before. Not only for the everyday chocolate lover, this contraption can be quite useful for concert venues looking to book Van Halen or Mariah Carey, whose rider requests demand no brown and yellow M&M’s, respectively, in their backstage candy bowls.

mandm-sorting-machine-front-12

The Maker claims that the DIY device is faster than most other sorters, which works by registering the candy’s’ color using an iPhone 5 camera. The high-speed M&M machine is equipped with a 12V 80RPM high torque motor that controls a rotating plate, before releasing one candy at a time through a hole.

mandm-sorting-machine-dispenser-10

As the M&M falls, the iPhone deciphers its color and communicates via Bluetooth to an Arduino Mega (ATmega1280). The Arduino then uses an eight-channel relay to fire off electromagnet-controlled gates that send the candy piece down a chute and into the appropriate bin.

mandm-sorting-machine-side-arduino-bluetooth

Although much quicker than other DIY M&M sorting projects, the blogger notes that there is still plenty of work to do. As good as the iPhone’s color sensing capabilities may be, the device still has trouble deciphering brown candies. “They are a pain to distinguish from orange and shadow. Obviously it can be done but it would need a bit more software work and perhaps some LED lighting on the chute to reduce the effect of the shadows,” he added. The Maker also says that he’d like to get the parts for the machine 3D-printed in the near future.

Pretty sweet, right? See it in action below!

Intrigued? You can read all about the project on its official page here. Meanwhile, you can satisfy your sweet tooth with a number of some other Atmel powered candy contraptions here.

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.