Our UV sensing solution empowers you to capture, measure, and analyze UV rays with unrivaled precision, opening doors to applications in health, safety, and scientific discovery
A
A
Hardware Overview
How does it work?
UV4 Click is based on the Si1133, a UV index and ambient light sensor with I2C Interface from Silicon Labs. This sensor features an integrated photo-elements array, used to sense the light intensity in a wide spectrum range, including the IR, visible and UV (UV-A and UV-B) wavelengths. Two integrated 23 bit A/D converters can be switched to sample any of the photo-sensing element types, allowing measurement under various light conditions, yielding a very wide dynamic range. The user is able to select between several light sensing configurations, to accommodate for low or high-intensity conditions. The sensing elements also include black photo-sensors used to provide readings of the dark current. The dark current is the current that flows through the photo-sensors in absence of light. For the improved accuracy and sensitivity, one of the ADCs can be configured to measure the dark current, allowing it to be subtracted from the final result of the measurement. The low-intensity measurements can also be obtained by adjusting the integration time. Typically, the integration time is 24.4 µs, but by increasing this time, it is possible to sense the light intensity down to 100mlx. For the accurate measurement of the visible light and the near-human eye response, the IR spectrum component needs to be removed from the measurement. The Si1133 sensor allows for both the visible and IR light spectrum to be read on separate channels, allowing external signal processing. This is done to allow the flexibility, given the fact that the used overlay might block less or more IR compared to visible light. The Si1133 IC contains an internal MCU with SRAM. The configuration of the Si1133 sensor is done via the
parameters table, which is kept in the SRAM of the integrated MCU. While some I2C registers are accessed directly, the parameters table is accessed indirectly, via the I2C registers. The internal structure of the sensor is based on channels topology. Each channel is actually a set of user-defined tasks. Every channel contains parameters such as the output format (16bit or 24bit), a choice of photo-sensing elements, ADC gain, how often the measurements are made, and so on. There are also some general configuration settings, such as the list of enabled channels, the configuration of the two counters that can be used by the channels, and three threshold levels that can also be used by the channels. The structure of channels allows flexible configuration and operation of the device, one channel can be set to read the visible spectrum of the light, while the other can detect the IR portion, a channel can be set to read the dark current and so on. More information on the Si1133 registers and I2C communication can be found in the datasheet. However, the provided library contains mikroC, mikroBASIC, and mikroPASCAL functions, which can be used to simplify working with the UV 4 click. There is also an example application that demonstrates the use of these functions, which can be used as a reference for custom projects. The device can work in several operational modes, allowing several power saving options: OFF mode, Initialization mode, Standby mode, Forced Conversion mode, and Autonomous mode. While the device is unpowered, it is basically in the OFF mode. After the power supply voltage reaches the operational level, the Initialization mode begins. It has to be completed prior to attempting I2C
communication. Once the initialization is finished, the device works in the Standby mode, most often used mode of operations. Although measurement is not possible while in standby, the I2C communication is available. The Standby mode uses the least power, while still operational. If set to a Forced Conversion mode, one cycle of measurement will be triggered for the enabled channels and the interrupt can be asserted upon finishing the conversion process. The Autonomous mode is used for the continuous conversion of the measurement data, with the parameters set by the user. The output registers are constantly updated, and the interrupt can be set to alert the host MCU. The interrupt can be also triggered in the case when the intensity threshold is reached, saving the host MCU of having to constantly poll the sensor for data. The Autonomous mode uses the most power of all modes since the conversion is run constantly (with the user-defined frequency) UV 4 click has the Si1133 interrupt pin routed to the standard INT pin of the mikroBUS™. This pin is set to a LOW logic level when asserted. The interrupt is also indicated by the interrupt status register, which can be used to locate the interrupt source. After reading it, the register will clear itself automatically. The interrupt pin is pulled to a HIGH logical level by the onboard resistors. As explained, UV 4 click uses the I2C communication bus, with its pins routed to the respective mikroBUS™ pins - SCL is the I2C clock, while the SDA is the I2C data pin. These pins are also pulled to the HIGH level, by the onboard resistors. Having these resistors, the device is ready to be operated with no additional passive components, right out from the box.
Features overview
Development board
Fusion for TIVA v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports a wide range of microcontrollers, such as different 32-bit ARM® Cortex®-M based MCUs from Texas Instruments, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer over a WiFi network. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, Fusion for TIVA v8 provides a fluid and immersive working experience, allowing access
anywhere and under any circumstances at any time. Each part of the Fusion for TIVA v8 development board contains the components necessary for the most efficient operation of the same board. An advanced integrated CODEGRIP programmer/debugger module offers many valuable programming/debugging options, including support for JTAG, SWD, and SWO Trace (Single Wire Output)), and seamless integration with the Mikroe software environment. Besides, it also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.
Communication options such as USB-UART, USB HOST/DEVICE, CAN (on the MCU card, if supported), and Ethernet is also included. In addition, it also has the well-established mikroBUS™ standard, a standardized socket for the MCU card (SiBRAIN standard), and two display options for the TFT board line of products and character-based LCD. Fusion for TIVA v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development 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

Type
8th Generation
Architecture
ARM Cortex-M4
MCU Memory (KB)
1024
Silicon Vendor
Texas Instruments
Pin count
128
RAM (Bytes)
262144
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Track your results in real time
Application Output
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for UV4 Click driver.
Key functions:
uv4_write_reg
- This function write one byte of data to given addressuv4_read_reg
- This function reads determined number of bytes from given addressuv4_write_param_data
- This function writes one byte of data in parameter table
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* \file
* \brief UV4 Click example
*
* # Description
* This application reads configured measurements from selected channels, and
* then logs them.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes driver, performs reset command, enables
* channels 0, 1 and 4 and configures channel 0 as 24-bit witch measures WHITE light,
* channel 1 as 24-bit witch measures Small IR light, and channel 4 as 16-bit witch
* measures UV light.
*
* ## Application Task
* Reads all configured measurements from selected channels
* and logs results on USB UART. Repeats operation every 500ms.
*
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "uv4.h"
// ------------------------------------------------------------------ VARIABLES
static uv4_t uv4;
static log_t logger;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
uv4_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.
uv4_cfg_setup( &cfg );
UV4_MAP_MIKROBUS( cfg, MIKROBUS_1 );
uv4_init( &uv4, &cfg );
uv4_default_cfg( &uv4 );
}
void application_task ( void )
{
uint8_t cnt;
uint8_t pom = 1;
uint32_t data_r[ 6 ];
uv4_read_measurements( &uv4, &data_r[ 0 ] );
for ( cnt = 0; cnt < 6; cnt++ )
{
if ( uv4.config_byte & pom )
{
switch ( uv4.optical_data[ cnt ] )
{
case UV4_OPT_FUNC_SMALL_IR:
{
log_printf( &logger, "Small IR: " );
break;
}
case UV4_OPT_FUNC_MEDIUM_IR:
{
log_printf( &logger, "Medium IR: " );
break;
}
case UV4_OPT_FUNC_LARGE_IR:
{
log_printf( &logger, "Large IR: " );
break;
}
case UV4_OPT_FUNC_WHITE:
{
log_printf( &logger, "White : " );
break;
}
case UV4_OPT_FUNC_LARGE_WHITE:
{
log_printf( &logger, "Large White: " );
break;
}
case UV4_OPT_FUNC_UV:
{
log_printf( &logger, "UV: " );
break;
}
case UV4_OPT_FUNC_UV_DEEP:
{
log_printf( &logger, "UV-Deep: " );
break;
}
default:
{
break;
}
}
log_printf( &logger, "%d\r\n", data_r[ cnt ] );
}
pom <<= 1;
}
Delay_ms ( 500 );
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END