TCS34725
An RGB and clear light colour sensor breakout with an IR-blocking filter and an on-board white LED, read over I2C, for colour detection and light measurement.
- Chip supply2.7 V to 3.6 V (TCS34725, I2C bus at VDD)
- Absolute maximum supply3.8 V
- I2C address0x29; ID register 0x12 reads 0x44
- I2C clockUp to 400 kHz

The TCS34725 measures red, green, blue and clear light through an IR-blocking filter with a 3,800,000:1 dynamic range, gains of 1, 4, 16 or 60× and integration times from 2.4 ms to 614 ms (TCS3472 datasheet TAOS135, pp. 1, 8). It answers at I2C address 0x29 and the chip runs from 2.7 V to 3.6 V (p. 3). The Adafruit breakout adds a 3.3 V regulator, I2C level shifting and a 4150 K white LED, so VIN takes 3.3 V or 5 V.
The TCS34725 has a 3 × 4 array of photodiodes filtered for red, green, blue and unfiltered (clear) light, each feeding its own 16-bit integrating ADC (TAOS datasheet, p. 2). An IR-blocking filter on the die keeps infrared out of the colour channels, which is what makes its readings track what the eye sees under mixed lighting (p. 1).
Sensitivity is set by two knobs: analog gain of 1, 4, 16 or 60×, and integration time from 2.4 ms to 614 ms in 2.4 ms steps (p. 8). Longer integration and higher gain resolve dim light; short integration and low gain avoid saturating in sunlight. From the four channels a library can estimate colour temperature in kelvin and illuminance in lux.
The chip is a 2.7 V to 3.6 V part with a 3.8 V absolute maximum (p. 3). The Adafruit breakout carries a 3.3 V regulator, level shifting for the I2C pins and a neutral 4150 K white LED on a MOSFET, so you can light the object you want to identify; pull the LED pin low to turn it off (Adafruit color sensors guide, pp. 3, 6).
TCS34725 pinout
| Pin | Function | Type |
|---|---|---|
| LED | LED enable | input |
| INT | Interrupt | open collector |
| SDA | I2C SDA3.3 V or 5 V logic | bidirectional |
| SCL | I2C SCL3.3 V or 5 V logic | input |
| 3V3 | 3V33.3 V | power out |
| GND | GND | power in |
| VIN | VIN3.3 V to 5 V | power in |
How to wire the TCS34725
Pin by pin, for the board you have.
| TCS34725 | Arduino Uno | Note |
|---|---|---|
| VIN | 5V | |
| GND | GND | |
| SCL | A5 | |
| SDA | A4 |
- LED and INT are left unconnected: the LED stays on. To switch it, wire LED to a spare pin (D4, say) and drive it LOW to turn it off.
| TCS34725 | ESP32 DevKit V1 | Note |
|---|---|---|
| VIN | 3V3 | |
| GND | GND | |
| SCL | GPIO22 (D22) | |
| SDA | GPIO21 (D21) |
- Power VIN from 3V3 so the level-shifted I2C lines sit at 3.3 V. LED and INT are left unconnected, so the LED stays on.
| TCS34725 | Raspberry Pi Pico | Note |
|---|---|---|
| VIN | 3V3(OUT) | |
| GND | GND | |
| SCL | GP5 | |
| SDA | GP4 |
- Power VIN from 3V3(OUT), not VBUS. LED and INT are left unconnected, so the LED stays on.
TCS34725 code
Every example here compiles for its board.
// TCS34725 on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/tcs34725
// TCS34725 on an Arduino Uno: VIN 5V, SDA A4, SCL A5, address 0x29
#include <Wire.h>
#include <Adafruit_TCS34725.h>
// 154 ms integration (ATIME 0xC0) and 4x gain: a good start indoors
Adafruit_TCS34725 tcs(TCS34725_INTEGRATIONTIME_154MS, TCS34725_GAIN_4X);
void setup() {
Serial.begin(115200);
Wire.begin();
if (!tcs.begin(0x29, &Wire)) {
Serial.println("TCS34725 not found at 0x29. Check wiring.");
while (true) delay(10);
}
Serial.println("TCS34725 ready");
}
void loop() {
uint16_t r, g, b, c;
tcs.getRawData(&r, &g, &b, &c); // waits for one integration cycle
uint16_t kelvin = tcs.calculateColorTemperature(r, g, b);
uint16_t lux = tcs.calculateLux(r, g, b);
Serial.print("R: "); Serial.print(r);
Serial.print(" G: "); Serial.print(g);
Serial.print(" B: "); Serial.print(b);
Serial.print(" Clear: "); Serial.print(c);
Serial.print(" CCT: "); Serial.print(kelvin);
Serial.print(" K Lux: "); Serial.println(lux);
delay(500);
}
Compiled for arduino:avr:uno on 2026-10-30// TCS34725 on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/tcs34725
// TCS34725 on an ESP32 DevKit V1: VIN 3V3, SDA GPIO21, SCL GPIO22, address 0x29
#include <Wire.h>
#include <Adafruit_TCS34725.h>
// 154 ms integration (ATIME 0xC0) and 4x gain: a good start indoors
Adafruit_TCS34725 tcs(TCS34725_INTEGRATIONTIME_154MS, TCS34725_GAIN_4X);
void setup() {
Serial.begin(115200);
Wire.begin(21, 22); // SDA, SCL
if (!tcs.begin(0x29, &Wire)) {
Serial.println("TCS34725 not found at 0x29. Check wiring.");
while (true) delay(10);
}
Serial.println("TCS34725 ready");
}
void loop() {
uint16_t r, g, b, c;
tcs.getRawData(&r, &g, &b, &c); // waits for one integration cycle
uint16_t kelvin = tcs.calculateColorTemperature(r, g, b);
uint16_t lux = tcs.calculateLux(r, g, b);
Serial.print("R: "); Serial.print(r);
Serial.print(" G: "); Serial.print(g);
Serial.print(" B: "); Serial.print(b);
Serial.print(" Clear: "); Serial.print(c);
Serial.print(" CCT: "); Serial.print(kelvin);
Serial.print(" K Lux: "); Serial.println(lux);
delay(500);
}
Compiled for esp32:esp32:esp32 on 2026-10-30// TCS34725 on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/tcs34725
// TCS34725 on a Raspberry Pi Pico (arduino-pico): VIN 3V3(OUT), SDA GP4, SCL GP5, address 0x29
#include <Wire.h>
#include <Adafruit_TCS34725.h>
// 154 ms integration (ATIME 0xC0) and 4x gain: a good start indoors
Adafruit_TCS34725 tcs(TCS34725_INTEGRATIONTIME_154MS, TCS34725_GAIN_4X);
void setup() {
Serial.begin(115200);
Wire.setSDA(4);
Wire.setSCL(5);
Wire.begin();
if (!tcs.begin(0x29, &Wire)) {
Serial.println("TCS34725 not found at 0x29. Check wiring.");
while (true) delay(10);
}
Serial.println("TCS34725 ready");
}
void loop() {
uint16_t r, g, b, c;
tcs.getRawData(&r, &g, &b, &c); // waits for one integration cycle
uint16_t kelvin = tcs.calculateColorTemperature(r, g, b);
uint16_t lux = tcs.calculateLux(r, g, b);
Serial.print("R: "); Serial.print(r);
Serial.print(" G: "); Serial.print(g);
Serial.print(" B: "); Serial.print(b);
Serial.print(" Clear: "); Serial.print(c);
Serial.print(" CCT: "); Serial.print(kelvin);
Serial.print(" K Lux: "); Serial.println(lux);
delay(500);
}
Compiled for rp2040:rp2040:rpipico on 2026-10-30Before you wire it
- Pick gain and integration for the light level: if the clear channel sits near its maximum count, the reading is saturated; lower the gain or the time (datasheet, p. 8).
- Shield the sensor from ambient light when identifying object colour, and keep the object at a fixed distance under the on-board LED.
- Calibrate against a white reference under your own lighting before mapping readings to colour names.
- Remember the fixed address 0x29: the VL53L0X and VL53L1X use it too.
- Never put more than 3.6 V on a bare TCS34725 board without a regulator; the absolute maximum is 3.8 V (p. 3).
- Never read faster than the integration time; getRawData() waits for a full cycle, up to 614 ms at the longest setting (p. 8).
- Never expect accurate RGB from a glossy surface lit at the same angle: the LED's reflection swamps the colour.
- The INT output can be wired to the LED pin so the library's setInterrupt() switches the LED (Adafruit guide, p. 6).
- Colour temperature and lux are estimates computed from the four channels; they assume a typical light spectrum.
- To compare colours, normalise R, G and B by the clear channel, which removes most of the brightness dependence.
- Sharing the bus with a VL53L0X or VL53L1X needs one of them moved: the ToF sensors' address can be changed in software at start-up.
Specifications
- Chip supply
- 2.7 V to 3.6 V (TCS34725, I2C bus at VDD)TAOS TCS3472 datasheet TAOS135 (Aug 2012), p. 3
- Absolute maximum supply
- 3.8 VTAOS TCS3472 datasheet TAOS135 (Aug 2012), p. 3
- I2C address
- 0x29; ID register 0x12 reads 0x44TAOS TCS3472 datasheet TAOS135 (Aug 2012), pp. 3, 18
- I2C clock
- Up to 400 kHzTAOS TCS3472 datasheet TAOS135 (Aug 2012), p. 2
- Gain
- 1×, 4×, 16×, 60×TAOS TCS3472 datasheet TAOS135 (Aug 2012), p. 8
- Integration time
- 2.4 ms to 614 ms, 2.4 ms per step (ATIME = 256 minus steps)TAOS TCS3472 datasheet TAOS135 (Aug 2012), p. 8
- Dynamic range
- 3,800,000:1TAOS TCS3472 datasheet TAOS135 (Aug 2012), p. 1
- Supply current
- 235 µA typical active (330 µA max), 65 µA wait, 2.5 µA sleepTAOS TCS3472 datasheet TAOS135 (Aug 2012), p. 4
- Breakout
- 3.3 V regulator, I2C level shifting, 4150 K white LED on a MOSFET (LED pin low turns it off)Adafruit color sensors guide (PDF), pp. 3, 6
From the ams TCS34725 product page and datasheet, published by ams OSRAM (originally TAOS).
Common mistakes
All channels read 65535 or a flat maximum
The ADCs are saturated. Drop the gain from 60× toward 1× or shorten the integration time; outdoors, start at 1× and 24 ms.
Colours look washed out
Ambient light and the LED's glare mix with the object's colour. Put a short black tube around the sensor and hold the object at a fixed 5 to 10 mm.
Address clash with a ToF sensor
The TCS34725 and ST's VL53L0X and VL53L1X all answer at 0x29. Change the ToF sensor's address at start-up with its XSHUT pin, or use separate buses.
Thinking RGB values are colours
The raw counts depend on the light source, gain and time. Divide by the clear channel and calibrate against known samples before naming a colour.
TCS34725 questions
What is the TCS34725's I2C address?
0x29, fixed (TAOS135 datasheet, p. 3). The TCS34721 and TCS34723 variants sit at 0x39; the ID register reads 0x44 on a TCS34725 (p. 18).
Can the TCS34725 run on 5 V?
The chip cannot: 2.7 V to 3.6 V, 3.8 V absolute maximum (p. 3). The Adafruit breakout has a 3.3 V regulator and I2C level shifting, so it runs from 3.3 V or 5 V.
How do I turn off the white LED?
Pull the LED pin low: wire it to GND, to a GPIO set LOW, or to INT and control it with setInterrupt() (Adafruit guide, p. 6).
TCS34725 or TCS3200?
The TCS34725 is digital I2C with an IR-blocking filter and 16-bit channels; the older TCS3200 outputs a frequency per colour and has no IR filter, so it is harder to read accurately under mixed light.
Can it measure lux?
It estimates lux from its channels, and with an IR-blocking filter it works as an ambient light sensor (datasheet, p. 1). For dedicated lux metering, a VEML7700 or BH1750 is simpler.
Build something with the TCS34725
- Build this
Colour mimic lamp
Hold an object to the sensor and a NeoPixel ring glows the same colour.
- Build this
Candy sorter
Read each sweet's colour and turn a servo chute to the right bin.
- Build this
Light colour temperature meter
Measure a room's light in kelvin and lux.
This page as plain Markdown, for ChatGPT, Claude or your own agent. /components/tcs34725.md