UV Sensor problem

Hello,

I got my GrovePi today. So I set it up with my raspberry pi. I had installed Raspbian 8 (jessie) on this one. So I cloned the GrovePi git repo from github.
If i run the grove_firmware_version_check.py script from Software/Python. I get the response, that GrovePi has version 1.2.2 installed. So it looks like the connection to the board works.
The next step was that I get data from the uv sensor, which I also ordered.
I got this one: http://www.seeedstudio.com/wiki/Grove_-_UV_Sensor
So I connected the sensor to the A0 connector and wrote a little test python script. But I think I get the wrong data.
My script looks like this:

import grovepi
import time

sensor = 0 

grovepi.pinMode(sensor, "INPUT")

while True:
    try:
        analog_value = grovepi.analogRead(sensor)
        print("Sensor Value: ", analog_value)
        time.sleep(.5)

    except IOError:
        print("Error")

If I run this script I get values between 58 and 62. But I don’t this this is correct. If I totally disconnect the sensor and run the script I get values between 105 and 109. Shouldn’t this be 0 than? Or is there something wrong?

Hey,
The analog line is floating when you disconnect the sensors and it’s behavior can be anything. AN easier way to check this would be take any other analog sensor or a digital sensor which can give it a proper voltage like 3.3V or 5V and see if it reads that correctly. Can you check the data from the UV sensor by converting it to the UV index from the information given here: http://www.seeedstudio.com/wiki/Grove_-_UV_Sensor and then checking if it’s right or not. You could also use a UV LED to check if it gives the reght value or not. These analog sensors are very tricky to get working. This http://www.seeedstudio.com/depot/Grove-Sunlight-Sensor-p-2530.html?cPath=25_128 is a much better option if you want to measure UV.

-Karan

-Karan