How does it work?
Ambient 19 Click as its foundation uses the APM-16D24-310-DF8/TR8, a digital I2C interface sensor that integrates Ambient Light Sensor (ALS), Proximity Sensor (PS), and Infrared LED (IR LED) from Everlight Electronics. The ALS can sense ambient light intensity that matches the human eye’s response and enable the device to implement display dimming or lighting brightness control functions, helping to reduce power consumption. On the other side, the proximity sensor use IR LED reflection function to detect “away or close” to the object triggering the device to turn ON/OFF or some other specific function.
Three photodiodes are built in the APM-16D24-310-DF8/TR8, where each photodiode responds to different light spectra. This feature can distinguish different light sources and derive different illuminance conversion formulas according to various light sources. Also, it has a flexible and wide operating range for the ambient light sensor with a maximum resolution of 0.0023lux/count and full detectable illumination of 57880Lux. An integrated proximity function has an adjustable number of IR pulses from 1 to 256 alongside a flexible IR LED driving current to meet different application requirements. There is also an integrated filter to reduce unwanted IR signals and environmental noise.
The APM-16D24-310-DF8/TR8 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 MAX8511, is used, providing a 1.8V out of both 5V and 3.3V mikroBUS™ power rails.
Ambient 19 Click communicates with MCU using the standard I2C 2-Wire interface with a maximum clock frequency of 400kHz, fully adjustable through software registers. Since the sensor for operation requires a power supply of 3.3V, this Click board™ also features the PCA9306 and SN74LVC1T45 voltage-level translators. The I2C interface bus lines are routed to the voltage-level translators allowing this Click board™ to work with both 3.3V and 5V MCUs properly. 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 operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the 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
Can be used for obtaining ambient light data in applications such as automatic residential and commercial lighting management
On-board modules
APM-16D24-310-DF8/TR8 – digital I2C interface sensor that integrates ambient light and proximity sensor, and Infrared LED from Everlight Electronics
Key Features
Optical response similar to human eyes, high resolution, integrated filter to reduce unwanted IR signals and environmental noise, adjustable number of pulse for the IR proximity signal, I2C interface, wide operational range, stable performance over temperature, and more
Interface
I2C
Feature
No 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 Ambient 19 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 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
Ambient 19 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
ALS Detection Resolution | – | 0.0023 | – | lx/count |
ALS Maximum Detection | – | 57880 | – | lux |
ALS ADC Resolution | 10 | – | 16 | bit |
PS ADC Resolution | 8 | – | 12 | bit |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the Ambient 19 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 19 Click driver.
Key functions
-
ambient19_measure_light_level
This function reads the raw ALS data from two channels and then measures the light level in lux based on those readings. -
ambient19_read_raw_proximity
This function reads the raw PS and IR data of the proximity sensor. -
ambient19_clear_interrupts
This function clears all interrupts by clearing the INT_FLAG register.
Example Description
This example demonstrates the use of Ambient 19 Click board™ by measuring the ambient light level in Lux.
void application_task ( void )
{
if ( !ambient19_get_int_pin ( &ambient19 ) )
{
uint16_t lux, ps_data, ir_data;
if ( AMBIENT19_OK == ambient19_measure_light_level ( &ambient19, &lux ) )
{
log_printf ( &logger, "rn Ambient light level [Lux]: %urn", lux );
}
if ( AMBIENT19_OK == ambient19_read_raw_proximity ( &ambient19, &ps_data, &ir_data ) )
{
log_printf ( &logger, " PS data: %urn", ps_data );
log_printf ( &logger, " IR data: %urn", ir_data );
}
ambient19_clear_interrupts ( &ambient19 );
}
}
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.Ambient19
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.