TSL2591 runtime error: Overflow reading light channels

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
Posts: 6
Joined: Sun Apr 26, 2020 3:36 pm

TSL2591 runtime error: Overflow reading light channels

Post by ttadam » Mon May 18, 2020 3:20 pm

Hello there! :)
I have a TSL2591 light sensor with this library. I use this sensor to mesure light from a special kind of partly infra led lamp.
Based on the datasheet this sensor should be good up to 88000 lux which is huge. But I get Overflow errors from around 2940 lux.
This is one okay measurement, above that its runtime error(overflow):

Total light: 2935.916 lux
infrared light: 11313
Visible light: 741434001
full spectrum(IR+ visible) light: 741445314

I tried to mess around with gain. Tried out every option, but no luck.
Also I digged into the library little bit, and I found out the the error is raised because channel_0 is ?too low? . channel_0 is getting his value from here _TSL2591_REGISTER_CHAN0_LOW = const(0x14).

Do you have any tips, what am I missing?
Thanks! :)

Post Reply