Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit TSL2561: Examples, Pinouts, and Specs

Image of Adafruit TSL2561
Cirkit Designer LogoDesign with Adafruit TSL2561 in Cirkit Designer

Introduction

The Adafruit TSL2561 is a sophisticated digital luminosity sensor that offers ambient light sensing capabilities by measuring both visible and infrared light levels. This sensor is ideal for applications that require precise light measurements, such as adjusting display backlighting based on environmental lighting conditions or for general-purpose light sensing in home automation, industrial, and environmental monitoring systems.

Explore Projects Built with Adafruit TSL2561

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP8266 and TSL2561 Wi-Fi Connected Light Sensor
Image of Schaltplan_1: A project utilizing Adafruit TSL2561 in a practical application
This circuit consists of an ESP8266 NodeMCU microcontroller connected to a TSL2561 Lux Sensor. The microcontroller reads light intensity data from the sensor via I2C communication, with the SCL and SDA lines connected to D1 and D2 pins of the ESP8266, respectively. Power is supplied to the sensor through the 3V3 and GND pins of the ESP8266.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Light Sensor with TSL2561 and LED Indicator
Image of TSL2561 light sensor: A project utilizing Adafruit TSL2561 in a practical application
This circuit uses an Arduino UNO to read data from a TSL2561 Lux Sensor and control a red LED. The Arduino reads light intensity values from the sensor via I2C communication and powers the LED through a current-limiting resistor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560-Based Multi-Sensor Weather Station with TFT Display and IR Control
Image of aqua2: A project utilizing Adafruit TSL2561 in a practical application
This circuit uses an Arduino Mega 2560 to read temperature data from multiple DS18B20 sensors, display the data on an ILI9341 TFT display, and maintain time using an Adafruit DS1307 RTC module. It also receives IR signals using a VS1838B IR receiver and includes an Adafruit MS8607 PHT sensor for additional environmental monitoring.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Based RGB Color Detection System with OLED and LCD Displays
Image of 1: A project utilizing Adafruit TSL2561 in a practical application
This circuit uses an Arduino UNO to interface with an Adafruit TCS34725 RGB color sensor, a 128x64 OLED display, and a 16x2 I2C LCD. The Arduino reads color data from the sensor and displays the color information on both the OLED and LCD screens.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit TSL2561

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Schaltplan_1: A project utilizing Adafruit TSL2561 in a practical application
ESP8266 and TSL2561 Wi-Fi Connected Light Sensor
This circuit consists of an ESP8266 NodeMCU microcontroller connected to a TSL2561 Lux Sensor. The microcontroller reads light intensity data from the sensor via I2C communication, with the SCL and SDA lines connected to D1 and D2 pins of the ESP8266, respectively. Power is supplied to the sensor through the 3V3 and GND pins of the ESP8266.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of TSL2561 light sensor: A project utilizing Adafruit TSL2561 in a practical application
Arduino UNO Light Sensor with TSL2561 and LED Indicator
This circuit uses an Arduino UNO to read data from a TSL2561 Lux Sensor and control a red LED. The Arduino reads light intensity values from the sensor via I2C communication and powers the LED through a current-limiting resistor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of aqua2: A project utilizing Adafruit TSL2561 in a practical application
Arduino Mega 2560-Based Multi-Sensor Weather Station with TFT Display and IR Control
This circuit uses an Arduino Mega 2560 to read temperature data from multiple DS18B20 sensors, display the data on an ILI9341 TFT display, and maintain time using an Adafruit DS1307 RTC module. It also receives IR signals using a VS1838B IR receiver and includes an Adafruit MS8607 PHT sensor for additional environmental monitoring.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 1: A project utilizing Adafruit TSL2561 in a practical application
Arduino-Based RGB Color Detection System with OLED and LCD Displays
This circuit uses an Arduino UNO to interface with an Adafruit TCS34725 RGB color sensor, a 128x64 OLED display, and a 16x2 I2C LCD. The Arduino reads color data from the sensor and displays the color information on both the OLED and LCD screens.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Features

  • Resolution: 16-bit digital output at 400 kHz I2C Fast-Mode
  • Dynamic Range: 0.1 - 40,000+ Lux
  • Interface: I2C
  • Supply Voltage: 2.7V to 3.6V
  • Operating Temperature: -30°C to 80°C

Pin Configuration and Descriptions

Pin Number Name Description
1 VDD Power supply (2.7V to 3.6V)
2 GND Ground connection
3 SDA I2C Data
4 SCL I2C Clock
5 ADDR Address pin to set I2C address
6 INT Interrupt output (active low)

Usage Instructions

Integration with a Circuit

To use the TSL2561 sensor in a circuit:

  1. Connect the VDD pin to a 2.7V to 3.6V power supply.
  2. Connect the GND pin to the ground of the power supply.
  3. Connect the SDA and SCL pins to the I2C data and clock lines, respectively.
  4. The ADDR pin can be connected to GND or VDD to set the I2C address.
  5. The INT pin can be left unconnected if the interrupt feature is not used.

Best Practices

  • Ensure that the power supply voltage does not exceed the maximum rating.
  • Use pull-up resistors on the I2C data and clock lines, typically 4.7kΩ to 10kΩ.
  • Avoid placing the sensor in direct sunlight or near strong infrared sources to prevent saturation.

Example Code for Arduino UNO

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_TSL2561_U.h>

Adafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);

void setup(void) {
  Serial.begin(9600);
  Serial.println("Light Sensor Test"); Serial.println("");

  // Initialise the sensor
  if(!tsl.begin()) {
    Serial.print("Ooops, no TSL2561 detected ... Check your wiring or I2C ADDR!");
    while(1);
  }

  // Set the gain and integration time
  tsl.setGain(TSL2561_GAIN_1X);      // No gain ... use in bright light to avoid sensor saturation
  tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_13MS);      // Fast but low resolution

  // Display some basic information on this sensor
  sensor_t sensor;
  tsl.getSensor(&sensor);
  Serial.println("------------------------------------");
  Serial.print  ("Sensor:       "); Serial.println(sensor.name);
  Serial.print  ("Driver Ver:   "); Serial.println(sensor.version);
  Serial.print  ("Unique ID:    "); Serial.println(sensor.sensor_id);
  Serial.print  ("Max Value:    "); Serial.print(sensor.max_value); Serial.println(" lux");
  Serial.print  ("Min Value:    "); Serial.print(sensor.min_value); Serial.println(" lux");
  Serial.print  ("Resolution:   "); Serial.print(sensor.resolution); Serial.println(" lux");  
  Serial.println("------------------------------------");
  Serial.println("");
  delay(500);
}

void loop(void) {
  // Get a new sensor event
  sensors_event_t event;
  tsl.getEvent(&event);

  // Display the results (light is measured in lux)
  if (event.light) {
    Serial.print(event.light); Serial.println(" lux");
  } else {
    // If event.light = 0 lux the sensor is probably saturated
    // and no reliable data could be generated!
    Serial.println("Sensor overload");
  }
  delay(250);
}

Troubleshooting and FAQs

Common Issues

  • Sensor not detected: Ensure that the wiring is correct and that the correct I2C address is used in the code.
  • Inaccurate readings: Check if the sensor is placed in a stable lighting environment and is not affected by external light sources.
  • Sensor saturation: If the sensor is exposed to too much light, it may become saturated. Try reducing the gain or increasing the integration time.

FAQs

Q: Can the TSL2561 sensor measure UV light? A: No, the TSL2561 is designed to measure visible and infrared light, not ultraviolet light.

Q: What is the purpose of the ADDR pin? A: The ADDR pin allows you to change the I2C address of the sensor, enabling multiple sensors to be used on the same I2C bus.

Q: How do I know if the sensor is saturated? A: If the sensor is saturated, it will typically return a maximum reading or zero lux. Adjust the gain or integration time to avoid saturation.

For further assistance, consult the Adafruit TSL2561 datasheet and the Adafruit forums for community support.