Tags: Color, Sensor, Recognition, Module, GY-31, TCS3200,

Color Sensor Recognition Module GY-31 TCS3200

  • 26.00 AED
    • Ex Tax:26.00 AED
    • Brands China
    • Product Code:
    • Availability: In Stock
    Chip: TCS3200Input voltage: DC 3 - 5VUse bright white LED lightsCan be connected directly with MicrocontrollerStatic detection of the measured object colorBest detection distance: 1cmPackage included:1 x GY-31 TCS3200 Color Sensor Recognition Module For ArduinoHow TCS230 Color Sensor Works..


    Chip: TCS3200
    Input voltage: DC 3 - 5V
    Use bright white LED lights
    Can be connected directly with Microcontroller
    Static detection of the measured object color
    Best detection distance: 1cm

    Package included:

    1 x GY-31 TCS3200 Color Sensor Recognition Module For Arduino

    How TCS230 Color Sensor Works


    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.

    TCS230 TCS3200 Color Sensor Working Principle

    If we take a closer look at the sensor we can see how it detects various colors. The photodiodes have three different color filters. Sixteen of them have red filters, another 16 have green filters, another 16 have blue filters and the other 16 photodiodes are clear with no filters.

    TCS230 TCS3200 Color Sensor Photodiodes Filters How It Works

    All 16 photodiodes are connected in parallel, so using the two control pins S2 and S3 we can select which of them will be read. So for example, if we want to detect red color, we can just use the 16 red filtered photodiodes by setting the two pins to a low logic level according to the table.

    TCS230 Color Sensor Frequency Scaling Photodiode Type Table

    The sensor has two more control pins, S0 and S1 which are used for scaling the output frequency. The frequency can be scaled to three different preset values of 100 %, 20 % or 2%. This frequency-scaling function allows the output of the sensor to be optimized for various frequency counters or microcontrollers.

    Now we are ready to move on and connect the TCS230 sensor to the Arduino board. Here’s the circuit schematics.

    Arduino Color Sensing Tutorial TSC230 TSC3200 Color Sensor Circuit Schematics

    You can get the components needed for this Arduino tutorial from the links below:

    • TCS230 TCS3200 Color Sensor……. 
    • Arduino Board …………………………… 
    • Breadboard and Jump Wires ……… 

    TCS230 Color Sensor Source Code


    Description: First we need to define the pins to which the sensor is connected and define a variable for reading the frequency. In the setup section we need to define the four control pins as outputs and the sensor output as an Arduino input. Here we also need to set the frequency-scaling, for this example I will set it to 20%, and start the serial communication for displaying the results in the Serial Monitor.

    In the loop section, we will start by reading the red filtered photodiodes. For that purpose, we will set the two control pins S2 and S3 to a low logic level. Then using the “pulseIn()” function we will read the output frequency and put it into the variable “frequency”. Using the Serial.print() function we will print the result on the serial monitor. The same procedure goes for the two other colors, we just need to adjust the control pins for the appropriate color.

    1. /* Arduino Color Sensing Tutorial
    2. *
    3. */
    4. #define S0 4
    5. #define S1 5
    6. #define S2 6
    7. #define S3 7
    8. #define sensorOut 8
    9. int frequency = 0;
    10. void setup() {
    11. pinMode(S0, OUTPUT);
    12. pinMode(S1, OUTPUT);
    13. pinMode(S2, OUTPUT);
    14. pinMode(S3, OUTPUT);
    15. pinMode(sensorOut, INPUT);
    16. // Setting frequency-scaling to 20%
    17. digitalWrite(S0,HIGH);
    18. digitalWrite(S1,LOW);
    19. Serial.begin(9600);
    20. }
    21. void loop() {
    22. // Setting red filtered photodiodes to be read
    23. There are no reviews for this product.

      Write a review

      Please login or register to review

    FREE RETURNS

    *for faulty items and in-store drop off for unused items. T&C applies.

    Customer Support

    We really care about you and your order as much as you do. Please contact us without hesitation.

    INTERNATIONAL SHIPPING

    We can ship your order internationally. Please contact us first before proceeding with your order.

    Fast Delivery

    You want your item next day? No problem! We advise contacting us ASAP to insure smooth delivery experience