TSL2581, TSL2583
LIGHT-TO-DIGITAL CONVERTER
TAOS134 − MARCH 2011
19
The LUMENOLOGY r Company
r
r
Copyright E 2011, TAOS Inc.
www.taosinc.com
APPLICATION INFORMATION: SOFTWARE
Interrupts
The interrupt feature of the TSL258x device simplifies and improves system efficiency by eliminating the need
to poll the sensor for a light intensity value. Interrupt mode is determined by the INTR field in the INTERRUPT
CONTROL Register. The interrupt feature may be disabled by writing a field value of 00h to the Interrupt Control
Register (02h) so that polling can be performed.
The versatility of the interrupt feature provides many options for interrupt configuration and usage. The primary
purpose of the interrupt function is to signal a meaningful change in light intensity. However, it can also be used
as an end-of-conversion signal. The concept of a meaningful change can be defined by the user both in terms
of light intensity and time, or persistence, of that change in intensity. The TSL258x device implements two
16-bit-wide interrupt threshold registers that allow the user to define thresholds above and below a desired light
level. An interrupt will then be generated when the value of a conversion exceeds either of these limits. For
simplicity of programming, the threshold comparison is accomplished only with Channel 0. This simplifies
calculation of thresholds that are based, for example, on a percent of the current light level. It is adequate to
use only one channel when calculating light intensity differences because, for a given light source, the channel 0
and channel 1 values are linearly proportional to each other and thus both values scale linearly with light
intensity.
To further control when an interrupt occurs, the TSL258x device provides an interrupt persistence feature. This
feature allows the user to specify a number of conversion cycles for which a light intensity exceeding either
interrupt threshold must persist before actually generating an interrupt. This can be used to prevent transient
changes in light intensity from generating an unwanted interrupt. With a value of 1, an interrupt occurs
immediately whenever either threshold is exceeded. With values of N, where N can range from 2 to 15, N
consecutive conversions must result in values outside the interrupt window for an interrupt to be generated. For
example, if N is equal to 10 and the integration time is 402 ms, then an interrupt will not be generated unless
the light level persists for more than 4 seconds outside the threshold.
The interrupt line goes active low and remains low until the interrupt is cleared by selecting the Special Function
in the COMMAND register and writing a 0 to the Interrupt Clear field value.
To configure the interrupt as an end-of-conversion signal so that every ADC integration cycle generates an
interrupt, the interrupt PERSIST field in the Interrupt Control Register (02h) is set to 0000b. An interrupt will be
generated upon completion of each conversion. The interrupt threshold registers are ignored.
TSL2581, TSL2583
LIGHT-TO-DIGITAL CONVERTER
TAOS134 − MARCH 2011
20
r
r
Copyright E 2011, TAOS Inc.
The LUMENOLOGY r Company
www.taosinc.com
APPLICATION INFORMATION: SOFTWARE
Calculating Lux
The TSL258x is intended for use in ambient light detection applications such as display backlight control, where
adjustments are made to display brightness or contrast based on the brightness of the ambient light, as
perceived by the human eye. Conventional silicon detectors respond strongly to infrared light, which the human
eye does not see. This can lead to significant error when the infrared content of the ambient light is high, such
as with incandescent lighting, due to the difference between the silicon detector response and the brightness
perceived by the human eye.
This problem is overcome in the TSL258x through the use of two photodiodes. One of the photodiodes
(channel 0) is sensitive to both visible and infrared light, while the second photodiode (channel 1) is sensitive
primarily to infrared light. An integrating ADC converts the photodiode currents to digital outputs. Channel 1
digital output is used to compensate for the effect of the infrared component of light on the channel 0 digital
output. The ADC digital outputs from the two channels are used in a formula to obtain a value that approximates
the human eye response in the commonly used Illuminance unit of Lux:
Chipscale Package
For CH1/CH0 = 0.00 to 0.25 Lux = 0.105 CH0 − 0.208 CH1
For CH1/CH0 = 0.25 to 0.38 Lux = 0.1088 CH0 − 0.2231 CH1
For CH1/CH0 = 0.38 to 0.45 Lux = 0.0729 CH0 − 0.1286 CH1
For CH1/CH0 = 0.45 to 0.60 Lux = 0.060 CH0 − 0.10 CH1
For CH1/CH0 > 0.60 Lux/CH0 = 0
FN Package
For CH1/CH0 = 0.00 to 0.30 Lux = 0.130 CH0 − 0.240 CH1
For CH1/CH0 = 0.30 to 0.38 Lux = 0.1649 CH0 − 0.3562 CH1
For CH1/CH0 = 0.38 to 0.45 Lux = 0.0974 CH0 − 0.1786 CH1
For CH1/CH0 = 0.45 to 0.54 Lux = 0.062 CH0 − 0.100 CH1
For CH1/CH0 > 0.54 Lux/CH0 = 0
The formulas shown above were obtained by optical testing with fluorescent and incandescent light sources,
and apply only to open-air applications. Optical apertures (e.g. light pipes) will affect the incident light on the
device.
Simplified Lux Calculation
Below is the argument and return value including source code (shown on following page) for calculating lux with
the TSL2583FN. The source code is intended for embedded and/or microcontroller applications. All floating
point arithmetic operations have been eliminated since embedded controllers and microcontrollers generally
do not support these types of operations. Because floating point has been removed, scaling must be performed
prior to calculating illuminance if the integration time is not 400 msec and/or if the gain is not 1× as denoted in
the source code on the following pages.
TSL2581, TSL2583
LIGHT-TO-DIGITAL CONVERTER
TAOS134 − MARCH 2011
21
The LUMENOLOGY r Company
r
r
Copyright E 2011, TAOS Inc.
www.taosinc.com
//****************************************************************************
//
// Copyright 2004−2008 TAOS, Inc.
//
// THIS CODE AND INFORMATION IS PROVIDED ”AS IS” WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Module Name:
// lux.cpp
//
//****************************************************************************
#define LUX_SCALE 16 // scale by 2^16
#define RATIO_SCALE 9 // scale ratio by 2^9
//−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
// Integration time scaling factors
//−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
#define CH_SCALE 16 // scale channel values by 2^16
#define NOM_INTEG_CYCLE 148 // Nominal 400 ms integration. See Timing Register
//−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
// Gain scaling factors
//−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
#define CH0GAIN128X 107 // 128X gain scalar for Ch0
#define CH1GAIN128X 115 // 128X gain scalar for Ch1
//−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
// FN Package coefficients
//−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
// For Ch1/Ch0=0.00 to 0.30:
// Lux=0.130*Ch0−0.240*Ch1
//
// For Ch1/Ch0=0.30 to 0.38:
// Lux=0.1649*Ch0−0.3562*Ch1
//
// For Ch1/Ch0=0.38 to 0.45:
// Lux=0.0974*Ch0−0.1786*Ch1
//
// For Ch1/Ch0=0.45 to 0.54:
// Lux=0.062*Ch0−0.10*Ch1
//
// For Ch1/Ch0>0.54:
// Lux/Ch0=0
//
//−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
#define K1C 0x009A // 0.30 * 2^RATIO_SCALE
#define B1C 0x2148 // 0.130 * 2^LUX_SCALE
#define M1C 0x3d71 // 0.240 * 2^LUX_SCALE
#define K2C 0x00c3 // 0.38 * 2^RATIO_SCALE
#define B2C 0x2a37 // 0.1649 * 2^LUX_SCALE
#define M2C 0x5b30 // 0.3562 * 2^LUX_SCALE
#define K3C 0x00e6 // 0.45 * 2^RATIO_SCALE
#define B3C 0x18ef // 0.0974 * 2^LUX_SCALE
#define M3C 0x2db9 // 0.1786 * 2^LUX_SCALE
#define K4C 0x0114 // 0.54 * 2^RATIO_SCALE
#define B4C 0x0fdf // 0.062 * 2^LUX_SCALE
#define M4C 0x199a // 0.10 * 2^LUX_SCALE
#define K5C 0x0114 // 0.54 * 2^RATIO_SCALE
#define B5C 0x0000 // 0.00000 * 2^LUX_SCALE
#define M5C 0x0000 // 0.00000 * 2^LUX_SCALE

TSL2581FN

Mfr. #:
Manufacturer:
ams
Description:
Light to Digital Converters Light to Digital 30x Sensitivity
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union