Home > News > Design of Sensing System Based on Light Intensity Sensor TSL256x--Photosensitive Sensor and Control Technology

Design of Sensing System Based on Light Intensity Sensor TSL256x--Photosensitive Sensor and Control Technology

2020-10-12
1 Introduction to TSL256x

TSL2560 and TSL2561 are a high-speed, low-power, wide-range, programmable and flexible configuration of light intensity digital conversion chips introduced by TAOS. The chip can be widely used in the monitoring of various display screens, the purpose is to make the display screen provide the best display brightness and reduce the power consumption as much as possible under changing lighting conditions; it can also be used for street lighting control and safety lighting And many other occasions. The main features of this chip are as follows:

Programmable upper and lower thresholds for permitted light intensity, and an interrupt signal is given when the actual light intensity exceeds this threshold;

Digital output conforms to standard SMBus (TSL2560) and I2C (TSL2561) bus protocols;

Programmable control of analog gain and digital output time;

1.25 mm & TImes; 1.75 mm ultra-small package, in low power mode, power consumption is only 0.75 mW;

Automatically suppress 50 Hz / 60 Hz light fluctuations.

2 TSL256x pin function

TSL256x has 2 kinds of packaging forms: 6LEAD CHIPSCALE and 6LEAD TMB. Different packaging forms have different formulas for calculating the corresponding illuminance.

The functions of each pin are as follows:

Pin 1 and pin 3: Power pin and signal ground respectively. Its operating voltage range is 2.7 ~ 3.5V.

Pin 2: Device access address selection pin. Due to the different levels of this pin, the device has 3 different access addresses. The corresponding relationship between the access address and the level is listed in Table 1.

Pin 4 and pin 6: I2C or SMBus bus clock signal line and data line.

Pin 5: Interrupt signal output pin. When the light intensity exceeds the upper or lower threshold set by the user, the device will output an interrupt signal.

3 TSL256x internal structure and working principle

TSL256x is the 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 light and infrared light, while channel 1 is only sensitive to infrared light. The integral A / D converter integrates the current flowing through the photodiode and converts it into a digital quantity. After the conversion is completed, the conversion result is stored in the registers of channel 0 and channel 1 inside the chip. When one integration cycle is completed, the integral A / D converter will automatically start the next integral conversion process. Microcontroller and TSL2560 can be realized through standard SMBus (System Management Bus) V1.1 or V2.0, TSL2561 can be accessed through I2C bus protocol. The control of TSL256x is realized by reading and writing 16 internal registers.

4 TSL256x application design

The access of TSL256x follows standard SMBus and I2C protocols, which makes the hardware and software design of the chip very simple. Although the read and write timings of these two protocols are very similar, there are still differences. The following uses only the TSL2561 chip as an example to illustrate the practical application of the TSL256x light intensity sensor.

4.1 Hardware design

TSL2561 can be accessed through the I2C bus, so the hardware interface circuit is very simple. If the selected microcontroller has an I2C bus controller, the clock line and data line of the bus are directly connected to the SCL and SDA of the I2C bus of the TSL2561; if there is no pull-up resistor inside the microcontroller, you need to Then use 2 pull-up resistors to connect to the bus. If the microcontroller does not have an I2C bus controller, connect the SCL and SDA of the TSL2561's I2C bus to the ordinary I / O port; but when programming, you need to simulate the timing of the I2C bus to access the TSL2561, and the INT pin is connected to the micro control The external interruption of the device.

4.2 Software design

The microcontroller can read and write the TSL2561 through the I2C bus protocol. When writing data, send the device address first, then send the data to be written. The write operation of TSL2561 is as follows: First send a group of device addresses; then write the command code, the command code is to specify the address 00h ~ 0fh of the next write register and the way to write the register, which is a byte, word or block ) The unit performs write operations; finally send the data to be written, according to the previous command code to specify the way to write the register, you can continuously send the data to be written, the internal write register will automatically increase by 1. For the specific reading and writing timing of the I2C protocol, you can refer to the relevant information, and I will not repeat them here.

Due to space limitations, here are some programs to read and write TSL2561:

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 conversion of the integral A / D converter is completed, the corresponding values CH0 and CH1 can be read from the channel 0 register and the channel 1 register, but the unit is Lux (lumens) and the calculation is based on CH0 and CH1. For the TMB package, assuming that the light intensity is E (unit is Lux), the calculation formula is as follows:

① 0 E = 0.030 4 & TImes; CH0-0.062 & TImes; CH0 & TImes; (CH1 / CH0) 1/4

② 0.50 E = 0.022 4 × CH0-0.031 × CH1

③ 0.61 E = 0.012 8 × CH0-0.015 3 × CH1

④ 0.80 E = 0.001 46 × CH0-0.001 12 × CH1

⑤ CH1 / CH0》 1.30

E = 0

For the CHIPSCALE package, the calculation formula can view the corresponding chip information.

5 Conclusion

A system that uses TSL256x to realize real-time monitoring of light intensity has the advantages of high accuracy, low cost, and small size. The chip integrates an integral A / D converter and uses digital signal output, so its anti-interference ability is stronger than similar chips. The chip has been widely used in the field of light intensity monitoring and control.

Home > News > Design of Sensing System Based on Light Intensity Sensor TSL256x--Photosensitive Sensor and Control Technology
Related Products List

Home

Product

Phone

About Us

Inquiry

We will contact you immediately

Fill in more information so that we can get in touch with you faster

Privacy statement: Your privacy is very important to Us. Our company promises not to disclose your personal information to any external company with out your explicit permission.

Send