Skip to content
color

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 typeTAOS TCS3200 programmable color light-to-frequency converter
Operating voltage2.7V–5.5V (breakout modules run at 3.3V or 5V)
Operating current~25-30 mA with onboard white LEDs active
Photodiode array8x8 array: 16 red-filtered, 16 green-filtered, 16 blue-filtered, 16 clear (no filter)
OutputSquare-wave frequency proportional to detected light intensity, per selected color channel
Output frequency range2 Hz to 500 kHz, set by S0/S1 scaling pins
Sensing distance~5-10mm optimal (close-proximity sensing)
InterfaceDigital pulse frequency — read with pulseIn() or a hardware timer/counter, not analogRead()

Pinout

PinNameDescription
1VCCPower, 3.3–5V DC depending on breakout
2GNDGround
3S0Output frequency scaling, bit 0 (paired with S1 — see pinout notes for the scaling table)
4S1Output frequency scaling, bit 1
5S2Photodiode filter select, bit 0 (paired with S3 — selects red/green/blue/clear)
6S3Photodiode filter select, bit 1
7OUTFrequency output — connect to a digital input pin capable of pulse timing
8OE / LEDOutput 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.

VariantTemp rangeHum rangeAccuracyProtocolPrice
TCS3200 breakout module~$2-4
TCS34725~$3-6
APDS-9960~$4-8