Arduino B.Tech/Diploma Beginner

RGB Color Detector using TCS3200 Color Sensor & Arduino

DIY Arduino RGB Color Detector using TCS3200 Color Sensor with Arduino Source Code program, circuit diagram & working method

  • Suitable forB.Tech/Diploma Arduino students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

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 Name
Quantity
Purchase Links

Arduino UNO Board

Amazon
AliExpress

TCS3200 Color Sensor
Amazon
AliExpress

16x2 LCD Display

Amazon
AliExpress

Potentiometer 10K

Amazon
AliExpress

Power Supply 9V

Amazon
AliExpress

Connecting Wires
10-20
Amazon
AliExpress

Breadboard

Amazon
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
Single-Supply Operation (2.7V to 5.5V)
High-Resolution Conversion of Light Intensity to Frequency
Programmable Color and Full-Scale Output Frequency
Power Down Feature
Communicates Directly to Microcontroller
S0~S1: Output frequency scaling selection inputs
S2~S3: Photodiode type selection inputs
OUT Pin: Output frequency
OE Pin: Output frequency enable pin (active low), can be impending when using
Support LED lamp light supplement control
11.Size: 28.4×28.4mm
Specifications & Pin Details:
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”.
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

#include <LiquidCrystal.h>
LiquidCrystal
lcd
(

)
;
//RS,EN,D4,D5,D6,D7
const
int
s0
=

;
const
int
s1
=

;
const
int
s2
=

;
const
int
s3
=

;
const
int
out
=

;
// LED pins connected to Arduino
int
redLed
=

;
int
greenLed
=

;
int
blueLed
=

;
// Variables
int
red
=

;
int
green
=

;
int
blue
=

;
void
setup
(
)
{
Serial
begin
(
9600
)
;
lcd
begin
(

)
;
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
(

)
;
lcd
(
" Color Detected "
)
;
//printing name
color
(
)
;
Serial
(
"R Intensity:"
)
;
Serial
(
red
DEC
)
;
Serial
(
" G Intensity: "
)
;
Serial
(
green
DEC
)
;
Serial
(
" B Intensity : "
)
;
Serial
(
blue
DEC
)
;
//Serial.println();
if
(
red
<
blue
&&
red
<
green
&&
red
<

)
{
Serial
println
(
" - (Red Color)"
)
;
lcd
setCursor
(

)
;
lcd
(
" RED Color "
)
;
delay
(

)
;
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
(

)
;
lcd
(
" Blue Color "
)
;
delay
(

)
;
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
(

)
;
lcd
(
" Green Color "
)
;
delay
(

)
;
digitalWrite
(
redLed
LOW
)
;
digitalWrite
(
greenLed
HIGH
)
;
// Turn GREEN LED ON
digitalWrite
(
blueLed
LOW
)
;
}
else
{
Serial
println
(
)
;
lcd
setCursor
(

)
;
lcd
(
" Can't Identify"
)
;
delay
(

)
;
}
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

Technologies used

ArduinoBLELCD

Hardware components

  • Arduino

Software & tools

  • Arduino IDE

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.