TCS34725 RGB Color Sensor Module I2C for Arduino ESP32 STM32

  • RM20.00

  • Product Code: TCS34725
  • Availability: In Stock

TCS34725 RGB Color Sensor Module with IR Filter

The TCS34725 is a high accuracy RGB color sensor module with an integrated IR blocking filter and white LED. It uses the I2C communication interface and is suitable for Arduino UNO, Arduino Nano, ESP32, STM32, Raspberry Pi and other microcontroller projects.

This module can detect Red, Green, Blue and Clear light values, making it suitable for colour identification, colour sorting, ambient light sensing and DIY automation projects.


Features

  • TCS34725 RGB colour sensor IC
  • Detects Red, Green, Blue and Clear light values
  • Built-in IR blocking filter for improved colour accuracy
  • On-board white LED for object illumination
  • I2C communication interface
  • Default I2C address: 0x29
  • Compatible with Arduino UNO / Nano
  • Compatible with ESP32
  • Compatible with STM32 and Raspberry Pi
  • Suitable for colour recognition and light sensing projects

Specifications

Sensor IC TCS34725
Communication I2C
I2C Address 0x29
Detected Channels Red, Green, Blue and Clear
Input Voltage 3.3V - 5V
Logic Interface I2C
Built-in LED White LED
IR Filter Yes

Pin Description

Pin Description
VIN Power input, 3.3V - 5V
GND Ground
3V3 3.3V output
SCL I2C clock
SDA I2C data
INT Interrupt output, active low
LED White LED control input

Arduino UNO / Nano Wiring

TCS34725 Arduino UNO / Nano
VIN 5V
GND GND
3V3 3.3V
SCL A5
SDA A4
INT D2 (Optional)
LED D3 (Optional)

For basic colour reading, only VIN, GND, SCL and SDA are required. The INT and LED pins are optional.


ESP32 Wiring

TCS34725 ESP32
VIN 5V VIN or 3.3V
GND GND
3V3 3.3V
SCL GPIO 22
SDA GPIO 21
INT GPIO 19 (Optional)
LED GPIO 23 (Optional)

Arduino Library

Recommended library: Adafruit TCS34725

In Arduino IDE:

  1. Go to Sketch → Include Library → Manage Libraries
  2. Search for Adafruit TCS34725
  3. Install the library

Arduino UNO / Nano Example Code

#include <Wire.h>
#include "Adafruit_TCS34725.h"

Adafruit_TCS34725 tcs =
Adafruit_TCS34725(
    TCS34725_INTEGRATIONTIME_50MS,
    TCS34725_GAIN_4X
);

void setup() {

    Serial.begin(9600);

    if (tcs.begin()) {
        Serial.println("TCS34725 sensor found");
    } else {
        Serial.println("No TCS34725 found. Check wiring.");
        while (1);
    }
}

void loop() {

    uint16_t r, g, b, c;

    tcs.getRawData(&r, &g, &b, &c);

    Serial.print("Red: ");
    Serial.print(r);

    Serial.print("  Green: ");
    Serial.print(g);

    Serial.print("  Blue: ");
    Serial.print(b);

    Serial.print("  Clear: ");
    Serial.println(c);

    delay(500);
}

ESP32 Example Code

#include <Wire.h>
#include "Adafruit_TCS34725.h"

Adafruit_TCS34725 tcs =
Adafruit_TCS34725(
    TCS34725_INTEGRATIONTIME_50MS,
    TCS34725_GAIN_4X
);

void setup() {

    Serial.begin(115200);

    Wire.begin(21, 22);

    if (tcs.begin()) {
        Serial.println("TCS34725 sensor found");
    } else {
        Serial.println("No TCS34725 found. Check wiring.");
        while (1);
    }
}

void loop() {

    uint16_t r, g, b, c;

    tcs.getRawData(&r, &g, &b, &c);

    Serial.print("Red: ");
    Serial.print(r);

    Serial.print("  Green: ");
    Serial.print(g);

    Serial.print("  Blue: ");
    Serial.print(b);

    Serial.print("  Clear: ");
    Serial.println(c);

    delay(500);
}

Example Applications

  • Colour recognition system
  • Colour sorting machine
  • DIY colour detector
  • Robot colour sensing
  • RGB measurement
  • Ambient light sensing
  • Smart lighting projects
  • Educational Arduino projects
  • ESP32 automation projects

Package Includes

  • 1 x TCS34725 RGB Color Sensor Module
  • 1 x Pin Header

Note:
Actual PCB colour, component arrangement or printing may vary slightly between production batches. Please refer to the product images for the current module version.

Write a review

Note: HTML is not translated!
    Bad           Good

 

Tags: TCS34725, RGB Sensor, Color Sensor, Arduino, ESP32