I have an TSL2561 connected to an ESP32 with this library: https://github.com/adafruit/micropython ... it-tsl2561
Documentation: https://micropython-tsl2561.readthedocs ... index.html
I don't understand the output of the TSL2561 sensor. For example:
Code: Select all
import tsl2561
from machine import I2C, Pin
i2c = I2C(scl=Pin(22), sda=Pin(21))
sensor = tsl2561.TSL2561(i2c, address=41)
sensor.gain(1)
sensor.integration_time(13)
print(sensor.read())
print(sensor.read(autogain=True))
print(sensor.read(autogain=True, raw=True))
print()
sensor.gain(16)
sensor.integration_time(13)
print(sensor.read())
print(sensor.read(autogain=True))
print(sensor.read(autogain=True, raw=True))
print()
sensor.gain(1)
sensor.integration_time(402)
print(sensor.read())
print(sensor.read(autogain=True))
print(sensor.read(autogain=True, raw=True))
print()
sensor.gain(16)
sensor.integration_time(402)
print(sensor.read())
print(sensor.read(autogain=True))
print(sensor.read(autogain=True, raw=True))
Code: Select all
%Run test.py
3.480131
2.995391
(90, 33)
2.995391
2.995391
(90, 33)
3.078674
3.09314
(2677, 964)
3.095333
3.09314
(2673, 962)
As luminosity is a physical quantity, shouldn't it be independent of the setting of gain and integration time?
There's another thing confusing me. The output of line 8 is 3.480131 and the output of line 15 is 2.995391. The gain in line 15 is 16 and 1 in line 8. I would expect the luminosity to be larger with higher gain. Am I wrong?