
A DIY M&Ms and Skittles sorting machine - joeguilmette
https://willemm.nl/mm-skittles-sorting-machine/
======
Animats
Here's the commercial version.[1] This machine is sorting peas by color. Peas.
Individual peas. Each individual pea is examined by cameras for size, color,
and looking like a pea. Rejects are kicked into the reject hopper by an air
jet. There are machines like this for most fruit. Typical throughput is a _ton
per hour._ Most fruit and berries go through such machines today. That's why
the fruit at the supermarket is so consistent.

The process looks like magic. Color-mixed items go in, and single-color items
come out, on a line going so fast that no human can see what's happening. It's
amazing to see computer vision systems that fast.

These machines work by putting the items on a conveyor belt, then dropping
them on a much faster conveyor to spread them out. The fast conveyor goes past
cameras, and at the end, launches the items into free flight for a few inches.
While in flight, computer-controlled air jets knock out the rejects.

[1]
[https://www.youtube.com/watch?v=JyGR6A5MWG0](https://www.youtube.com/watch?v=JyGR6A5MWG0)

~~~
yesbabyyes
A friend of mine works for a consulting company specializing in optics. They
invented a machine for one client which sorts wheat grains. The machine does
spectrography of each individual grain, looking for moulds and fungi as well
as heavy metals and more. It's a big rotating drum with small chambers for
each grain. After doing the spectrography it shoots each grain off into either
the selected or rejected direction.

But it doesn't just reject every bad seed, instead it will optimize to keep
within legally accepted limits.

~~~
Drdrdrq
> But it doesn't just reject every bad seed, instead it will optimize to keep
> within legally accepted limits.

This is just... I guess the emotion you feel when reading the last paragraph
defines you as either technical guy (outrage / resignation, depending on your
age and experience) or managerial guy (pure delight).

I am guessing there is a switch that makes it sort properly, you know, for
VIP?

~~~
jacobolus
In the 1970s, the USA sold a large amount of wheat to the USSR in a famous
deal.

The contract stipulated that the wheat would contain something like <1% sand.
US wheat at the time had effectively no sand at all, so they mixed in 1% of
pure sand, staying just within the contract terms.

(I heard this from a friend whose friend knew something about it; in searching
I can’t find a source online, so the story might be apocryphal. I also might
be off on the precise percentage.)

~~~
ue_
That doesn't sound like a very nice thing to do. I wonder if capitalism is to
blame, as I would certainly blame capitalism, or good old fashioned
egotistical rivalry that I'm told was common in many areas of life then
between the USSR and the US.

I'd say that feeding humans or even livestock is more important than profits.
Or at least, it ought to be.

~~~
LeifCarrotson
Or classical capitalism, because 99 ton of wheat plus one ton of sand is one
ton of wheat cheaper than 100 tons of wheat. Sand is heavy and cheap.

~~~
nikcub
I just happen to have bought some sand recently, and it isn't _that_ cheap.
Especially not the type of sand that you'd feel comfortable mixing into food.

Where I am, a ton of sand aggregate using in construction is ~$100 per ton.
The better sand used in gardens, the brown sand (it's used to repel water so
you don't over-water crops) is more than than.

Considering the wheat/ton spot price is $160 per ton at the moment, I don't
think the actual prices would be too different.

[0]
[http://www.indexmundi.com/commodities/?commodity=wheat&month...](http://www.indexmundi.com/commodities/?commodity=wheat&months=60&currency=aud)

------
jacquesm
What a nice job this person did.

Coincidentially I'm working on something similar at the moment only with an
order of complexity that is several magnitudes larger than the one on display
here (39000 different shapes, several 10's of possible colors). But my
contraption doesn't nearly look as nice as this one and definitely is not
ready for any kind of production.

I've been working on this for the last two years or so, it has just about
every bit of my skills exercised (optical, mechanical, software, electronics)
and every time there is a minor breakthrough I feel like throwing a party.

Likely this piece of gear will never see the light of day in a commercial
setting but it's the most fun I've had in a long long time.

Disillusioned with web programming (security _really_ spoiled the fun I used
to have making web stuff) I figured I should do something that will make
programming fun again and at least on that count I have succeeded.

And on another note, I've gained a lot of respect for the visual cortex and
it's preprocessing capabilities.

~~~
taneq
Just remember that the moment you stick an Ethernet port or WiFi connection on
it, security becomes just as important again.

~~~
jacquesm
Networking this particular device is useless so not planning on that, but yes,
you're 100% right. Many producers of SCADA stuff and industrial controllers
that worked just fine as long as they were isolated have found this out the
hard way over the last couple of years. And I don't doubt that there are many
still to come, insecure protocols, world-open ports whose only protection is
that probably nobody knows what sits behind that port.

------
crusso
Top marks for: 1\. Showing a diversity of maker skills 2\. Making something
that actually works 3\. Industrial design savvy 4\. Entertaining video

You've given me some motivation to get off of HN and work on one of my side
projects for the rest of today.

~~~
joezydeco
Mechanically, it could have been done a bit simpler. This is an old project
that has been around a long time:

[https://www.youtube.com/watch?v=Ku9PKRoH1CE](https://www.youtube.com/watch?v=Ku9PKRoH1CE)

------
acheron
Now that green skittles have changed from "lime" to "apple" (my lawsuit
regarding calling the flavor assortment "original" will be filed any day now),
I need a machine like this to sort the green ones into the trash where they
belong.

~~~
aubreykilian
Flavour-based sorting? That's Version 2.0!

------
dankohn1
Your video is even more compelling:
[https://www.youtube.com/watch?v=ceGlMV4sHnk](https://www.youtube.com/watch?v=ceGlMV4sHnk)

~~~
jt2190
So is the write up. My favorite part:

> I started working on this machine in May ’16 and only finished it in
> December. It took a lot of time to design and build the machine, and I kept
> optimizing the parts and software after the first prototype was done.
> Including all prototypes and spare parts, I spent nearly €500 on this
> machine. Well worth it, considering everything I learned.

[https://willemm.nl/mm-skittles-sorting-machine/](https://willemm.nl/mm-
skittles-sorting-machine/)

~~~
dang
Thanks! Url changed to that from
[http://imgur.com/a/M539W](http://imgur.com/a/M539W).

~~~
jt2190
Google cache is here:

[http://webcache.googleusercontent.com/search?q=cache:https:/...](http://webcache.googleusercontent.com/search?q=cache:https://willemm.nl/mm-
skittles-sorting-machine/)

------
gjkood
Fantastic job! Functional and beautiful at the same time.

This is the kind of stuff that I love to read about in the mornings.

I know this machine will not solve world hunger or bring about world peace but
I know this would bring peace to my family.

I apologize in advance but I am going to "borrow" your design and work with my
kids to recreate this.

Thank you for giving me something worthwhile and productive to do with my kids
today. Atleast give them something inspiring and fun to look forward to.

------
saghm
This is really cool! I love how it lights up with the color of the candy it's
sorting each time.

I'm curious, have you tried putting both Skittles and M&M's in the same batch?
I'd be interested to see if it determines that the purple Skittles and the
brown M&M's are the same color, for example

------
asafira
This is still an awesome project, but anyone else notice the machine makes a
mistake? @ 1:10, in the background, you can see a purple skittle with green
ones.

(Technically it we don't see it make the mistake, but it probably had made a
mistake...)

Awesome job! Any stats on its error rate?

------
elihu
I wish I had a link, but this reminds me of a machine that was at the OMSI
Maker Faire in Portland last summer that measured the shininess of pennies and
then directed them into a large board with columns (kind of like a giant
connect-four board).

The machine sorted the pennies to match a greyscale image given as input, so
that the final output is a penny mural ready to be encased in epoxy.

------
pimlottc
I've often idly thought about such a machine but this is much more beautiful
than anything I would come up with, well done! I expect you'll be working on
some statistical analysis on M&M color distribution now that you've got this
part finished?

Also, what's the difference between processing M&Ms and Skittles? Is it just
the expected colors?

------
ktta
Here's the google cache:
[https://webcache.googleusercontent.com/search?q=cache:nt1C4j...](https://webcache.googleusercontent.com/search?q=cache:nt1C4j4CvjYJ:https://willemm.nl/mm-
skittles-sorting-machine)

------
DoctorNick
The perfect machine for when you're hosting Van Halen concerts:
[http://www.snopes.com/music/artists/vanhalen.asp](http://www.snopes.com/music/artists/vanhalen.asp)

~~~
stevefeinstein
I bet he could sell a budget version which only removes one color and sell it
to every concert venue in the world.

------
prashnts
It's brilliant! Well done for such a fantastic job designing the hopper and
sort units. Plus the sound it makes while sorting is very pleasing. :)

------
overcast
I remember doing the same thing in my Digital Electronics class in junior
high. Except it was marbles, and we used BASIC.

------
BillyParadise
You could probably sell one of these into every concert theatre in the world.
I'm wracking my brain and exercising my google-fu, but I can't seem to
find/remember which famous musician wanted only one color of candy on their
rider. Or was it everything except the green ones. Or something like that.

~~~
sahinabi
van halen _-_

apparently they don't want the green ones :
[http://www.snopes.com/music/artists/vanhalen.asp](http://www.snopes.com/music/artists/vanhalen.asp)

~~~
BillyParadise
silly me, forgot to check snopes. Thanks for the link!

------
nycmattw
You know what would be even better? Sorting the difference between M&Ms and
Skittles :)

------
matart
I didn't see it anywhere but are you willing to provide the 3D printing files?

------
Reason077
Mars, Inc. could save us all a lot of trouble by pre-sorting them at the
factory!

------
myfonj
If you are into this kind of things, check out the pebble sorting artistic
installation, Jller:
[https://vimeo.com/167126696](https://vimeo.com/167126696)

------
femto113
Am I the only one who read the headline and thought the machine was created to
undo this monstrosity?

[http://imgur.com/kXfGutB](http://imgur.com/kXfGutB)

------
dugluak
A lego sorting machine by shape and color would be so great

~~~
yesbabyyes
This one is pretty impressive. :-)
[https://www.youtube.com/watch?v=m7Gs6-6p7qw](https://www.youtube.com/watch?v=m7Gs6-6p7qw)

~~~
dugluak
Impressive indeed ! I meant something that can be used at home. Like this M&M
one

------
zaf
For our high school end of year CDT (Craft, Design and Technology) project, my
best friend built a snooker ball sorter. It was awesome.

------
source99
This is very cool. Well done and great write up.

I don't think I could punch that much effort into something i wasn't going to
commercialize.

------
BlytheSchuma
Anyone here found a good pill sorting machine yet? All the ones I've found
just seem to be vaporware.

------
makwarth
Very cool - thanks for sharing!

------
exabrial
Thank goodness this problem is finally solved.

------
dammitcoetzee
This one is so fast! Nice Job!

------
anjc
Very cool

