The TSL2561 sensor is a luminosity sensor. It's spectral sensivity approximately meets the human eye sensivity. The gain of the sensor can be set to a 16xgain mode with the settings. It is connected to the ESP via I²C so connecting even with several sensors and a display is easy to do. The sensor gives luminosity as a digital value.
The TSL2561 runs well on 3,3V so no level shifter or special power supply is needed.
The bare circuit is very small and difficult to handle and solder. Usually you will use a breakout board from the market that is much easier to handle.
Connecting the TSL2561 is easy. Just connect it as shown in the schematic:
TSL2561 ESP GND GND VCC 3,3V SCL D1(GPIO5) SDA D2(GPIO4) ADDR not connected.
If you're connecting several devices to I²C and/or using longer cabling please see the "Basics: The I²C Bus" wiki for further informations. []
First check if the TSL2561 show up:
Go to the "Advanced" Tab and click "I²C Scan" It should show this result:
Set up the ESPEasy task according to the screenshot.
Integration time: The sensor uses two photo detectors to meter luminosity. The values are calculated with a built-in circuit into "Lux" value. The "integration time" can be equaled to the shutter of a camera. For a darker environment a longer shutter time is usefull as it makes the sensor more senitive.
Technically the integration time says how many measurement cycles are done and the values collected before the conversion into a lux value takes place. A long integration time makes the sensor more sensitive this way - and somewhat slow. This is nice if a short light in the night might influence your home control, in case of controlling window blinds by outside light for example.
Rule of thumb: the longer the integration time is, the more exact is the result, the more sensitive is the sensor and the slower the sensor works.
Gain: The sensivity can be set to 16x gain with this setting.
Submit your settings. After some seconds the tasklist will show like this:
If it shows all values as zero, don't worry. Wait a minute and refresh the browser page.
See "Basics: Calibrating" for further information []
Your TSL2561 does not show up at I²C-scan
Usually this failure results of cabling faults. If your device does not show up, SCL and SCA might be swapped or the module does not get power or ground. If you are testing on a breadboard, the breadboard contacts might be worn out or you got some faulty cables. A digital multimeter will help with this sutuations.
Your TSL2561 shows all values zero
The I²C-scan showed your TSL2561 but after submitting and returning to the task list all values are zero. First, wait a minute and then refresh the page. Depending on the "Delay" value in the settings it might take some seconds until the first measurement takes place. If that does not help, switch the ESP completely off and back on after some seconds.
Your TSL2561 shows deviating values
This might have several reasons.
These sensors all have their own tolerances. On top the analog to digital conversion produces a deviation of about +/- 1...2 digits.
It is possible to calibrate sensors using a formula See "Basics: Calibrating" for further information []
Last but not least problems with the power supply are quite usual. See "Basics: Taming false positives" in the wiki for info about filtering power supply. []