How does it work?
UVB Click based on GUVB-C31SM, a Digital UV Sensor from GENUV Technology. The sensor detects UVB light, as it includes on-chip GaN Sensors for UVB. The current generated by photo detectors is converted and measured by ADC and changed to 16-bit resolution digital data. The measured data can be delivered to host via I2C serial interface. Spectral responsivity of sensor is from 240nm up to 320nm which covers full range of UVB spectrum that’s defined as light with wavelength from 280nm up to 315nm.
The atmosphere blocks about 77% of the Sun’s UV, of the ultraviolet radiation that reaches the Earth’s surface, more than 95% is the longer wavelengths of UVA, with the small remainder UVB. Overexposure to UVB radiation not only can cause sunburn but also some forms of skin cancer. UVB radiation can cause direct DNA damage. This cancer connection is one reason for concern about ozone depletion and the ozone hole.
One of the benefits of UV light is that it causes the body to produce vitamin D (specifically, UVB), which is essential for life. The human body needs some UV radiation to maintain adequate vitamin D levels; however, excess exposure produces harmful effects that typically outweigh the benefits. With all of this in mind it’s very useful to know the amount of UVB radiation that you are exposed to, and UVB Click board™ is perfect solution for such purpose, and perfect tool for developing wearable devices or weather stations that can report amount of UVB light intensity.
Since sensor is supplied with 3.3V only, also featured on this Click board™ is voltage level shifter. For the level shifting, the PCA9306 dual bidirectional I2C bus and SMBus voltage level shifter is used. This level shifter IC allows shifting (converting) the I2C signal levels to the voltage level selected by the VCC SEL onboard SMD jumper. This allows both 3.3V and 5V capable MCUs to be interfaced with the UVB Click board™.
Specifications
Type
Optical
Applications
It can be used for UV measurement applications, sun exposure protection devices, prototyping of wearables, handsets, and various consumer electronics based on received UV light
On-board modules
GUVB-C31SM
Key Features
UVB sensing with 16-bit resolution, Support UV index measurement (0~16), Response at only UV range
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on UVB Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
PWR | LD1 | – | Power LED Indicator |
VCC SEL | JP1 | Left | Logic level voltage selection: left position 3V3, right position 5V |
Technical specification
Characteristic | Value |
---|---|
UVB sensing resolution | 16-bit |
UV index measurement | 0~16 |
Spectral responsivity | 240nm – 320nm |
Software Support
We provide a library for the UVB Click 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 basic functions for working with the UVB click.
Key functions:
void uvb_configuration ( uint8_t reg, uint8_t cfg )
– Configuration registeruint8_t uvb_check_communication ( void )
– Check communicationuint16_t uvb_get_uv_data ( void )
– Get UVB data
Examples description
The application is composed of three sections :
- System Initialization – Initializes I2C module
- Application Initialization – Initialization driver init, check communication and configuration module for measurement.
- Application Task – Reads UVB data and logs to the USBUART every 1500ms.
void application_task ( ) { uint16_t uvb_data; char demo_text[ 20 ]; uvb_data = uvb_get_uv_data( ); IntToStr( uvb_data, demo_text ); mikrobus_logwrite( ">> UVB data: ", _LOG_TEXT ); mikrobus_logwrite( demo_text, _LOG_LINE ); mikrobus_logwrite( "--------------------------", _LOG_LINE ); Delay_ms( 1500 ); }
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 informations
Depending on the development board you are using, you may need 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.
mikroSDK
This 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.
For more information about mikroSDK, visit the official page.