Tableau de clic Ambient 5
Tableau de clic Ambient 5
Overview
L' Ambient 5 Click Board™ peut détecter l'intensité de la lumière ambiante et fournir des données de mesure au format numérique, via l'interface I2C. Il utilise le VEML6030, un capteur de lumière ambiante miniature (ALS) qui occupe seulement 2x2 mm d'espace. Emballé dans un petit boîtier transparent, ce capteur offre de nombreuses fonctionnalités.
Grâce à sa plage dynamique de 16 bits, il peut être utilisé dans des conditions d'éclairage très faibles, mais aussi très lumineuses. Une technologie Filtron fournit une réponse spectrale proche d'un véritable œil humain. L'algorithme de rejet du bruit de scintillement améliore la précision, tandis qu'une excellente compensation thermique garantit des mesures cohérentes.
Thanks to the used proprietary technologies that allow high precision, reliability, and low power consumption, the Ambient 5 Click Board™ can be used for the 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.
How Does The Ambient 5 Click Board™ Work?
The main component of the Ambient 5 Click Board™ is the VEML6030, a high accuracy ambient light sensor (ALS) with an I2C interface, from Vishay Semiconductors. This sensor utilizes several proprietary technologies to ensure accurate measurements of the light intensity, with the spectral response very close to a human eye. By utilizing a sensitive photo-diode, low noise amplifier, and a 16-bit A/D converter (ADC), this sensor can provide the data directly, with no need for complex calculations. The dynamic range for the ambient light sensor is very large, starting down from 0 lux up to about 120 lux, with the maximum resolution of only 0.0036 lux/count. The extremely high sensitivity along with the linear response to different light sources, allows this sensor to be placed behind a dark glass or panels made of other semi-transparent materials.
The VEML6030 sensor has only six 16-bit registers, which make it very simple to configure and use. Even though, it comes with the mikroSDK compatible library, which simplifies the development even more. However, a more detailed explanation of each command can be found in the datasheet of the VEML6030, if required.
A selectable GAIN allows a very wide dynamic range for ALS measurement. There are two ALS_GAIN bits, allowing the gain level to be set to 1/4x, 1/2x, 1x, and 2x. This offers four different luminosity ranges to be covered for each selected integration time (ALS_IT). For example, the fastest integration time (25ms) results in the lowest resolution (1.8432 lx/count), and combined with the gain of 1/8x, it allows the highest luminosity value to be measured (120,796 lx)
The power consumption of the VEML6030 is in tight relation with the programmed integration time, power supply, and amplification. There are two bits available to select the power mode (PSM), four bits to select the integration time (ALS_IT), and two bits to select the gain (ALS_GAIN). These parameters are determining factors for the average power consumption, measurement resolution, and refresh time. By utilizing such a flexible power-saving scheme, the VEML6030 can be adapted to any type of power-sensitive application.
A configurable interrupt engine allows optimized firmware to be developed, avoiding polling routines and frequent access over the I2C interface. The interrupt pin (INT) is an open-drain output, which is pulled to a HIGH logic level when it is not asserted. When any of the programmed light thresholds is exceeded for a programmed number of times, an interrupt event will be generated, asserting this pin to a LOW logic level. The interrupt pin is routed to the mikroBUS™ INT pin.
The slave I2C address of the VEML6030 can be selected by switching the SMD jumper to an appropriate position. Unlike some other devices, this jumper does not set the LSB of the I2C address, but rather selects between two possible values: when tied to GND (0), the I2C address of the VEML6030 will be 0b0010000x. When tied to VCC (1), the I2C address will be 0b1001000x. The x is the I2C address R/W byte. Due to maximum electrical ratings, this Click board™ is to be used with 3.3V MCUs, only.
SPECIFICATIONS
Type | Optical |
Applications | This sensor is an ideal solution for both IoT light sensing applications, but also for portable or handheld devices which utilize accurate light intensity sensing, such as the TFT/LCD screens, keypad backlight, cell phones, digital cameras, and similar |
On-board modules | VEML6030, a high accuracy ambient light sensor (ALS) with an I2C interface, from Vishay Semiconductors |
Key Features | High resolution and range of light intensity that can be measured, spectral response similar to the human eye, low power consumption, compact design ideal for building 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 the Ambient 5 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 | INT | Interrupt OUT | |
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 |
JP1 | I2C ADD | Left | I2C slave address selection: left position tied to GND (0), right position tied to VCC (1) |
Software Support
We provide a library for the Ambient 5 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
The library contains functions for reading from and writing to selected registers library contains functions for calculating refresh time, data resolution and light level Library contains functions for powering the device on and checking the state of int pin Library contains functions for setting high and low threshold values.
Key Functions
void ambient5_powerOn( void )
- Fpowers device on and sets basic settings.float ambient5_getHighResolutionLightLevel( void )
- returns ambient light level in lux [lx].uint16_t ambient5_getRefreshTime( void )
- returns time needed for new data to become available.
Example Description
The application is composed of the three sections :
- System Initialization - Initializes i2c, log, and INT pin as input.
- Application Initialization - Initializes i2c driver, powers the device and calculates refresh time.
- Application Task - Logs high resolution data after a period of time ( refresh time calculated using - ambient5_getRefreshTime( ) ).
void applicationTask( ) { for (i = 0; i < rTime; i ++) { Delay_ms(1); } highResLightLevel = ambient5_getHighResolutionLightLevel( ); FloatToStr( highResLightLevel, text ); mikrobus_logWrite( " Ambient Light Level : ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_TEXT ); mikrobus_logWrite( " lx", _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 a 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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
Software Support
We provide a library for the Ambient 5 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
The library contains functions for reading from and writing to selected registers library contains functions for calculating refresh time, data resolution and light level Library contains functions for powering the device on and checking the state of int pin Library contains functions for setting high and low threshold values.
Key Functions
void ambient5_powerOn( void )
- Fpowers device on and sets basic settings.float ambient5_getHighResolutionLightLevel( void )
- returns ambient light level in lux [lx].uint16_t ambient5_getRefreshTime( void )
- returns time needed for new data to become available.
Example Description
The application is composed of the three sections :
- System Initialization - Initializes i2c, log, and INT pin as input.
- Application Initialization - Initializes i2c driver, powers the device and calculates refresh time.
- Application Task - Logs high resolution data after a period of time ( refresh time calculated using - ambient5_getRefreshTime( ) ).
void applicationTask( ) { for (i = 0; i < rTime; i ++) { Delay_ms(1); } highResLightLevel = ambient5_getHighResolutionLightLevel( ); FloatToStr( highResLightLevel, text ); mikrobus_logWrite( " Ambient Light Level : ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_TEXT ); mikrobus_logWrite( " lx", _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 a 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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.