0

Accuracy of TCS34725
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Accuracy of TCS34725

by sketchy on Thu Oct 03, 2013 11:16 am

When I run the TCS34725 example script I get the following values for the LUX at my current lighting:

gain_1x: 767
gain_4x 2850
gain_16X 12080
gain_60X 34196

I then measured with a LX1010B Light Meter and got a reading of 440

Should the gain_1x (767) be *that* different than the reading I received on the Light meter (440) under the same lighting conditions?

And a related question....while the doc notes the gain parameter can boost the light significantly = how should I best use this parameter when initializing the TCS34725 (library)?

thank you.

sketchy
 
Posts: 217
Joined: Thu Jun 28, 2012 11:37 pm

Re: Accuracy of TCS34725

by adafruit_support_bill on Thu Oct 03, 2013 11:37 am

Like all sensors, there is variability between units and they need to be calibrated against a standard. But there are other factors that can account for the discrepancy. These sensors both measure incident light, but the LX1010B has a large diffusing disc in front of the sensor. This will alter the effective angular responsivity of the sensor. They may also be differences in the spectral response of the two sensors. These are documented for the TCS34725 here: http://www.adafruit.com/datasheets/TCS34725.pdf.

Gain is helpful in low-light situations to improve the resolution of the readings (usually in exchange for increased noise). You just have to remember to divide the reading by the gain used to obtain it.

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

Re: Accuracy of TCS34725

by sketchy on Fri Oct 04, 2013 7:37 am

Thank you very much for the reply/insights.

To clarify (i apologize for what is perhaps common knowledge yet i lack?)...could you please comment on the below:

Gain - amplifies the signal in order to provide a closer reading to the "real" value. This is valuable (but of limited value) in low light situations (since both the signal and noise are amplified) - e.g.: as gain is used in videography as a last resort versus adding more light.
The TCS34725 supports amplifying the signal by 4, 16, an 60. The value provided based on the gain then needs to be divided by the amount of gain. So in my readings, the value for a gain of 60x is 570. Which is closer to the 440 reading of the light meter. Other factors on how the two read light characteristics is most likely causing a significant part of the differences in readings.

When to use which gain is "an art." e.g.: would i put in my sketch if lux < 500 use a gain of 60x ...if lux is < 1000 but > 500 use a gain of 16x and so on? (based on adhoc testing)...or IS there a rule of thumb?

QUESTION: You note calibration. Do you have a reference/method you'd recommend for calibration of the TCS34725?

Thank you!

sketchy
 
Posts: 217
Joined: Thu Jun 28, 2012 11:37 pm

Re: Accuracy of TCS34725

by adafruit_support_bill on Fri Oct 04, 2013 8:14 am

Gain - amplifies the signal in order to provide a closer reading to the "real" value. This is valuable (but of limited value) in low light situations (since both the signal and noise are amplified)

Not exactly. The 3.8 million-to-one dynamic range of the sensor means that measurements at the lower end of that range would only be using 1 or 2 bits of the A/D resolution. Gain amplifies the signal so it is in the range where the A/D converter can measure it with reasonable resolution. Yes, noise is amplified too. But without gain, you would not be able to distinguish some signals from the noise.

The optimal gain to use in a given situation is the one that makes use of the full 16-bits of A/D resolution. That would be the gain that puts the reading somewhere between mid-range and full-scale.

QUESTION: You note calibration. Do you have a reference/method you'd recommend for calibration of the TCS34725?

This is the NIST standard (temporarily unavailable due to politics): http://www.nist.gov/calibrations/upload/sp250-37.pdf

But the appropriate calibration method mostly depends on how you plan to use it. If you require lux readings comparable to your LX1010B, then calibrate it to agree with that. Take readings at several different illuminance levels, first with one sensor, then the other. Make sure that the position and orientation of the sensors are the same for each reading. Plot the results and calculate the 'correction' function to map one to the other.

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

Re: Accuracy of TCS34725

by sketchy on Wed Oct 09, 2013 6:28 am

A question on integration time. Is it the same as exposure time for a camera?

regarding the data sheet:

RGBC Timing Register (0x01)

The RGBC timing register controls the internal integration time of the RGBC clear and IR channel ADCs in
2.4-ms increments. Max RGBC Count = (256 − ATIME) × 1024 up to a maximum of 65535.
Table 6. RGBC Timing Register
FIELD BITS DESCRIPTION
ATIME 7:0 VALUE INTEG_CYCLES TIME MAX COUNT
0xFF 1 2.4 ms 1024
0xF6 10 24 ms 10240
0xD5 42 101 ms 43008
0xC0 64 154 ms 65535
0x00 256 700 ms 6553

In the above, does the INTEG_CYCLES (e.g.: 700 ms has 256 INTEG_CYCLES) refer to the number of times the spectrum was sampled and ADC converted? What is the max count?

thank you.

sketchy
 
Posts: 217
Joined: Thu Jun 28, 2012 11:37 pm

Re: Accuracy of TCS34725

by adafruit_support_bill on Wed Oct 09, 2013 6:56 am

Yes. It is pretty much the same as camera exposure time. This can help in low-light. It can also make a difference with non-constant sources like fluorescents. You need to integrate over some number of 60Hz cycles to get an accurate average measurement.

The term "count" in the context of sensors usually means the raw ADC output. I would interpret "MAX COUNT" to be the full-scale reading for the specified integration cycle setting.

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

Please be positive and constructive with your questions and comments.