Today, ambient light sensors are part of smartphones, notebooks, other mobile devices, car displays and LCD TVs. These sensors are used to detect the amount of light in the environment, and in devices such as smartphones and notebooks, these sensors are used to automatically adjust the brightness of the display screen, according to the ambient light, as a result, this saves energy and increases the device lifespan.
In general, there are three common types of ambient light sensors: phototransistors, photodiodes, and photonic ICs, which is made of a photodetector and an amplifier.
An overview of the TSL25721FN sensor
The TSL2572 device family provides ambient light sensing (ALS) that approximates human eye response to light intensity under a variety of lighting conditions and through a variety of attenuation materials. Accurate ALS measurements are the result of AMS’ patented dual-diode technology and the UV rejection filter incorporated in the package. In addition, the operating range is extended to 60,000 lux in sunlight when the low-gain mode is used.
- Display Backlight Control
- Keyboard Illumination Control
- Solid State Lighting Control for Daylight Harvesting
- Printer Paper Detection
TSL25721FN module Key Features
- On Board, ON/OFF LED indicator
- I2C interface for reading data and configuring the sensor
- GEBRABIT Pin Compatible with GEBRABUS
- LED indicator for Dedicated Interrupt Pin
- It can be used as a daughter board of GEBRABIT MCU Modules
- Featuring Castellated pad (Assembled as SMD Part)
- Separatable screw parts to reduce the size of the board
GebraBit TSL25721FN module
GebraBit TSL25721FN is a module that provides ambient light sensing (ALS). GebraBit TSL25721FN module operates with “3V3”.The GebraBit TSL25721FN module communicates with the I2C protocol and features a LED indicator for Dedicated Interrupt Pin.
Considering that it is difficult to access the sensor pins, the user needs a starter circuit and driver for the hardware development and of course the software development of the TSL25721FN sensor. GebraBit implements TSL25721FN sensor circuit and provides access for the convenience of users.
It is enough to put the GebraBit TSL25721FN module in the BreadBoard, then by applying the proper voltage set up the GebraBit TSL25721FN module with any of Arduino, Raspberry Pi, Discovery board, and especially we recommend using GebraBit microcontroller development modules (GebraBit STM32F303 or GebraBit ATMEGA32 module) then receive the data.
The reason for our recommendation when setting up the GebraBit TSL25721FN module with GebraBit microcontroller development modules (such as GebraBit STM32F303 or GebraBit ATMEGA32), is the presence of an internal 3V3 regulator on these modules and the compatibility of the pin order of all GebraBit modules together (GEBRABUS standard), it’s enough to Put the TSL25721FN in the corresponding socket as shown in the above picture and develop the desired sensor module without the need for wiring.
Introduction of module sections
TSL25721FN sensor is the Digital Ambient Light sensor of this module which is placed in the center of the module and its circuit is designed.
A dedicated LED is considered for the interrupt pin on the module and its status changes when the interrupt state changes according to the sensor data sheet.
Power supply LED
By applying voltage to the module through the corresponding pin, the LED of the module will be lit.
GebraBit TSL25721FN Module pins
- 3V3: This pin can supply the sensor main power supply and the logic level of the sensor digital connection (I2C).
- GND: This is the common ground pin for power and logic level of the sensor.
- SDA: This pin is the I2C communication data pin, which is connected to the corresponding data pin in the microcontroller (processor).
- SCL: This pin is the I2C communication clock pin, which is connected to the corresponding clock pin in the microcontroller (processor).
- INT : Interrupt pin for TSL25721FN sensor, according to the datasheet , the user can set the interrupt conditions, the modes and methods of the interruption, etc.
Connect to the processor
I2C connection with GebraBit STM32F303
for I2C communication of GebraBit TSL25721FN and GebraBit STM32F303 microcontroller module, after defining SDA and SCL on pins PB9 and PB8 (for convenience in STMCUBEMX), follow the below steps:
- Connect the 3V3 pin of the TSL25721FN module to the 3V3 output pin of the microcontroller module. (red wire)
- Connect the GND pin of the TSL25721FN module to the GND pin of the microcontroller module (black wire).
- Connect the SCL pin of the TSL25721FN module to the PB8 pin of the microcontroller (SCL) module (blue wire).
- Connect the SDA pin of the TSL25721FN module to the PB9 pin of the microcontroller (SDA) module. (yellow wire)
Note: Considering that the PA14 pin of the GebraBit STM32F303 microcontroller module is used to program the microcontroller, I2C setting on the PA14 and PA15 pins is impossible in this version, so in this version for I2C connection with the GebraBit STM32F303 microcontroller module, GebraBit TSL25721FN module cannot be placed as Pin to Pin on it.
I2C connection with GebraBit ATMEGA32A
Considering that the I2C pins of the ATMEGA32A microcontroller are based on the GEBRABUS standard and correspond to the I2C pins of other GEBRABIT modules, the GebraBit TSL25721FN module can be placed pin to pin on the GebraBit ATMEGA32A module. Here, for better understanding, the separate connection of these two modules is shown.
I2C Connection with ARDUINO UNO
follow the below steps to connect the GebraBit TSL25721FN module to the ARDUINO UNO via I2C:
- connect the “3V3” pin of the TSL25721FN module to the “3V3” output pin of the ARDUINO UNO board. (Red wire)
- connect the “GND” pin of the TSL25721FN module to the “GND” pin of the ARDUINO UNO board. (Black wire)
- Connect the SCL pin of the TSL25721FN module to the A5 pin of the ARDUINO UNO board (SCL). (Blue wire)
- Connect the SDA pin of the TSL25721FN module to the A4 pin of the ARDUINO UNO board (SDA). (Orange wire)
How to connect the above mentioned steps can be seen in this picture: