Share this

Design of a sensing system based on the TSL256x light intensity sensor

2026-04-06 06:56:26 · · #1
Abstract The TSL256x is a high-speed, low-power, wide-range, programmable, and flexibly configurable light intensity sensor chip launched by TAOS. This paper briefly introduces the basic features, pin functions, internal structure, and working principle of the TSL256x, and provides a practical circuit, software design flow, and core program for the TSL2561. Keywords Light intensity sensor, TSL256x, I2C bus, integrating A/D converter 1 Introduction to TSL256x The TSL2560 and TSL2561 are high-speed, low-power, wide-range, programmable, and flexibly configurable light intensity digital conversion chips launched by TAOS. This chip can be widely used in the monitoring of various displays, aiming to provide optimal display brightness and minimize power consumption under varying lighting conditions; it can also be used in street lighting control, safety lighting, and many other applications. The main features of this chip are as follows: ◇ Programmable upper and lower threshold values ​​for permitted light intensity, providing an interrupt signal when the actual illuminance exceeds the threshold; ◇ Digital output conforms to standard SMBus (TSL2560) and I2C (TSL2561) bus protocols; ◇ Programmable control of analog gain and digital output timing; ◇ Ultra-small 1.25 mm × 1.75 mm package, consuming only 0.75 mW in low-power mode; ◇ Automatic suppression of illuminance fluctuations at 50 Hz/60 Hz. 2. Pin Functions of TSL256x The TSL256x is available in two package types: 6LEAD CHIPSCALE and 6LEAD TMB. The illuminance calculation formula differs depending on the package type. Figure 1 shows the pinout for these two package types. [align=center] Figure 1 TSL256x Package[/align] The functions of each pin are as follows: Pin 1 and Pin 3: Power supply and signal ground, respectively. Their operating voltage range is 2.7~3.5V. Pin 2: Device access address selection pin. Due to different pin levels, the device has three different access addresses. The correspondence between access addresses and levels is listed in Table 1. [align=center]Table 1 Correspondence between Device Access Addresses and Pin 2 Levels[/align] Pins 4 and 6: Clock and data lines for the I2C or SMBus bus. Pin 5: Interrupt signal output pin. When the light intensity exceeds the upper or lower threshold set by the user programming, the device outputs an interrupt signal. 3. Internal Structure and Working Principle of TSL256x The TSL256x is a second-generation ambient light intensity sensor, and its internal structure is shown in Figure 2. Channel 0 and Channel 1 are two photodiodes, where Channel 0 is sensitive to both visible and infrared light, while Channel 1 is only sensitive to infrared light. The integrating A/D converter integrates the current flowing through the photodiodes and converts it into a digital quantity. After the conversion is completed, the conversion result is stored in the respective registers of Channel 0 and Channel 1 inside the chip. After one integration cycle is completed, the integrating A/D converter will automatically start the next integration conversion process. The microcontroller and TSL2560 can be accessed via the standard SMBus (System Management Bus) V1.1 or V2.0, while the TSL2561 can be accessed via the I2C bus protocol. Control of the TSL256x is achieved by reading and writing to its 16 internal registers, whose addresses are listed in Table 2. [align=center] Figure 2 TSL256x Internal Structure Chart 2 TSL256x Internal Register Addresses and Functions[/align] 4 TSL256x Application Design The access to the TSL256x follows the standard SMBus and I2C protocols, which makes the hardware and software design of this chip very simple. Although the read and write timing of these two protocols is similar, there are still differences. The following uses the TSL2561 chip as an example to illustrate the practical application of the TSL256x light intensity sensor. 4.1 Hardware Design The TSL2561 can be accessed via the I2C bus, so the hardware interface circuit is very simple. If the selected microcontroller has an I2C bus controller, connect the clock and data lines of that bus directly to the SCL and SDA pins of the TSL2561's I2C bus, respectively. If the microcontroller does not have internal pull-up resistors, two additional pull-up resistors will be needed to connect to the bus. If the microcontroller does not have an I2C bus controller, connect the SCL and SDA pins of the TSL2561's I2C bus to a general-purpose I/O port. However, during programming, it is necessary to simulate the I2C bus timing to access the TSL2561, and the INT pin should be connected to the microcontroller's external interrupt. The hardware connection is shown in Figure 3. [align=center] Figure 3 Hardware connection diagram of microcontroller and TSL2561[/align] 4.2 Software Design [align=center] Figure 4 Software design flow[/align] Due to space limitations, part of the program for reading and writing TSL2561 is given here: unsigned char TSL2561_write_byte( unsigned char addr, unsigned char c) { unsigned char status=0; status=twi_start();//start status=twi_writebyte(TSL2561_ADDR|TSL2561_WR);//write TSL2561 address status=twi_writebyte(0x80|addr);//write command status=twi_writebyte(c);//write data twi_stop();//stop delay_ms(10);//delay 10 ms return 0; } unsigned char TSL2561_read_byte(unsigned char addr, unsigned char *c) { unsigned char status=0; status= twi_start();//start status=twi_writebyte(TSL2561_ADDR|TSL2561_WR);//write TSL2561 address status=twi_writebyte(0x80|addr);//write command status=twi_start();//restart status=twi_writebyte(TSL2561_ADDR|TSL2561_RD);//write TSL2561 address status=twi_readbyte(c,TW_NACK);//write data twi_stop(); delay_ms(10); return 0; } After the integrating A/D converter completes the conversion, the corresponding values ​​CH0 and CH1 can be read from the channel 0 register and channel 1 register, respectively. However, to express the value in Lux (lumens), calculations must be performed based on CH0 and CH1. For TMB packages, assuming the light intensity is E (in Lux), the calculation formula is as follows: ① 0 1.30 E=0. For the CHIPSCALE package, the calculation formula can be found in the corresponding chip datasheet. 5. Conclusion: The system using the TSL256x for real-time light intensity monitoring has advantages such as high accuracy, low cost, and small size. The chip integrates an integrating A/D converter and uses digital signal output, thus its anti-interference capability is stronger than similar chips. This chip has been widely used in the field of light intensity monitoring and control.
Read next

CATDOLL 126CM Alisa (TPE Body + Hard Silicone Head) Customer Photos

Height: 126cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/58/66cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22