Overview
The TSL2591 (TSL25911FN) is an ultra-high dynamic range digital ambient light sensor (ALS) manufactured by ams OSRAM (formerly TAOS). Built as the advanced successor to the popular TSL2561, it features a massive dynamic range, measuring light levels from sub-lux starlight/moonlight ( minimum detectable signal) up to full bright sunlight (88,000 Lux).
The TSL2591 incorporates dual integrating photodiodes:
- Channel 0 (
CH0): Full-spectrum diode (detects both Visible and Infrared light). - Channel 1 (
CH1): Infrared diode (detects Infrared light only).
By calculating the difference between channels in software, the sensor accurately models the human eye photopic response curve while allowing independent IR spectrum intensity measurement over (0x29).
Quick reference
Operating voltage (VCC) | 3.3 V to 5.0 V DC (breakout module includes 3.3V LDO regulator) |
IC supply voltage (VDD) | 2.7 V to 3.6 V DC (3.3 V nominal) |
| Interface | (Fast Mode up to 400 kHz) |
| Fixed address | 0x29 |
| Dynamic range | 600,000,000 : 1 |
| Lux range | () to 88,000 Lux |
| Resolution | 16-bit dual-channel digital count outputs (0 to 65,535 counts) |
| Programmable Gain | Low (), Med (), High (), Max () |
| Programmable Integration Time | 100 ms, 200 ms, 300 ms, 400 ms, 500 ms, 600 ms |
Pinout
STEMMA QT / Qwiic 4-pin connector & 0.1" header pins:
| Pin | Name | Type | Description |
|---|---|---|---|
| 1 | VIN / VCC | Power | Supply input (+3.3 V to +5.0 V DC) |
| 2 | GND | Power | Ground reference (0 V) |
| 3 | SCL | Digital Input | Serial Clock |
| 4 | SDA | Digital Input / Output | Serial Data |
| 5 | INT | Digital Output | Active-Low interrupt output (programmable lux thresholds) |
Specifications
| Parameter | Symbol | Min | Typ | Max | Unit | Conditions |
|---|---|---|---|---|---|---|
| Supply Voltage (Module) | 3.3 | 3.3 / 5.0 | 5.5 | V | Power rail with LDO | |
| Active Supply Current | — | 250 | 350 | µA | Active integration state | |
| Shutdown Current | — | 3.0 | 5.0 | µA | Software shutdown mode | |
| Min Detectable Lux | — | 0.000188 | — | Lux | Max Gain (), | |
| Max Detectable Lux | — | 88000 | — | Lux | Low Gain (), | |
| Peak Sensitivity Wavelength | — | 630 (CH0) / 850 (CH1) | — | nm | Visible and IR peaks |
Gain Settings & Integration Time Table
| Gain Setting | Multiplier Symbol | Typical Application |
|---|---|---|
TSL2591_GAIN_LOW | Bright direct sunlight (up to 88,000 Lux) | |
TSL2591_GAIN_MED | Standard indoor room lighting | |
TSL2591_GAIN_HIGH | Dim indoor lighting / overcast shade | |
TSL2591_GAIN_MAX | Extremely dark environments / moonlight / starlight |
Lux Calculation Math
Where (Lux Device Factor constant for TSL2591).
Wiring
| TSL2591 Pin | → | Arduino / MCU | ESP32 | Notes |
|---|---|---|---|---|
VIN | 5V / 3.3V | 3.3V | Module includes 3.3V LDO | |
GND | GND | GND | System ground | |
SCL | A5 | GPIO 22 | Clock | |
SDA | A4 | GPIO 21 | Data |
Example (Adafruit_TSL2591 Library)
cpp
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_TSL2591.h"
Adafruit_TSL2591 tsl = Adafruit_TSL2591(2591); // Pass sensor ID
void setup() {
Serial.begin(9600);
Serial.println("Adafruit TSL2591 Light Sensor Test");
if (!tsl.begin()) {
Serial.println("TSL2591 not found! Check wiring.");
while (1);
}
// Configure gain and integration time
tsl.setGain(TSL2591_GAIN_MED); // 25x gain
tsl.setTiming(TSL2591_INTEGRATIONTIME_100MS); // 100 ms integration
}
void loop() {
// Read combined 32-bit channel data (CH0 and CH1)
uint32_t lum = tsl.getFullLuminosity();
uint16_t ir = lum >> 16;
uint16_t full = lum & 0xFFFF;
uint16_t visible = full - ir;
float lux = tsl.calculateLux(full, ir);
Serial.print("IR: "); Serial.print(ir);
Serial.print(" | Full Spectrum: "); Serial.print(full);
Serial.print(" | Visible: "); Serial.print(visible);
Serial.print(" | Calculated Lux: "); Serial.println(lux);
delay(1000);
}
Common mistakes
- I2C Address Collision: TSL2591 has a fixed hardcoded address (
0x29). - Saturation in direct sunlight: Operating at Medium or High gain under full sunlight causes 16-bit register saturation (65,535 count cap). When full-spectrum readings hit 65,535, lower the gain setting to
TSL2591_GAIN_LOW().
Notes
- TSL2591 vs TSL2561: TSL2591 offers dynamic range (vs for TSL2561), higher max Lux ( vs ), and improved sub-lux sensitivity.
Assets & downloads
- datasheetdatasheet
- product-pagereference