# Adafruit VEML6075 UVA / UVB / UV Index Sensor

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/062/575/medium800/adafruit_products_3964_iso_ORIG_2018_09.jpg?1537990292)

This little sensor is a great way to add UVA and UVB light sensing to any microcontroller project. The VEML6070 from Vishay has both true UVA and UVB band light sensors and an I2C-controlled ADC that will take readings and integrate them. The sensor also comes with calibration registers so you can easily convert the UVA/UVB readings into the UV Index.

![](https://cdn-learn.adafruit.com/assets/assets/000/062/577/medium800/adafruit_products_3964_top_ORIG_2018_09.jpg?1537990309)

Compared to our other UV sensors, this one actually does a pretty good job of getting accurate UV data. Unlike the Si1145, it has a real UV sensor, and in contrast to the VEML6070, it has dual band senors and an Index calculation algorithm. So far this is the best UV sensor we've got!

![](https://cdn-learn.adafruit.com/assets/assets/000/062/578/medium800/adafruit_products_3964_quarter_ORIG_2018_09.jpg?1537990317)

This UV sensor works great with 3 or 5V power or logic, its nice and compact, and its easy to use with any I2C-capable microcontroller. We have [example code and libraries for Arduino](https://github.com/adafruit/Adafruit_VEML6075) and [CircuitPython/Python](https://github.com/adafruit/Adafruit_CircuitPython_VEML6075).

![](https://cdn-learn.adafruit.com/assets/assets/000/062/576/medium800/adafruit_products_3964_kit_ORIG_2018_09.jpg?1537990301)

Each order comes with one assembled PCB with a sensor, power regulator, level shifting and a small piece of header. Some light soldering is required to attach the header but its a fast task!

# Adafruit VEML6075 UVA / UVB / UV Index Sensor

## Pinouts

The VEML607 is a I2C sensor. That means it uses the two I2C data/clock wires available on most microcontrollers, and can share those pins with other sensors as long as they don't have an address collision. For future reference, the I2C address is **0x10** and you _can't_ change it!

![](https://cdn-learn.adafruit.com/assets/assets/000/062/579/medium800/adafruit_products_pinout.jpg?1537990370)

## Power Pins:

- **Vin** - this is the power pin. Since the chip uses 3 VDC, we have included a voltage regulator on board that will take 3-5VDC and safely convert it down. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V
- **3v3** - this is the 3.3V output from the voltage regulator, you can grab up to 100mA from this if you like
- **GND** - common ground for power and logic

## I2C Logic pins:

- **SCL** - I2C clock pin, connect to your microcontrollers I2C clock line.
- **SDA** - I2C data pin, connect to your microcontrollers I2C data line.

# Adafruit VEML6075 UVA / UVB / UV Index Sensor

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/062/772/medium800/adafruit_products_3964-01.jpg?1538410789)

## Prepare the header strip:

&nbsp;

Cut the strip to length if necessary. It will be easier to solder if you insert it into a breadboard -&nbsp; **long pins down**.

&nbsp;

Place the breakout board over the pins so that the short pins poke through the breakout pads.

![adafruit_products_DSC_3983.jpg](https://cdn-learn.adafruit.com/assets/assets/000/062/773/medium640/adafruit_products_DSC_3983.jpg?1538410808)

![adafruit_products_DSC_3983.jpg](https://cdn-learn.adafruit.com/assets/assets/000/062/903/medium640/adafruit_products_DSC_3983.jpg?1538497267)

## Add the breakout board:

&nbsp;

Place the breakout board over the pins so that the short pins poke through the breakout pads

![adafruit_products_DSC_3982.jpg](https://cdn-learn.adafruit.com/assets/assets/000/062/901/medium640/adafruit_products_DSC_3982.jpg?1538497202)

## And Solder!

&nbsp;

Be sure to solder all pins for reliable electrical contact.  
  
_(For tips on soldering, be sure to check out our&nbsp;_[_Guide to Excellent Soldering_](http://learn.adafruit.com/adafruit-guide-excellent-soldering)_)._

![adafruit_products_DSC_3984.jpg](https://cdn-learn.adafruit.com/assets/assets/000/062/775/medium640/adafruit_products_DSC_3984.jpg?1538410869)

![adafruit_products_DSC_3987.jpg](https://cdn-learn.adafruit.com/assets/assets/000/062/904/medium640/adafruit_products_DSC_3987.jpg?1538497297)

You're done! Check your solder joints visually and continue onto the next steps

![adafruit_products_DSC_3988_copy.jpg](https://cdn-learn.adafruit.com/assets/assets/000/062/905/medium640/adafruit_products_DSC_3988_copy.jpg?1538497323)

![](https://cdn-learn.adafruit.com/assets/assets/000/062/788/medium800/adafruit_products_DSC_3989.jpg?1538411637)

# Adafruit VEML6075 UVA / UVB / UV Index Sensor

## Arduino Test

You can easily wire this breakout to any microcontroller, we'll be using an Arduino. For another kind of microcontroller, just make sure it has I2C, then port the code - its pretty simple stuff!

![](https://cdn-learn.adafruit.com/assets/assets/000/062/590/medium800/adafruit_products_image.png?1537994251)

- Connect **Vin** to the power supply, 3-5V is fine. Use the same voltage that the microcontroller logic is based off of. For most Arduinos, that is 5V
- Connect **GND** to common power/data ground
- Connect the **SCL** pin to the I2C clock **SCL** pin on your Arduino. On an UNO & '328 based Arduino, this is also known as **A5** , on a Mega it is also known as **digital 21** and on a Leonardo/Micro, **digital 3**
- Connect the **SDA** pin to the I2C data **SDA** pin on your Arduino. On an UNO & '328 based Arduino, this is also known as **A4** , on a Mega it is also known as **digital 20** and on a Leonardo/Micro, **digital 2**

The VEML6075 has a default I2C address of **0x10** and cannot be changed!

# Install Arduino Libraries

Lets begin by installing all the libraries we need. Open up the library manager in Arduino IDE

![](https://cdn-learn.adafruit.com/assets/assets/000/062/581/medium800/adafruit_products_libmanager.png?1537991546)

Search for and install the latest version of the **Adafruit VEML6075** library

![](https://cdn-learn.adafruit.com/assets/assets/000/062/582/medium800/adafruit_products_image.png?1537991802)

And the **Adafruit BusIO** library

![](https://cdn-learn.adafruit.com/assets/assets/000/075/667/medium800/adafruit_products_image.png?1557768639)

# Basic Example

Start by opening up the **Adafruit VEML6075 -\> simpletest** under the Adafruit VEML6075 library:

![](https://cdn-learn.adafruit.com/assets/assets/000/062/583/medium800/adafruit_products_image.png?1537992355)

And upload it to your board!

Open up the serial console to see the readings. I used a UV lamp to shine some UV light on it. Note that indoors with office lighting you may get very low or even negative values.

![](https://cdn-learn.adafruit.com/assets/assets/000/062/585/medium800/adafruit_products_image.png?1537992505)

# Advanced settings

For 99% of users, the default configuration is recommended because we use the calibration values from the VEML6075 app note for a non-covered sensor (no glass or teflon filter). You'll get the most accurate results that way.

If you do want to change settings here's what you can adjust:

- Integration time - this will take readings over a shorter or longer period of time, default is 100ms **If changed**  **the UV Index calculated value will not be correct anymore**
- Normal/High Dynamic mode - We're not sure what this is (it isn't described) but the default is Normal. **If changed the UV Index calculated value will not be correct anymore**
- Forced/Continuous mode - Whether to get continuous readings or require reading only on request. Default is reading only on request
- UV Coefficients - These are the calibration numbers that will convert the raw UVA/UVB readings into a UV Index. We use the defaults for "No teflon, open air" from the App note for the 6 floating point values. If you plan to cover the sensor with a thin teflon sheet, you can use those other values to configure the calculation

![](https://cdn-learn.adafruit.com/assets/assets/000/062/586/medium800/adafruit_products_image.png?1537992961)

# Adafruit VEML6075 UVA / UVB / UV Index Sensor

## Arduino Library Docs

# Adafruit VEML6075 UVA / UVB / UV Index Sensor

## Python & CircuitPython

It's easy to use the VEML6075 sensor with Python or CircuitPython and the [Adafruit CircuitPython VEML6075](https://github.com/adafruit/Adafruit_CircuitPython_VEML6075) module.&nbsp; This module allows you to easily write Python code that reads the UV index from the sensor.

You can use this sensor with any CircuitPython microcontroller board or with a computer that has GPIO and Python [thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

# CircuitPython Microcontroller Wiring

First wire up a VEML6075 to your board exactly as shown on the previous pages for Arduino.&nbsp; You can use I2C.&nbsp; Here's an example of wiring a Feather M0 to the sensor with I2C:

- **Board 3V** to **sensor VIN**
- **Board GND** to **sensor GND**
- **Board SCL** to **sensor SCL**
- **Board SDA** to **sensor SDA**

![adafruit_products_FeatherM0_VEML6075_I2C_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/062/955/medium640/adafruit_products_FeatherM0_VEML6075_I2C_bb.jpg?1538594651)

# Python Computer Wiring

Since there's _dozens_ of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Here's the Raspberry Pi wired with I2C:

- **Pi 3V3** to **sensor VIN**
- **Pi GND** to **sensor GND**
- **Pi SCL** to **sensor SCL**
- **Pi SDA** to **sensor SDA**

![adafruit_products_raspi_veml6075_i2c_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/062/956/medium640/adafruit_products_raspi_veml6075_i2c_bb.jpg?1538594700)

# CircuitPython Installation of VEML6075 Library

You'll need to install the&nbsp;[Adafruit CircuitPython VEML6075](https://github.com/adafruit/Adafruit_CircuitPython_VEML6075)&nbsp;library on your CircuitPython board.

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython)&nbsp;for your board.

Next you'll need to install the necessary libraries&nbsp;to use the hardware--carefully follow the steps to find and install these libraries from&nbsp;[Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases).&nbsp; Our CircuitPython starter guide has [a great page on how to install the library bundle](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

For non-express boards like the Trinket M0 or Gemma M0, you'll need to manually install the necessary libraries from the bundle:

- **adafruit\_veml6075.mpy**
- **adafruit\_bus\_device**

Before continuing make sure your board's lib folder or root filesystem has the&nbsp; **adafruit\_veml6075.mpy,** and **adafruit\_bus\_device**** &nbsp; **files and folders** &nbsp;**copied over.

Next[&nbsp;connect to the board's serial REPL](https://learn.adafruit.com/welcome-to-circuitpython/the-repl) so you are at the CircuitPython&nbsp; **\>\>\>** &nbsp;prompt.

# Python Installation of VEML6075 Library

You'll need to install the Adafruit\_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Once that's done, from your command line run the following command:

- `sudo pip3 install adafruit-circuitpython-veml6075`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

# CircuitPython & Python Usage

To demonstrate the usage of the sensor we'll initialize it and read the UV index from the board's Python REPL.

Since you're using an I2C connection run the following code to import the necessary modules and initialize the I2C connection with the sensor:

```
import time
import board
import busio
import adafruit_veml6075
i2c = busio.I2C(board.SCL, board.SDA)
veml = adafruit_veml6075.VEML6075(i2c, integration_time=100)
```

The **integration\_time** is the amount of time the VEML6075 is sampling data for, in milliseconds. Valid times are 50, 100, 200, 400 or 800ms. We've chosen to set it to 100 milliseconds.

Now you're ready to read values from the sensor using any of these properties:

- **uv\_index** - The calculated UV Index.
- **uva** - The calibrated UVA reading, in 'counts' over the sample period
- **uvb** - The calibrated UVB reading, in 'counts' over the sample period

For example to print the UV index:

```
print("UV index:", veml.uv_index)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/062/958/medium800/adafruit_products_VEML6075_REPL_output.png?1538595655)

Info: 

That's all there is to using the VEML6075 sensor with CircuitPython!

# Full Example Code
https://github.com/adafruit/Adafruit_CircuitPython_VEML6075/blob/main/examples/veml6075_simpletest.py

# Adafruit VEML6075 UVA / UVB / UV Index Sensor

## Python Docs

# Adafruit VEML6075 UVA / UVB / UV Index Sensor

## Downloads

# Files & Datasheets:

- [Latest datasheets and App Notes from Vishay](https://www.vishay.com/ppg?84304)
- [Fritzing object in Adafruit Fritzing library](https://github.com/adafruit/Fritzing-Library)
- [PCB CAD files in GitHub](https://github.com/adafruit/Adafruit-VEML6075-UV-Sensor-PCB)

# Schematic & Fabrication Print
![](https://cdn-learn.adafruit.com/assets/assets/000/062/587/medium800/adafruit_products_schem.png?1537993764)

![](https://cdn-learn.adafruit.com/assets/assets/000/062/588/medium800/adafruit_products_fab.png?1537993768)


## Primary Products

### Adafruit VEML6075 UVA UVB and UV Index Sensor Breakout

[Adafruit VEML6075 UVA UVB and UV Index Sensor Breakout](https://www.adafruit.com/product/3964)
This little sensor is a great way to add UVA and UVB light sensing to any microcontroller project. The VEML6075 from Vishay has both true UVA and UVB band light sensors and an I2C-controlled ADC that will take readings and integrate them. The sensor also comes with calibration registers so you...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/3964)
[Related Guides to the Product](https://learn.adafruit.com/products/3964/guides)

## Related Guides

- [Adafruit MCP4728 I2C Quad DAC](https://learn.adafruit.com/adafruit-mcp4728-i2c-quad-dac.md)
- [Adafruit Motor Shield](https://learn.adafruit.com/adafruit-motor-shield.md)
- [Adafruit PyRuler](https://learn.adafruit.com/adafruit-pyruler.md)
- [Adafruit Sensirion SHT40, SHT41 & SHT45 Temperature & Humidity Sensors](https://learn.adafruit.com/adafruit-sht40-temperature-humidity-sensor.md)
- [Adafruit IoT Button with NeoPixel BFF](https://learn.adafruit.com/adafruit-iot-button-with-neopixel-bff.md)
- [Adafruit PAM8302 - Mono 2.5W Class D Audio Amplifier](https://learn.adafruit.com/adafruit-pam8302-mono-2-5w-class-d-audio-amplifier.md)
- [Adafruit ADG729 Dual 1-to-4 Analog Matrix Switch](https://learn.adafruit.com/adafruit-adg729-dual-1-to-4-analog-matrix-switch.md)
- [Adafruit CH9328 UART to HID Keyboard Breakout](https://learn.adafruit.com/adafruit-ch9328-uart-to-hid-keyboard-breakout.md)
- [Remote controlled door lock using a fingerprint sensor & Adafruit IO](https://learn.adafruit.com/remote-controlled-door-lock-using-a-fingerprint-sensor-and-adafruit-io.md)
- [Matrix Portal Stained Glass with WLED](https://learn.adafruit.com/matrix-portal-stained-glass-with-wled.md)
- [Adafruit CH552 QT Py](https://learn.adafruit.com/adafruit-ch552-qt-py.md)
- [Adafruit AS7331 UV / UVA / UVB / UVC Sensor](https://learn.adafruit.com/adafruit-as7331-uv-uva-uvb-uvc-sensor.md)
- [Introducing Trinket](https://learn.adafruit.com/introducing-trinket.md)
- [Quick-Start the Pico W WiFi with CircuitPython](https://learn.adafruit.com/pico-w-wifi-with-circuitpython.md)
- [Adafruit ANO Rotary Encoder to I2C Adapter](https://learn.adafruit.com/adafruit-ano-rotary-navigation-encoder-to-i2c-stemma-qt-adapter.md)
