TCS3200 Color Sensor
Precise RGB color recognition for sorting machines, color-matching, and line-following projects.
A color-frequency sensor used in color-sorting machines, line-following robots, and color-matching projects.
Specifications
| Sensor type | TAOS TCS3200 programmable color light-to-frequency converter |
| Operating voltage | 2.7V–5.5V (breakout modules run at 3.3V or 5V) |
| Operating current | ~25-30 mA with onboard white LEDs active |
| Photodiode array | 8x8 array: 16 red-filtered, 16 green-filtered, 16 blue-filtered, 16 clear (no filter) |
| Output | Square-wave frequency proportional to detected light intensity, per selected color channel |
| Output frequency range | 2 Hz to 500 kHz, set by S0/S1 scaling pins |
| Sensing distance | ~5-10mm optimal (close-proximity sensing) |
| Interface | Digital pulse frequency — read with pulseIn() or a hardware timer/counter, not analogRead() |
Pinout
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power, 3.3–5V DC depending on breakout |
| 2 | GND | Ground |
| 3 | S0 | Output frequency scaling, bit 0 (paired with S1 — see pinout notes for the scaling table) |
| 4 | S1 | Output frequency scaling, bit 1 |
| 5 | S2 | Photodiode filter select, bit 0 (paired with S3 — selects red/green/blue/clear) |
| 6 | S3 | Photodiode filter select, bit 1 |
| 7 | OUT | Frequency output — connect to a digital input pin capable of pulse timing |
| 8 | OE / LED | Output enable (active LOW) on the bare IC; on most breakout boards this pin instead switches the onboard white LEDs |
S0/S1 output frequency scaling — these two pins set how fast OUT pulses, as a percentage of the sensor's maximum frequency: 00 = power down, 01 = 2%, 10 = 20%, 11 = 100%. Most projects use the 20% setting (S0=1, S1=0); 100% can outrun what pulseIn() can reliably capture on slower microcontrollers.
S2/S3 filter selection — these select which of the four photodiode types is active: 00 = red, 01 = blue, 10 = clear (no filter), 11 = green. Read all three color channels in sequence (switching S2/S3 between each) to build a full RGB reading — a single read only returns one channel.
Ambient light matters a lot — this sensor has no light shielding of its own, so results drift with room lighting unless the target is close (5-10mm) and, ideally, shielded from ambient light with a small enclosure or hood. Calibrate against a known white and black reference under your actual lighting setup rather than trusting raw frequency values.
OUT is a frequency, not a voltage — do not use analogRead() on this pin. Use pulseIn() to measure the pulse width and derive frequency, or better, an interrupt-driven pulse counter if your microcontroller supports one, since pulseIn() blocks and is slow for rapid color-cycling applications.
Variants
Choose the classic TCS3200 when a project specifically wants to learn frequency-based sensing or already has example code built around pulseIn(). For anything new, the TCS34725 is usually the better choice — same sensing quality, but I2C means no timing-sensitive code and it drops straight into existing I2C sketches alongside other sensors.
| Variant | Temp range | Hum range | Accuracy | Protocol | Price |
|---|---|---|---|---|---|
| TCS3200 breakout module | ~$2-4 | ||||
| TCS34725 | ~$3-6 | ||||
| APDS-9960 | ~$4-8 |