Adafruit_APDS9960
Adafruit_APDS9960 copied to clipboard
calculateLux does not reflect APDS sensor documentation
-
Arduino board: ESP32
-
Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.16
-
List the steps to reproduce the problem below: In any condition a call to apds.calculateLux returns incorrect results. You can reproduce this via: uint16_t lux = apds.calculateLux(r, g, b); or uint32_t lux = apds.calculateLux(r, g, b);
The values used as RGB conversion factors in the library are not correct and do not reflect the irradiance responsivity described in APDS documentation. This results in the calculated lux values being completely wrong.
if my math is right, which it probably isn't totally;
double lux = (double(c) / (2360.0)) * 468.2344;
would work better, where c is the clear output 'count'. I used this as a basis for calculating lux given the 'clear' sensitivity
(here)