1

Using Arduino Uno and a GUVA-S12SD sensor (https://www.adafruit.com/product/1918).

Here's my circuit. 5V into sensor+, GND into sensor-, A0 to sensor out.

circuit

Here's my code:

void setup() 
{
  Serial.begin(9600);
}
 
void loop() 
{
  float sensorVoltage; 
  float sensorValue;
  float uvIndex;
 
  sensorValue = analogRead(A0);
  Serial.print("Analog out: ");
  Serial.println(sensorValue);

  // 5 because 5V
  sensorVoltage = sensorValue * (5.0 / 1023.0);
  Serial.print("Output voltage: ");
  Serial.println(sensorVoltage);

  uvIndex = sensorVoltage / 0.1;
  Serial.print("UV Index: ");
  Serial.println(uvIndex);

  Serial.println();

  delay(1000);
}

Here's a sample from the serial monitor. The values stay about the same regardless of where I am in my house (in a sunny room, in the dark bathroom, etc.).

Analog out: 853.00
Output voltage: 4.17
UV Index: 41.69

Analog out: 853.00
Output voltage: 4.17
UV Index: 41.69

Analog out: 853.00
Output voltage: 4.17
UV Index: 41.69

Analog out: 853.00
Output voltage: 4.17
UV Index: 41.69

Output voltage is supposed to be very low. The UV index maxes out at around 11 - so 41 is too high. I checked what it is in my city right now, and it's 3. So this is super wrong. I don't have a multimeter to test with right now.

Any ideas about what could be going on? Did I order a bad sensor?

9
  • 2
    looks like the sensor module pins are not soldered
    – jsotola
    Nov 2, 2021 at 20:36
  • 1
    @Dan the pins should be soldered to the module ... i am talking about the three pins visible in the three gold rings next to - Out +
    – jsotola
    Nov 2, 2021 at 22:40
  • 1
    @jsotola Ah I don't have any soldering equipment. I might be able to get some soon though. Is there any way to test this in the meantime or is soldering sort of the first step?
    – Dan
    Nov 2, 2021 at 23:23
  • 1
    take the red jumper and insert it from the back of the board through the + hole ... insert the other two jumpers into the other two holes ... tie the three jumpers to the back of the board using the mounting hole next to the adafruit logo ... use a cable tie, or twist tie, or string, or rubber band ... pull on the jumper wire so that the ends are at an angle in the holes and are pressed tight against the side og the holes .... hopefuly that will work
    – jsotola
    Nov 2, 2021 at 23:32
  • 1
    @jsotola I managed to get the thing soldered but I'm getting the same high readings. Safe to say that the sensor is bad I guess?
    – Dan
    Nov 3, 2021 at 16:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.