TCS34725 RGB Color Sensor

From Let's Control It
Jump to: navigation, search


This Plugin in currently only available in the latest DEV build on github, but should in the next official release

The ESP module can read the TCS34725 RGB Color Sensor via the i2c protocol. Be sure to calibrate your sensor by having it fixed on certain distance from the objects being analyzed. And be aware that highly glossy objects might be interpreted as whiter than what your eyes are experiencing, this is due to the fact that the high gloss makes more light bounce back from the object. Calibration is done by experimenting with the time and gain and also the formula for each individual RGB color.

Our test objects are a white piece of paper (80g A4 paper) and a black fabric (a blanket). These objects are analyzed from a distance of 10mm.


The TCS34725 sensor can be connected directly to an ESP module by using the two pins SDA and SCL. These pins can be configured on the hardware tab.



ESP Easy

Use the device tab on the ESP Easy webinterface and create a new task. Select "Luminosity & Color - TCS34725" from the dropdown box.

Select the Integration Time and Gain Factor you want. We used 24ms for time and 4x for gain. By testing the blanket and the paper we found that the best values are obtained with the following formula for all three RGB colors: %value%*0.9, more thorough experiments might give you better results.

TCS34725-RGB-Color-Sensor settings.jpg

Optional settings

Use of formulas

Example of getting color names instead of RGB values

Use of value names