How does it work?
Ambient 2 Click is based on the OPT3001, a digital ambient light sensor with a high-precision human-eye response and excellent infrared rejection from Texas Instruments. The OPT3001 has a flexible and wide operating range for the ambient light sensor with a resolution of 0.01lux and full detectable illumination of 83865.6lux over a 23-bit effective dynamic range. Matching the sensor's spectral response to the human eye response is vital because ambient light sensors are used to measure and help create ideal human lighting experiences. This feature makes this Click board™ especially suitable for operation underneath visibly dark but infrared windows transmissive.
.jpg)
The OPT3001 optical filtering system is not overly sensitive to non-ideal particles and micro-shadows on the optical surface, which results in the relatively minor device dependency on uniform density optical illumination of the sensor area for infrared rejection. Proper optical surface cleanliness is always recommended for the best results on all optical devices.
Ambient 2 Click communicates with MCU using the standard I2C 2-Wire interface with a maximum clock frequency of 2.6MHz, fully adjustable through software registers. The OPT3001 can be commanded to operate continuously or in single-shot measurement modes. Also, it can be configured into an automatic full-scale, range-setting mode that always selects the optimal 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.
Besides, the OPT3001 allows choosing its I2C slave address by positioning the onboard SMD jumper labeled ADD to an appropriate position marked as GND, SCL, SDA, and VCC. Depending on the position of the jumper, four different slave addresses are available to the users. It also possesses an additional interrupt signal, routed on the INT pin of the mikroBUS™ socket labeled as INT, indicating when a specific interrupt event occurs, such as detecting a meaningful change in light intensity.
This Click board™ can be operated only 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 such as automatic residential and commercial lighting management |
On-board modules |
OPT3001 - digital ambient light sensor from Texas Instruments |
Key Features |
Low power consumption, high-precision, human-eye response, excellent infrared rejection, automatic full-scale setting, I2C interface with selectable slave address, wide operational range, stable performance over temperature, and more |
Interface |
I2C |
Feature |
ClickID Manifest,No 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 2 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes |
Pin |
 |
Pin |
Notes |
---|
|
NC |
1 |
AN |
PWM |
16 |
NC |
|
|
NC |
2 |
RST |
INT |
15 |
INT |
Interrupt |
ID COMM |
CS |
3 |
CS |
RX |
14 |
NC |
|
|
NC |
4 |
SCK |
TX |
13 |
NC |
|
|
NC |
5 |
MISO |
SCL |
12 |
SCL |
I2C Clock |
|
NC |
6 |
MOSI |
SDA |
11 |
SDA |
I2C Data |
Power Supply |
3.3V |
7 |
3.3V |
5V |
10 |
NC |
|
Ground |
GND |
8 |
GND |
GND |
9 |
GND |
Ground |
Onboard settings and indicators
Label |
Name |
Default |
Description |
---|
LD1 |
PWR |
- |
Power LED Indicator |
J1-J4 |
ADD |
Populated |
I2C Address Selection |
Ambient 2 Click electrical specifications
Description |
Min |
Typ |
Max |
Unit |
---|
Supply Voltage |
- |
3.3 |
- |
V |
Measurement Range |
-30 |
- |
83 |
kLux |
Peak Wavelength |
- |
540 |
- |
nm |
Software Support
We provide a library for the Ambient 2 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 2 Click driver.
Key functions
Example Description
This is a example which demonstrates the use of Ambient 2 Click board. This example measures and calculates abmient light from OPT3001 sensor.
void application_task( void )
{
if ( ambient2_generic_read( &ambient2, AMBIENT2_REG_CONFIGURATION ) & AMBIENT2_FLAG_MASK_CONV_READY )
{
ambient2_get_sens_results( &ambient2 );
log_printf( &console, "** Ambient Light Sensor : %.2f lux **rn", ambient2.sens_data.amb_light_lx );
log_printf( &console, "** Ambient Light Range : %.2f lux **rn", ambient2.sens_data.amb_light_range );
log_printf( &console, "** Ambient Light Percents : %d %% **rnn", ambient2.sens_data.amb_light_per );
}
}
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.Ambient2
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.