Home Code VEML6070 ultraviolet light sensor and Arduino example

VEML6070 ultraviolet light sensor and Arduino example

by shedboy71
[lebox id="1"]

In this example we look at an VEML6070 UV sensor and connect it to an Arduino UNO

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.

You can find out about the UV index at the following link – https://en.wikipedia.org/wiki/Ultraviolet_index

This is the key chart from this site and one of the reasons that a UV index meter is so important

UV Index Media graphic color Risk of harm from unprotected sun exposure, for the average adult Recommended protection
0.0–2.9 Green “Low” A UV Index reading of 0 to 2 means low danger from the sun's UV rays for the average person.Wear sunglasses on bright days. If you burn easily, cover up and use broad spectrum SPF 30+ sunscreen. Bright surfaces, such as sand, water and snow, will increase UV exposure.
3.0–5.9 Yellow “Moderate” A UV Index reading of 3 to 5 means moderate risk of harm from unprotected sun exposure.Stay in shade near midday when the sun is strongest. If outdoors, wear sun protective clothing, a wide-brimmed hat, and UV-blocking sunglasses. Generously apply broad spectrum SPF 30+ sunscreen every 2 hours, even on cloudy days, and after swimming or sweating. Bright surfaces, such as sand, water and snow, will increase UV exposure.
6.0–7.9 Orange “High” A UV Index reading of 6 to 7 means high risk of harm from unprotected sun exposure. Protection against skin and eye damage is needed.Reduce time in the sun between 10 a.m. and 4 p.m. If outdoors, seek shade and wear sun protective clothing, a wide-brimmed hat, and UV-blocking sunglasses. Generously apply broad spectrum SPF 30+ sunscreen every 2 hours, even on cloudy days, and after swimming or sweating. Bright surfaces, such as sand, water and snow, will increase UV exposure.
8.0–10.9 Red “Very high” A UV Index reading of 8 to 10 means very high risk of harm from unprotected sun exposure. Take extra precautions because unprotected skin and eyes will be damaged and can burn quickly.Minimize sun exposure between 10 a.m. and 4 p.m. If outdoors, seek shade and wear sun protective clothing, a wide-brimmed hat, and UV-blocking sunglasses. Generously apply broad spectrum SPF 30+ sunscreen every 2 hours, even on cloudy days, and after swimming or sweating. Bright surfaces, such as sand, water and snow, will increase UV exposure.
11.0+ Violet “Extreme” A UV Index reading of 11 or more means extreme risk of harm from unprotected sun exposure. Take all precautions because unprotected skin and eyes can burn in minutes.Try to avoid sun exposure between 10 a.m. and 4 p.m. If outdoors, seek shade and wear sun protective clothing, a wide-brimmed hat, and UV-blocking sunglasses. Generously apply broad spectrum SPF 30+ sunscreen every 2 hours, even on cloudy days, and after swimming or sweating. Bright surfaces, such as sand, water and snow, will increase UV exposure.

The easiest way to work with this sensor is to buy a module – this is a picture of the module that I bought

Connection

An I2C device so easy to get connected to an Arduino

arduino and veml6070

arduino and veml6070

Code

I used the Adafruit library – 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 – just as a note in my example I was indoors – hence the UV value was 0

VEML6070 Test
UV light level: 0
UV light level: 0
UV light level: 0
UV light level: 0

 

Link

You can pick up one of these sensors for about $2.50

UV sensor module VEML6070 UV Sensitivity Detection Sensor for Arduino

Share
[lebox id="2"]

You may also like

Leave a Comment