Overview

The TCS3200 (an upgraded version of the TCS230) is a programmable color light-to-frequency converter manufactured by AMS OSRAM (formerly TAOS). It integrates a matrix of 64 silicon photodiodes and a current-to-frequency converter into a single CMOS IC.

The 8×88 \times 8 photodiode array is split into four color filter sets: 16 photodiodes with Red filters, 16 with Green filters, 16 with Blue filters, and 16 Clear (unfiltered). By selecting filter combinations via digital input pins (S2 and S3), the module outputs a 50% duty-cycle square wave on the OUT pin whose frequency is directly proportional to the irradiance of the selected primary color. Four bright white LEDs surround the sensor on breakout boards to provide uniform object illumination for color-sorting robots.

Quick reference

Operating voltage (VCC)2.7 V to 5.5 V DC (5.0 V nominal)
Output signalSquare-wave frequency (50% duty cycle, 0 to 500 kHz0\text{ to }500\text{ kHz})
Control inputsS0, S1 (Frequency Scaling), S2, S3 (Color Filter Select)
Photodiode matrix64 photodiodes (16×Red16 \times \text{Red}, 16×Green16 \times \text{Green}, 16×Blue16 \times \text{Blue}, 16×Clear16 \times \text{Clear})
Onboard illumination4 white spotlight LEDs with LED control pin
Operating current2 mA2\text{ mA} typical (IC only; LEDs draw ~40 mA40\text{ mA})

Pinout

Standard 8-pin or 10-pin breakout board header:

PinNameTypeDescription
1VCCPowerSupply voltage (+2.7 V to +5.5 V DC)
2GNDPowerGround (0 V)
3S0Digital InputOutput frequency scaling selector bit 0
4S1Digital InputOutput frequency scaling selector bit 1
5S2Digital InputPhotodiode color filter selector bit 0
6S3Digital InputPhotodiode color filter selector bit 1
7OUTDigital OutputSquare-wave output frequency pin
8LEDDigital InputActive-Low / High control pin for 4 white LEDs

Specifications

ParameterSymbolMinTypMaxUnitConditions
Supply VoltageVCCV_{CC}2.75.05.5VDC
Output Frequency (Clear)foutf_{out}500600750kHz100%100\% scaling, λ=640 nm\lambda = 640\text{ nm}
Non-LinearityELE_L0.5%2.0%0 to 100 kHz0\text{ to }100\text{ kHz}
Temperature CoefficientTCfTC_f200ppm/°CFrequency output stability
Peak Red SensitivityλR\lambda_R640nmRed filter peak
Peak Green SensitivityλG\lambda_G524nmGreen filter peak
Peak Blue SensitivityλB\lambda_B470nmBlue filter peak

Control Logic Tables

Filter Selection (S2, S3)

S2S3Active Photodiode Filter Set
LOWLOWRed filter
LOWHIGHBlue filter
HIGHLOWClear (no filter)
HIGHHIGHGreen filter

Output Frequency Scaling (S0, S1)

S0S1Output Frequency ScalingTypical Max Frequency
LOWLOWPower Down0 Hz
LOWHIGH2% scaling~10–12 kHz
HIGHLOW20% scaling~100–120 kHz
HIGHHIGH100% scaling~500–600 kHz
Tip

20% scaling (S0=HIGH, S1=LOW) is the most common setting for Arduino and 8-bit microcontrollers, keeping pulse frequencies under 120 kHz120\text{ kHz} for reliable hardware interrupt timing (pulseIn()).

Wiring

TCS3200 PinArduino UnoESP32Notes
VCC5V3.3V / 5VPowers IC and white LEDs
GNDGNDGNDSystem ground
S0Digital D4GPIO 16Set HIGH
S1Digital D5GPIO 17Set LOW (for 20% scaling)
S2Digital D6GPIO 18Color select bit 0
S3Digital D7GPIO 19Color select bit 1
OUTDigital D2 (INT0)GPIO 4Frequency reading pin

Example

cpp
#define S0 4
#define S1 5
#define S2 6
#define S3 7
#define sensorOut 2

void setup() {
  pinMode(S0, OUTPUT);
  pinMode(S1, OUTPUT);
  pinMode(S2, OUTPUT);
  pinMode(S3, OUTPUT);
  pinMode(sensorOut, INPUT);
  
  // Set Frequency scaling to 20%
  digitalWrite(S0, HIGH);
  digitalWrite(S1, LOW);
  
  Serial.begin(9600);
}

void loop() {
  // Read Red Filtered Frequency
  digitalWrite(S2, LOW);
  digitalWrite(S3, LOW);
  int redFreq = pulseIn(sensorOut, LOW);
  
  // Read Green Filtered Frequency
  digitalWrite(S2, HIGH);
  digitalWrite(S3, HIGH);
  int greenFreq = pulseIn(sensorOut, LOW);

  // Read Blue Filtered Frequency
  digitalWrite(S2, LOW);
  digitalWrite(S3, HIGH);
  int blueFreq = pulseIn(sensorOut, LOW);

  Serial.print("R: "); Serial.print(redFreq);
  Serial.print(" | G: "); Serial.print(greenFreq);
  Serial.print(" | B: "); Serial.println(blueFreq);

  delay(500);
}

Common mistakes

  • Inverting frequency and period: pulseIn() measures pulse width period (microseconds). Lower period values correspond to higher color intensity. Remember to map low pulse durations to high RGB intensity values.
  • Ambient light interference: External ambient light drastically alters color balance. Use an opaque hood around the sensor to shield target objects from external room lighting.

Notes

  • TCS3200 vs TCS34725: TCS3200 outputs digital square-wave frequencies; TCS34725 uses I2CI^2C communication with built-in IR-blocking filters.

Assets & downloads