How does it work?
Light 3 Click is based on the OPT4003-Q1, an automotive-grade digital ambient light sensor from Texas Instruments. This component is specifically designed for use in various automotive applications, including but not limited to interior and exterior lighting systems, entertainment and dashboard clusters, adaptive mirrors, rain-sensing wiper systems, head-up displays, and automotive camera setups. Central to its design, the OPT4003-Q1 sensor incorporates a dual-channel functionality that accurately captures and converts light from visible and near-infrared (NIR) spectrums into digital signals. The sensor’s visible light detection is fine-tuned with a unique filter miming the human eye’s response, ensuring precise visible light measurement by eliminating NIR interference. Conversely, its NIR channel is optimized to filter out visible light, focusing on capturing NIR light with a high degree of accuracy, marked by a clear cutoff at 800nm.
This sensor outputs measurements in a semi-logarithmic scale featuring binary logarithmic scales for full light intensity range coverage. The visible light detection channel offers nine binary light ranges, ranging from 535μlux to 143klux, with an effective dynamic range of 28 bits. On the other hand, the NIR channel spans seven light ranges, from 565pW/cm2 to 38mW/cm2, and delivers a 26-bit dynamic range. Its automatic range selection capability dynamically adjusts gain based on ambient light levels, ensuring optimal resolution without requiring manual adjustments.
The OPT4003-Q1 also includes sophisticated optical filters that provide exceptional out-of-band light rejection, which is crucial for maintaining accurate light measurements under various conditions, including under tinted glass. It is an ideal replacement for traditional light sensing solutions like photodiodes and photoresistors, which generally need more precision, dynamic range, and NIR filtration. The device offers flexible configuration options, with light conversion times adjustable between 600μs and 800ms across 12 steps to accommodate different application requirements.
The OPT4003-Q1 supports both continuous and single-shot measurement modes. It incorporates threshold detection, enabling energy-efficient operation by allowing the processor to remain in low-power states until a significant light change occurs. Communication with the sensor is achieved via an I2C-compatible interface, with a built-in FIFO buffer ensuring data integrity during slower readout periods. Besides I2C pins, the device allows the adjustment of its I2C slave address’s least significant bit via an SMD jumper marked as ADDR SEL. This board also has an interrupt reporting system (INT pin) that allows the host MCU connected to the I2C bus to sleep or otherwise ignore the device results until a user-defined event occurs that requires possible action.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VIO SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Specifications
Type
Optical
Applications
Ideal for automotive interior and exterior lighting, infotainment and clusters, electrochromatic and smart mirrors, wiper modules, head-up display systems, automotive camera systems
On-board modules
OPT4003-Q1 – automotive-grade digital ambient light sensor from Texas Instruments
Key Features
Independent measurement of visible and near-infrared (NIR) light, sharp cutoff at 800nm for high NIR sensitivity, high accuracy, automatic gain adjustment, support both continuous and single-shot measurement modes, I2C interface with selectable slave address, low power consumption, and more
Interface
I2C
Feature
ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Light 3 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 |
JP1 | VIO SEL | Left | Logic Voltage Level Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2 | ADDR SEL | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
Light 3 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Visible Channel Measurement Range | 535µ | – | 143 k | lux |
Wavelength (ALS/IR) | 550 / 810 | nm |
Software Support
We provide a library for the Light 3 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 3 Click driver.
Key functions
-
light3_sw_reset
This function is used to perform software reset. -
light3_write_reg
This function writes a desired data into the selected register by using I2C serial interface. -
light3_get_ch0_data
This function reads ambient light data from the Channel 0 and performs the calculatios from raw data to Lux.
Example Description
This example demonstrates the use of Light 3 Click board by measuring the ambient light level in Lux.
void application_task ( void )
{
float lux_data = 0;
if ( LIGHT3_PIN_STATE_LOW == light3_get_int_pin( &light3 ) )
{
light3_get_ch0_data( &light3, &lux_data );
log_printf( &logger, "Light level: %f lux rn", ( float ) lux_data );
}
}
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.Light3
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.