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?
Thanks in advance!
Simple TCS34725 code to AMBIENT Color Temperature
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- malowz
- Posts: 5
- Joined: Mon Nov 22, 2021 3:11 am
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Simple TCS34725 code to AMBIENT Color Temperature
Can you paste in some of the values you are seeing for temperature / color?
What sample code are you running Arduino or CircuitPython?
What sample code are you running Arduino or CircuitPython?
- malowz
- Posts: 5
- Joined: Mon Nov 22, 2021 3:11 am
Re: Simple TCS34725 code to AMBIENT Color Temperature
Hi! im using with arduino pro mini, using Adafruit_TCS34725 libraries, "tcs34725.ino" sample
function "tcs.colorTemperature()"
for example, a 6500k led (using a rgb led and a e27 led, that show 6500k on the spot using a DSLR camera for "measurement") show as 5400k on the sensor readout.
3200k show as 2800k
8500k show as 6200k
other library/example code show the same result
function "tcs.colorTemperature()"
for example, a 6500k led (using a rgb led and a e27 led, that show 6500k on the spot using a DSLR camera for "measurement") show as 5400k on the sensor readout.
3200k show as 2800k
8500k show as 6200k
other library/example code show the same result
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Simple TCS34725 code to AMBIENT Color Temperature
malowz,
Are you measuring these by pointing the LED directly at the TCS34725 sensor or by reading the LED output reflected off a surface?
Have adjusted the gain output (varies from 1x - 60x) meant for low light conditions. This sensor also has an IR filter.
Have you taken a look at the datasheet?
https://cdn-shop.adafruit.com/datasheets/TCS34725.pdf
Are you measuring these by pointing the LED directly at the TCS34725 sensor or by reading the LED output reflected off a surface?
Have adjusted the gain output (varies from 1x - 60x) meant for low light conditions. This sensor also has an IR filter.
Have you taken a look at the datasheet?
https://cdn-shop.adafruit.com/datasheets/TCS34725.pdf
- malowz
- Posts: 5
- Joined: Mon Nov 22, 2021 3:11 am
Re: Simple TCS34725 code to AMBIENT Color Temperature
pointing the light at the sensor.mikeysklar wrote:Are you measuring these by pointing the LED directly at the TCS34725 sensor or by reading the LED output reflected off a surface?
tried fixed examples and autogain, the color value does not change with intensity variationmikeysklar wrote:Have adjusted the gain output (varies from 1x - 60x) meant for low light conditions. This sensor also has an IR filter.
yes, if i could not get to work properly i think will try to do simple math from raw rgb to get a "near correct" color value ;(mikeysklar wrote:Have you taken a look at the datasheet?
- adafruit_support_bill
- Posts: 88136
- Joined: Sat Feb 07, 2009 10:11 am
Re: Simple TCS34725 code to AMBIENT Color Temperature
vson the spot using a DSLR camera for "measurement"
Those are two very different measurement conditions and I wold not expect the readings to match. The spot reading on the DSLR is reading the light of the LED alone. The sensor has a Lambertian sensitivity pattern with an FOV of nearly 180 degrees and will be integrating all the ambient illumination as reflected by surfaces in the background and periphery.pointing the light at the sensor.
- malowz
- Posts: 5
- Joined: Mon Nov 22, 2021 3:11 am
Re: Simple TCS34725 code to AMBIENT Color Temperature
"on the spot" i mean precisely the kelvin value. im using a WhiBal to reflect the RGB light on the camera and setting the kelvin value on the camera i get a perfectly white balance (RGB color on histogram are aligned) tru the kelvin range range of the RGB led.adafruit_support_bill wrote:Those are two very different measurement conditions and I wold not expect the readings to match. The spot reading on the DSLR is reading the light of the LED alone. The sensor has a Lambertian sensitivity pattern with an FOV of nearly 180 degrees and will be integrating all the ambient illumination as reflected by surfaces in the background and periphery.
this show the values of the RGB led are precise, and the "camera agrees".
independent of the distance, intensity, or even using a neutral diffuser on top of the the TCS34725 the values are the same, "very wrong"
- sj_remington
- Posts: 1021
- Joined: Mon Jul 27, 2020 4:51 pm
Re: Simple TCS34725 code to AMBIENT Color Temperature
As Bill says, the camera and the TCS34725 are measuring very different things, and will almost always disagree.
Color temperature has a well defined meaning only for radiation emitted by an ideal black body. Everything else is an approximation.
Color temperature has a well defined meaning only for radiation emitted by an ideal black body. Everything else is an approximation.
- adafruit_support_bill
- Posts: 88136
- Joined: Sat Feb 07, 2009 10:11 am
Re: Simple TCS34725 code to AMBIENT Color Temperature
Distance and intensity are minor factors. The FOV is very different, so you are not even measuring the same thing.independent of the distance, intensity, or even using a neutral diffuser on top of the the TCS34725 the values are the same, "very wrong"
- malowz
- Posts: 5
- Joined: Mon Nov 22, 2021 3:11 am
Re: Simple TCS34725 code to AMBIENT Color Temperature
i'm measuring the reflected light in the whibal and the led pointed at the rgb sensor in a dark room, so o don't think the way i'm doing it is the problem.
just the math behind the sensor input to kelvin values are
just the math behind the sensor input to kelvin values are
Please be positive and constructive with your questions and comments.