Identify Colors with an RGB LED
When you look at an object, what you’re sensing is the different red, green, and blue components of light bouncing off of it. While something that’s purely red will absorb the green and blue light components, most of what we see is some mixture of these shades. Taking this principle and applying it with an RGB LED and a simple photoresistor, YouTuber Tech Martian was able to make a basic RGB sensor.

His design shines light onto a colored piece of paper, reflecting it onto the photoresistor. Since the Arduino program knows which color is emitted by the LED, the amount of light taken in by the photoresistor can be recorded for each shade, allowing it to determine the paper’s color. In order to take accurate readings, the program first goes through a calibration routine, emitting a variety of colors, while a black then white piece of paper is used as the reflector.
Be sure to check out the project’s write-up for more info on the build, along with the code used.


