How does it work?
Light 4 Click is based on the TSL2585, an ambient light sensor with UV and light flicker detection capabilities from ams OSRAM. This sensor’s unique architecture incorporates photopic, infrared (IR), and ultraviolet (UV) photodiodes, enabling it to perform multiple sensing functions concurrently. Applications of Light 4 Click include automatic display brightness management in changing light conditions, UV index estimation for environmental monitoring, and camera assistance for auto exposure and flicker detection. This versatility makes it an excellent choice for consumer electronics, outdoor applications, and camera systems that require precise light and UV sensing.
The TSL2585’s innovative design ensures it can continuously monitor ambient light levels under any glass type. Additionally, its flicker detection functionality operates parallel with ambient light sensing, using the same photodiodes to capture data for calculating flicker frequencies. The sensor buffers this data, allowing a host MCU to process and detect flicker from various light sources. Its photopic photodiode is equipped with an optimized filter that mimics the human eye’s response to visible light, while a dedicated IR channel allows for accurate ambient light measurement and irradiance calculation of various light sources. Moreover, the UV photodiode is fitted with a band-pass UV filter, which, combined with the photopic and IR channels, allows for the estimation of the ambient UV index. An external MCU running specialized algorithms can further process this information to provide real-time UV index readings.
This Click board™ uses a standard 2-wire I2C interface to communicate with the host MCU, supporting Standard mode with up to 400kHz of frequency clock. It also provides interrupt-driven events through the INT pin on the mikroBUS™ socket, triggered when ALS results exceed or fall below user-configured threshold levels. The SNC pin on the mikroBUS™ socket serves a dual-purpose function. It can be used as a synchronization input, allowing the sensor to align its measurements with external events or signals, ensuring accurate timing and coordination in applications that require precise synchronization. Alternatively, it can also function as a general-purpose open-drain input/output pin, providing additional flexibility for various control or signaling tasks, depending on the application’s specific requirements.
The TSL2585 does not require a specific Power-Up sequence but requires a voltage of 1.8V for its interface and logic part to work correctly. Therefore, a small regulating LDO, the AP2112, provides a 1.8V out of 3.3V mikroBUS™ power rail.
This Click board™ can be operated only with a 3.3V logic voltage level and activated via the EN pin of the mikroBUS™ socket, providing a power-enabling function. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Specifications
Type
Optical
Applications
Ideal for automatic display brightness management, environmental UV monitoring, and camera assistance for exposure and flicker detection
On-board modules
TSL2585 – ambient light sensor with UV and light flicker detection from ams OSRAM
Key Features
Simultaneous sensing functions for ambient light, UV index estimation, and flicker detection, optimized photopic filter, band-pass UV filter for accurate UV index estimation, IR channel for irradiance calculation, flicker detection engine, I2C interface, interrupt-driven events for user-configured ALS thresholds, and more
Interface
I2C
Feature
ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on Light 4 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
Light 4 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Spectral Responsivity (PH/UVA/IR) | 560/350/880 | nm | ||
ALS Gain Ration | 0.5 | – | 4096 | x |
Software Support
We provide a library for the Light 4 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Library Description
This library contains API for Light 4 Click driver.
Key functions
-
light4_write_reg
This function writes a byte into the selected register by using I2C serial interface. -
light4_sw_reset
This function is used to perform software reset of Light 4 click board. -
light4_read_channel_data
This function is used to read data from selected channel of Light 4 click board.
Example Description
This example demonstrates the use of Light 4 Click by measuring the ambient light level in Lux.
void application_task ( void )
{
float channel_data = 0;
err_t error_flag;
error_flag = light4_read_channel_data( &light4, LIGHT4_CHANNEL0_SEL, &channel_data );
if( LIGHT4_OK == error_flag )
{
log_printf( &logger, " Data: %.2f Lux rn", channel_data );
}
else if ( LIGHT4_ANALOG_SAT == error_flag )
{
log_error( &logger, " Analog saturation rn" );
}
Delay_ms( 1000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Other MIKROE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Light4
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.