UV Index Sensor VEML6075: Measure Sunlight with Arduino
The VEML6075 UV index sensor from Vishay measures both UVA (315-400nm) and UVB (280-315nm) radiation to calculate the standardized UV Index — a critical parameter for sun safety in India, where UV exposure is significantly higher than in European countries. With I2C interface and ±1 UV Index unit accuracy, the VEML6075 is the preferred choice for Arduino-based UV monitoring stations, sunscreen reminder systems, and agricultural light monitoring. This guide covers complete setup, calibration, and real-world applications for Indian weather conditions.
UV Index Basics and India’s Solar UV Exposure
The UV Index (UVI) is a WHO-standardized scale measuring the intensity of UV radiation reaching Earth’s surface. It’s calculated from the erythemally effective irradiance — the UV spectrum weighted by human skin sensitivity to sunburn.
| UV Index | Category | Recommended Protection |
|---|---|---|
| 0-2 | Low | No protection needed |
| 3-5 | Moderate | Sunscreen SPF 30+ |
| 6-7 | High | SPF 50+, protective clothing |
| 8-10 | Very High | Avoid midday sun |
| 11+ | Extreme | Full protection essential |
India experiences some of the world’s highest UV indices. Mumbai regularly sees UVI 10-12 from March to October. Rajasthan and Gujarat can reach UVI 13-14 in summer — classified as “extreme.” Coastal Kerala and Tamil Nadu maintain UVI above 8 for 8+ months annually. By contrast, UK averages peak UVI of only 5-7 in summer. This makes UV monitoring particularly important for Indian public health and outdoor worker protection.
VEML6075 Sensor Specifications
- Measures: UVA (315-400nm) and UVB (280-315nm) independently
- UV Index range: 0 to 11+ (extreme conditions in India)
- Interface: I2C (address: 0x10 fixed)
- Integration time: 50ms to 800ms (longer = more sensitive, less noise)
- Dynamic range: 1 to 2241 counts (UVA), 1 to 2241 counts (UVB)
- Supply voltage: 1.7V – 3.6V (3.3V typical)
- Current: 480µA active, 800nA shutdown
- Operating temperature: -40°C to +85°C
- India module price: ₹280-450
I2C Wiring with Arduino and ESP32
/* VEML6075 → Arduino Uno
* VEML6075 VCC → Arduino 3.3V
* VEML6075 GND → Arduino GND
* VEML6075 SCL → Arduino A5 (SCL)
* VEML6075 SDA → Arduino A4 (SDA)
* Note: Most modules have 3.3V/5V level shifting onboard
*
* VEML6075 → ESP32
* VEML6075 VCC → ESP32 3.3V
* VEML6075 GND → ESP32 GND
* VEML6075 SCL → ESP32 GPIO 22
* VEML6075 SDA → ESP32 GPIO 21
*/
Arduino Code for UV Index Calculation
// VEML6075 UV Index Sensor - Arduino Library
// Library: Install "VEML6075" by SparkFun via Library Manager
// Or use: Adafruit VEML6075 library
#include <Wire.h>
#include <SparkFun_VEML6075_Arduino_Library.h>
VEML6075 uv;
void setup() {
Serial.begin(115200);
Wire.begin();
if (!uv.begin()) {
Serial.println("VEML6075 not found! Check wiring.");
while (1);
}
// Set integration time (longer = more accurate in low UV)
uv.setIntegrationTime(VEML6075_100MS); // Options: 50MS, 100MS, 200MS, 400MS, 800MS
// Set high dynamic range (for extreme UV in India)
uv.setHighDynamic(VEML6075_DYNAMIC_HIGH); // Extends range to UVI 16+
Serial.println("VEML6075 UV Sensor Ready");
Serial.println("UVA_raw, UVB_raw, UVA_cal, UVB_cal, UV_Index, UV_Category");
}
void loop() {
uv.poll(); // Trigger a new reading
// Raw counts (before calibration)
float uvaRaw = uv.rawUVA();
float uvbRaw = uv.rawUVB();
// Calibrated readings (corrected for dark current + visible light)
float uvaCal = uv.calibratedUVA();
float uvbCal = uv.calibratedUVB();
// UV Index (library calculates using Vishay formula)
float uvIndex = uv.index();
String category = getUVCategory(uvIndex);
Serial.print(uvaRaw, 0); Serial.print(", ");
Serial.print(uvbRaw, 0); Serial.print(", ");
Serial.print(uvaCal, 1); Serial.print(", ");
Serial.print(uvbCal, 1); Serial.print(", ");
Serial.print(uvIndex, 1); Serial.print(", ");
Serial.println(category);
// Alert for extreme UV (UVI > 8 — very common in India)
if (uvIndex >= 8) {
Serial.println("⚠ ALERT: Extreme UV! Seek shade immediately!");
// Trigger buzzer or LED alert
}
delay(1000);
}
String getUVCategory(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";
}
// Manual UV Index calculation (without library)
// Using Vishay application note coefficients:
float calculateUVIndex(float uva, float uvb) {
// Compensation coefficients from VEML6075 AN
float uv_comp_a = uva - 2.22 * uvb;
float uv_comp_b = uvb - 1.33 * uva;
// UV Index formula
float uvi = (uv_comp_a * 0.001461) + (uv_comp_b * 0.002424);
return max(uvi, 0.0f);
}
Recommended Product
5V Active Buzzer Module for Arduino
Pair with VEML6075 for audible UV alerts — ideal for outdoor worker protection systems and school playground safety monitors in high-UV Indian states.
Category: Audio & Sound Modules
Calibration and Accuracy
VEML6075’s factory calibration assumes clear-sky direct sunlight measurement. Accuracy can be improved for specific applications:
Verification Against Phone App
UV Index apps (Samsung Weather, AccuWeather) use UV forecast models from satellites. These disagree with ground-truth by ±1-2 UVI due to local cloud cover, air pollution (significant in Indian cities), and elevation differences. Cross-reference your sensor with the ASTM UVIR reference standard data for your city from IMD (India Meteorological Department) website.
Correction for Indian Haze
// Indian urban haze correction factor
// AOD (Aerosol Optical Depth) in major Indian cities is 0.3-0.8
// Higher AOD = more UV scattered = lower actual UV at ground
// Delhi winter: factor ~0.85, Mumbai monsoon: factor ~0.75
// Approximate correction (seasonal, city-specific):
float applyHazeCorrection(float uvIndex, String city, String season) {
float factor = 1.0;
if (city == "Delhi" && season == "winter") factor = 0.82;
else if (city == "Delhi" && season == "summer") factor = 0.90;
else if (city == "Mumbai") factor = 0.88;
else if (city == "Rajasthan") factor = 0.95; // Clearer skies
return uvIndex * factor;
}
Real-World Applications in India
School Playground UV Alert System
Install VEML6075 + ESP32 + LCD at school playgrounds in Rajasthan and Gujarat (highest UV states). Display real-time UV Index with color-coded warning, and activate a buzzer during recess when UV exceeds safe levels. Budget per installation: ₹1200-1500.
Agricultural UV Monitoring
UV-B radiation at 280-315nm affects crop photosynthesis, vitamin D synthesis in animals, and activates certain plant defense mechanisms. Monitoring UV-B alongside temperature and humidity helps agricultural scientists correlate crop yield with solar radiation parameters.
Industrial Rooftop Solar Station
UV Index correlates with solar irradiance (GHI — Global Horizontal Irradiance). When combined with BMP280 (atmospheric pressure, cloud cover proxy) and pyranometer data, VEML6075 helps characterize daily solar resource variability for rooftop solar performance monitoring.
Recommended Product
4-20mA to 5V Converter for Arduino
Interface professional industrial UV radiometers (4-20mA output) alongside VEML6075 for comparison and calibration of your DIY weather station.
Category: Sensors & Modules
Integration with Weather Station
// Complete weather station with UV, temperature, humidity, pressure
#include <Wire.h>
#include <SparkFun_VEML6075_Arduino_Library.h>
#include <DHT.h>
#include <Adafruit_BMP280.h>
VEML6075 uv;
DHT dht(4, DHT22);
Adafruit_BMP280 bmp;
void setup() {
Wire.begin();
Serial.begin(115200);
uv.begin();
dht.begin();
bmp.begin(0x76);
Serial.println("Weather,Station,Ready");
Serial.println("Temp(C),Humidity(%),Pressure(hPa),UV_Index,Category");
}
void loop() {
float temp = dht.readTemperature();
float hum = dht.readHumidity();
float pres = bmp.readPressure() / 100.0;
uv.poll();
float uvIndex = uv.index();
// CSV output for data logging / ThingSpeak upload
Serial.print(temp, 1); Serial.print(",");
Serial.print(hum, 1); Serial.print(",");
Serial.print(pres, 1); Serial.print(",");
Serial.print(uvIndex, 1); Serial.print(",");
Serial.println(getUVCategory(uvIndex));
delay(5000); // 5-second intervals
}
Recommended Product
8-Channel Solid State Relay Module for Arduino
Control outdoor shade systems, UV-blocking louvers, or irrigation based on UV Index readings from VEML6075 — automate UV-responsive systems with SSR switching.
Category: Industrial Automation
Frequently Asked Questions
Q: What’s the difference between UVA, UVB, and UVC?
A: UVA (315-400nm): Long-wave UV, 95% of UV reaching Earth’s surface, causes skin aging and penetrates glass. UVB (280-315nm): Medium-wave, 5% of surface UV, causes sunburn and most UV-related skin cancer. UVC (100-280nm): Completely absorbed by ozone layer — doesn’t reach Earth’s surface naturally. VEML6075 measures both UVA and UVB for the complete UV Index calculation.
Q: Why does my VEML6075 read UV Index even indoors?
A: Glass windows block UVB almost completely but transmit 60-80% of UVA. In sunlit rooms in India, UVI can reach 2-4 through windows in summer — significant levels for prolonged indoor sun exposure. The sensor is working correctly. True outdoor UVI through open air will be higher than through glass.
Q: Can VEML6075 measure UV from artificial UV lamps?
A: Yes — VEML6075 responds to any UV source in 280-400nm range. It’s used in nail lamp curing monitors, UV sterilization verification (check if UV lamp is effective), and phototherapy light monitoring. Note that LEDs emit at narrow wavelengths while solar UV is broadband; the UV Index calculation assumes solar spectrum.
Q: What is the highest UV Index ever recorded in India?
A: IMD records show UV Index values of 14-16 in parts of Rajasthan, Gujarat, and at high altitudes in the Himalayas (where thinner atmosphere provides less UV absorption). The Thar Desert region regularly reaches UVI 14 during summer months. High altitude locations like Leh (3,524m) experience even higher values due to thinner atmosphere.
Q: Is VEML6075 accurate enough for medical or official reporting?
A: No — it’s ±1 UVI accuracy is sufficient for personal/educational use but not WHO or ICNIRP standard reporting, which requires certified Brewer spectrophotometers. For official UV Index reporting, calibration against WMO-standard instruments is required. IMD maintains certified UV monitoring stations in major cities.
Add comment