TCS34725 Color Sensor Color Sensor RGB Development Board Module

Model:
TCS34725 Color Sensor Module
Chip Model:
TCS34725FN
Communication Interface:
I2C
I2C Address:
0x29
Operating Voltage:
3.3V - 5V
Output Resolution:
4‑channel RGBC, 16‑bit per channel
Operating Temperature:
-30℃ to +70℃
Pinout:
VCC, GND, SDA, SCL, INT, LED
Interface Types:
PH2.0 / XH2.54
Applications:
Color recognition and sorting, ambient light sensing, RGB color mixing, smart lighting, product color detection

TCS34725 color sensor module Product Overview

The TCS34725 color sensor module is a high‑precision RGB full‑color recognition sensor based on the TCS34725FN chip. It identifies surface colors through optical sensing, supporting red, green, blue (RGB) and clear light sensing, outputting 4‑channel 16‑bit digital values. The module integrates an infrared blocking filter to minimize the IR spectral component of incident light for accurate color measurement. Onboard 4 high‑brightness LED fill‑lights enable operation under low ambient light. It communicates via I2C interface, supports 3.3V/5V power supply, with a detection distance of 3‑10mm. Widely used in color recognition and sorting, ambient light sensing and calibration, product color detection, and smart lighting.


TCS34725 color sensor module Core Features

The TCS34725 color sensor module uses the original ams TCS34725FN chip with 4 independent analog‑to‑digital converters (ADCs), providing 4‑channel RGBC data output at 16‑bit resolution per channel. The 3.8M:1 wide dynamic range enables accurate color measurement under various lighting conditions. The built‑in IR blocking filter minimizes infrared and UV effects for accurate color measurement. It communicates via I2C interface with a default 7‑bit address of 0x29. Onboard voltage level translation supports both 3.3V and 5V operating voltages. Onboard 4 high‑brightness LED fill‑lights are controlled via the LED pin, supporting PWM brightness adjustment. Supports light intensity interrupt output with programmable upper/lower thresholds. Module size is 27mm × 20mm, available with PH2.0 and XH2.54 (breadboard‑compatible) interfaces. Operating temperature range is -30℃ to +70℃ (chip‑grade -40℃ to +85℃).


TCS34725 color sensor module Applications

The TCS34725 color sensor module is widely used in color recognition and sorting (e.g., product sorting, object color detection), ambient light sensing and calibration, RGB LED color mixing and lighting control, smart lighting and color temperature adjustment, electronic color pickers and color matching devices, smart home color sensing, educational robotics, and Arduino/STM32 development projects.


TCS34725 color sensor module Key Advantages

The TCS34725 color sensor module offers high sensitivity, wide dynamic range, and low power consumption. Built‑in ADC eliminates the need for external ADC chips, simplifying circuit design. 16‑bit high‑resolution output enables accurate color reproduction. The IR blocking filter ensures accurate color measurement without IR interference. Onboard 4 high‑brightness LED fill‑lights enable use under low ambient light. I2C interface uses only SDA and SCL signal lines, saving I/O resources. Onboard voltage level translation supports both 3.3V and 5V systems. Comprehensive supporting materials are provided for Arduino, Raspberry Pi, STM32, and other platforms. Adafruit and other open‑source libraries facilitate rapid development.


Why Choose QIXINWEI

Years of experience in the electronics industry. Trusted by global customers.

Massive In-Stock Inventory – Ready to ship promptly

BOM Matching Service – One-stop solution, save time

PCBA Customization – Professional engineering team creates tailor-made solutions based on your needs

Cost-Effective & Efficient – Better channel, better cost

A dedicated team makes your procurement smoother.

Contact us for BOM quotes or PCBA inquiries





FAQ

1. How does the TCS34725 color sensor differ from the traditional TCS3200/TCS230, and why is it better suited for accurate color measurement?
The TCS3200/TCS230 outputs a square‑wave frequency to indirectly represent RGB components, requiring the MCU to measure frequency or pulse width—slow and easily affected by ambient light. The TCS34725, in contrast, features a built‑in 16‑bit high‑precision ADC and outputs digitized Clear, R, G, and B channel values directly over the I2C bus. It also includes adjustable gain and integration time, enabling stable, accurate readings even in low light. An integrated IR‑blocking filter effectively suppresses infrared interference, making color measurements much closer to human visual perception. It is ideal for applications requiring precise color recognition, light‑source color‑temperature calibration, and object sorting in both industrial and consumer projects.

2. Does the module support both 3.3 V and 5 V systems? How should I connect it safely?
Most TCS34725 modules include an on‑board low‑dropout regulator (LDO) and level‑shifting circuitry, so the VCC pin can accept 3.3 V to 5 V directly. The I2C lines (SDA, SCL) are typically pulled up to VCC and are compatible with both 3.3 V and 5 V logic levels. Whether you are using a 3.3 V ESP32/STM32 or a 5 V Arduino, you can connect directly without external level‑shifting chips. To be safe, check your module’s schematic before first use to confirm the presence of the LDO and level‑shifters.

3. How should I wire it? What is the I2C address? Can multiple modules be used simultaneously?
Only four wires are needed: VCC, GND, SDA, and SCL. The TCS34725 has a fixed 7‑bit I2C address of 0x29 that cannot be changed via hardware pins. Therefore, only one TCS34725 can be placed on a single I2C bus. If multiple color sensors are needed, you can use an I2C multiplexer (e.g., TCA9548A) to expand the bus into several channels, each with its own sensor. The module also provides an LED pin that can drive a high‑brightness white LED for supplemental lighting when measuring object surface colors.

4. Why do my RGB readings shift with ambient light, and how do I perform a white‑balance calibration?
The TCS34725 measures the spectrum of light reflected from an object, so changes in the ambient light’s spectral composition (e.g., sunlight vs. incandescent vs. LED) directly affect the RGB values. Performing a white‑balance calibration greatly improves color‑recognition consistency. Aim the sensor at a standard white reference (such as a sheet of white paper or an 18% gray card) under the same lighting conditions, read the four channels, and compute scaling factors for R, G, and B relative to the Clear channel. During subsequent measurements, multiply each object’s RGB values by these factors to obtain ambient‑light‑independent relative reflectance, making color judgments far more robust.

5. How do I set the gain and integration time? How can I optimize readings under different lighting conditions?
The sensor supports four gain levels—1×, 4×, 16×, and 60×—and integration times ranging from 2.4 ms to 614 ms. In bright light, use low gain and a short integration time to avoid channel saturation (readings hitting the 65535 ceiling). In dim light, use high gain and a long integration time to capture sufficient signal. A good starting point is the default setting (16× gain, 154 ms integration time). If readings are too low or saturated, adjust gradually. Ideally, the Clear channel count should stay between 10,000 and 50,000 to ensure adequate dynamic range and signal‑to‑noise ratio.

6. How do I control the white LED on the module, and when should it be turned on?
The module usually includes a high‑brightness white LED controlled through the chip’s LED pin. You can set the output current for this pin via a register. When measuring the surface color of an opaque object, turn on the LED to provide stable illumination and reduce the influence of ambient light variations. When using the sensor for ambient‑light color‑temperature detection (e.g., sensing the warm/cool hue of room lighting), the LED must be turned off so that the sensor directly receives the ambient light. Note that the LED can heat up if kept on at full brightness for extended periods; it is recommended to pulse it only during the sampling moment or control its duty cycle in firmware.

7. How many colors can the sensor distinguish, and how accurate is the color recognition?
The TCS34725 outputs 16‑bit relative intensity values for the R, G, and B channels, not a direct color name. By converting the RGB values to HSL (Hue‑Saturation‑Lightness) or HSV color space, you can define hue ranges that map to different color categories. Under ideal conditions, it can reliably distinguish dozens to over a hundred colors—sufficient for color sorting, smart lighting, and color‑picker applications. To achieve industrial‑grade color‑difference detection (e.g., ΔE measurement), however, you also need strict light‑source control, white‑balance calibration, and spectral‑matching algorithms.

8. Are there ready‑made libraries for Arduino, ESP32, or STM32 development?
Very mature libraries are available. For Arduino and ESP32, the `Adafruit TCS34725` library is highly recommended. It offers a clean API for initializing the sensor, setting gain and integration time, and reading raw RGB as well as normalized color‑temperature data. On STM32, you can use a HAL‑based port of the same library or write your own I2C read/write functions. Example sketches are included that demonstrate how to read colors and display them on the serial monitor, allowing you to run your first color‑recognition program within minutes.

9. Does the TCS34725 have a built‑in IR filter? Why are readings inaccurate when measuring black objects?
The chip integrates an IR‑blocking filter that effectively suppresses infrared light beyond 700 nm, making the spectral response of the RGB channels close to the human eye’s color‑matching functions. However, black objects reflect very little light, resulting in a low signal‑to‑noise ratio; any small ambient‑light leakage or circuit noise can cause relatively large errors. When measuring black objects, increase the gain and integration time, keep the distance between the sensor and the object fixed, and prevent stray light from directly entering the sensor window. If possible, use an enclosed measurement chamber with internal LED illumination to dramatically improve repeatability for dark objects.

10. How can I build a small color sorter or smart lighting controller with this sensor?
The basic approach for a color sorter is: use an LED to provide stable illumination, place differently colored items directly beneath the sensor, read the RGB values, convert them to the HSL space, and set hue threshold ranges for each color. Based on the recognition result, the MCU controls a servo or solenoid to push the item into the appropriate sorting bin. For a smart lighting controller, the idea is reversed: point the sensor toward the environment, read the ambient light’s RGB values, convert them to a correlated color temperature, and adjust the drive parameters of a tunable‑white LED strip according to that temperature so that the lighting automatically compensates for ambient changes and maintains a constant atmosphere.