Component guide · Beginner · 3 min read
GUVA-S12SD UV Sensor

Pinout, Wiring and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The GUVA-S12SD is a UV photodiode that responds to ultraviolet light from about 240 to 370 nm. Modules add an amplifier, giving an analog voltage that rises with UV intensity, which you read with analogRead() and convert to an approximate UV index. Use it for sun-exposure alarms, weather stations and UV lamp checks.
Key specs at a glance
- Sensor
- GaN-based UV photodiode (GUVA-S12SD)
- Spectral range
- About 240 to 370 nm (UVA and UVB)
- Output
- Analog voltage, rises with UV
- Supply
- 3.3 to 5 V
- UV index estimate
- About UV index = output voltage / 0.1 V on common modules
- Response time
- Under 0.5 s
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
What the GUVA-S12SD UV sensor is
Ultraviolet light is invisible but causes sunburn. A GaN photodiode responds to UV and is almost blind to visible light, so indoor lamps barely move the reading while sunlight does.
The photodiode current is tiny, so modules use an op-amp to turn it into a voltage you can read. The exact scale depends on the module's resistor and amplifier, so treat the UV index as an estimate.
GUVA-S12SD UV sensor pinout
The pins on the GUVA-S12SD UV sensor and what each one does.
| Pin | Function |
|---|---|
| VCC / + | Supply, 3.3 to 5 V |
| GND / − | Ground |
| SIG / OUT | Analog output voltage |
- VCC / +
- Supply, 3.3 to 5 V
- GND / −
- Ground
- SIG / OUT
- Analog output voltage
Wiring the GUVA-S12SD UV sensor
Point the sensor's window at the sky or the UV source. On an ESP32, power it from 3.3 V.
| GUVA-S12SD UV sensor pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | 5V | 3V3 |
| GND | GND | GND |
| SIG | A0 | GPIO 34 (ADC1) |
- VCC
- Arduino Uno:
- 5V
- ESP32:
- 3V3
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- SIG
- Arduino Uno:
- A0
- ESP32:
- GPIO 34 (ADC1)
Example code
Compare against a local UV index forecast on a clear day and adjust the 0.1 V factor for your module.
const int UV = A0;
void setup() { Serial.begin(115200); }
void loop() {
long sum = 0;
for (int i = 0; i < 32; i++) sum += analogRead(UV);
float v = (sum / 32.0) * 5.0 / 1023.0;
float uvIndex = v / 0.1; // typical module scale
Serial.print(v, 3); Serial.print(" V UV index ~"); Serial.println(uvIndex, 1);
delay(1000);
}Setup and tuning
ordinary glass and many plastics block UVB; use a quartz or UV-transparent window, or leave it open.
point it straight up for UV index; the reading drops when tilted.
average several readings to remove ADC noise at low UV.
What you need
Shop this list6 of 7 found in our store · ₹2,322
CJMCU GUVA-S12SD UV sensor module: the sensor this guide coversCJMCU-GUVA-S12SD Sunlight Ultraviolet Ray Intensity UV Sensor Module₹207Closest match, check the specs
DFRobot Gravity GUVA-S12SD Analog UV Light Sensor (200-370nm, UVA, UVB, UVC) – Module w/ Cable: another version this guide coversDFRobot Gravity GUVA-S12SD Analog UV Light Sensor (200-370nm, UVA, UVB, UVC) – Module w/ Cable₹619
Seeed Studio Studio Grove UV Sensor – GUVA-S12SD Photodiode Module: another version this guide coversSeeed Studio Grove UV Sensor – GUVA-S12SD Photodiode Module₹919Closest match, check the specs- Uno R3 development board: the controller used in the wiring tableFind this part
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
0.96 inch OLED display 128x64: to show readings without a computer0.96" OLED Display 128x64₹139Closest match, check the specs
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- UV sensors compared: GUVA-S12SD, ML8511 and VEML6070.
- VEML7700: visible light in lux, not UV.
- Weather station sensors: building a full station.
Try it: Adc resolution calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Putting it behind a glass or acrylic window that blocks UV.
- Testing it under indoor LED lights, which emit almost no UV.
- Treating the UV index estimate as a calibrated measurement.
- Powering it from 5 V into a 3.3 V ADC.
Frequently asked questions
What does the GUVA-S12SD measure?
UV light from about 240 to 370 nm, covering UVA and UVB.
How do I get the UV index?
On common modules, divide the output voltage by about 0.1 V. Check against a reference.
Does it work indoors?
It reads near zero under most indoor lights, which emit little UV.
Does it work with ESP32?
Yes, power it from 3.3 V and read an ADC1 pin.
Can it check a UV lamp?
Yes, for relative strength; use a UV-C rated meter for germicidal lamps.
Parts for this guide
Calculators
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
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

