The GUVA-S12SD is a UV-B sensor that responds to radiation in the range 240 to 370 nm. Here is the datasheet. It's also old-fangled, from 2011.

The module that I bought has extra circuitry onboard. There's a power LED and what looks like an op-amp. I guess this is needed to convert the diode current to a voltage.
I found a Github library for it at https://github.com/ma2shita/GUVA-S12SD from 8 years ago but I actually went with a fork https://github.com/ppaauuoo/GUVA-S12SD from 2 years ago which has one patch to fix a syntax error. But when I tried to compile this test sketch:
#include <GUVA-S12SD.h>
GUVAS12SD uv(A0,5.0,1000);
void setup()
{
Serial.begin(115200);
}
void loop()
{
float mV = uv.read();
float uv_index = uv.index(mV);
Serial.println(uv_index);
}
I found it could not find <arduino.h> which contains prototypes for the Arduino library. Changing the include in the library source to <Arduino.h> fixed the problem. I'm guessing that the change came with the version 2 IDE.
Not surprisingly the sensor read 0.0 because it is indoors and what's more at night. I would have to put it outside in the sunshine to get any readings. Or maybe put it inside my UV EPROM eraser.
A couple of days pass. I found a bunch of EEPROMs to erase so I fired up the eraser. A little UV light leaks from the gaps so I put the sensor next to the gap. 0.0. Put the sensor inside the eraser. 0.0. I guess the UV spectrum of the eraser is very narrow and falls outside the sensor's range. Oh well, have to wait until I have a prototype to put outdoors.
But this brings up a point: how do I know if sensors are correctly calibrated? I don't mean meterologically accurate measurements, just close enough for everyday use. With the temperature and humidity sensor I could compare it with another sensor. For the UV sensor I would probably have to compare it with the UV forecast on a weather app. The result I get would only be good for gauging whether I need protective clothing. Especially for lightly overcast days where there is no direct sunshine but the UV level is actually significant.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.