← All parts

TSL2561 Light Sensor

TSL2561

amssensor light distance

The TSL2561 is a digital light sensor that converts light intensity into a digital signal. It features a 16-bit output, programmable gain, and integration time, with an I2C interface for easy integration into microcontrollers.

In stock

Specifications

9
Operating Voltage
2.7 V
Operating Voltage
3.6 V
Interface
I2C
Resolution
16-Bit
I2c Clock Speed
400 kHz
Active Supply Current
0.75 mW
Power Down Supply Current
3.2 uA
Temperature Range
-30 °C
Temperature Range
70 °C

Pinout

6
PinNameFunctionsNotes
1VDD
POWER
Supply voltage
2ADDR SEL
GPIO
Address select pin
3GND
GND
Power supply ground
4SCL
I2C
Serial clock input
5INT
GPIO
Interrupt output, open drain
6SDA
I2C
Serial data I/O

Interactive pinout

Highlight:
TSL2561

Click a pin to copy its name · tap a tag above to spotlight a bus.

Starter code

Community starter examples — minimal, unofficial, and provided to get you wiring fast. Verify against the manufacturer datasheet before relying on them.

Arduino (C++)

Arduino library: Adafruit TSL2561 (+ Adafruit Unified Sensor)

arduino
// TSL2561 light sensor (lux) over I2C — community starter example
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_TSL2561_U.h>

Adafruit_TSL2561_Unified tsl(TSL2561_ADDR_FLOAT, 12345);

void setup() {
  Serial.begin(115200);
  if (!tsl.begin()) { Serial.println("TSL2561 not found"); while (1) delay(10); }
  tsl.enableAutoRange(true);
  tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_101MS);
}

void loop() {
  sensors_event_t event;
  tsl.getEvent(&event);
  if (event.light) { Serial.print(event.light); Serial.println(" lx"); }
  delay(1000);
}

MicroPython

MicroPython library: tsl2561 (driver port)

python
# TSL2561 (ESP32) — community starter example
# driver: a TSL2561 MicroPython port
from machine import Pin, I2C
import tsl2561, time

i2c = I2C(0, scl=Pin(22), sda=Pin(21))
sensor = tsl2561.TSL2561(i2c)

while True:
    print(sensor.read(), "lx")
    time.sleep(1)

Wiring

PinArduino Uno R3ESP32 DevKitC (WROOM-32)Notes
VCC+5V3V3Breakout 3-5 V safe
GNDGNDGND
SCLA5/SCLGPIO22I2C clock
SDAA4/SDAGPIO21I2C data

Typical uses

  • Wide-range light measurement (lux)
  • Light metering for cameras/displays

Related parts

4