I apologize my last post did not upload properly so I am creating a new question.
I am using the CCS811 Gas Sensor with a Pi 3 Model b. I followed the steps on this page https://learn.adafruit.com/adafruit-ccs811-air-quality-sensor/raspberry-pi-wiring-and-test and it ran without issue during the burn in period. Now I am getting the error below.
I know the sensor works because I tested it with my Arduino Uno and I can get the readings. On my Pi it shows the correct address of the sensor when I run sudo i2cdetect -y 1.
I have wiped the SD card 3 times now and started over on a clean slate all to end up with this error each time. Any help will be greatly appreciated!
Here is the code that I am using to read the data from the sensor:
ccs = Adafruit_CCS811() while not ccs.available(): pass temp = ccs.calculateTemperature() ccs.tempOffset = temp - 25.0 while(1): if ccs.available(): temp = ccs.calculateTemperature() if not ccs.readData(): print "CO2: ", ccs.geteCO2(), "ppm, TVOC: ", ccs.getTVOC(), "temp: ", temp else: print "ERROR!" while(1): pass sleep(2)
Here is the error:
pi@raspberrypi:~/Adafruit_CCS811_python/examples$ sudo python CCS811_example.py Traceback (most recent call last): File "CCS811_example.py", line 6, in <module> ccs = Adafruit_CCS811() File "/usr/local/lib/python2.7/dist-packages/Adafruit_CCS811/Adafruit_CCS811.py", line 84, in __init__ raise Exception("Device ID returned is not correct! Please check your wiring.") Exception: Device ID returned is not correct! Please check your wiring.