Hi Mark,
Thanks for the answer but I still do not fully understand.
From my understanding, the raw signal (counts) is dependent from the sensor setting that are the GAIN and integration time, as you said.
Changing these parameters changes the resolution and the detection range, as indicated in the tables.
On the other hand, the lux output should be independent from the parameters, if within the detection range.
I would expect just small variations depending on the different resolution not a 4x variation!
This is what the function _calculateLux and the conversion table are for. Correct?
I had a closer look at the library and I think the index in the _calculateLux function points to the wrong column of the conversion table.
If you look at the following index selection in the _calculateLux function, for GAIN=0.125 (1/8) it points to _convPos = 2 (3rd column of the conversion table, see below) while on the website (https://learn.sparkfun.com/tutorials/qw … e-overview) it is the the 4th column that holds the values for GAIN=1/8. The same is valid for GAIN = 1 and GAIN = 2.
if (_gain == 1.00)
_convPos = 0;
else if (_gain == 2.00)
_convPos = 1;
else if (_gain == .125)
_convPos = 2;
else if (_gain == .25)
_convPos = 3;
else
return UNKNOWN_ERROR;
const float eightHIt[] = {.0036, .0072, .0288, .0576};
const float fourHIt[] = {.0072, .0144, .0576, .1152};
const float twoHIt[] = {.0144, .0288, .1152, .2304};
const float oneHIt[] = {.0288, .0576, .2304, .4608};
const float fiftyIt[] = {.0576, .1152, .4608, .9216};
const float twentyFiveIt[] = {.1152, .2304, .9216, 1.8432};
Please let me know what is your opinion.
I am not an Arduino expert.
Bests,
Matteo