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 LTR303ALS01 sensor
The LTR-303ALS-01 is a low voltage I2C digital light sensor [ALS] which converts light intensity to a digital output signal capable of direct I2C interface. It provides a linear response over a wide dynamic range from 0.01 lux to 64k lux and it features immunity to IR / UV Light Source. This sensor is well suited to applications under high ambient brightness.
- Back-lighting Control in mobile/portable devices
- Touch Panel Control in mobile/portable devices
LTR303ALS01 module Key Features
- User-selectable module I/O logic voltage between 1V8 and 3V3
- On Board, ON/OFF LED indicator
- I2C interface for reading data and configuring the sensor
- LED indicator for Dedicated Interrupt Pin
- Pin Compatible with GEBRABUS
- 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
- Package: GebraBit small (36.29mm x 32.72mm)
GebraBit LTR303ALS01 module
GebraBit LTR-303ALS-01 is a module that converts light intensity to a digital output signal Close to human eye spectral response by rejecting UV/IR light.
GebraBit LTR-303ALS-01 module operates with a “3V3” supply Voltage. a jumper named “VDIO SEL” embedded, which is regarded to select the logic level voltage of module I/O pins between “1V8” or “3V3”. This feature helps to use a wide range of microcontrollers for interfacing with this module.
GebraBit LTR-303ALS-01 communicates with the I2C interface.
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 LTR-303ALS-01 sensor. GebraBit implements the LTR-303ALS-01 sensor circuit and provides access for the convenience of users.
It is enough to put the GebraBit LTR-303ALS-01 module in the BreadBoard, then by applying the proper voltage set up the GebraBit LTR-303ALS-01 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 LTR-303ALS-01 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 LTR-303ALS-01 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
LTR-303ALS-01 sensor is the Digital Ambient Light sensor of this module which is placed in the center of the module and its circuit is designed.
According to the 0R resistance state of this jumper, the main voltage of the sensor power supply and the digital communication logic level of the sensor are selected between “1V8” and “3V3”.
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
According to the state of the VDIO SEL jumper and applying voltage to the module by the corresponding pin, the LED of the module will be lit.
GebraBit LTR303ALS01 Module pins
- 3V3 and 1V8: These pins can supply the sensor main power supply and the logic level of the sensor digital connection (I2C) according to the state of the VDIO SEL selector jumper.
- 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). According to the state of the VDIO SEL jumper, you can use the logic level with a voltage of 1V8 or 3V3.
- SCL: This pin is the I2C communication clock pin, which is connected to the corresponding clock pin in the microcontroller (processor). Depending on the state of the VDIO SEL jumper, you can use the logic level with a voltage of 1V8 or 3V3.
- INT : Interrupt pin for LTR-303ALS-01 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 LTR-303ALS-01 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 LTR-303ALS-01 module to the 3V3 output pin of the microcontroller module. (red wire)
- Connect the GND pin of the LTR-303ALS-01 module to the GND pin of the microcontroller module (black wire).
- Connect the SCL pin of the LTR-303ALS-01 module to the PB8 pin of the microcontroller (SCL) module (blue wire).
- Connect the SDA pin of the LTR-303ALS-01 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 LTR-303ALS-01 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 LTR-303ALS-01 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.
Note: If you are using GebraBit microcontroller modules, note that the power selector jumper of the GebraBit LTR-303ALS-01 is set to 3V3 so that you can easily power-on the GebraBit LTR-303ALS-01 module by getting the 3V3 voltage from the microcontroller module.
I2C Connection with ARDUINO UNO
follow the below steps to connect the GebraBit LTR-303ALS-01 module to the ARDUINO UNO via I2C:
- connect the “3V3” pin of the LTR-303ALS-01 module to the “3V3” output pin of the ARDUINO UNO board. (Red wire)
- connect the “GND” pin of the LTR-303ALS-01 module to the “GND” pin of the ARDUINO UNO board. (Black wire)
- Connect the SCL pin of the LTR-303ALS-01 module to the A5 pin of the ARDUINO UNO board (SCL). (Blue wire)
- Connect the SDA pin of the LTR-303ALS-01 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: