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
Curiosity HPC, standing for Curiosity High Pin Count (HPC) development board, supports 28- and 40-pin 8-bit PIC MCUs specially designed by Microchip for the needs of rapid development of embedded applications. This board has two unique PDIP sockets, surrounded by dual-row expansion headers, allowing connectivity to all pins on the populated PIC MCUs. It also contains a powerful onboard PICkit™ (PKOB), eliminating the need for an external programming/debugging tool, two mikroBUS™ sockets for Click board™ connectivity, a USB connector, a set of indicator LEDs, push button switches and a variable potentiometer. All
these features allow you to combine the strength of Microchip and Mikroe and create custom electronic solutions more efficiently than ever. Each part of the Curiosity HPC development board contains the components necessary for the most efficient operation of the same board. An integrated onboard PICkit™ (PKOB) allows low-voltage programming and in-circuit debugging for all supported devices. When used with the MPLAB® X Integrated Development Environment (IDE, version 3.0 or higher) or MPLAB® Xpress IDE, in-circuit debugging allows users to run, modify, and troubleshoot their custom software and hardware
quickly without the need for additional debugging tools. Besides, it includes a clean and regulated power supply block for the development board via the USB Micro-B connector, alongside all communication methods that mikroBUS™ itself supports. Curiosity HPC development board allows you to create a new application in just a few steps. Natively supported by Microchip software tools, it covers many aspects of prototyping thanks to many number of different Click boards™ (over a thousand boards), the number of which is growing daily.
Microcontroller Overview
MCU Card / MCU
![default](https://dbp-cdn.mikroe.com/catalog/mcus/resources/PIC18LF26K80.jpeg)
Architecture
PIC
MCU Memory (KB)
64
Silicon Vendor
Microchip
Pin count
28
RAM (Bytes)
3648
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