GUVA-S12SD UV sensor reading problem.

Hello everyone. I am new to this hobby. I know I should be posting in the sensor section, but for some reason the "new-post" bar is not showing on that forum. *if someone can help me re-direct it would be greatly appreciated

I am trying to make a UV sensor with the following equipment:

  • GUVA-S12SD uv sensor.
  • Maker Nano (almost a spitting image of the Arduino Nano)
  • half bread board

So far i am following this schematic:

The code I am using is:

// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
// print out the value you read:
Serial.print("voltage = ");
Serial.print (" | ");
Serial.print("UV index = ");

When I run the script, it is showing voltage range of 1-3 volts indoors with no source of UV.

I had someone else test my Maker Nano board and the power output is coming out clean.

I tried another experiment where i pulled the UV sensor off, and the leads. The script is still showing a voltage range of 1-3 volts. Which is odd since there is no data being fed into the board. Is the voltage being read from the background voltage from the Arduino board?

Thanks for reading this post, and thank you again for your time.

We need some more information. What is the wavelength of the UV light you are measuring. The data sheet graph shows it is sensitive only in the 240 nm to 375 nm range and it is not a linear response. Adafruit specifically states: Please note, our UV LEDs are 400nm, outside the range of this sensor, so if you're trying to test this sensor, don't use them! A UV tanning lamp or 'lizard-lamp' will work much better." That is a big flag indicating you should read the full data sheet. I hope this is what you needed, I am not sure what your question is.

You might find adding a delay into the loop might make a difference. I recall the A/D require some setup time.

However in your current state I would:

Measure the output of the UV sensor with a multimeter (if you have one)

If not I suggest you get two resistors of the same value and type. Connect one between 5V and A0, then connect the 2nd one between A0 and GND.

You should read 2.5 volts and be pretty steady.

If you don't have a multi meter you should get one. For this type of work you don't need an expensive one. Maybe $20 or so on ebay. You need to measure DC volts, Ohms and at some point DC amps.

As is said it doesn't need to be super accurate, if you are looking at a signal and it measures 4.86 volts by your meter indicates 4.93. It doesn't matter which is correct you know enough that there is 5v Power to that circuit.

For my learning, what is your goal for measuring UV?

Thanks for the quick reply everyone! I am using a multimeter. but i think my room/house has a lot of static or EM interference. THe number are jumping everywhere right now without the leads being attached on the multimeter.

Can all of these interference also affect the UV sensor too?

I am using a reptile UV bulb right now. It has a range of 280 - 320 nm.

Thanks again everyone.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.