Hi, i got a Tcs34725 module to measure ambient temperature (to adjust led temperature to match ambient) and testing sample codes (adafruit and others) seems all of them are to measure the reflected color from the build-in led.
but i'm looking to measure AMBIENT light temperature, not reflected color. using the sample codes provided by the modules the kelvin values are way way off.
anyone using it to measure ambient temperature can help out? sample code or how to change the math behind the kelvin value measurements?
well, lets replace "ambient" by a "source of light"
the led is already off, but the temperature color value the sensor gives is based on the reflection of that led, not a direct light source on the sensor, that is the problem
No, it is not, and it makes no sense to calculate color temperature for reflected light.
The color temperature approximation is based on the readings of the three or four photodiodes (depending on which algorithm you use), assuming that they are pointed at a single light source.
but the sensor examples are made to detect the color of objects based on the led reflected light, so if the led is 3200k or 6500k the result would be very different, no?
Correct, but it is meaningless to calculate color temperature from those readings.
if the led is 3200k or 6500k the result would be very different
Yes, of course! Object "color" is relative to illumination and background.
Unfortunately, RGB values from photodiodes are not closely related to how humans perceive color, especially under different lighting conditions and local color contrast.