

The TCS34725 is a high-performance color sensor manufactured by Arduino, with the part ID UNO. It is designed to detect and measure the intensity of red, green, blue, and clear light. The sensor features an integrated infrared (IR) filter to minimize IR interference, ensuring accurate color measurements. It communicates via the I2C protocol, making it easy to integrate into microcontroller-based projects.








The TCS34725 is a versatile and precise sensor with the following key specifications:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V to 5V |
| Communication Interface | I2C |
| I2C Address (Default) | 0x29 |
| Spectral Range | Red, Green, Blue, and Clear Light |
| IR Filter | Integrated |
| Maximum I2C Clock Speed | 400 kHz |
| Operating Temperature | -30°C to 85°C |
| Dimensions | 20mm x 20mm (typical breakout) |
The TCS34725 is typically available on a breakout board with the following pin configuration:
| Pin Name | Description |
|---|---|
| VIN | Power supply input (3.3V to 5V) |
| GND | Ground connection |
| SDA | I2C data line |
| SCL | I2C clock line |
| INT | Interrupt output (optional, for advanced use cases) |
Adafruit_TCS34725 library for Arduino to simplify communication with the sensor.Below is an example code snippet to read RGB and clear light values from the TCS34725 using the Arduino UNO:
#include <Wire.h>
#include "Adafruit_TCS34725.h"
// Create an instance of the TCS34725 sensor
Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_700MS,
TCS34725_GAIN_1X);
void setup() {
Serial.begin(9600); // Initialize serial communication
if (tcs.begin()) {
Serial.println("TCS34725 found and initialized.");
} else {
Serial.println("No TCS34725 found. Check connections.");
while (1); // Halt execution if sensor is not found
}
}
void loop() {
uint16_t r, g, b, c; // Variables to store color data
// Read RGB and clear light values
tcs.getRawData(&r, &g, &b, &c);
// Print the values to the Serial Monitor
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); // Wait for 500ms before the next reading
}
Sensor Not Detected
Inaccurate Color Readings
No Data Output
Adafruit_TCS34725 library is installed and the sensor is initialized correctly in the code.Q: Can the TCS34725 measure light intensity?
A: Yes, the sensor provides a "clear" channel that measures overall light intensity.
Q: Is the TCS34725 compatible with 3.3V microcontrollers?
A: Yes, the sensor operates at both 3.3V and 5V, making it compatible with a wide range of microcontrollers.
Q: How do I extend the I2C cable length?
A: Use shielded cables and lower the I2C clock speed to reduce noise and ensure reliable communication.
By following this documentation, you can effectively integrate the TCS34725 into your projects and achieve accurate color sensing results.