Quick Candy Sorting Machine

OCD. Sometimes things just get to you, like those pesky bags of randomly assorted candies. [Torsten] decided to build a sorting machine capable of sorting Skittles or M&Ms into separate cups by color at around 80 pieces per minute. It’s a great implementation, using an Arduino Duo. He based the code on the principles of a finite-state machine, in order to make it as quick as possible.

It works as you would expect: When a candy piece is loaded, the color is determined using an RGB sensor. A 360-degree servo is used to move the chute to the proper position, and interestingly, the system preemptively releases the candy before the chute is in position in order to maximize the speed. If you watch closely, you can see this behavior in the video (embedded after the break).

[Torsten] includes a complete bill of materials, if you’d like to try it for yourself. He also included a list of possible improvements.

32 thoughts on “Quick Candy Sorting Machine

      1. If only Del Preston had had this machine… him an jeff beck would have never gone to that sweet shop on the edge of town…
        [youtube=http://www.youtube.com/watch?v=k_7kg5ZzDZo&w=420&h=315]

  1. Bet it doesn’t work for Liquorice allsorts… ;-)

    The colour sensing arrangement is quite interesting in particular – I wonder how accurate it is?

    1. There seams enough color deferential to pick them apart with fairly low accuracy equipment. My guess is that this device run at better than 99.9% and most likely not made a mistake since final software revision.

  2. Just the thing when you need to eliminate all brown M&M’s:

    http://www.thesmokinggun.com/file/van-halens-legendary-mms-rider?page=6
    http://www.snopes.com/music/artists/vanhalen.asp
    http://www.npr.org/blogs/therecord/2012/02/14/146880432/the-truth-about-van-halen-and-those-brown-m-ms

    Personally, if I had ever produced their show (very unlikely :^), I would have adhered to the letter of the contract, but left a bag in a bowl and a big sign “pick out your own @#$% brown M&Ms.

    (I tried to get a boss to do basically the same – he sent a long and fairly detailed contract to a supplier. I wanted a clause in the middle where they would send us a couple of pounds of M&Ms when they actually signed the contract, just to check they really read it. He did not see the humor. Sigh.)

  3. Really slick setup and good use of 3d printed parts. The wiring is even nice to look at,and modular. Not a practical machine but I’d put one on my desk ‘just because.’

  4. Awesome. I wonder if it’d be practical to sort faster by having the chute rotate at a constant speed (higher than the current speed, as it wouldn’t need to keep stopping and starting) and just dropping the items at the right times.

    1. I thought the same thing, but then you’d have to be very sure that all M&M’s took the exact amount of time.
      I also would use 2 chutes simultaneously.

      1. I would use six chutes and a small angled centerpiece as the only rotating part to reduce the inertia. Once you drop the candy, you can immediately start to move it to the next position instead of waiting for the candy to fall down the chute.

        1. Conversely, you could also determine the time the candy takes to travel down the shute and drop it before the end of the shute is even over the cup.

          1. He still has to keep the arm there all the while the candy is rolling down the chute, instead of dropping the candy in and immediately turning to drop the next candy to a different chute.

  5. If speed’s the driver, perhaps add a continuous rotation servo to the chute also? Seems to got ‘the long way around’ sometimes. A continuous rotation pot would give you abs. pos. feedback, as would reed/hall/IR/etc etc sensors placed at each cup. Does the system provide stats? Ie. total # counted, # of each colour, etc? Fun, elegantly designed project – thanks for sharing!

  6. This would be an interesting piece, not necessarily art, but something with the video or demonstration of Skittles or M&Ms being funneled together by the machine that makes them at the factory. As I’m sure they are made in batches by color. And then this little semi-autonomous machine, unsorting them. Like some kind of null void.

    1. I think his rotation servo is a 360 degree servo, not a “continuous rotation” one. It has an end-stop at the right. It cannot move directly from “two oclock” to “four oclock” except by passing the “nine oclock” position..

  7. Seems to go the wrong way around often. I programmed an 8 bin sorter like this in ’84, though we weren’t sorting skittles by color. Was easy with an 8 byte lookup table: Where you are vs where you want to be, 1 for CW and 0 for CCW.

    1. I’m pretty sure its because the multi-directional servo has a limited range of motion. Only the one dropping the candy is continuous motion.

Leave a Reply to vonskippyCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.