Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » RGB Color Detector using TCS3200 Color Sensor & Arduino
Arduino Projects

RGB Color Detector using TCS3200 Color Sensor & Arduino

Mamtaz AlamBy Mamtaz AlamUpdated:February 2, 20259 Comments4 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Arduino RGB Color Detector using TCS3200 Color Sensor
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Introduction:

Thus Arduino RGB Color Detector using TCS3200 Color Sensor is a wonderful project for students who want to have fun with too many colors. In this project, we will be “Interfacing TCS3200 Color Sensor with Arduino” for designing a simple color detector. Earlier we learned about APDS9960 Color Sensor.

Experimental Set-Up has been designed specifically for detecting the frequency of RGB color. The LCD panel directly displays the frequency of RGB color. A combination of all these colors gives a different color. There is various software available which directly converts the combination of RGB frequency into the desired color. The set up is absolutely self-contained and requires no other apparatus.



Bill of Materials:

For designing Arduino RGB Color Detector using TCS3200 Color Sensor we use the following components. Each and every component are described below further.

S.N.Components NameQuantityPurchase Links
1Arduino UNO Board2Amazon | AliExpress
2TCS3200 Color SensorAmazon | AliExpress
516x2 LCD Display1Amazon | AliExpress
6Potentiometer 10K1Amazon | AliExpress
8Power Supply 9V 1Amazon | AliExpress
9Connecting Wires10-20Amazon | AliExpress
10Breadboard1Amazon | AliExpress

Color Sensor

What is TCS3200 Color Sensor

TCS3200 RGB Color Sensor For Arduino is a complete color detector, including a TAOS TCS3200 RGB sensor chip and 4 white LEDs. The TCS3200 can detect and measure a nearly limitless range of visible colors. Applications include test strip reading, sorting by color, ambient light sensing and calibration, and color matching, to name just a few. You can check the TCS3200 Datasheet

The TCS3200 RGB Color Sensor For Arduino has an array of photodetectors, each with either a red, green, or blue filter, or no filter (clear). The filters of each color are distributed evenly throughout the array to eliminate location bias among the colors. Internal to the device is an oscillator that produces a square-wave output whose frequency is proportional to the intensity of the chosen color.

The TCS3200 color sensor can detect a wide variety of colors based on their wavelength. This sensor is especially useful for color recognition projects such as color matching, color sorting, test strip reading, and much more.

Features of TCS3200 Color Sensor

  1. Single-Supply Operation (2.7V to 5.5V)
  2. High-Resolution Conversion of Light Intensity to Frequency
  3. Programmable Color and Full-Scale Output Frequency
  4. Power Down Feature
  5. Communicates Directly to Microcontroller
  6. S0~S1: Output frequency scaling selection inputs
  7. S2~S3: Photodiode type selection inputs
  8. OUT Pin: Output frequency
  9. OE Pin: Output frequency enable pin (active low), can be impending when using
  10. Support LED lamp light supplement control
    11.Size: 28.4×28.4mm

Specifications & Pin Details:

Arduino RGB Color Detector using TCS3200 Color Sensor



RGB Color Detector using TCS3200 Color Sensor & Arduino

Assemble the circuit as shown in the following figure. This figure or Circuit Diagram is for “Interfacing TCS3200 Color Sensor with Arduino” or simply designing “Arduino RGB Color Detector using TCS3200 Color Sensor”.

Arduino RGB Color Detector using TCS3200 Color Sensor


Working Explanation:

The TCS230 senses color light with the help of an 8 x 8 array of photodiodes. Then using a Current-to-Frequency Converter the readings from the photodiodes are converted into a square wave with a frequency directly proportional to the light intensity. Finally, using the Arduino Board we can read the square wave output and get the results for the color.

To TCS3002D, then choose a color filter, it can allow only one particular color to get through and prevent another color. For example, when choosing the red filter, the Only red incident light can get through, blue and green will be prevented. So we can get the red light intensity. Similarly, when choosing other filters we can get blue or green light.

TCS3002D has four photodiode types. Red, blue, green, and clear, reducing the amplitude of the incident light uniformity greatly so that to increase the accuracy and simplify the optical. When the light project to the TCS3002D we can choose the different types of photodiode by different combinations of S2 and S3. Look at the form as follows.

TCS3002D can output the frequency of a different square wave (occupies empties compared 50%), different color and light intensity correspond with a different frequency of the square wave. There is a relationship between output and light intensity. The range of the typical output frequency is 2HZ~500KHZ. We can get different scaling factors by different combinations of S0 and S1. Look at the form as follows.


Source Code: Interfacing TCS3200 Color Sensor with Arduino

Simply copy this code and upload it to the Arduino board. Make sure to have the same connection as indicated above in the circuit diagram of the Arduino RGB Color Detector using TCS3200 Color Sensor.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);//RS,EN,D4,D5,D6,D7
 
const int s0 = 8;  
const int s1 = 9;  
const int s2 = 10;  
const int s3 = 11;  
const int out = 12;  
// LED pins connected to Arduino
int redLed = 16;  
int greenLed = 15;  
int blueLed = 14;
// Variables  
int red = 0;  
int green = 0;  
int blue = 0;  
    
void setup()  
{  
  Serial.begin(9600);
  lcd.begin(16, 2);
  pinMode(s0, OUTPUT);  
  pinMode(s1, OUTPUT);  
  pinMode(s2, OUTPUT);  
  pinMode(s3, OUTPUT);  
  pinMode(out, INPUT);  
  pinMode(redLed, OUTPUT);  
  pinMode(greenLed, OUTPUT);  
  pinMode(blueLed, OUTPUT);  
  digitalWrite(s0, HIGH);  
  digitalWrite(s1, HIGH);  
}  
    
void loop()
{  
   lcd.setCursor(0, 0);
  lcd.print(" Color Detected ");//printing name
  color();
  Serial.print("R Intensity:");  
  Serial.print(red, DEC);  
  Serial.print(" G Intensity: ");  
  Serial.print(green, DEC);  
  Serial.print(" B Intensity : ");  
  Serial.print(blue, DEC);  
  //Serial.println();  
 
  if (red < blue && red < green && red < 20)
  {  
   Serial.println(" - (Red Color)");
    lcd.setCursor(0, 1);  
   lcd.print("    RED Color   ");
   delay(500);
   digitalWrite(redLed, HIGH); // Turn RED LED ON
   digitalWrite(greenLed, LOW);  
   digitalWrite(blueLed, LOW);  
  }  
 
  else if (blue < red && blue < green)  
  {  
   Serial.println(" - (Blue Color)");
   lcd.setCursor(0, 1);
   lcd.print("   Blue Color   ") ;
   delay(500);
   digitalWrite(redLed, LOW);  
   digitalWrite(greenLed, LOW);  
   digitalWrite(blueLed, HIGH); // Turn BLUE LED ON  
  }  
 
  else if (green < red && green < blue)  
  {  
   Serial.println(" - (Green Color)");
   lcd.setCursor(0, 1);
   lcd.print("   Green Color   ");
   delay(500);
   digitalWrite(redLed, LOW);  
   digitalWrite(greenLed, HIGH); // Turn GREEN LED ON
   digitalWrite(blueLed, LOW);  
  }  
  else{
  Serial.println();
  lcd.setCursor(0, 1);
  lcd.print(" Can't Identify");
  delay (500);
  }  
  digitalWrite(redLed, LOW);  
  digitalWrite(greenLed, LOW);  
  digitalWrite(blueLed, LOW);  
}  
    
void color()  
{    
  digitalWrite(s2, LOW);  
  digitalWrite(s3, LOW);  
  //count OUT, pRed, RED  
  red = pulseIn(out, digitalRead(out) == HIGH ? LOW : HIGH);  
  digitalWrite(s3, HIGH);  
  //count OUT, pBLUE, BLUE  
  blue = pulseIn(out, digitalRead(out) == HIGH ? LOW : HIGH);  
  digitalWrite(s2, HIGH);  
  //count OUT, pGreen, GREEN  
  green = pulseIn(out, digitalRead(out) == HIGH ? LOW : HIGH);  
}


Video Preview and Explanation:

Color Sensor Tutorial - RGB Color Detector Project using Arduino & TCS3200
Watch this video on YouTube.

Check more Arduino project here: Arduino Projects

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleGas Leakage Detector using GSM & Arduino with SMS Alert
Next Article How to use Modbus RTU with Arduino to read Sensor Data

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 9 Comments

9 Comments

  1. Lam on July 4, 2018 10:02 PM

    What type of TCS3200 is used? I found many types of them on amazon and ebay

    Reply
    • Alex Newton on July 5, 2018 9:52 AM

      TCS3200 IS ACOLOR SENSOR. Use any. Every sensor basically functions the same

      Reply
  2. Lam on July 4, 2018 10:04 PM

    Can you explain in detail how you actually make it?

    Reply
    • Alex Newton on July 5, 2018 9:52 AM

      Assemble the circuit as for connection diagram and upload the code

      Reply
  3. winson on December 1, 2018 5:23 PM

    why the led no active

    Reply
    • Alex Newton on December 1, 2018 5:27 PM

      It is active.

      Reply
  4. Alex on April 7, 2019 11:27 PM

    My LCD screen seems very dim when connected up and the LEDs flash very dimly when the colour is detected, any idea why?

    Reply
  5. Josh Andre Elisan on December 21, 2019 9:06 PM

    can you add more colors?

    Reply
  6. pawarvivek3679849 on May 7, 2022 9:26 PM

    Can you share PCB design of this

    Reply

CommentsCancel reply

Latest Posts

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 14, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • IoT Based PM & Air Quality Monitoring System using ESP32
    IoT Based PM & Air Quality Monitoring System using ESP32
  • How to use LDR Sensor Module with Arduino
    How to use LDR Sensor Module with Arduino
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • Silicon Controlled Rectifier (SCR): Construction, Working & Applications
    Silicon Controlled Rectifier (SCR): Construction, Working & Applications
  • ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
    ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.