[Fjord Carver] brings together an RGB LED and CdS Photoresistor to make a color sensor. Those Cadmium Sulfide lights sensors usually have a very wide swing of resistance when exposed to varying levels of light sensitivity. That makes for great resolution when reading them using the ADC of a microcontroller. The LED comes into play by shining known wavelengths of light on the surface being measured. Three separate readings are taken with each of the LED’s different colors, then used to extrapolate the RGB value of the test material. We saw the very same method used a couple of years back. This time around it’s an Arduino doing the measuring instead of a PIC.
So why isn’t that sensor shown in this picture? It’s because we appreciate the application which [Fjord] is using for this sensor. He built a lamp that shines the same color as the surface on which it is placed.
11 thoughts on “Color Sensing With An RGB LED And Photoresistor”
Bah, beat me to it! Only mine uses 6 different LEDs instead of a single RGB one. Also, im using a TSL-230R Light-to-frequency IC instead of a photoresistor. Haven’t got through the calculation portion though.
Me too!! This has been on my to-do project list for so long! I haven’t gotten past buying a few components though.
If the LEDs themselves were exposed, you could also get directional information. Nice work here!
Oops, I thought the LEDs were collecting the light, not emitting it.
I really like the chameleon concept. I struggle to think of good applications for colour sensing, but this is cool.
One use I thought of was in a Pinball game. I’ve seen implementations such as Twilight Zone that use a ceramic pinball coupled with eddy sensors to provide different scoring based on the ball used.
With this method, I could use 2 different coloured steel pinballs and be able to tell them apart electrically.
Nice application for this concept, I this method from Lego NXP mindstorms for some time now. The system was able to recognize about nine different colors.
But colour sending with this method can be difficult, if the wavelengths of the led and the material do not match. The result
would be black (or at least almost)
Awesome, another one of my doohickeys is on HAD!!!
(Glad you like the Chameleon Lamp, feel free to vote for it on Instructables)
@Nippey, that is why I am controlling the colour(hence wavelength) with 3 LEDs. Try breadboarding one up, it only takes 5 minutes. I put up a processing sketch that will show the results. More than 9 colours, very little comes back black…except really black black. (this is largely dependent on how you set the balance)
Thanks Hack-A-Day!! (Thanks for picking this up, hope it becomes as popular as my tilt switches did. I won a prize, and I suspect it largely had to do with the traffic coming from here)
So go vote!!! And check out some of my other ‘ibles, there might be something else that you like.
Share and enjoy!
Thats a nice coincidence.We just submitted a similar simplified project for our embdedded systems module.The main difference is using a single ultra bright white led and an LDR so its actually detecting luminance variations.
My question lies what would happen if you use infrared LED and phototransistor?Colors react differently to IR but its more reflective and much easier to filter for the sensor.
As for the applications you can for one built a 2 stage Rfid detection circuit that will read the tag and the color of it.
I am thinking that with one white LED and 3 CdS photocells, each with a coloured transparency filter, you could accomplish the same thing that I have done with 3 LEDs, the real trick is limiting the frequencies that can bounce back(and knowing what you are limiting). As for IR, I think it would just do the same as the white, but with less sensitivity, essentially you are still just getting one reading, which may allow you differentiate between a few colours, but you are not actually getting colour data.
Oh and awesome project by the way. really cool
Please be kind and respectful to help make the comments section excellent. (Comment Policy)