How does it work?
Ambient 16 Click as its foundation uses the BH1726NUC, a 16-bit digital-output ambient light sensor from Rohm Semiconductor. The BH1726NUC can detect a wide range of illuminance up to 30klx and provides an excellent responsivity close to the response of human eyes. It also has stable performance over a wide temperature range of -40°C to 85°C, and a voltage range suitable to measure the amount of the present ambient light.
The BH1726NUC is designed to control the brightness in various applications based on ambient light availability, brightness for optimum visibility, and energy efficiency. This IC can change its ambient-light sensitivity used to compensate for the effect of attenuation by the optical window. Adjustment is made by changing the measurement time. For example, when the transmission rate of the optical window is 1/n (measurement result becomes 1/n times if the optical window is set), the effect of the optical window is compensated by changing sensor sensitivity from default to n times.
Ambient 16 Click communicates with MCU using the standard I2C 2-Wire interface to read data and configure settings, supporting Standard Mode operation with a clock frequency of 100kHz and Fast Mode up to 400kHz. Besides, the BH1726NUC allows choosing the least significant bit (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 labeled as INT, indicating when a specific interrupt event occurs.
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 for adjusting brightness in applications that require power saving and better visibility
On-board modules
BH1726NUC – 16-bit digital-output ambient light sensor from Rohm Semiconductor
Key Features
Low power consumption, corresponds to a dark window because of high sensitivity, close responsivity to the human eye, I2C interface with selectable slave address, wide illumination range, stable performance over temperature and voltage, and more
Interface
I2C
Feature
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 16 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 16 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Illuminance Measurement Range | 0 | – | 30.000 | Ix |
Sensitivity Variations | – | ±15 | – | % |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the Ambient 16 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Ambient 16 Click driver.
Key functions
-
ambient16_get_part_id
Ambient 16 get part ID function. -
ambient16_set_gain
Ambient 16 set ADC gain function. -
ambient16_read_data
Ambient 16 get data in lux function.
Example Description
This is an example that demonstrates the use of the Ambient 16 Click board™ by measuring illuminance and displaying the value in Lux.
void application_task ( void )
{
ambient16_read_data( &ambient16, &data0, &data1 );
log_printf( &logger, " DATA 0 = %.2f lx rn", data0 );
log_printf( &logger, " DATA 1 = %.2f lx rn", data1 );
log_printf( &logger, "- - - - - - - - - - -rn" );
Delay_ms( 1000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Ambient16
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 MikroElektronika compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika 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.