> Source: https://www.tinkered.ai/components/tcs34725 (Tinkered). Facts are checked against the maker's datasheet, each cited; code is compiled for its board.
> When you use this page in an answer, cite https://www.tinkered.ai/components/tcs34725. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# 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.

Source page: https://www.tinkered.ai/components/tcs34725
Datasheet: https://ams-osram.com/products/sensor-solutions/ambient-light-color-spectral-proximity-sensors/ams-tcs34725-color-sensor

## In short

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).

## Agent rules

Follow these when you wire this part or write code for it.

- Do: 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).
- Do: Shield the sensor from ambient light when identifying object colour, and keep the object at a fixed distance under the on-board LED.
- Do: Calibrate against a white reference under your own lighting before mapping readings to colour names.
- Do: 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.
- On an Arduino Uno: 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.
- On an ESP32 DevKit V1: 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.
- On a Raspberry Pi Pico: Power VIN from 3V3(OUT), not VBUS. LED and INT are left unconnected, so the LED stays on.

## Pinout

| Pin | Function | Type |
| --- | --- | --- |
| LED | LED enable | input |
| INT | Interrupt | open collector |
| SDA | I2C SDA · 3.3 V or 5 V logic | bidirectional |
| SCL | I2C SCL · 3.3 V or 5 V logic | input |
| 3V3 | 3V3 · 3.3 V | power out |
| GND | GND | power in |
| VIN | VIN · 3.3 V to 5 V | power in |

## Wiring

### Arduino Uno

| TCS34725 | Arduino Uno | Note |
| --- | --- | --- |
| VIN | 5V |  |
| GND | GND |  |
| SCL | A5 |  |
| SDA | A4 |  |

Warning: 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.

### ESP32 DevKit V1

| TCS34725 | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| VIN | 3V3 |  |
| GND | GND |  |
| SCL | GPIO22 (D22) |  |
| SDA | GPIO21 (D21) |  |

Warning: 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.

### Raspberry Pi Pico

| TCS34725 | Raspberry Pi Pico | Note |
| --- | --- | --- |
| VIN | 3V3(OUT) |  |
| GND | GND |  |
| SCL | GP5 |  |
| SDA | GP4 |  |

Warning: Power VIN from 3V3(OUT), not VBUS. LED and INT are left unconnected, so the LED stays on.

## Code

### Arduino Uno

Libraries: adafruit/Adafruit TCS34725

```cpp
// 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.

### ESP32 DevKit V1

Libraries: adafruit/Adafruit TCS34725

```cpp
// 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.

### Raspberry Pi Pico

Libraries: adafruit/Adafruit TCS34725

```cpp
// 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-30.

## Specifications

| Spec | Value | Source |
| --- | --- | --- |
| 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 V | TAOS TCS3472 datasheet TAOS135 (Aug 2012), p. 3 |
| I2C address | 0x29; ID register 0x12 reads 0x44 | TAOS TCS3472 datasheet TAOS135 (Aug 2012), pp. 3, 18 |
| I2C clock | Up to 400 kHz | TAOS 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:1 | TAOS TCS3472 datasheet TAOS135 (Aug 2012), p. 1 |
| Supply current | 235 µA typical active (330 µA max), 65 µA wait, 2.5 µA sleep | TAOS 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 |

## Circuit notes

- 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.

## 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.

## 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.

## Related parts

- [APDS-9960](https://www.tinkered.ai/components/apds-9960.md): Colour plus proximity and gesture in one chip
- [VEML7700](https://www.tinkered.ai/components/veml7700.md): Dedicated ambient light (lux) sensor
- [NeoPixel Ring 12](https://www.tinkered.ai/components/neopixel-ring-12.md): Show the detected colour on LEDs
- [SG90 Micro Servo](https://www.tinkered.ai/components/servo-sg90.md): Sort objects by colour

## Try it

Tinkered can design a circuit with the TCS34725, draw its schematic and check it. Free to start at https://www.tinkered.ai.
