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
formatting link
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?
Basically...I/O 12 is an analog input. Probably to a microcontroller or 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.
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.
three ldr's in a tube each, adc the light level for each and ther ya go. multichannel adc would work well enough, but a single with a 2-4 decoder would work as well.
To detect Red, Green & Blue I used the Taos TCS230 color sensor:
formatting link
"Integrated Color Light-to-Frequency Converters : The integrated light-to-frequency converter provides RGB color sensing and is performed by a photodiode grid consisting of 16 groups of 4 elements each. The output for each color is a square wave whose frequency is directly proportional to the intensity of the selected color. Each group consists of a red sensor, a green sensor, a blue sensor, and a clear sensor with no filter."
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.