How does it work?
Ambient 14 Click is based on the TMD2755, an advanced sensor from ams OSRAM that combines digital ambient light sensing (ALS) and proximity detection in a highly compact 1.1mm module. The TMD2755 integrates an infrared VCSEL (Vertical-Cavity Surface-Emitting Laser) and a factory-calibrated VCSEL driver for efficient proximity detection. This sensor excels in detecting objects, such as recognizing the proximity of a user’s ear to a mobile device screen, by measuring the reflected IR energy emitted by the integrated VCSEL. The board’s proximity detection capabilities are supported by a sophisticated proximity engine, which includes an offset adjustment feature to eliminate unwanted reflections from nearby objects, enhancing accuracy. It also improves proximity measurements by automatically subtracting ambient light interference. The results from both ALS and proximity detection are provided as 16-bit data, enabling precise measurement of ambient light levels for tasks like adjusting display backlight brightness.
This Click board™ uses a standard 2-wire I2C interface to communicate with the host MCU, supporting Standard mode with up to 1MHz of frequency clock. It also provides interrupt-driven detect/release events through the INT pin on the mikroBUS™ socket. These interrupts are triggered when proximity results exceed or fall below user-configured threshold levels.
The TMD2755 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 BH18PB1WHFV, provides a 1.8V out of 3.3V mikroBUS™ power rail. Since the sensor operates on 1.8V, this Click board™ also features the PCA9306 voltage-level translator, allowing the TMD2755 to work properly with 3.3V and 5V MCU. This regulator can be activated via the SBY pin of the mikroBUS™ socket, providing an enable function simultaneously.
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. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Specifications
Type
Ambient Light,Optical,Proximity
Applications
Ideal for applications in mobile devices, smart displays, and other electronics requiring accurate light and proximity sensing
On-board modules
TMD2755 – ambient light sensing (ALS) and proximity detection sensor from ams OSRAM
Key Features
Ambient light and proximity detection capability, integrated IR VCSEL and factory-calibrated VCSEL driver, 16-bit data output, proximity engine, interrupt-driven detect/release events, I2C interface, 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 14 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 |
Ambient 14 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Spectral Response (ALS/IR) | 580/920 | nm |
Software Support
We provide a library for the Ambient 14 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 14 Click driver.
Key functions
-
ambient14_read_proximity
This function reads the raw proximity data. The higher the value, the closer the detected object is. -
ambient14_read_als_ir
This function reads the raw ALS and IR data. -
ambient14_get_illuminance
This function calculates the illuminance level (Lux) from ALS data counts input.
Example Description
This example demonstrates the use of Ambient 14 Click by measuring the illuminance level (Lux) and the proximity data on the USB UART.
void application_task ( void )
{
uint16_t proximity = 0;
uint16_t als_data = 0;
uint16_t ir_data = 0;
float illuminance = 0;
// Enable and wait for proximity interrupt
ambient14_write_reg ( &ambient14, AMBIENT14_REG_INTENAB, AMBIENT14_INTENAB_PIEN );
while ( ambient14_get_int_pin ( &ambient14 ) );
// Read proximity data and clear interrupts
if ( AMBIENT14_OK == ambient14_read_proximity ( &ambient14, &proximity ) )
{
log_printf ( &logger, " Proximity: %urn", proximity );
}
ambient14_clear_interrupts ( &ambient14 );
// Enable and wait for ALS interrupt
ambient14_write_reg ( &ambient14, AMBIENT14_REG_INTENAB, AMBIENT14_INTENAB_AIEN );
while ( ambient14_get_int_pin ( &ambient14 ) );
// Read ALS and IR data counts, calculates illuminance level, and clear interrupts
if ( AMBIENT14_OK == ambient14_read_als_ir ( &ambient14, &als_data, &ir_data ) )
{
log_printf ( &logger, " ALS: %urn", als_data );
log_printf ( &logger, " IR: %urn", ir_data );
if ( AMBIENT14_OK == ambient14_get_illuminance ( &ambient14, als_data, &illuminance ) )
{
log_printf ( &logger, " Illuminance: %.1f Luxrnn", illuminance );
}
}
ambient14_clear_interrupts ( &ambient14 );
}
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.Ambient14
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.