user59381: I am using Arduino UNO with the sensor with the following programm.
#include <Wire.h>

// TCS34725 I2C address is 0x29(41)
#define Addr 0x29

void setup()
{
  // Initialise I2C communication as MASTER
  Wire.begin();
  // Initialise Serial Communication, set baud rate = 9600
  Serial.begin(9600);

  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Select Wait Time register
  Wire.write(0x83);
  // Set wait time = 2.4 ms
  Wire.write(0xFF);
  // Stop I2C Transmission
  Wire.endTransmission();

  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Select Atime register
  Wire.write(0x81);
  // Atime = 700 ms, max count = 65536
  Wire.write(0x00);
  // Stop I2C Transmission on the device
  Wire.endTransmission();

  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Select control register
  Wire.write(0x8F);
  // AGAIN = 1x
  Wire.write(0x00);
  // Stop I2C Transmission
  Wire.endTransmission();

  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Select enable register
  Wire.write(0x80);
  // Power ON, RGBC enable, wait time disable
  Wire.write(0x03);
  // Stop I2C Transmission
  Wire.endTransmission();
  delay(800);
}

void loop()
{
  unsigned int data[8];

  // Start I2C Transmission on the device
  Wire.beginTransmission(Addr);
  // Select data register
  Wire.write(0x94);
  // Stop I2C Transmission on the device
  Wire.endTransmission();

  // Request 8 byte of data from the device
  Wire.requestFrom(Addr, 8);

  // Read 8 bytes of data
  // cData lsb, cData msb, red lsb, red msb, green lsb, green msb, blue lsb, blue msb
  if (Wire.available() == 8)
  {
    data[0] = Wire.read();
    data[1] = Wire.read();
    data[2] = Wire.read();
    data[3] = Wire.read();
    data[4] = Wire.read();
    data[5] = Wire.read();
    data[6] = Wire.read();
    data[7] = Wire.read();
  }

  // Convert the data
  float cData = (data[1] * 256.0) + data[0];
  float red = (data[3] * 256.0) + data[2];
  float green = (data[5] * 256.0) + data[4];
  float blue = (data[7] * 256.0) + data[6];

  // Calculate the final lux
  float luminance = (-0.32466 * red) + (1.57837 * green) + (-0.73191 * blue);

  // Output data to serial monitor
  Serial.print("Red color Luminance   : ");
  Serial.print(red);
  Serial.println(" lux");
  Serial.print("Green color Luminance : ");
  Serial.print(green);
  Serial.println(" lux");
  Serial.print("Blue color Luminance  : ");
  Serial.print(blue);
  Serial.println(" lux");
  Serial.print("IR Luminance          : ");
  Serial.print(cData);
  Serial.println(" lux");
  Serial.print("Ambient Light Luminance : ");
  Serial.print(luminance);
  Serial.println(" lux");
  delay(500);
}

Is the output really in lux or is it counts? If it's counts, how can I calculate the illuminance in lux?

user7508: The output of this program is a very wild guess at what the illuminance
may be. I would definitely no trust it. It uses the same formula as the
function Adafruit_TCS34725::calculateLux(), from the
Adafruit TCS34725 driver. Googling for the numeric
coefficients, I found that the likely source of this formula is the
application note Calculating Color Temperature and Illuminance using
the TAOS TCS3414CS Digital Color Sensor. That application note
seems serious, but it addresses a different model of sensor from the
one you have. It also gives a formula that does not depend on the gain
nor the integration time (maybe that's not adjustable on the TCS3414CS),
which makes absolutely no sense if you have a TCS34725. I found an
issue filed against the Adafruit driver that shows the formulas
used in the library are grossly wrong when compared against a
high-quality lux- and color-meter.
I suggest you try implementing the illuminance formula given in the
application note DN40 – Lux and CCT Calculations using ams Color
Sensors. This documents gives a generic formula with specific
coefficient matching different color sensor models, and it does give
coefficients specific for the TCS3472 family. Adafruit did use this
document to implement a color temperature calculation (function
Adafruit_TCS34725::calculateColorTemperature_dn40()), but they failed
to use it for the illuminance calculation.

59381: <p>I am using Arduino UNO with the sensor with the following programm.</p>

<pre><code>#include &lt;Wire.h&gt;

// TCS34725 I2C address is 0x29(41)
#define Addr 0x29

void setup()
{
  // Initialise I2C communication as MASTER
  Wire.begin();
  // Initialise Serial Communication, set baud rate = 9600
  Serial.begin(9600);

  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Select Wait Time register
  Wire.write(0x83);
  // Set wait time = 2.4 ms
  Wire.write(0xFF);
  // Stop I2C Transmission
  Wire.endTransmission();

  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Select Atime register
  Wire.write(0x81);
  // Atime = 700 ms, max count = 65536
  Wire.write(0x00);
  // Stop I2C Transmission on the device
  Wire.endTransmission();

  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Select control register
  Wire.write(0x8F);
  // AGAIN = 1x
  Wire.write(0x00);
  // Stop I2C Transmission
  Wire.endTransmission();

  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Select enable register
  Wire.write(0x80);
  // Power ON, RGBC enable, wait time disable
  Wire.write(0x03);
  // Stop I2C Transmission
  Wire.endTransmission();
  delay(800);
}

void loop()
{
  unsigned int data[8];

  // Start I2C Transmission on the device
  Wire.beginTransmission(Addr);
  // Select data register
  Wire.write(0x94);
  // Stop I2C Transmission on the device
  Wire.endTransmission();

  // Request 8 byte of data from the device
  Wire.requestFrom(Addr, 8);

  // Read 8 bytes of data
  // cData lsb, cData msb, red lsb, red msb, green lsb, green msb, blue lsb, blue msb
  if (Wire.available() == 8)
  {
    data[0] = Wire.read();
    data[1] = Wire.read();
    data[2] = Wire.read();
    data[3] = Wire.read();
    data[4] = Wire.read();
    data[5] = Wire.read();
    data[6] = Wire.read();
    data[7] = Wire.read();
  }

  // Convert the data
  float cData = (data[1] * 256.0) + data[0];
  float red = (data[3] * 256.0) + data[2];
  float green = (data[5] * 256.0) + data[4];
  float blue = (data[7] * 256.0) + data[6];

  // Calculate the final lux
  float luminance = (-0.32466 * red) + (1.57837 * green) + (-0.73191 * blue);

  // Output data to serial monitor
  Serial.print("Red color Luminance   : ");
  Serial.print(red);
  Serial.println(" lux");
  Serial.print("Green color Luminance : ");
  Serial.print(green);
  Serial.println(" lux");
  Serial.print("Blue color Luminance  : ");
  Serial.print(blue);
  Serial.println(" lux");
  Serial.print("IR Luminance          : ");
  Serial.print(cData);
  Serial.println(" lux");
  Serial.print("Ambient Light Luminance : ");
  Serial.print(luminance);
  Serial.println(" lux");
  delay(500);
}
</code></pre>

<p>Is the output really in lux or is it counts? If it's counts, how can I calculate the illuminance in lux?</p>
 7508: <p>The output of this program is a very wild guess at what the illuminance
may be. I would definitely no trust it. It uses the same formula as <a href="https://github.com/adafruit/Adafruit_TCS34725/blob/1.3.0/Adafruit_TCS34725.cpp#L541-L559" rel="nofollow noreferrer">the
function <code>Adafruit_TCS34725::calculateLux()</code></a>, from the
<a href="https://github.com/adafruit/Adafruit_TCS34725" rel="nofollow noreferrer">Adafruit TCS34725 driver</a>. Googling for the numeric
coefficients, I found that the likely source of this formula is the
application note <a href="https://ams.com/documents/20143/80162/TCS34xx_AN000517_1-00.pdf/1efe49f7-4f92-ba88-ca7c-5121691daff7" rel="nofollow noreferrer">Calculating Color Temperature and Illuminance using
the TAOS TCS3414CS Digital Color Sensor</a>. That application note
seems serious, but it addresses a <em>different model</em> of sensor from the
one you have. It also gives a formula that does not depend on the gain
nor the integration time (maybe that's not adjustable on the TCS3414CS),
which makes absolutely no sense if you have a TCS34725. I found an
<a href="https://github.com/adafruit/Adafruit_TCS34725/issues/21" rel="nofollow noreferrer">issue filed against the Adafruit driver</a> that shows the formulas
used in the library are grossly wrong when compared against a
high-quality lux- and color-meter.</p>
<p>I suggest you try implementing the illuminance formula given in the
application note <a href="https://ams.com/documents/20143/80162/ColorSensors_AN000166_1-00.pdf/c0b4a4b4-9948-f2a7-f8a1-36a8208bd0a9" rel="nofollow noreferrer">DN40 – Lux and CCT Calculations using ams Color
Sensors</a>. This documents gives a generic formula with specific
coefficient matching different color sensor models, and it does give
coefficients specific for the TCS3472 family. Adafruit did use this
document to implement a color temperature calculation (function
<code>Adafruit_TCS34725::calculateColorTemperature_dn40()</code>), but they failed
to use it for the illuminance calculation.</p>
