Color Sensing With An RGB LED And Photoresistor

[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

    1. 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.

  1. 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)

  2. 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!

  3. 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.

    http://www.youtube.com/watch?v=qDMedG3FmJU

    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.

  4. 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.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.