TCS34725 RGB Color Sensor
Overview
A sensor that detects object colors and measures RGB (Red, Green, Blue) color values. It features a built-in White LED for measurements in dark environments and an infrared (IR) blocking filter to minimize IR spectrum components from external light, enabling accurate color detection. Uses I2C interface.

Specifications
- Operating Voltage: 3.3-5V
- Operating Current: 65 uA
- Detection Range: 3 – 10 mm
- The Clock Frequency: 0 – 400 KHZ
- Interface: I2C
- Temperature Range: -30℃ – + 70 ℃
Supported GPIO
- Raspberry Pi 0~4
- Raspberry Pi 5
- BeagleBone Black/Green
- Jetson Nano
- FT232H, FT2232H, FT4232H
- MCP2221
Commands
[CONFIG]
Configures integration time and gain settings.
Item | Type | Description |
---|---|---|
Integration Time | WRITE | Determines how long the sensor will receive light to measure color. Higher values increase accuracy but also noise, and make measurements slower. (2.4ms,24ms,50ms,60ms,101ms,120ms,154ms,180ms,199ms,240ms, 300ms,360ms,401ms,420ms,480ms,499ms,540ms,600ms,614ms) |
Gain | WRITE | Determines how much to amplify the measured light intensity. Higher values increase sensitivity but also noise. (1x,4x,16x,60x) |
[GET_DATA]
Reads the measured object color (R,G,B) and calculates color temperature and Lux values.
Item | Type | Description |
---|---|---|
R | READ | R value of the measured color |
G | READ | G value of the measured color |
B | READ | B value of the measured color |
Color Temperature * | READ | Calculated color temperature value |
Lux * | READ | Calculated Lux value |
* Reference – Refer to DN40 document
Example
Objective
Detect object colors and display R, G, B values on dashboard widgets.
Parts
Part | Quantity |
---|---|
Raspberry Pi 4 * | 1 |
TCS34725 | 1 |
* Other hardware can also be used. Refer to Supported GPIO.
Wiring
Connect each component to the corresponding connection as listed in each row below.
TCS34725 | GPIO |
---|---|
3V3 | 3.3V |
GND | GND |
SCL | 3 (I2C1 SCL) |
SDA | 2 (I2C1 SDA) |

Project Link