Simplify lighting management and reduce energy consumption with our responsive ambient light solution
A
A
Hardware Overview
How does it work?
Ambient 11 Click is based on the VEML6035, which is a 16-bit low power, high sensitivity CMOS ambient light sensor operated via a simple I2C command from Vishay Semiconductor. This sensor has many features that make it a perfect solution for small designs such as the Ambient 11 Click board™. One of these features is certainly its high level of integration that allows a minimal number of external components. The sensor offers an active interruption feature that is triggered outside of the threshold window settings eliminating loading on the host. Besides that, VEML6035 has excellent temperature
compensation to maintain output stability under changing temperature and its refresh rate setting does not need an external RC low pass filter. There is a programmable shutdown mode which reduces current consumption to 0.5 μA. Operating voltage ranges from 1.7 V to 3.6 V. VEML6035 is a cost effective solution of ambient light sensor with I2C bus interface. The standard serial digital interface is easy to access “Ambient Light Signal” without complex calculation and programming by external controller. Beside the digital output also a flexible programmable interrupt pin is available. Given the options its elements can offer, the
Ambient 11 Click can be used as an ambient light sensor for mobile devices, industrial lighting operation, and as an optical switch for consumer, computing and industrial devices and displays. 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.
Features overview
Development board
Flip&Click PIC32MZ is a compact development board designed as a complete solution that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit PIC32MZ microcontroller, the PIC32MZ2048EFH100 from Microchip, four mikroBUS™ sockets for Click board™ connectivity, two USB connectors, LED indicators, buttons, debugger/programmer connectors, and two headers compatible with Arduino-UNO pinout. Thanks to innovative manufacturing technology,
it allows you to build gadgets with unique functionalities and features quickly. Each part of the Flip&Click PIC32MZ development kit contains the components necessary for the most efficient operation of the same board. In addition, there is the possibility of choosing the Flip&Click PIC32MZ programming method, using the chipKIT bootloader (Arduino-style development environment) or our USB HID bootloader using mikroC, mikroBasic, and mikroPascal for PIC32. This kit includes a clean and regulated power supply block through the USB Type-C (USB-C) connector. All communication
methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, user-configurable buttons, and LED indicators. Flip&Click PIC32MZ development kit allows you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
![default](https://dbp-cdn.mikroe.com/catalog/mcus/resources/PIC32MZ2048EFH100/PIC32MZ2048EFH100.jpg)
Architecture
PIC32
MCU Memory (KB)
2048
Silicon Vendor
Microchip
Pin count
100
RAM (Bytes)
524288
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
![Ambient 11 Click Schematic schematic](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1ee790a1-58f3-6328-a057-0242ac120009/schematic.webp)
Step by step
Project assembly
Track your results in real time
Application Output
After loading the code example, pressing the "DEBUG" button builds and programs it on the selected setup.
![Application Output Step 1](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed554e-d80f-6694-8cb9-02420a000272/AP-Step1.jpg)
After programming is completed, a header with buttons for various actions available in the IDE appears. By clicking the green "PLAY "button, we start reading the results achieved with Click board™.
![Application Output Step 3](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed5550-3c0f-6800-a19f-02420a000272/AP-Step3.jpg)
Upon completion of programming, the Application Output tab is automatically opened, where the achieved result can be read. In case of an inability to perform the Debug function, check if a proper connection between the MCU used by the setup and the CODEGRIP programmer has been established. A detailed explanation of the CODEGRIP-board connection can be found in the CODEGRIP User Manual. Please find it in the RESOURCES section.
![Application Output Step 4](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed5550-d4d0-6b20-a348-02420a000272/AP-Step4.jpg)
Software Support
Library Description
This library contains API for Ambient 11 Click driver.
Key functions:
ambient11_generic_write
- This function writes data to the desired registerambient11_generic_read
- This function reads data from the desired registerambient11_calc_illumination
- Function is used to calculate ambiental illuminationambient11_check_int
- Function checks interrupt occurence
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* \file
* \brief Ambient11 Click example
*
* # Description
* < The devices resolution depends on settings applied.
* User should consult the datasheet and choose resolution value
* that corresponds to the settings applied. >
*
* The demo application is composed of two sections :
*
* ## Application Init
* < Initalizes I2C driver, applies low sensitiviti settings
* ( GAIN = 0, DG = 0, SENS = 1 and IT = 100ms ) and
* makes an initial log.>
*
* ## Application Task
* < This example shows the capabilities of the Ambient 11 click
* by measuring ambiental illumination and displaying calculated value
* via USART terminal in luxes.>
*
* *note:*
*
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "ambient11.h"
// ------------------------------------------------------------------ VARIABLES
static ambient11_t ambient11;
static log_t logger;
float lx_val;
float resolution = 0.1024;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
ambient11_cfg_t cfg;
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
ambient11_cfg_setup( &cfg );
AMBIENT11_MAP_MIKROBUS( cfg, MIKROBUS_1 );
ambient11_init( &ambient11, &cfg );
ambient11_default_cfg ( &ambient11 );
}
void application_task ( void )
{
lx_val = ambient11_calc_illumination( &ambient11, resolution );
log_printf( &logger, "Illumination : %.2f lx \r\n", lx_val );
log_printf( &logger, "-------------------------\r\n" );
Delay_ms( 1000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END