Simple color sensor

Have a question or want to show off your project? Post it! No Registration Necessary.  Now with pictures!

•  Subject
• Author
• Posted on
Hi,

I need a simple color sensor for my robotic arm, which can basically
discern between basic colors. I would like to build one, I'm guess it
should be pretty simple using a photo cell, I just don't know how
exactly.

I found this schematic at
http://www.lynxmotion.com/images/jpg/color.jpg
But I don't understand what the circuit on the right (with the LED's is
for). I understand that the circuit on the left with the CdS sends the
voltage on I/O 12 depending on the color and intensity of the light,
but will my robot know which color it is?

Thanks

Re: Simple color sensor

You would turn each led on in turn and each time read
the voltage on I/O 12 to give you the red, green and
blue values of the colour.

Another color sensor circuit,

http://www.siliconchip.com.au /

PICAXE Colour Recognition System 29 June 2005

Re: Simple color sensor
Hmm. I still don't understand what you mean. Are you saying that the
output of I/O 12 is the input for I/Os 13,14,15 ?

If yes, then it should light up all 13,14,15. If not then what do I
measure the voltage at I/O 12 with, and how to translate that into the
color?

Thanks

JGCASEY wrote:

Re: Simple color sensor

soemthing, the schematic doesn't say.  From what I can discern via the
chematic and past experiences, it works like this:

1) you turn on the red LED
2) take a measurement and store it
3) turn on the green LED, and turn the red LED off
4) take a measurement and store it
5) turn on the blue LED and turn the green LED off
6) take a measurement and store it.
7) use your stored measurements to mathematically come up with a color
based on the intensity of the reflected light from the three base colors
(it will give you an RGB value)

I/O's 13,14,and 15 are outputs to source current to the pins of the tri
color LED.  You turn one of them on, and the LED glows with the
appropriate color.  The Sensor goes to I/O 12, which is most likely an
analog measuring pin.  This will give you a numerical value of the
intensity of the reflected light for each color.  You can use P1, P2,
and P3 to "white balance" the sensor, so that from a pure white source,
all colors are reflected evenly.

--Andy P

Re: Simple color sensor

As AndyP says the I/O 12 would connect to an
Analog to Digital Converter (ADC) interface.
I/O 13,14,15 would be set for output.
I/O 12 would be an analog to digital input

You could experiment yourself by using a digital
volt meter to read out the Cds value and three
switches to turn the leds on or off.

JC