

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 |
|---|---|
| Supply Voltage (VDD) | 3.3V to 5V |
| Communication Interface | I2C |
| I2C Address | 0x29 |
| Operating Current | 240 µA (typical) |
| Standby Current | 2.5 µA (typical) |
| Light Sensing Range | 0 to 65,535 (16-bit resolution) |
| IR Filter | Integrated |
| Operating Temperature | -30°C to 85°C |
The TCS34725 module typically comes with the following pinout:
| 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) |
Below is an example code snippet to read RGB and clear light values from the TCS34725 using an 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
tcs.getRawData(&r, &g, &b, &c); // Read raw color data
// Calculate color temperature and lux (optional)
uint16_t colorTemp = tcs.calculateColorTemperature(r, g, b);
uint16_t lux = tcs.calculateLux(r, g, b);
// Print the results to the Serial Monitor
Serial.print("R: "); Serial.print(r);
Serial.print(" G: "); Serial.print(g);
Serial.print(" B: "); Serial.print(b);
Serial.print(" C: "); Serial.print(c);
Serial.print(" Temp: "); Serial.print(colorTemp); Serial.print(" K");
Serial.print(" Lux: "); Serial.println(lux);
delay(1000); // Wait 1 second before the next reading
}
Adafruit_TCS34725 library must be installed via the Arduino Library Manager.Sensor Not Detected
Inaccurate Readings
No Output on Serial Monitor
Q: Can the TCS34725 measure ambient light intensity?
A: Yes, the sensor can measure ambient light intensity in lux using its clear light channel.
Q: Is the TCS34725 compatible with 3.3V microcontrollers?
A: Yes, the sensor operates with both 3.3V and 5V logic levels, making it compatible with a wide range of microcontrollers.
Q: How do I reduce noise in the sensor readings?
A: Use proper shielding to minimize electrical noise and avoid placing the sensor near high-frequency components.
Q: Can I use multiple TCS34725 sensors on the same I2C bus?
A: The TCS34725 has a fixed I2C address (0x29), so using multiple sensors requires an I2C multiplexer.
By following this documentation, you can effectively integrate and utilize the TCS34725 color sensor in your projects.