Tableau de clic Ambient 8
Tableau de clic Ambient 8
Overview
L' Ambient 8 Click Board™ est équipé d'un circuit intégré de capteur de lumière ambiante (ALS), qui fournit des mesures de l'intensité lumineuse ambiante au format numérique. Il utilise le LTR-329ALS-01, un ALS avec interface I2C. Emballé dans un petit boîtier ChipLED transparent, ce capteur peut fournir des mesures très précises : grâce à une résolution de 16 bits et à une plage dynamique élevée, il peut être utilisé dans des conditions d'éclairage très faibles comme très lumineuses : il peut couvrir la plage de 0,01 lux à 64 Klux. Il dispose d'un excellent filtrage IR et de deux éléments photo-détecteurs, permettant une réponse linéaire sur toute la plage. L'algorithme de rejet du bruit de scintillement améliore encore la précision, tandis qu'une excellente compensation thermique assure la cohérence des résultats de mesure.
L' Ambient 8 Click Board™ est pris en charge par une bibliothèque compatible mikroSDK, qui comprend des fonctions qui simplifient le développement logiciel. Ce Click Board™ est un produit entièrement testé, prêt à être utilisé sur un système équipé du socket mikroBUS™.
The LTR-329ALS-01 offers six programmable gain settings, ranging from 1x up to 96x. This allows operating flexibility, as the sensor can be used in both very bright and very dim environments. The Ambient 8 Click Board™ can be used for a rapid development of various cost-effective applications that rely on light intensity sensing, including optical switches, backlight dimming applications for mobile and handheld devices, light metering applications (lux meters), and similar.
How Does The Ambient 8 Click Board™ Work?
The main component of the Ambient 8 Click Board™ is the LTR-329ALS-01, a high accuracy ambient light sensor (ALS) with I2C interface, from LiteOn. This sensor has an excellent IR filtering capability, offering a spectral response similar to a response of a human eye. By utilising two sensitive photo-diodes (PDs), of which one is sensitive to IR light only, the ALS IC is able cancel out the effect of the IR light spectrum. The dynamic range for the ambient light sensor is very large, starting down from 0.01 lx up to about 64 klx. Besides two PDs, the IC incorporates a temperature compensation, and a logic section with the I2C interface. A high dynamic range along with a linear response over the entire range, allows this sensor to be placed behind a dark glass or panels made of other semi-transparent materials.
The LTR-329ALS-01 sensor uses a set of configuration registers, which allow very simple operation. By default, the ALS sensor is set to the standby mode. It does not perform any conversions until set up in the active mode. The Click Board™ is supported by the mikroSDK compatible library, which simplifies the development by offering simple functions. However, more detailed explanation of each register and its function can be found in the datasheet of the LTR-329ALS-01.
There is also a set of four 8-bit output registers, which contain the conversion data from both PDs. Once the firmware starts reading their value, all four output registers will become locked, preventing any further changes. This allows for data consistency during the I2C reading sequence. There is also a status register, which indicates availability of new conversion data at the output registers. The output data is in LSB/MSB format, 16-bit value which is spread across two 8-bit registers.
There are two parameters that affect the overall sensing speed and the output rate: the LTR-329ALS-01 allows to set up both the integration time, and the measurement rate. The integration time improves the noise and the accuracy at the cost of reduced output data rate, while the measurement rate is the rate at which the measurements are made. The maximum value of the integration time is 350ms, while the slowest measurement rate is 2 seconds.
A selectable sensitivity allows a very wide dynamic range for the ALS measurement. There are three sensitivity bits, allowing the sensitivity to be set to six different values: 1x, 2x, 4x, 8x, 48x, and 96x. This offers six different luminosity ranges to be covered. When the gain is set to 1x, the ALS sensor can read the whole range from 1 lx up to 65535 lx (1 lx/LSB sensitivity). By increasing the gain setting, the resolution is increased, but the upper measurement limit is reduced. For example, gain 2x will reduce the maximum value to 32768 lx, resulting with 0.5 lx/LSB.
The Ambient 8 Click Board™ is supported by the mikroSDK library, which contains functions for simplified development. The mikroSDK functions are well-documented, but there is still a need, the datasheet of the LTR-329ALS-01 offers listing of all the registers and their specific functions.
The Ambient 8 Click Board™ is designed to work with 3.3V only. When using it with MCUs that use 5V levels for their communication, a proper level translation circuit should be used.
SPECIFICATIONS
Type | Optical |
Applications | It can be used for a rapid development of various cost-effective applications that rely on light intensity sensing, including optical switches, screen dimming applications for mobile and handheld devices, light metering applications (lux meters), and similar. |
On-board modules | LTR-329ALS-01, a high accuracy ambient light sensor (ALS) with I2C interface, from LiteOn. |
Key Features | High resolution and range of light intensity that can be measured, spectral response similar to human eye, low-power consumption, compact design ideal for building of IoT applications, immune to flickering and fluorescent light sources, independent of the light source type, and more. |
Interface | I2C |
Compatibility | mikroBUS |
Click Board™ size | M (42.9 x 25.4 mm) |
Input Voltage | 3.3V |
PINOUT DIAGRAM
This table shows how the pinout on Ambient 8 Click Board™ 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 | NC | ||
NC | 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 | 3V3 | 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 |
Software Support
Software Support
We provide a library for the Ambient 8 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library contains function for reading data from device registers Library contains function for writing data to device registers Library contains function for setting constants ( gain and integration time ) for Lux calculations Library contains function for device initialization Library contains function for reading ALS data ( channel 0 and channel 1 ) Library contains function for calculating Lux level based on ALS data from channels 0 and 1, window factor and IR factor.
Key Functions
void ambient8_setConstants( void )
- sets constants (gain and integration time) for lux level calculation.void ambient8_init( void )
- initializes the device, sets gain to 8X, sets integration time to 400ms.uint8_t ambient8_getLuxLevel( float * luxLevel_, float windowFactor_, float IRfactor_ )
- reads and data and performs lux level calculation.
Example Description
The application is composed of the three sections :
- System Initialization - Initializes LOG and I2C.
- Application Initialization - Initializes device and I2C driver.
- Application Task - Performs Lux calculation based on window and IR factor and log results.
void applicationTask( ) { statusFlag = ambient8_getLuxLevel( &luxLevel, windowFactor, IRfactor ); if (statusFlag == 0) { mikroBUS_logWrite( "lux Level : ", _LOG_TEXT ); FloatToStr( luxLevel, text ); mikroBUS_logWrite( text, _LOG_TEXT ); mikroBUS_logWrite( " lx", _LOG_LINE ); mikroBUS_logWrite( " ", _LOG_LINE ); } }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
I2C
UART
Conversions
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The Ambient 8 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.
Software Support
Software Support
We provide a library for the Ambient 8 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library contains function for reading data from device registers Library contains function for writing data to device registers Library contains function for setting constants ( gain and integration time ) for Lux calculations Library contains function for device initialization Library contains function for reading ALS data ( channel 0 and channel 1 ) Library contains function for calculating Lux level based on ALS data from channels 0 and 1, window factor and IR factor.
Key Functions
void ambient8_setConstants( void )
- sets constants (gain and integration time) for lux level calculation.void ambient8_init( void )
- initializes the device, sets gain to 8X, sets integration time to 400ms.uint8_t ambient8_getLuxLevel( float * luxLevel_, float windowFactor_, float IRfactor_ )
- reads and data and performs lux level calculation.
Example Description
The application is composed of the three sections :
- System Initialization - Initializes LOG and I2C.
- Application Initialization - Initializes device and I2C driver.
- Application Task - Performs Lux calculation based on window and IR factor and log results.
void applicationTask( ) { statusFlag = ambient8_getLuxLevel( &luxLevel, windowFactor, IRfactor ); if (statusFlag == 0) { mikroBUS_logWrite( "lux Level : ", _LOG_TEXT ); FloatToStr( luxLevel, text ); mikroBUS_logWrite( text, _LOG_TEXT ); mikroBUS_logWrite( " lx", _LOG_LINE ); mikroBUS_logWrite( " ", _LOG_LINE ); } }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
I2C
UART
Conversions
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The Ambient 8 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.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.