adafruit / Adafruit_TSL2591_Library

This is an Arduino library for the TSL2591 digital luminosity (light) sensors.
58 stars 48 forks source link

Inaccurate sensor information #22

Closed NuclearPhoenixx closed 10 months ago

NuclearPhoenixx commented 6 years ago

Hi,

I just found out that together with the Adafruit Unified Sensor API, this sensor reports back inaccurate data, like a minimum value of 0.0 when it should really be more like 0.000118.

https://github.com/adafruit/Adafruit_TSL2591_Library/blob/608b3a2460f8f0c6e2c206f2116303c0568214f6/Adafruit_TSL2591.cpp#L484

And also the resolution seems to not be correct :thinking:

https://github.com/adafruit/Adafruit_TSL2591_Library/blob/608b3a2460f8f0c6e2c206f2116303c0568214f6/Adafruit_TSL2591.cpp#L485

NuclearPhoenixx commented 5 years ago

Any thoughts on this?

caternuson commented 5 years ago

Where does 0.000118 come from? How are you reading back min_value? Why is the resolution incorrect?

NuclearPhoenixx commented 5 years ago

Compared to low cost CdS cells, this sensor is more precise, allowing for exact lux calculations and can be configured for different gain/timing ranges to detect light ranges from 188 uLux up to 88,000 Lux on the fly.

caternuson commented 5 years ago

That's probably indicating the minimum detectable lux. Zero lux will still be zero, so the minimum output is zero.

The driver doesn't actually use any of those parameters internally. They're more like meta data about the sensor. How are you using them in your application?

NuclearPhoenixx commented 5 years ago

Don't know about the min lux limit...

Anyways, of course I know it's meta data and I'm not really using it for any real code, but it would be nice if those values actually reflected the real ones. And I'm not really sure anymore what's the correct data anymore.

caternuson commented 5 years ago

Are you getting bad readings using the library read functions? Like shown in the example? https://github.com/adafruit/Adafruit_TSL2591_Library/blob/master/examples/tsl2591/tsl2591.ino

NuclearPhoenixx commented 5 years ago

Like I said, since this is meta data this has nothing to do with the reading themselves. This is just about the documentation part.

caternuson commented 10 months ago

Closing for now. Can re-open if these values are creating an issue. The actual datasheet information on what these should be is lacking.

NuclearPhoenixx commented 10 months ago

You're right with the datasheet, but it would be nice if the values in the software at least reflect the value that you use to promote the sensor on your website i.e. sensor->min_value=0.000188. It's very confusing to see the values online and then see completely different ones in the software.