Skip to Content

Light UV Ultraviolet Ray Detection Sensor GY-VEML6070

The VEML6070 is an advanced ultraviolet (UV) light sensor featuring an I2C interface and CMOS process design. It operates easily via simple I2C commands and includes an active acknowledge (ACK) feature with configurable threshold windows. This allows the sensor to send UV Index (UVI) alert messages under strong solar UV conditions, which can be handled efficiently with software.

Integrated within a single chip, the VEML6070 combines a photodiode, amplifiers, and analog/digital circuits. Its Filtron™ UV technology ensures excellent spectral sensitivity across the UV spectrum. The sensor offers precise temperature compensation and a robust refresh rate without requiring an external RC low pass filter. The sensor's linear sensitivity to solar UV light is adjustable with an external resistor. It also supports a software shutdown mode to reduce power consumption below 1 μA. The operating voltage range is from 2.7 V to 5.5 V.

54.60 AED 54.60 AED Tax Included
54.60 AED Tax Included

Not Available For Sale

This combination does not exist.

Terms and Conditions
30-day money-back guarantee
Shipping: 2-3 Business Days

 

Connection Layout

Below is the pinout layout of the Adafruit VEML6070 module connected to a Raspberry Pi (shown with Raspberry Pi 3, but compatible with other models). The sensor requires only 3.3V and GND connections along with the I2C lines, making it simple to integrate.

VEML6070 Raspberry Pi Connection Layout

Parts List

Amount Part Type Properties
1 VEML6070 GY-VEML6070 UV light sensor module
1 Raspberry Pi 3 Raspberry Pi 3 Model B Board 1GB LPDDR2 BCM2837 Quad-Core

Python Code Example

This example code reads UV light values from the VEML6070 sensor over I2C and prints the readings to the terminal. It is designed to work with the VEML6070_I2CS I2C Mini Module.

import smbus
import time

# Get I2C bus
bus = smbus.SMBus(1)

# I2C address of the device
VEML6070_DEFAULT_ADDRESS = 0x38

# VEML6070 Command Set
VEML6070_CMD_ACK_DISABLE = 0x00        # Acknowledge Disable
VEML6070_CMD_ACK_ENABLE = 0x20         # Acknowledge Enable
VEML6070_CMD_ACK_THD_102 = 0x00        # Acknowledge threshold 102 Steps
VEML6070_CMD_ACK_THD_145 = 0x10        # Acknowledge threshold 145 Steps
VEML6070_CMD_IT_1_2T = 0x00            # Integration time = 1/2T
VEML6070_CMD_IT_1T = 0x04               # Integration time = 1T
VEML6070_CMD_IT_2T = 0x08               # Integration time = 2T
VEML6070_CMD_IT_4T = 0x0C               # Integration time = 4T
VEML6070_CMD_RESERVED = 0x02            # Reserved, Set to 1
VEML6070_CMD_SD_DISABLE = 0x00          # Shut-down Disable
VEML6070_CMD_SD_ENABLE = 0x01           # Shut-down Enable
VEML6070_CMD_READ_LSB = 0x38            # Read LSB of the data
VEML6070_CMD_READ_MSB = 0x39            # Read MSB of the data

class VEML6070():
    def __init__(self):
        self.write_command()

    def write_command(self):
        """Select the UV light command from the given provided values"""
        COMMAND_CONFIG = (VEML6070_CMD_ACK_DISABLE | VEML6070_CMD_IT_1_2T | VEML6070_CMD_SD_DISABLE | VEML6070_CMD_RESERVED)
        bus.write_byte(VEML6070_DEFAULT_ADDRESS, COMMAND_CONFIG)

    def read_uvlight(self):
        """Read data back from the sensor MSB and LSB"""
        data0 = bus.read_byte(VEML6070_CMD_READ_MSB)
        data1 = bus.read_byte(VEML6070_CMD_READ_LSB)
        uvlight = data0 * 256 + data1
        return {'u': uvlight}

veml6070 = VEML6070()

while True:
    light = veml6070.read_uvlight()
    print("UV Light Level : %d" % (light['u']))
    print("***********************************")
    time.sleep(0.5)

To run this code on your Raspberry Pi, save it as VEML6070.py, then open a terminal and run:

sudo python VEML6070.py

Sample Output

Here is an example output captured indoors:

VEML6070 Sensor Output