In this article we connect a VEML6075 UV Light Sensor to a Raspberry Pi Pico running Circuitpython
Sensor Information
The VEML6075 senses UVA and UVB light and incorporates photodiode, amplifiers, and analog / digital circuits into a single chip using a CMOS process. When the UV sensor is applied, it is able to detect UVA and UVB intensity to provide a measure of the signal strength as well as allowing for UVI measurement.
The VEML6075 provides excellent temperature compensation capability for keeping the output stable under changing temperature.
VEML6075’s functionality is easily operated via the simple command format of I2C (SMBus compatible) interface protocol. VEML6075’s operating voltage ranges from 1.7 V to 3.6 V.
Features
Compact package: 2.0 mm x 1.25 mm x 1.0 mm
UVA and UVB individual channel solutions
16-bit resolution per channel
Operating voltage range: 1.8 V to 3.6 V
Integrated modules: ultraviolet sensor (UV), and signal conditioning IC
Converts solar UV light intensity to digital data
Reliable performance of UV radiation measurement under long time solar UV exposure
Low power consumption I2C protocol (SMBus compatible) interface
Temperature compensation: -40 °C to +85 °C
Output type: I2C bus
Parts Required
Name | Link |
Pico | Raspberry Pi Pico Development Board |
VEML6075 | VEML6075 UVA UVB Light Sensor Module |
Connecting cables | Aliexpress product link |
Schematic/Connection
I used the VEML6075 module
Black for GND
Red for V+
Blue for SDA
Yellow for SCL
So color coded for ease of use, this layout shows a connection to the module
Code Example
I used Thonny for development
The following is based on a library , I copied the adafruit_ads1x15 folder whioch contains various libraries for this device to the lib folder on my Feather M0 Express – https://circuitpython.org/libraries
This is the basic example which comes with the library
[codesyntax lang=”python”]
import time import board import adafruit_veml6075 import busio # Create sensor object, communicating over the board's default I2C bus i2c = busio.I2C(scl=board.GP1, sda=board.GP0) # uses board.SCL and board.SDA veml = adafruit_veml6075.VEML6075(i2c, integration_time=100) print("Integration time: %d ms" % veml.integration_time) while True: print(veml.uv_index) time.sleep(1)
[/codesyntax]
Output
Here is what I saw in Thonny REPL window
Links