All Analog-Sensors gets Error 5 in python

Hi there,

When I connect a analog-sensor like air-quality-sensor or light-sensor I become an input/output Error 5 in python shell. All other sensors which are digital or i2c sensors works perfectly. Only the analog-sensors are not working. Can you help me?

sorry for my english :slight_smile:

Itā€™s fine :slight_smile: Could you provide the code you were using?
Plus welcome to the forums :smile:

thank you :blush:
I have used the example from dexter:import time
import grovepi

Connect the Grove Air Quality Sensor to analog port A0

SIG,NC,VCC,GND

air_sensor = 0

grovepi.pinMode(air_sensor,ā€œINPUTā€)

while True:
try:
# Get sensor value
sensor_value = grovepi.analogRead(air_sensor)

    if sensor_value > 700:
        print "High pollution"
    elif sensor_value > 300:
        print "Low pollution"
    else:
        print "Air fresh"

    print "sensor_value =", sensor_value
    time.sleep(.5)

except IOError:
    print "Error"

Sorry, forgot to ask what error messages do you get or outputs if any?
I was also unable to access the page, Iā€™ll report the page is down. Until then Iā€™ll do my best I can to figure this out.

Hi @leon.luethi,

As @graykevinb said, can you post a screenshot of the error message that you get and also follow this guide, generate a test log and post it along with your reply. If possible can you post a few pictures of your setup when you get this error to help you better.

-Shoban

1 Like

Thanks @Shoban. Iā€™d like to add that the wiki has been undergoing changes and @cleoqc showed me the new link: http://wiki.seeed.cc/Grove-Air_Quality_Sensor_v1.3/

More about that on the thread:

http://forum.dexterindustries.com/t/air-quality-sensor-wiki-page-completely-down/2291/2

thank you for your help @graykevinb @Shoban! :slight_smile:
Today I startet my raspberry with the connected air_quality_sensor an re-run the script. I donā€™t know but now it worksā€¦ I can not reproduce the fail. So strange!

Well glad itā€™s working! :slight_smile:
Yah, These bugs can be odd at times.
Maybe you had it plugged in wrong and it got wiggled when you tried again or something. Anyways glad it works. emphasized text Have fun with it!