Ambient 8 Click Board
Ambient 8 Click Board
The Ambient 8 Click Board™ is equipped with the ambient light sensor (ALS) IC, providing measurements of the ambient light intensity in a digital format. It utilizes the LTR-329ALS-01, an ALS with the I2C interface. Packed in a small transparent ChipLED package, this sensor can provide very accurate readings: thanks to a 16-bit and resolution and high dynamic range, it can be used in both very dim and very bright lighting conditions: it can cover the range from 0.01 lux to 64 Klux. It has excellent IR filtering and two photo-sensing elements, allowing linear response over the whole range. The flicker noise rejection algorithm further improves accuracy, while excellent thermal compensation ensures consistency of the measurement results.
The Ambient 8 Click Board™ is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click Board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
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.
Ambient 8 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.