Skip to content

TSL2591

ams TSL2591 high-dynamic-range light sensor (full-spectrum + IR channels).

Live catalog

Prefer labwired_describe with the catalog id over guessing pins or addresses.

Status at a glance

Aspect Status
Catalog id tsl2591
Bus I²C
Address 0x29 (fixed)
Source configs/devices/tsl2591.yaml (declarative, no Rust model)
Datasheet ams DS000338 TSL2591 Light-to-Digital Converter: command register, register set table, control register
Tier smoke-proven (register-level tests: crates/core/tests/everyday_sensor_set.rs)

Pins / attachment

Pin / net Role
SDA I²C SDA
SCL I²C SCL
VDD/GND Power (digital twin)

Support matrix

Behavior Status Notes
Command byte 0xA0 reg ✅
ID 0x12 = 0x50, PID 0x11 = 0x00 ✅
C0 / C1 data (LE) ✅ Scale with AGAIN (1/25/428/9876×) × (ATIME+1); saturate 37888 @100 ms, 65535 otherwise
AEN gating + AVALID ✅ Channels read 0 until AEN; AVALID 100 ms after AEN
Interrupts / persistence / special functions ❌ Threshold registers are storage
Analog / power ❌ Bench

Stimulus

Host inputs: ch0, ch1 (counts at 1× gain, 100 ms).

How to run

  1. Place the part and an MCU in Playground, or add it to a system YAML:
    external_devices:
      - id: "tsl2591"
        type: "tsl2591"
        connection: "i2c0"   # the bus id your chip system uses
    
  2. Agent: labwired_list → labwired_describe id=tsl2591 → wire → labwired_validate → labwired_run / labwired_verify.
  3. Register-level smoke: cargo test -p labwired-core --test everyday_sensor_set — ID 0x50 via 0xB2; after ENABLE = 0x03 and 100 ms, AVALID set and CH0/CH1 = 1200/300. The same file's negative control proves the check fails against a part that answers only 0x00 or only 0xFF.

Limitations

  • Inputs are raw counts (the datasheet characterises counts, not lux).
  • PON-only gating and the CH0→CH1 shadow latch are not modelled.

See the YAML header for the full datasheet trace and every named approximation.