TCS34725 RGB Color Sensor Module
TCS34725 RGB Color Sensor Module
High-Accuracy Digital Color Detection with IR Filter
Introduction
The TCS34725 is a digital RGB color sensor with IR blocking filter that provides precise color sensing through an I2C interface. This sensor offers better color accuracy than traditional light-to-frequency sensors by providing direct digital outputs for red, green, blue, and clear light sensing.
Key Features
True RGB Sensing
Separate digital outputs for red, green, blue, and clear channels
IR Filter
Integrated IR blocking filter for accurate color measurement
Programmable
Adjustable integration time and gain
I2C Interface
Simple connection with 3.3V or 5V microcontrollers
Technical Specifications
Detection Range | 380nm-780nm (Visible Light Spectrum) |
---|---|
Resolution | 16-bit per channel (RGB and Clear) |
Interface | I2C (0x29 default address) |
Supply Voltage | 2.7V – 3.6V (5V tolerant I/O) |
Current Consumption | 0.65mA (typical at 50ms integration) |
Integration Time | 2.4ms – 614ms (programmable) |
Gain Settings | 1x, 4x, 16x, 60x |
Pin Configuration

Pin | Label | Description | Arduino Connection |
---|---|---|---|
1 | VCC | Power (3.3V) | 3.3V |
2 | GND | Ground | GND |
3 | SCL | I2C Clock | A5 (Uno) or SCL |
4 | SDA | I2C Data | A4 (Uno) or SDA |
5 | LED | LED control (optional) | Digital pin (optional) |
6 | INT | Interrupt output (optional) | Digital pin (optional) |
Note: The sensor requires proper lighting conditions for accurate color detection
Wiring with Arduino
// Basic I2C Connections: // VCC → 3.3V // GND → GND // SCL → A5 (Uno) or SCL // SDA → A4 (Uno) or SDA // Optional connections: // LED → Digital pin (to control illumination LED) // INT → Digital pin (for interrupt functionality) // Requires Adafruit TCS34725 library
Important: Use 3.3V power supply for the sensor, though I/O pins are 5V tolerant
Basic Color Detection Example
// TCS34725 Color Sensor Basic Example #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("Could not find TCS34725 sensor"); while (1); } } void loop() { uint16_t r, g, b, c; tcs.getRawData(&r, &g, &b, &c); Serial.print("R: "); Serial.print(r); Serial.print(" G: "); Serial.print(g); Serial.print(" B: "); Serial.print(b); Serial.print(" C: "); Serial.println(c); delay(500); }
Advanced Features
Color Temperature
// Calculate color temperature
uint16_t colorTemp = tcs.calculateColorTemperature(r, g, b);
Serial.print("Color Temp: "); Serial.print(colorTemp); Serial.println(" K");
Lux Calculation
// Calculate illuminance (lux)
uint16_t lux = tcs.calculateLux(r, g, b);
Serial.print("Lux: "); Serial.println(lux);
Interrupt Function
// Set interrupt thresholds
tcs.setInterrupt(true); // Enable interrupt
tcs.setIntLimits(1000, 2000); // Set low and high thresholds
// Connect INT pin to handle interrupts
RGB to Hex
// Convert RGB to hex color code
String rgbToHex(uint16_t r, uint16_t g, uint16_t b) {
char hexColor[8];
sprintf(hexColor, "#%02X%02X%02X", r>>8, g>>8, b>>8);
return String(hexColor);
}
Troubleshooting
Sensor Not Detected
- Verify I2C connections (SCL/SDA)
- Check sensor address (default 0x29)
- Ensure proper power supply (3.3V)
Inaccurate Readings
- Adjust integration time for lighting conditions
- Use proper gain setting (1x, 4x, 16x, 60x)
- Ensure consistent lighting and distance
Saturation Issues
- Reduce integration time
- Lower gain setting
- Move sensor further from light source
Related Posts
MG90S Mini Digital 180° Servo
MG90S Mini Digital 180° Servo
Metal Gear, 2.2kg·cm Torque for RC and Robotics
Introduction
The MG90S is a compact di...
XKC-Y25-V Non-Contact Water Liquid Level Sensor
XKC-Y25-V Non-Contact Water Liquid Level Sensor
Capacitive Detection Without Physical Contact
Introduction
The XKC-Y...
Waterproof Ultrasonic Obstacle Sensor, Sensor with Separate Probe
+
Waterproof Ultrasonic Obstacle Sensor
Distance Measurement with Separate Waterproof Probe
Introduction
The Wa...
Water Level Depth Detection Sensor
Water Level Depth Detection Sensor
Liquid Measurement for Arduino and IoT Projects
Introduction
The Water Level Dept...
VL53L0X Purple Laser Distance Sensor Module
VL53L0X Laser Distance Sensor Module
High-Speed, High-Precision Time-of-Flight Distance Measurement
Introduction
The...
TCS3200 Color Sensor Module
TCS3200 Color Sensor Module
Precise RGB Color Detection for Arduino and Embedded Projects
Introduction
The TCS3200 C...
PN532 NFC RFID Read/Write Module V3 Kit
PN532 NFC RFID Read/Write Module V3 Kit
Advanced Near Field Communication for Arduino and Embedded Systems
Introducti...
HC-SR501 PIR Motion Sensor Module
HC-SR501 PIR Motion Sensor Module
Passive Infrared Detection for Security and Automation Projects
Introduction
The H...
Flex Sensor 5.6 cm (Detect Bending Motion)
Flex Sensor 5.6cm
Bend Detection Sensor for Arduino and Wearable Electronics Projects
Introduction
The 5.6cm...
ACS712 Current Sensor Module
ACS712 5A Current Sensor Module
Hall-Effect Based AC/DC Current Measurement for Arduino Projects
Introduction
The AC...
AS608 Optical Fingerprint Sensor Module
AS608 Optical Fingerprint Sensor Module
High-Precision Biometric Recognition for Arduino and Microcontroller Projects
...
DHT11 Temperature and Humidity Sensor Module
DHT11 Temperature & Humidity Sensor
Basic Environmental Sensing with Status LED for Arduino Projects
Introduction...
Recent Comments