Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Simple TCS34725 code to AMBIENT Color Temperature
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Simple TCS34725 code to AMBIENT Color Temperature

by malowz on Mon Nov 22, 2021 3:19 am

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!

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

Re: Simple TCS34725 code to AMBIENT Color Temperature

by mikeysklar on Tue Nov 23, 2021 8:27 pm

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

What sample code are you running Arduino or CircuitPython?

mikeysklar
 
Posts: 6242
Joined: Mon Aug 01, 2016 8:10 pm

Re: Simple TCS34725 code to AMBIENT Color Temperature

by malowz on Wed Nov 24, 2021 7:01 pm

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

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

Re: Simple TCS34725 code to AMBIENT Color Temperature

by mikeysklar on Wed Nov 24, 2021 8:07 pm

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

mikeysklar
 
Posts: 6242
Joined: Mon Aug 01, 2016 8:10 pm

Re: Simple TCS34725 code to AMBIENT Color Temperature

by malowz on Thu Nov 25, 2021 1:10 am

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 ;(

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

Re: Simple TCS34725 code to AMBIENT Color Temperature

by adafruit_support_bill on Thu Nov 25, 2021 8:27 am

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.

adafruit_support_bill
 
Posts: 82457
Joined: Sat Feb 07, 2009 10:11 am

Re: Simple TCS34725 code to AMBIENT Color Temperature

by malowz on Thu Nov 25, 2021 3:45 pm

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"

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

Re: Simple TCS34725 code to AMBIENT Color Temperature

by sj_remington on Thu Nov 25, 2021 7:18 pm

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.

sj_remington
 
Posts: 196
Joined: Mon Jul 27, 2020 4:51 pm

Re: Simple TCS34725 code to AMBIENT Color Temperature

by adafruit_support_bill on Thu Nov 25, 2021 8:44 pm

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.

adafruit_support_bill
 
Posts: 82457
Joined: Sat Feb 07, 2009 10:11 am

Re: Simple TCS34725 code to AMBIENT Color Temperature

by malowz on Fri Nov 26, 2021 2:45 am

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

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

Please be positive and constructive with your questions and comments.