I am going to show you how you can use an RGB LED and a Cds photocell as a colour sensor for a micro-controller. I will illustrate the method to retrieve a colour using Arduino, and I will show you a how you can verify the colour being scanned with a small Processing sketch.
We will be making this colour sensor on a breadboard, but it is easily transferred onto a prototyping board, and for those who fab their own boards, this would be an awesome kit that is super cheap to throw together. I am sure it would only take about two minutes to write a gerber file for this circuit and make a nice little finished sensor.
Step 1: Gather Some Parts
For this sensor you will need
a breadboard (not required, but it is how I will walk you through it.)
an RGB LED (alternatively you could use 3 LEDs)
A 220 ohm resistor
A CdS photocell (these can be salvaged out of all kinds of things like nightlights or garden lamps)
An Arduino, or a clone. I am using a RBB in this example