Component guide · Beginner · 3 min read
UV Sensors

GUVA-S12SD, ML8511 and VEML6070
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
A UV sensor module measures ultraviolet light, mostly UVA and UVB from sunlight. Analog types such as the GUVA-S12SD and ML8511 give a voltage that rises with UV intensity, read on an analog pin. I2C types such as the VEML6070 return a number directly. With calibration you can estimate the UV index, but hobby modules are indicators, not certified meters.
Key specs at a glance
- Sensing range
- Roughly 240 to 370 nm depending on the part
- Outputs
- Analog voltage (GUVA-S12SD, ML8511) or I2C (VEML6070)
- Supply
- Typically 3.3 V; many modules accept 5 V
- GUVA-S12SD
- Photodiode plus op-amp; about 0.1 V per UV index step on common modules
- ML8511
- About 1 V in darkness rising to about 2.8 V at strong UV, with an enable pin
- Window
- Must face the sky with no glass or plastic in front
How UV sensors work
Inside is a photodiode made to respond mainly to ultraviolet wavelengths. The tiny photocurrent is amplified by an op-amp into a voltage, or digitised on the chip and sent over I2C.
The UV index is a weighted measure of sunburn-causing UV. A simple sensor does not apply that weighting exactly, so any UV index you calculate is an estimate. For a classroom weather station or a "wear sunscreen" warning light that is fine; for health or safety decisions, use a calibrated meter.
Wiring and reading
Analog modules: VCC to 3.3 V (or 5 V if the module allows), GND to GND, OUT to an analog pin. On an ESP32, keep the output below 3.3 V and use an ADC1 pin if Wi-Fi is on.
For a GUVA-S12SD module, divide the output voltage by about 0.1 V to get a rough UV index, then check it against a weather service on a clear day and adjust the factor. For the ML8511, tie EN high, read the output and also read the 3.3 V rail on a second pin to cancel supply errors, as the datasheet application notes suggest.
I2C modules: connect SDA and SCL and use the maker's library; the integration time setting trades speed for sensitivity.
Getting sensible readings
- Glass and most clear plastics block much of the UV, so a sensor behind a window reads almost nothing. Use a UV-transparent cover such as PTFE film or quartz, or leave the window open under a rain hood.
- Point the sensor at the sky, not at the sun, for a stable reading.
- Average several readings; clouds change UV fast.
- Indoor lights give very little UV, so a near-zero reading indoors is normal.
Try it: ADC resolution calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Mounting the sensor behind glass or acrylic.
- Treating the reading as a certified UV index.
- Feeding a 5 V output into a 3.3 V ADC pin.
- Testing indoors and assuming it is broken.
- Leaving the ML8511 enable pin floating.
Frequently asked questions
Which UV sensor is best for Arduino?
The GUVA-S12SD analog module is the simplest. I2C parts such as the VEML6070 avoid analog noise.
Can a UV sensor measure UV index?
Approximately. Calibrate against a trusted source and treat it as an estimate.
Why does my UV sensor read zero indoors?
Indoor light contains very little UV and windows block most of what comes from outside.
Can it detect UV LEDs?
Usually yes for 365 nm and 395 nm LEDs, though response falls off at the longer wavelengths.
Does it work at 3.3 V?
Most modules do. Check the module's voltage range and keep the output within your ADC range.
Parts for this guide
- ₹1,939View
Calculators
Terms in this guide
Projects that use it
Put this into practice: 26 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- GenUV GUVA-S12SD datasheet
- Lapis ML8511 datasheet
- Vishay VEML6070 datasheet
- WHO Global Solar UV Index guide
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

