Grove - I2C UV Sensor (VEML6070)

The Grove - I2C UV Sensor(VEML6070) is an advanced ultraviolet (UV) light sensor with I2C protocol interface. Ultraviolet (UV) is electromagnetic radiation with a wavelength from 10 nm to 400 nm, shorter than that of visible light but longer than X-rays, this sensor detects 320-410nm light most effectively, and will converts solar UV light intensity to digital data.

This module is based on VEML6070, which has linear sensitivity to solar UV light and is easily adjusted by an external resistor.

What's more the active acknowledge (ACK) feature with threshold windows setting allows the UV sensor to send out a UVI alert message. Under a strong solar UVI condition, the smart ACK signal can be easily implemented by the software programming.


  • Excellent performance of UV radiation measurement under long time solar UV exposure
  • Excellent UV sensitivity and linearity
  • Excellent temperature compensation
  • High dynamic detection resolution
  • Support acknowledge feature (ACK)


Item Value
Operating Voltage 3.3V / 5V
Range of spectral sensitivity 320 ~ 410 nm
Peak Sensitivity 355 nm
UVA Sensitivity 5 μW/cm2/step(typical)
Interface I2C
I2C Address 0x38(Data LSB) / 0x39(Data MSB)


Actually, this sensor has 3 I2C address, each address

Typical applications

  • Solar UV indicator
  • Cosmetic / outdoor sport handheld product
  • Consumer products

Hardware Overview

Pin Out

Platforms Supported

Arduino Raspberry Pi


The platforms mentioned above as supported is/are an indication of the module's software or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Getting Started

Play With Arduino


Materials required

Seeeduino V4.2 Base Shield Grove - I2C UV Sensor (VEML6070)
enter image description here enter image description here enter image description here
Get One Now Get One Now Get One Now


1 Please plug the USB cable gently, otherwise you may damage the port. Please use the USB cable with 4 wires inside, the 2 wires cable can't transfer data. If you are not sure about the wire you have, you can click here to buy

2 Each Grove module comes with a Grove cable when you buy. In case you lose the Grove cable, you can click here to buy.

  • Step 1. Connect the Grove - I2C UV Sensor (VEML6070) to port I2C of Grove-Base Shield.

  • Step 2. Plug Grove - Base Shield into Seeeduino.

  • Step 3. Connect Seeeduino to PC via a USB cable.


If we don't have Grove Base Shield, We also can directly connect this module to Seeeduino as below.

Seeeduino Grove Cable Grove - I2C UV Sensor (VEML6070)
5V or 3.3V Red VCC
SCL Yellow SCL



If this is the first time you work with Arduino, we strongly recommend you to see Getting Started with Arduino before the start.

  • Step 1. Download the Seeed_VEML6070 Library from Github.

  • Step 2. Refer to How to install library to install library for Arduino.

  • Step 3. Restart the Arduino IDE. Open the example, you can open it in the following three ways:

    1. Open it directly in the Arduino IDE via the path: File → Examples → Seeed_VEML6070 → INT_mode.

    2. Open it in your computer by click the INT_mode.ino which you can find in the folder XXXX\Arduino\libraries\Seeed_VEML6070-master\examples\INT_mode, XXXX is the location you installed the Arduino IDE.

    3. Or, you can just click the icon in upper right corner of the code block to copy the following code into a new sketch in the Arduino IDE.

#include "Seeed_VEML6070.h"

/*SAMD core*/
  #define SERIAL SerialUSB
  #define SERIAL Serial

VEML6070 sensor;

char *UV_str[]={"low level","moderate level","high_level","very high","extreme"};

err_t read_UV()
    err_t ret=NO_ERROR;
    u16 step;
    SERIAL.print("UV step = ");
    RISK_LEVEL level=sensor.convert_to_risk_level(step);
    SERIAL.print("UV level is ");
    SERIAL.println(" ");
    SERIAL.println(" ");
    SERIAL.println(" ");
    return ret;

void setup()
    SERIAL.println("serial start!!");
      SERIAL.println("init failed!!!");
    /*threshold is 145 steps*/

void loop()
      SERIAL.print("read UV sensor failed!!");


There are 2 demos in the library:

This example can get the UV index and UV level from the serial.polling for data.


here is a INT pad on the sensor module which connect to ACK pin of VEML6070. You can set UV threshold by 102 steps or 145 steps(only two choises).The INT pin outputs low when the UV value beyond limit.You can attach INT pin to a interrupt pin of host,To improve the efficiency of program operation.


The library file may be updated. This code may not be applicable to the updated library file, so we recommend that you use the first two methods.

  • Step 4. Upload the demo. If you do not know how to upload the code, please check How to upload code.

  • Step 5. Open the Serial Monitor of Arduino IDE by click Tool-> Serial Monitor. Or tap the Ctrl+Shift+M key at the same time. Set the baud rate to 115200.


If every thing goes well, when you use UV light to illuminate this module, you will see information like:

4serial start!!
cmd reg=32
UV step = 20
UV level is low level

UV step = 125
UV level is low level

UV step = 511
UV level is low level

Alert Function

As we can see in the hardware Overview part, there is a ACK pin for user to work as a interrupt signal. The good news is that there are two threshold 102 step and 145 step to choose, the bad one is that you can not set your own number, only 102 and 145 are valid. The ACK pin default output low, once the UV value exceed the threshold you setted, the ACK pin output High. Let's come back to the example code INT_mode.ino.

Line 46, the default setting of threshold is 145, if you want to use the 102, you should just change the code as below:

$$ \downdownarrows $$


Play With Raspberry Pi (With Grove Base Hat for Raspberry Pi)


  • Step 1. Things used in this project:
Raspberry pi Grove Base Hat for RasPi Grove - I2C UV Sensor (VEML6070)
enter image description here enter image description here enter image description here
Get ONE Now Get ONE Now Get ONE Now
  • Step 2. Plug the Grove Base Hat into Raspberry.
  • Step 3. Connect the Grove - I2C UV Sensor (VEML6070) to I2C port of the Base Hat.
  • Step 4. Connect the Raspberry Pi to PC through USB cable.


  • Step 1. Follow Setting Software to configure the development environment.
  • Step 2. Download the source file by cloning the grove.py library.
cd ~
git clone https://github.com/Seeed-Studio/grove.py
  • Step 3. Excute below commands to run the code.
cd grove.py/grove
python grove_uv_sensor.py 

Following is the grove_uv_sensor.py code.

from __future__ import print_function
import time, sys, signal, atexit
from upm import pyupm_veml6070 as veml6070

def main():
    # Instantiate a Vishay UV Sensor on the I2C bus 0
    veml6070_sensor = veml6070.VEML6070(0);

    ## Exit handlers ##
    # This function stops python from printing a stacktrace when you hit control-C
    def SIGINTHandler(signum, frame):
        raise SystemExit

    # This function lets you run code on exit, including functions from abpdrrt005pg2a5
    def exitHandler():

    # Register exit handlers
    signal.signal(signal.SIGINT, SIGINTHandler)

    # Read the value every second and detect the pressure
        print("UV Value: {0}".format(veml6070_sensor.getUVIntensity()))

if __name__ == '__main__':


If everything goes well, you will be able to see the following result

pi@raspberrypi:~/grove.py/grove $ python grove_uv_sensor.py 
UV Value: 0
UV Value: 0
UV Value: 0
UV Value: 0

You can quit this program by simply press Ctrl+C.

Schematic Online Viewer



This is the introduction Video of this product, simple demos, you can have a try.

Tech Support

Please do not hesitate to submit the issue into our forum