GY-31 TCS3200 Color Recognition Sensor Module

  • Uses TCS3200 Sensor for accurate color detection

  • Detects RGB Colors and converts to frequency output

  • Built-in White LEDs for consistent illumination

  • Compatible with Arduino, Raspberry Pi and other microcontrollers

  • Ideal for Line Tracking, Color Sorting, and Robotics Projects

SKU: aA1822 Categories: , Tags: ,

Apple Shopping Event

Hurry and get discounts on all Apple devices up to 20%

350,00 EGP

2 People watching this product now!

Payment Methods:

Description

Give your hardware the ability to “see” and differentiate colors with the GY-31 TCS3200 Color Recognition Sensor Module. Built around the highly accurate TAOS TCS3200 RGB sensor chip, this module acts as a complete color detector by converting light intensity directly into a readable square-wave frequency. It features an 8×8 array of filtered photodiodes and four onboard bright white LEDs to illuminate the target object, ensuring reliable readings regardless of ambient lighting conditions. Because it outputs a simple digital frequency, it interfaces seamlessly with any standard microcontroller—like an Arduino or ESP32—making it the perfect addition to automated color sorting machines, environmental monitoring nodes, or interactive robotic systems.

 

 


Key Features

  • Accurate Color Detection: Utilizes an integrated array of 64 photodiodes (16 Red, 16 Green, 16 Blue, and 16 Clear) to accurately measure and separate the RGB components of reflected light.

  • Direct Frequency Output: Converts detected light intensity directly into a high-resolution square-wave frequency, allowing for easy reading via standard microcontroller digital pins without needing an analog-to-digital converter (ADC).

     

     

  • Programmable Scaling: Features selectable output frequency scaling (2%, 20%, or 100%) via the S0 and S1 pins, allowing you to optimize the module for different processor speeds and timing requirements.

     

     

  • Integrated Lighting: Includes 4 bright white LEDs to provide a consistent light source for the object being measured, effectively neutralizing the impact of external room lighting.

     

     

  • Microcontroller Ready: Operates on standard logic levels and voltages (2.7V to 5.5V), making it immediately plug-and-play compatible with 3.3V and 5V development boards.

     

     


Technical Specifications

Specification Detail
Sensor Chip TAOS TCS3200
Operating Voltage (VCC) 2.7V – 5.5V DC
Output Type Digital Square Wave (Frequency directly proportional to light intensity)
Photodiode Filters Red, Green, Blue, Clear (Selectable via S2 & S3 pins)
Frequency Scaling Power Down, 2%, 20%, 100% (Selectable via S0 & S1 pins)
Optimal Sensing Distance ~10 mm (1 cm)
Temperature Coefficient Stable at 200 ppm/°C
Dimensions

~33.2 mm × 33.2 mm × 25 mm

 

Pinout Configuration

  • VCC: Power Supply (2.7V – 5.5V)

     

  • GND: Ground

     

  • OE: Output Enable (Active Low)

     

  • OUT: Frequency Output Signal

  • S0, S1: Output Frequency Scaling Selection Inputs

  • S2, S3: Photodiode Type (Color Filter) Selection Inputs

     

  • LED: Onboard LED Control (High = On, Low = Off)

🔌
Pin Connections
1 Table
Pin Connections Table 1
BoardSensor PinConnection
TCS3200VCC/GND/S0-S3/OUT3.3-5V / GND / 4 digital pins / 1 digital pin
📟
GY-31 TCS3200 Color Recognition Sensor Module
7 Examples • C/C++ | Boards: Arduino Uno, Arduino Nano, Arduino Mega, ESP32, ESP8266, STM32, Raspberry Pi Pico
GY-31 TCS3200 Color Recognition Sensor Module - Arduino Uno
GY-31 TCS3200 Color Recognition Sensor Module - Arduino Nano
GY-31 TCS3200 Color Recognition Sensor Module - Arduino Mega
GY-31 TCS3200 Color Recognition Sensor Module - ESP32
GY-31 TCS3200 Color Recognition Sensor Module - ESP8266
GY-31 TCS3200 Color Recognition Sensor Module - STM32
GY-31 TCS3200 Color Recognition Sensor Module - Raspberry Pi Pico
📄 File: gy-31_tcs3200_color_recognition_sensor_module_-_arduino_uno.inoArduino Uno
867 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// S0=4, S1=5, S2=6, S3=7, OUT=8 on Arduino Uno
6#define S0 4
7#define S1 5
8#define S2 6
9#define S3 7
10#define OUT_PIN 8
11
12void setup() {
13 Serial.begin(115200);
14 pinMode(S0, OUTPUT); pinMode(S1, OUTPUT);
15 pinMode(S2, OUTPUT); pinMode(S3, OUTPUT);
16 pinMode(OUT_PIN, INPUT);
17 digitalWrite(S0, HIGH); digitalWrite(S1, LOW); // 20% frequency scaling
18}
19
20int readColorFreq(bool s2val, bool s3val) {
21 digitalWrite(S2, s2val); digitalWrite(S3, s3val);
22 return pulseIn(OUT_PIN, LOW, 50000); // lower period = more of that color
23}
24
25void loop() {
26 int red = readColorFreq(LOW, LOW);
27 int blue = readColorFreq(LOW, HIGH);
28 int green = readColorFreq(HIGH, HIGH);
29
30 Serial.print("R:"); Serial.print(red);
31 Serial.print(" G:"); Serial.print(green);
32 Serial.print(" B:"); Serial.println(blue);
33
34 delay(200);
35}
📄 File: gy-31_tcs3200_color_recognition_sensor_module_-_arduino_nano.inoArduino Nano
868 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// S0=4, S1=5, S2=6, S3=7, OUT=8 on Arduino Nano
6#define S0 4
7#define S1 5
8#define S2 6
9#define S3 7
10#define OUT_PIN 8
11
12void setup() {
13 Serial.begin(115200);
14 pinMode(S0, OUTPUT); pinMode(S1, OUTPUT);
15 pinMode(S2, OUTPUT); pinMode(S3, OUTPUT);
16 pinMode(OUT_PIN, INPUT);
17 digitalWrite(S0, HIGH); digitalWrite(S1, LOW); // 20% frequency scaling
18}
19
20int readColorFreq(bool s2val, bool s3val) {
21 digitalWrite(S2, s2val); digitalWrite(S3, s3val);
22 return pulseIn(OUT_PIN, LOW, 50000); // lower period = more of that color
23}
24
25void loop() {
26 int red = readColorFreq(LOW, LOW);
27 int blue = readColorFreq(LOW, HIGH);
28 int green = readColorFreq(HIGH, HIGH);
29
30 Serial.print("R:"); Serial.print(red);
31 Serial.print(" G:"); Serial.print(green);
32 Serial.print(" B:"); Serial.println(blue);
33
34 delay(200);
35}
📄 File: gy-31_tcs3200_color_recognition_sensor_module_-_arduino_mega.inoArduino Mega
868 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// S0=4, S1=5, S2=6, S3=7, OUT=8 on Arduino Mega
6#define S0 4
7#define S1 5
8#define S2 6
9#define S3 7
10#define OUT_PIN 8
11
12void setup() {
13 Serial.begin(115200);
14 pinMode(S0, OUTPUT); pinMode(S1, OUTPUT);
15 pinMode(S2, OUTPUT); pinMode(S3, OUTPUT);
16 pinMode(OUT_PIN, INPUT);
17 digitalWrite(S0, HIGH); digitalWrite(S1, LOW); // 20% frequency scaling
18}
19
20int readColorFreq(bool s2val, bool s3val) {
21 digitalWrite(S2, s2val); digitalWrite(S3, s3val);
22 return pulseIn(OUT_PIN, LOW, 50000); // lower period = more of that color
23}
24
25void loop() {
26 int red = readColorFreq(LOW, LOW);
27 int blue = readColorFreq(LOW, HIGH);
28 int green = readColorFreq(HIGH, HIGH);
29
30 Serial.print("R:"); Serial.print(red);
31 Serial.print(" G:"); Serial.print(green);
32 Serial.print(" B:"); Serial.println(blue);
33
34 delay(200);
35}
📄 File: gy-31_tcs3200_color_recognition_sensor_module_-_esp32.inoESP32
871 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// S0=25, S1=26, S2=27, S3=14, OUT=12 on ESP32
6#define S0 25
7#define S1 26
8#define S2 27
9#define S3 14
10#define OUT_PIN 12
11
12void setup() {
13 Serial.begin(115200);
14 pinMode(S0, OUTPUT); pinMode(S1, OUTPUT);
15 pinMode(S2, OUTPUT); pinMode(S3, OUTPUT);
16 pinMode(OUT_PIN, INPUT);
17 digitalWrite(S0, HIGH); digitalWrite(S1, LOW); // 20% frequency scaling
18}
19
20int readColorFreq(bool s2val, bool s3val) {
21 digitalWrite(S2, s2val); digitalWrite(S3, s3val);
22 return pulseIn(OUT_PIN, LOW, 50000); // lower period = more of that color
23}
24
25void loop() {
26 int red = readColorFreq(LOW, LOW);
27 int blue = readColorFreq(LOW, HIGH);
28 int green = readColorFreq(HIGH, HIGH);
29
30 Serial.print("R:"); Serial.print(red);
31 Serial.print(" G:"); Serial.print(green);
32 Serial.print(" B:"); Serial.println(blue);
33
34 delay(200);
35}
📄 File: gy-31_tcs3200_color_recognition_sensor_module_-_esp8266.inoESP8266
873 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// S0=D0, S1=D1, S2=D2, S3=D3, OUT=D4 on ESP8266
6#define S0 D0
7#define S1 D1
8#define S2 D2
9#define S3 D3
10#define OUT_PIN D4
11
12void setup() {
13 Serial.begin(115200);
14 pinMode(S0, OUTPUT); pinMode(S1, OUTPUT);
15 pinMode(S2, OUTPUT); pinMode(S3, OUTPUT);
16 pinMode(OUT_PIN, INPUT);
17 digitalWrite(S0, HIGH); digitalWrite(S1, LOW); // 20% frequency scaling
18}
19
20int readColorFreq(bool s2val, bool s3val) {
21 digitalWrite(S2, s2val); digitalWrite(S3, s3val);
22 return pulseIn(OUT_PIN, LOW, 50000); // lower period = more of that color
23}
24
25void loop() {
26 int red = readColorFreq(LOW, LOW);
27 int blue = readColorFreq(LOW, HIGH);
28 int green = readColorFreq(HIGH, HIGH);
29
30 Serial.print("R:"); Serial.print(red);
31 Serial.print(" G:"); Serial.print(green);
32 Serial.print(" B:"); Serial.println(blue);
33
34 delay(200);
35}
📄 File: gy-31_tcs3200_color_recognition_sensor_module_-_stm32.inoSTM32
881 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// S0=PA0, S1=PA1, S2=PA2, S3=PA3, OUT=PA4 on STM32
6#define S0 PA0
7#define S1 PA1
8#define S2 PA2
9#define S3 PA3
10#define OUT_PIN PA4
11
12void setup() {
13 Serial.begin(115200);
14 pinMode(S0, OUTPUT); pinMode(S1, OUTPUT);
15 pinMode(S2, OUTPUT); pinMode(S3, OUTPUT);
16 pinMode(OUT_PIN, INPUT);
17 digitalWrite(S0, HIGH); digitalWrite(S1, LOW); // 20% frequency scaling
18}
19
20int readColorFreq(bool s2val, bool s3val) {
21 digitalWrite(S2, s2val); digitalWrite(S3, s3val);
22 return pulseIn(OUT_PIN, LOW, 50000); // lower period = more of that color
23}
24
25void loop() {
26 int red = readColorFreq(LOW, LOW);
27 int blue = readColorFreq(LOW, HIGH);
28 int green = readColorFreq(HIGH, HIGH);
29
30 Serial.print("R:"); Serial.print(red);
31 Serial.print(" G:"); Serial.print(green);
32 Serial.print(" B:"); Serial.println(blue);
33
34 delay(200);
35}
📄 File: gy-31_tcs3200_color_recognition_sensor_module_-_raspberry_pi_pico.inoRaspberry Pi Pico
883 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// S0=10, S1=11, S2=12, S3=13, OUT=14 on Raspberry Pi Pico
6#define S0 10
7#define S1 11
8#define S2 12
9#define S3 13
10#define OUT_PIN 14
11
12void setup() {
13 Serial.begin(115200);
14 pinMode(S0, OUTPUT); pinMode(S1, OUTPUT);
15 pinMode(S2, OUTPUT); pinMode(S3, OUTPUT);
16 pinMode(OUT_PIN, INPUT);
17 digitalWrite(S0, HIGH); digitalWrite(S1, LOW); // 20% frequency scaling
18}
19
20int readColorFreq(bool s2val, bool s3val) {
21 digitalWrite(S2, s2val); digitalWrite(S3, s3val);
22 return pulseIn(OUT_PIN, LOW, 50000); // lower period = more of that color
23}
24
25void loop() {
26 int red = readColorFreq(LOW, LOW);
27 int blue = readColorFreq(LOW, HIGH);
28 int green = readColorFreq(HIGH, HIGH);
29
30 Serial.print("R:"); Serial.print(red);
31 Serial.print(" G:"); Serial.print(green);
32 Serial.print(" B:"); Serial.println(blue);
33
34 delay(200);
35}
Frequency-output color sensor, same protocol as TCS230.

Specification

Specification

WeightWeight6 g
Dimensions3 × 2 × 1 cm
SensorTCS3200
FunctionColor Recognition / Color Sensing
OutputFrequency output corresponding to color intensity
InterfaceDigital pins (S0–S4)
Operating Voltage3.3V–5V
MaterialPCB with electronic components
UsageColor detection projects, robotics, automated sorting, DIY electronics

Customer Reviews