What is a Colour Sensor?
Get NowA colour sensor is a device that emits light and then measures exactly what bounces back.
The Flashlight Analogy:
"Think of it like being in a dark room with a flashlight. If you shine your flashlight on a red apple, red light bounces back to your eyes. If you shine it on a black shirt, almost no light bounces back."

A colour sensor does exactly this, but fast. It usually has two main parts:
- [+] The Emitter: A bright white LED that shines on the object.
- [+] The Receiver: A tiny grid of photodiodes or light detectors that catch the reflection.
It converts that reflection into numbers that our microcontroller (like an ESP8266) can understand.
When the sensor looks at an orange object, it measures how much of each light colour is bouncing back. It breaks the Orange down into three specific numbers:
Red: 100%
Green: 50%
Blue: 0%
It sends these numbers to the computer, and the computer calculates, "Ah, lots of red and some green, that creates orange!"
The TCS34725 Sensor
There are many cheap sensors out there, but the TCS34725 is the gold standard for hobbyists. It is the one we will be using in our labs.
Why is it special?
- The IR Filter: Sunlight and indoor lights have a lot of infrared light that messes up color readings. The TCS34725 wears invisible "sunglasses" that block this bad light.
- High Sensitivity: It can tell the difference between "dark red" and "slightly darker red."
- The Built-in LED: It comes with its own high-quality white LED on the board for consistent lighting.
