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
It’s fine Could you provide the code you were using?
Plus welcome to the forums
I have used the example from dexter:import time
Connect the Grove Air Quality Sensor to analog port A0
air_sensor = 0
# Get sensor value
sensor_value = grovepi.analogRead(air_sensor)
if sensor_value > 700:
print "High pollution"
elif sensor_value > 300:
print "Low pollution"
print "Air fresh"
print "sensor_value =", sensor_value
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.
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.
thank you for your help @graykevinb @Shoban!
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!
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!