Hello everyone, I am interested in doing my first arduino project. I have a friend who is allergic to red food dye and cannot eat red candies, so I want to make a machine that will separate out the red skittles, mms etc. My plan is to have the candies pass through an rgb led and a light sensor or similar to detect the color, and use a servo to operate some kind of trapdoor or gate to drop out the red candies. This is my first project, so my questions are:
Which board would be best for this project? All I need to operate is one rgb led, one light sensor and one motor or servo.
Can anyone recommend the best way to detect color?
Does anyone have any tips about the best way to code this? I have very limited experience, but this seems like it should be a simple project to code.
An UNO would do the job if that's the full components list and will have plenty of RAM and program memory, although it sounds like you will need more than an RGB led, LDR and a servo. Are you planning on dropping a bag of sweets/candies through a chute (hopper style) or having something that you can place over the top of a sweet to detect its colour?
You can buy a colour detection module off ebay or sparkfun etc.. or you can build your own with the parts you suggested but it would work by cycling though each of the Red, Green and Blue LEDs and measuring the reflected light (which also means you would need to control the environment/ambient light in the room) so an enclosure would probably be better so you can store default thresholds for white and black.
There is an instructable using an arduino and processing (with example code) and it explains the theory quite well:
I was going to build a Skittles Sorting Machine last year and built/coded my own color sensor but i wanted a way to get the Skittles from the cups on the turntable to be collected or elevated somehow back to the pour spout at the top so it was a continuous loop.
Heres a shot of what i scribbled down, it might come in handy