

The TCS34725 is a highly accurate color sensor capable of detecting and measuring the intensity of red, green, blue, and clear (non-filtered) light. It features an integrated infrared (IR) blocking filter, which enhances color accuracy by reducing IR interference. The sensor communicates via the I2C protocol, making it easy to integrate with microcontrollers and development boards like the Arduino UNO.
This component is widely used in applications such as:








The TCS34725 is designed for precision and ease of use. Below are its key technical details:
| Parameter | Value |
|---|---|
| Supply Voltage (VDD) | 2.7V to 3.6V |
| I/O Voltage | 1.8V to 3.6V |
| Communication Interface | I2C (7-bit address: 0x29) |
| Operating Current | 240 µA (typical) |
| Standby Current | 2.5 µA (typical) |
| Light Sensing Range | 3,800,000:1 dynamic range |
| IR Blocking Filter | Integrated |
| Integration Time | Programmable (2.4 ms to 700 ms) |
| Operating Temperature | -30°C to +85°C |
The TCS34725 is typically available in a 6-pin package. Below is the pinout:
| Pin | Name | Description |
|---|---|---|
| 1 | VDD | Power supply input (2.7V to 3.6V) |
| 2 | GND | Ground connection |
| 3 | SDA | I2C data line |
| 4 | SCL | I2C clock line |
| 5 | INT | Interrupt output (active low, optional use) |
| 6 | LED | LED control pin (optional, for external illumination) |
To use the TCS34725 with an Arduino UNO, follow these steps:
Wiring: Connect the sensor to the Arduino as follows:
Install Required Libraries: Use the Adafruit TCS34725 library for easy integration. Install it via the Arduino IDE Library Manager.
Arduino Code Example: Below is a sample code to read RGB and clear light values from the TCS34725:
#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
// Get raw data from the sensor
tcs.getRawData(&r, &g, &b, &c);
// Print the RGB and clear light values
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(1000); // Wait 1 second before the next reading
}
Sensor Not Detected:
Inaccurate Color Readings:
No Data Output:
Q: Can the TCS34725 measure light intensity in lux?
A: Yes, the sensor can estimate lux values using its clear light channel. The Adafruit library includes functions for this purpose.
Q: Is the interrupt pin necessary for basic operation?
A: No, the INT pin is optional and used for advanced applications like threshold-based interrupts.
Q: Can I use the TCS34725 with a 5V microcontroller?
A: Yes, but you must use a level shifter for the I2C lines to prevent damage to the sensor.
By following this documentation, you can effectively integrate the TCS34725 into your projects for accurate color and light sensing.