Identify Colors with an RGB LED

Hackster Staff
Aug 29, 2017 · 2 min read

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.

Hackster Blog

Hackster.io, an Avnet community, is the world’s largest network for hardware & software developers. With 1 million members and 17,000+ projects, beginners and professionals can learn and share how to build robotics, industrial automation systems, AI-powered machines, and more.

)
Hackster Staff

Written by

Hackster Blog

Hackster.io, an Avnet community, is the world’s largest network for hardware & software developers. With 1 million members and 17,000+ projects, beginners and professionals can learn and share how to build robotics, industrial automation systems, AI-powered machines, and more.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade