In this article we will measure uv light using a VEML6070 sensor connected to a chipKIt MAX32
VEML6070 is an advanced ultraviolet (UV) light sensor with I2C protocol interface and designed by the CMOS process. It is easily operated via a simple I2C command. 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.
VEML6070 incorporates a photodiode, amplifiers, and analog / digital circuits into a single chip. VEML6070’s adoption of FiltronTM UV technology provides the best spectral sensitivity to cover UV spectrum sensing. It has an
excellent temperature compensation and a robust refresh rate setting that does not use an external RC low pass filter.
VEML6070 has linear sensitivity to solar UV light and is easily adjusted by an external resistor. Software shutdown mode is provided, which reduces power consumption to be less than 1 μA. VEML6070’s operating voltage ranges from 2.7 V to 5.5 V.
Shopping List
Amount | Part Type | |
---|---|---|
1 | VEML6070 | |
1 | Best Price Square TDGL003, CHIPKIT, MAX32, DEV BOARD CHIPKIT MAX32 By DIGILENT |
Schematics/Layout
Another I2C sensor which needs 3.3v and GND as well, easy to connect to a chipkit as you can see in the layout below
Code
Adafruit have a library we can use, so lets try this one out –https://github.com/adafruit/Adafruit_VEML6070
[codesyntax lang=”cpp”]
#include <Wire.h> #include "Adafruit_VEML6070.h" Adafruit_VEML6070 uv = Adafruit_VEML6070(); void setup() { Serial.begin(9600); Serial.println("VEML6070 Test"); uv.begin(VEML6070_1_T); // pass in the integration time constant } void loop() { Serial.print("UV light level: "); Serial.println(uv.readUV()); delay(1000); }
[/codesyntax]
Output
Open the serial monitor – in my testing I was indoors hence the low values
VEML6070 Test
UV light level: 1
UV light level: 1
UV light level: 1
UV light level: 1
UV light level: 0
UV light level: 0
UV light level: 0
UV light level: 0
UV light level: 1
UV light level: 1