Grove - Sunlight Sensor V2 correct usage

Hi! I did get some sense out of it, but I had to do it myself. I went over the datasheet for a while and modified the library code to get it to work. The sensor does NOT have a UV sensor unlike advertised, which was a disappointment. The code for it in the library is garbage.

It does however have a visible light and IR sensing capabilities, which it outputs in lux. I couldn’t modify the code in a way that it would produce the correct lux values, perhaps it can be done by messing with the registers in the datasheet, but at least I did not succeed in that. I’m not even really sure if my modified library code is giving me data from the visible light or IR sensor, but it is giving something. Working with the registers has been quite the challenge.

For me to get accurate lux readings I had to calibrate the sensors values against a calibrated lux sensor. I can link the code for the modified library and calibration I used if you want.