TCS34725 RGB Color Sensor Module I2C for Arduino ESP32 STM32
-
RM20.00
- Product Code: TCS34725
- Availability: In Stock
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.
| 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 |
|---|---|
| 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 |
| 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.
| 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) |
Recommended library: Adafruit TCS34725
In Arduino IDE:
#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);
}
#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);
}
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.
Tags: TCS34725, RGB Sensor, Color Sensor, Arduino, ESP32