Hi, a newbie here. I am trying to use TCS34725 for a color detection project. When connected to Arduino uno, my sensor shows very low values.
Values should be between 0-65536 right? I am trying to calibrate it with black and white but I am not happy with the readings I get.
When in normal light condition my values are Color Temp: 4599 K - Lux: 54 - R: 76 G: 80 B: 64 C: 229
When exposed to black, Color Temp: 4600 K - Lux: 213 - R: 298 G: 313 B: 251 C: 925
When exposed to white, Color Temp: 4661 K - Lux: 3169 - R: 4160 G: 4520 B: 3571 C: 13214
I check my connections between the sensor and Arduino, they are all correct.
You haven't said what integration time you have selected.
You haven't said what "normal light condition" means - indoor/outdoor? There's about a 500:1 ratio between bright sun and indoor lighting so it really matters what
you mean...
I see the readings for white much bigger than for black, looks entirely sensible.
I am sorry about that. I am using the tcs34725 code that is in the examples of the "Adafruit_TCS34725" library.
I tested the sensor indoor.
Even though my sensor readings for white is much bigger than readings for black, when I divide them by 256 to get values between 0-256, I get RGB values like (5, 6, 6) for white. Then it is a little hard to differentiate between colors when I do color detection right?
Divide by a smaller number, so that the maximum result you see in any color channel is 255.
Given these measurements:
When exposed to black, Color Temp: 4600 K - Lux: 213 - R: 298 G: 313 B: 251 C: 925
When exposed to white, Color Temp: 4661 K - Lux: 3169 - R: 4160 G: 4520 B: 3571 C: 13214
a good divisor could be 4520/255 (= 18, rounded up).
The integer division results are then:
Black R: 16 G: 17 B: 13
White R: 231 G: 251 B: 198
Do you know what gain means? The sensor has a photo detector (or 3 of them I guess), and then a programmable-gain amplifier, then an ADC. Changing the gain swaps resolution for headroom in bright conditions.