GUVA-S12SD UV sensor
An ultraviolet sensor module: a UV photodiode and an op-amp, with OUT rising about 0.11 V for each step of the UV index.
A gallium nitride photodiode on a small board with three pins. Aliases: GUVA-S12SD, S12SD, UV sensor module, UV index sensor, ultraviolet sensor.
The photodiode sees 240 to 370 nm, UVB and most of UVA, and is blind to visible
light: a desk lamp does nothing, the sun does. The op-amp turns its tiny current into
a voltage on OUT.
Pins
| Pin | What it does |
|---|---|
VCC |
Supply, 2.7 to 5.5 V. |
GND |
Ground. |
OUT |
The analog output: 0 V in the dark, rising with the UV. |
Properties
None. Drag the slider to set the UV index, 0 to 15. The label gives the WHO band: low, moderate, high, very high, extreme (11 and up).
What the model gets right
The photodiode. The GUVA-S12SD datasheet gives a typical photocurrent of 26 nA at UV index 1. (A later revision of the sheet gives 21 nA a UV index plus an 83 nA offset; the model follows the 2011 sheet the module's documentation goes with.)
The module. Its documentation (Adafruit's page for the breakout, the one the
tutorials quote) gives Vo = 4.3 x photocurrent in µA.
Together. 4.3 x 0.026 = 0.1118 V per UV index: 0.67 V at UV index 6, 1.12 V at 10. Many sketches divide the voltage by 0.1 V to get the index, a round figure the same documentation suggests; with the datasheet's photocurrent that reads about 12% high, as it does with the real module. The UV index meter template divides by 0.1118.
The supply. It runs from 2.7 V, so it works on a 3.3 V board too, and the output never passes the supply.
What it does not model
The spectrum: the slider is the UV index itself, a weighted sum over wavelengths that the photodiode does not weigh the same way, so under a real UVA lamp the module reads differently from the sun. The photocurrent's spread from part to part, its 0.08% per degree temperature coefficient, the 1 nA dark current, the angle the light comes from, and the op-amp's offset and response time are not modeled.
Common mistakes
Testing it under a lamp or through a window. Indoor light has almost no UV and glass blocks most of what there is; take it outside.
Reading it against the wrong reference. On a 5 V Uno one converter step is 4.9 mV, about 0.04 of a UV index, plenty. On a 3.3 V board use 3.3 in the sum.
See it in action
UV index meter shows the index and its band on an I2C LCD. Open it at /templates.