How does it work?
Ambient 22 Click is based on the OPT3005, a single-chip lux meter from Texas Instruments, measuring light intensity as visible by the human eye. The device’s precision spectral response and extreme IR rejection enable the OPT3005 to accurately meter light intensity as seen by the human eye regardless of the light source and any stray light from 850nm or 940nm active illumination. The IR rejection also helps to maintain high accuracy when this board is mounted under dark glass, especially with active 850nm or 940nm NIR illumination. This board is designed for applications that create light-based experiences for humans and is a preferred replacement for photodiodes, photoresistors, or other ambient light sensors with less human eye matching and IR rejection.
The OPT3005 measures 20mlux up to 166klux over a 23-bit effective dynamic range. It can be configured into an automatic full-scale, range-setting mode that always selects the best full-scale range setting for the lighting conditions. This mode frees the user from having to program their software for potential iterative measurement cycles and readjustment of the full-scale range until optimal for any given measurement. The OPT3005 can also operate continuously or in single-shot measurement modes.
Ambient 22 Click communicates with an MCU using the standard I2C 2-Wire interface to read data and configure settings, supporting High-Speed mode. Also, the OPT3005 allows choosing the least significant bits (LSB) of its I2C slave address using the SMD jumper labeled ADDR SEL. It also possesses an additional interrupt signal, routed on the INT pin of the mikroBUS™ socket, indicating when a specific interrupt event occurs, such as detecting a meaningful change in light intensity.
This Click board™ can only be operated with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ 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
Can be used for obtaining ambient light data in applications like display optical-intensity, industrial, or commercial lighting control
On-board modules
OPT3005 – single-chip lux meter from Texas Instruments
Key Features
Low power consumption, precision optical filtering to match human eye, corresponds to a dark window because of high sensitivity, I2C interface, wide and flexible operational range, effective dynamic range with automatic gain ranging, 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 Ambient 22 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 | ADDR SEL | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
Ambient 22 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Spectral Range | – | – | 167 | klux |
Wavelength | 850/940 | nm |
Software Support
We provide a library for the Ambient 22 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 Ambient 22 Click driver.
Key functions
-
ambient22_get_int_pin
This function returns the INT pin logic state. -
ambient22_read_lux
This function checks for a conversion ready flag bit and then reads the ambient light level in lux. -
ambient22_write_register
This function writes a desired data to the selected register by using I2C serial interface.
Example Description
This example demonstrates the use of Ambient 22 Click board™ by measuring the ambient light level in lux.
void application_task ( void )
{
float lux;
// Wait for a data ready interrupt
while ( ambient22_get_int_pin ( &ambient22 ) );
if ( AMBIENT22_OK == ambient22_read_lux ( &ambient22, &lux ) )
{
log_printf( &logger, " Ambient light: %.2f luxrnn", lux );
}
}
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.Ambient22
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, which needs to be downloaded from the LibStock and installed for the compiler you are using to ensure proper operation of mikroSDK compliant Click board™ demo applications.
For more information about mikroSDK, visit the official page.