Light/Lux - TSL2561 NORMAL



The TSL2561 are light-to-digital converters that transform light intensity to a digital signal output. First targeted to accompany LCD and OLED displays in order to dim them if the ambient light is lower, making the battery life better for the unit its a part of. The unit can also be found in illuminated keyboards and digital cameras.

The TSL2561 sensor is a luminosity sensor. It’s spectral sensitivity approximately meets the human eye sensitivity. The gain of the sensor can be set to a 16x gain 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.

  • Output: 0.1 - 40 000+ Lux

  • Temperature (-30 to +70C but best readings between +5 to +50C)

  • Humidity (0 - 60 % rel. humidity)


ESP               TSL2561
GPIO (5)   <-->   SCL
GPIO (4)   <-->   SDA
                  ADDR (not used = 0x39)

3.3V       <-->   VCC
GND        <-->   GND

The ADDR pin can be used if you have an i2c address conflict, to change the address.

Connect it to GND to set the address to 0x29.

Connect it to VCC (3.3V) to set the address to 0x49.

Leave it floating (unconnected) to use address 0x39.

Some boards have soldering pads or jumper selectors for the ADDR.




Task settings

  • Device: Name of plugin

  • Name: Name of the task (example name Light)

  • Enable: Should the task be enabled or not


  • I2C Address: Default 0x39 is used.

  • Integration time: 13 msec is the default, works in normal lit areas. Increase the integration time for low light areas, it will collect light longer if set to longer time.

  • Send sensor to sleep: Have it checked in order to save the unit from wear, especially good if you do measurements with long intervals in between.

  • Enable 16x Gain: Have it checked in order to get higher readings in low light areas.

Data acquisition

  • Send to controller 1..3: Check which controller (if any) you want to publish to. All or no controller can be used.

  • Interval: How often should the task publish its value (5..15 seconds is normal).

Rules examples

on Light#VI_Lux do
 if Light#VI_Lux>100
   Publish,%sysname%/light,Is on
   Publish,%sysname%/light,Is off

Where to buy




Link 1 ($)


Link 2 ($)


Link 3 ($)

$ = affiliate links which will give us some money to keep this project running, thank you for using those.