Raspberry Pi UV Sensor using the VEML6075?

The VEML6075 is an ideal UV sensor for integrating with a Raspberry Pi to measure UV index and UV light intensity. This sensor breaks out the I2C interface of the VEML6075 chip onto a compact PCB, making it easy to connect to a Raspberry Pi.

Raspberry Pi UV Sensor using the VEML6075?

The VEML6075 UV sensor by Vishay Semiconductors measures UV intensity from 280nm to 370nm wavelengths. Key features:

  • Measures UV index and UV light intensity
  • Spectral responsivity closely matches the Erythema action spectrum
  • I2C digital interface
  • Very compact PCB form factor
  • Low power consumption

This UV sensor is designed to be highly configurable, allowing you to optimize performance for different use cases. Settings like integration time and averaging can be tuned to achieve desired precision and sampling rate tradeoffs.

Connecting the VEML6075 Breakout to a Raspberry Pi

Connecting the VEML6075 breakout board to a Raspberry Pi is straightforward thanks to the compact form factor and I2C interface:

What You’ll Need

  • Raspberry Pi
  • VEML6075 UV Sensor Breakout
  • Jumper wires
  • Breadboard (optional)


Simply connect the breakout to the Raspberry Pi’s I2C pins:

  • VEML6075 VDD -> Raspberry Pi 3.3V pin
  • VEML6075 GND -> Raspberry Pi GND pin
  • VEML6075 SCL -> Raspberry Pi SCL pin
  • VEML6075 SDA -> Raspberry Pi SDA pin

No external pull up resistors are required since the VEML6075 breakout has 4.7K internal pull ups on SDA and SCL.

Reading UV Index and UV Light Intensity

Interfacing with the sensor over I2C using Python or another programming language is simple. The VEML6075 has a straightforward I2C register interface.

To start, import the SMBus I2C library then initialize the I2C bus object:

import smbus

bus = smbus.SMBus(1)

The default I2C address is 0x10. Output data is two bytes, with UV intensity in the first byte and UV index in the second byte.

data = bus.read_i2c_block_data(0x10, 0x00, 2)  

uv_intensity = data[0]

uv_index = data[1]

Enable Auto Integration Time mode for hands-free operation:

bus.write_byte_data(0x10, 0x00, 0x04)

Configuring the Sensor

The VEML6075 is highly configurable, allowing optimization for different applications. Some key registers:

Register Description
0x00 UV data output
0x01 Command register – integration time, power mode
0x02 High threshold window setting
0x03 Low threshold window setting

Integration time can be tuned with values from 50ms up to 800ms, controlling the balance between precision and sampling rate.


The VEML6075 UV sensor is well suited to a variety of monitoring, logging, and IoT applications:

  • UV monitoring – Measure UV index to monitor radiation levels and protect skin/eyes.
  • UV logging – Track UV exposure over time. Integrate sensor on wearable for logging personal exposure.
  • Smart agriculture – Monitor greenhouse and crop UV to aid growth.
  • IoT integration – Incorporate into IoT systems with cloud connectivity for data analytics.


The VEML6075 breakout provides an easy way to measure UV intensity and UV index by interfacing the digital UV sensor with a Raspberry Pi over I2C. With configurable integration times supporting a variety sampling rates, the VEML6075 can be optimized for everything from wearables to smart agriculture.

Key Takeaways

  • The VEML6075 UV sensor measures 280-370nm wavelength intensity
  • Breakout board makes it easy to interface with Raspberry Pi via I2C
  • Highly configurable settings balance precision and sampling rate
  • Variety of applications from UV monitoring to smart agriculture

Frequently Asked Questions

  1. What is the spectral range of the VEML6075?
    The VEML6075 measures UV intensity from 280nm to 370nm wavelength. This covers the UVB and UVA spectra.

  2. What Raspberry Pi models are compatible?
    Any Raspberry Pi with I2C pins will work, including Raspberry Pi 3B+, 4B, Pico, and Zero.

  3. How do I connect multiple VEML6075 sensors?
    You can have multiple VEML6075 sensors on the same I2C bus, just assign each a unique I2C address.

  4. What is the typical sampling rate?
    The integration time setting allows optimizing sampling rate from 2 samples per second down to about 1 sample every 2 seconds.

  5. Can the sensor measure visible or infrared light?
    No, the VEML6075 only detects UV light from 280-370nm wavelength. It has an IR/visible cut filter.

  6. What UV index range can the sensor detect?
    The VEML6075 can detect UV index levels from 0 to 15, covering the typical environmental range.

  7. What is the power consumption?
    Active current usage is about 2.5mA, allowing low power operation. Standby mode is 1 μA.

  8. What I2C pull ups does the breakout board have?
    The breakout board contains integrated 4.7K ohm pull up resistors on SDA and SCL.

  9. What is the typical application for this UV sensor?
    Typical applications include UV monitoring, UV logging, wearables, smart agriculture, robotics, and IoT.

  10. What wavelength is most responsible for causing sun burns?
    UVB wavelengths from 290nm to 320nm are typically associated with causing sun burns. UVA can also contribute.

  11. Can this sensor detect if I’m getting a sun burn?
    Yes, by tracking UV intensity levels, you can estimate risk of sun burn or when to apply/reapply sunscreen.

  12. How do I know if the sensor readings are accurate?
    Compare sensor UV index readings with trusted sources like government UV index forecasts for your area.

  13. Do UV index readings differ by location?
    Yes, geographic location (latitude/altitude) and current weather conditions can significantly impact UV index.

  14. Can the sensor be damaged by overexposure?
    The VEML6075 is designed to withstand overexposure without damage. However, extended exposure above UV index 15 is not recommended.

  15. How long can the sensor run on a portable battery?
    Estimated battery life is over 15 days using 2xAA batteries, depending on configuration.

  16. Is special calibration required?
    Nope, the integrated temperature sensor handles temperature compensation. The sensor ships pre-calibrated.

  17. Can I connect over SPI or analog instead of I2C?
    No, the only available interface for the VEML6075 is I2C digital communication.

  18. What is the typical service life of this UV sensor?
    The VEML6075 is rated for over 5 years of continuous operation within specified conditions, extending service life for most applications.

  19. Does the sensor detect UVC light?
    No, the VEML6075 only detects light from 280nm to 370nm, covering UVB and UVA spectra. It does not detect shorter UVC wavelengths.

  20. Can I use the sensor in a waterproof enclosure outdoors?
    Yes, when properly enclosed in a waterproof housing, the VEML6075 can be used outdoors for extended UV monitoring in applications like weather stations.

Leave a Comment