Simple TCS34725 code to AMBIENT Color Temperature

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
malowz
 
Posts: 5
Joined: Mon Nov 22, 2021 3:11 am

Simple TCS34725 code to AMBIENT Color Temperature

Post by malowz »

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!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Simple TCS34725 code to AMBIENT Color Temperature

Post by mikeysklar »

Can you paste in some of the values you are seeing for temperature / color?

What sample code are you running Arduino or CircuitPython?

User avatar
malowz
 
Posts: 5
Joined: Mon Nov 22, 2021 3:11 am

Re: Simple TCS34725 code to AMBIENT Color Temperature

Post by malowz »

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

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Simple TCS34725 code to AMBIENT Color Temperature

Post by mikeysklar »

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

User avatar
malowz
 
Posts: 5
Joined: Mon Nov 22, 2021 3:11 am

Re: Simple TCS34725 code to AMBIENT Color Temperature

Post by malowz »

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?
pointing the light at the sensor.
mikeysklar wrote:Have adjusted the gain output (varies from 1x - 60x) meant for low light conditions. This sensor also has an IR filter.
tried fixed examples and autogain, the color value does not change with intensity variation
mikeysklar wrote:Have you taken a look at the datasheet?
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 ;(

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Simple TCS34725 code to AMBIENT Color Temperature

Post by adafruit_support_bill »

on the spot using a DSLR camera for "measurement"
vs
pointing the light at the sensor.
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.

User avatar
malowz
 
Posts: 5
Joined: Mon Nov 22, 2021 3:11 am

Re: Simple TCS34725 code to AMBIENT Color Temperature

Post by malowz »

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.
"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.

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"

User avatar
sj_remington
 
Posts: 997
Joined: Mon Jul 27, 2020 4:51 pm

Re: Simple TCS34725 code to AMBIENT Color Temperature

Post by sj_remington »

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.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Simple TCS34725 code to AMBIENT Color Temperature

Post by adafruit_support_bill »

independent of the distance, intensity, or even using a neutral diffuser on top of the the TCS34725 the values are the same, "very wrong"
Distance and intensity are minor factors. The FOV is very different, so you are not even measuring the same thing.

User avatar
malowz
 
Posts: 5
Joined: Mon Nov 22, 2021 3:11 am

Re: Simple TCS34725 code to AMBIENT Color Temperature

Post by malowz »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”