Ultraviolet radiation from the sun causes sunburn, accelerates skin aging, and is the primary cause of skin cancer — the most common cancer globally. The VEML6075 UV index sensor from Vishay makes it easy to measure real-time UVA and UVB radiation and compute the standardised UV Index value on a microcontroller. In this guide, you will build a complete safe sun exposure monitor using the VEML6075 and an Arduino, with buzzer alerts when UV levels become dangerous, display output, and data logging capability. This project is perfect for portable sun safety wearables, agricultural IoT systems, and school science projects.
UV Radiation Basics: UVA, UVB, UVC and UV Index
The ultraviolet spectrum spans 10–400 nm wavelength. For sun exposure monitoring, three bands matter:
- UVA (315–400 nm): The most abundant UV radiation at the Earth’s surface (~95% of UV reaching us). Penetrates deeply into the skin, causing tanning, premature aging, and long-term DNA damage. Intensity doesn’t change much through the day.
- UVB (280–315 nm): Shorter wavelength, higher energy. Causes sunburn, directly damages DNA, and is the primary driver of skin cancer risk. Intensity peaks at solar noon and is filtered by clouds and the ozone layer.
- UVC (100–280 nm): Completely absorbed by the ozone layer and atmosphere — does not reach the surface from the sun. Used in UV sterilisation equipment.
The UV Index (UVI) is a dimensionless international standard (WHO/WMO) that combines UVA and UVB into a single number representing the intensity of UV-erythema (sunburn-causing) radiation at the Earth’s surface. UVI 1–2 is low; UVI 11+ is extreme.
In India, UV Index regularly reaches 9–12 in summer months across most states — well into the Very High to Extreme categories. A real-time UV monitor is therefore genuinely useful for outdoor workers, athletes, and children.
VEML6075 Sensor Overview and Specifications
The VEML6075 from Vishay is a dedicated dual-photodiode UV sensor with two separate channels:
- UVA channel: Peak sensitivity at 365 nm, integrates over 315–400 nm
- UVB channel: Peak sensitivity at 305 nm, integrates over 280–320 nm
- Visible + IR compensation channel: On-chip compensation photodiode corrects for background light leaking into UV channels
Key specifications:
- Interface: I2C (address 0x10, fixed)
- Supply voltage: 1.7–3.6 V (breakout boards include 3.3 V regulator)
- Current consumption: 480 µA active; 0.8 µA in shutdown
- Integration time: 50, 100, 200, 400, 800 ms (longer = more sensitive)
- High dynamic range mode: 16× sensitivity increase for overcast conditions
- Output: 16-bit ADC counts for each channel (UVA, UVB, compensation)
- Optical window: Glass filter with UV pass characteristics
- Package: 2×1.65×0.7 mm (SMD); available on breakout boards for easy use
The VEML6075 does NOT directly output a UV Index value — it outputs raw ADC counts for UVA and UVB, which you convert to UV Index using coefficients provided in the Vishay application note AN84310.
How the VEML6075 Measures UV Radiation
Inside the VEML6075, silicon photodiodes with carefully designed optical bandpass filters convert photon energy into electrical current. The photodiode currents are then integrated by on-chip amplifiers over the chosen integration time and converted to 16-bit counts by an ADC.
The visible light compensation is critical: without it, visible sunlight bleeding through the filter would make the sensor report falsely high UV values on bright (but actually low-UV) overcast days. The compensation photodiode measures this background light leakage and the correction algorithm subtracts it from the UV readings.
The UV Index calculation from raw counts uses the formula from Vishay AN84310:
UVAcomp = UVA - (a × UVcomp) - (b × UVD)
UVBcomp = UVB - (c × UVcomp) - (d × UVD)
UVI = ((UVAcomp × UVA_resp) + (UVBcomp × UVB_resp)) / 2
Where a, b, c, d are correction coefficients (2.22, 1.33, 2.95, 1.74 for typical open-air use) and UVA_resp (0.001461) and UVB_resp (0.002591) convert counts to UV Index units.
Wiring VEML6075 to Arduino
| VEML6075 Breakout Pin | Arduino Pin | Notes |
|---|---|---|
| VCC / 3V3 | 3.3 V | Most breakouts have 5V→3.3V regulator |
| GND | GND | Common ground |
| SDA | A4 (Uno) / D21 (Mega) | I2C data with 4.7kΩ pull-up |
| SCL | A5 (Uno) / D20 (Mega) | I2C clock with 4.7kΩ pull-up |
| INT (optional) | D2 | Not typically used for basic projects |
For the alert buzzer, connect a passive piezo buzzer’s positive terminal to D8 and negative to GND. For display, an SSD1306 OLED shares the I2C bus (address 0x3C, different from VEML6075’s 0x10).
Arduino Code: UV Index Calculation and Display
Install the Adafruit VEML6075 library via Library Manager. For the OLED display, install Adafruit SSD1306 and Adafruit GFX:
#include <Wire.h>
#include <Adafruit_VEML6075.h>
#include <Adafruit_SSD1306.h>
Adafruit_VEML6075 uv = Adafruit_VEML6075();
Adafruit_SSD1306 display(128, 64, &Wire, -1);
const int BUZZER_PIN = 8;
const float ALERT_UVI = 6.0; // Alert at High UV Index
const char* uviCategory(float uvi) {
if (uvi < 3) return "Low";
if (uvi < 6) return "Moderate";
if (uvi < 8) return "High";
if (uvi < 11) return "Very High";
return "EXTREME";
}
void setup() {
Serial.begin(115200);
pinMode(BUZZER_PIN, OUTPUT);
if (!uv.begin()) {
Serial.println("VEML6075 not found!");
while (1);
}
uv.setIntegrationTime(VEML6075_100MS);
uv.setHighDynamic(false);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.setTextColor(WHITE);
Serial.println("UV Monitor Ready");
}
void loop() {
float uva = uv.readUVA();
float uvb = uv.readUVB();
float uvi = uv.readUVI();
const char* category = uviCategory(uvi);
// Serial output
Serial.print("UVA: "); Serial.print(uva);
Serial.print(" | UVB: "); Serial.print(uvb);
Serial.print(" | UVI: "); Serial.print(uvi, 1);
Serial.print(" ("); Serial.print(category); Serial.println(")");
// OLED display
display.clearDisplay();
display.setTextSize(1);
display.setCursor(0, 0); display.print("UV Index Monitor");
display.setCursor(0, 16);
display.setTextSize(3);
display.print(uvi, 1);
display.setTextSize(1);
display.setCursor(0, 48); display.print(category);
display.setCursor(70, 48);
display.print("UVA:"); display.print(uva, 0);
display.display();
// Alert buzzer if UV is High or above
if (uvi >= ALERT_UVI) {
tone(BUZZER_PIN, 2000, 200);
delay(300);
tone(BUZZER_PIN, 2000, 200);
}
delay(2000);
}
The readUVI() method in the Adafruit library already applies the Vishay compensation coefficients and returns the calibrated UV Index. The readUVA() and readUVB() methods return compensated µW/cm² values.
UV Index Table and Sun Safety Guidelines
| UV Index | Category | Colour Code | Recommended Action (Fair Skin) |
|---|---|---|---|
| 0–2 | Low | Green | No protection needed |
| 3–5 | Moderate | Yellow | SPF 30 sunscreen, hat, seek shade at noon |
| 6–7 | High | Orange | SPF 50, protective clothing, limit midday exposure |
| 8–10 | Very High | Red | SPF 50+, full cover clothing, avoid 10am–4pm outdoors |
| 11+ | Extreme | Violet | Stay indoors midday; unprotected skin burns in <10 min |
Indian summers regularly bring UV Index 9–12 across Rajasthan, Gujarat, Maharashtra, and Telangana between 10 AM and 3 PM. A real-time UV monitor can alert outdoor workers (construction, agriculture, delivery) to reapply sunscreen or take shade breaks at the right times.
Building the Complete Sun Exposure Monitor
To build a fully functional portable sun monitor, add these components to the VEML6075 + Arduino core:
- OLED display (SSD1306 128×64): Shows live UV Index, category, and colour-coded severity bar — share the I2C bus with VEML6075
- Piezo buzzer: Sounds a double-beep when UVI crosses from Moderate to High (UVI ≥ 6) and a continuous alarm at Extreme (UVI ≥ 11)
- RGB LED: Displays the WHO colour code — green for Low, yellow for Moderate, orange for High, red for Very High, violet for Extreme — using PWM on three digital pins
- Battery: 18650 Li-ion cell with a TP4056 charging module and 5 V boost converter for portable outdoor use
- Enclosure: A 3D-printed clip-on case for attaching to a hat brim or backpack strap — UV sensor faces up, display faces the user
- Optional DHT11: Add temperature and humidity readings — UV intensity correlates with heat and useful for heat stress monitoring alongside UV exposure
Accuracy Tips and Placement Guide
- Sensor orientation: The VEML6075 must face the sky at a flat horizontal angle (0°) for accurate UV Index readings. Tilted placement reduces measured UVA/UVB.
- Shadow-free placement: Ensure no objects shade the sensor — even a 10% shadow reduces UV reading by up to 50% because UV is scattered from the entire sky dome.
- Warm-up time: Allow 10–15 seconds after power-on before taking readings. The first few readings may be unstable as the ADC settles.
- Integration time: Use 100 ms integration for normal outdoor use. Use 800 ms (highest sensitivity) for indoor or overcast conditions. Avoid saturation in direct noon summer sun — check the raw ADC values don’t exceed 65535.
- Temperature effects: The VEML6075 is rated from −40°C to +85°C but sensitivity can drift ±10% across the temperature range. For precise measurements, apply the temperature correction from Vishay AN84310.
- Glass / plastic covers: Most glass and clear plastics absorb UVB and partially absorb UVA. If you put the sensor behind a protective window, calibrate with the window in place.
Project Variations: Wearable and Agricultural
UV Wearable Patch
Replace the Arduino Uno with an Arduino Nano 33 IoT (built-in Wi-Fi/BLE). 3D print a 35 mm circular case that clips to clothing. The device sends UV Index readings via BLE to a phone app, logging cumulative UV dose over the day. When the calculated daily UV dose approaches the erythema threshold (which varies by skin type), send a phone notification to reapply sunscreen.
Agricultural UV Monitor
Some crops (e.g., grapes, tomatoes, basil) have optimal UV ranges for anthocyanin and terpene production. Mount the VEML6075 in a weather-resistant enclosure with an ESP8266 and push readings to a Grafana dashboard via MQTT. Combine with soil moisture and temperature data for a comprehensive crop microclimate monitor.
UV Water Purifier Monitor
UV-C lamps are used for water sterilisation (254 nm). While the VEML6075 doesn’t measure UV-C directly, monitor UVA output from ageing UV lamps as a proxy for overall lamp performance. When UVA output drops to 70% of new lamp baseline, alert for lamp replacement.
Recommended Products from Zbotic
LM35 Temperature Sensors
Complement your UV monitor with precise temperature measurement. High UV usually coincides with high heat — use LM35 to calculate combined heat and UV stress index for outdoor safety monitoring.
DHT20 SIP Packaged Temperature and Humidity Sensor
The DHT20 communicates via I2C and can share the bus with the VEML6075. Add temperature and humidity to your UV monitor for a complete outdoor health and safety sensor unit.
BMP280 Barometric Pressure and Altitude Sensor I2C/SPI Module
Altitude strongly affects UV Index — UV increases about 6-10% per 1000 m gain. Combine BMP280 altitude readings with VEML6075 UV data to correct for elevation, useful for trekking safety apps.
Frequently Asked Questions
Q1: What is the difference between VEML6075 and ML8511?
The ML8511 is a simpler analog output UV sensor measuring the combined UV-A/UV-B band. It outputs a voltage proportional to UV intensity, but doesn’t separate UVA from UVB and doesn’t have on-chip compensation for visible light. The VEML6075 is significantly more accurate — it separately measures UVA and UVB with on-chip visible light compensation and integrates over a precisely defined spectral response closely matching the WHO UV Index action spectrum.
Q2: Can the VEML6075 measure UV from artificial sources like tanning lamps?
Yes. The VEML6075 responds to any radiation in its UVA (315–400 nm) and UVB (280–320 nm) bandpass, regardless of source. It can be used to characterise UV tanning lamps, UV-A curing lights (385 nm peak), and germicidal UV sources. For UV-C measurement (254 nm germicidal), a different sensor (e.g., GUVC-T21GH) is needed as the VEML6075 doesn’t respond below 280 nm.
Q3: How long does it take to get a sunburn at UVI 10?
Time to minimum erythemal dose (first sunburn) at UVI 10 depends heavily on skin type. For very fair skin (Type I), approximately 10–15 minutes. For medium skin (Type III, typical South Indian), approximately 30–45 minutes. For dark skin (Type V), approximately 60+ minutes. Always apply SPF 30+ to multiply safe exposure time by 30×.
Q4: Will the VEML6075 work through a car window?
Standard automotive glass (laminated windshield) blocks almost all UVB and 50–80% of UVA. The VEML6075 behind car glass will significantly underread UV Index. This is actually a useful experiment: you can measure how much UV protection your car glass provides by comparing inside-car vs outside-car readings.
Q5: Is the VEML6075 accurate enough for scientific UV measurements?
The VEML6075 achieves ±1 UV Index unit accuracy under ideal conditions (proper orientation, temperature within operating range, no dirt on the optical window). Research-grade UV radiometers achieve ±0.1 UV Index. For health advisory, educational, and hobbyist purposes, ±1 UVI is excellent. For regulatory measurements, professional broadband UV radiometers are needed.
Q6: Can I build a UV logging station with Wi-Fi upload?
Yes. Replace the Arduino with an ESP8266 (NodeMCU) or ESP32. The VEML6075 still connects via I2C. Upload UV Index readings to ThingSpeak (free), Google Sheets (via AppScript), or your own server via MQTT. Plot daily UV curves and compare with IMD UV forecast data for your city. Add a GPS module to auto-tag location in the data for mobile monitoring stations.
All the sensors, microcontrollers, and displays you need for your UV Index monitoring project are available at Zbotic’s Sensors & Measurement store. Shop now for fast delivery across India and expert support for every step of your build.
Add comment