Archive for March, 2018

Comparing Adafruit Gas Sensors

I am comparing the performance of the Adafruit CCS811 and SGP30 gas sensors. These sensors monitor the atmosphere for effective carbon dioxide (eCO2) and total volatile organic compounds (TVOC) and report those values when polled. You can artificially test the sensors by blowing on them and watching the reported values spike.

I wanted to make this comparison because I was running these sensors independently and I noticed occasional spikes or artificially elevated periods. In order to test the sensors and remove actual environmental fluctuations, I needed both sensors connected to the same board.

At first, I used an Arduino Nano, but then switched to an Adafruit ESP32 Feather. For some reason the CCS811 board would report only zeros. I suspect this is because the CCS811 uses I2C clock stretching, and the ESP32 probably doesn’t support that in hardware.

Enter the prototype Metro M4 Express. This is a new pre-production board (which I am helping test) from Adafruit. It runs a custom cross-compiled version of CircuitPython – currently 3.0.0 alpha 1 compiled on 2/27/18. There are CircuitPython modules available in Adafruit’s GitHub repositories for both the CCS811 and SGP30 sensors. It took me almost no time at all to compile the latest firmware for the M4, flash it, and connect the circuit that I used for the ESP32 test. Both sensors work flawlessly.

There is, however, the pesky case of spurious values. On a plot of observations vs. the difference between the readings (i.e., SGP30 – CCS811 values), we should see a flat line indicating the sensor values are moving in lock-step with each other, with perhaps some minor fluctuations. That’s not what we see, though!

As you can see, the SGP30 has quite large spikes that the CCS811 does not. This indicates that the SGP30 values are considerably less reliable than the CCS811, which is unfortunate because I like the electronics in the SGP30 a lot more (true I2C for one). Unfortunately, the numbers don’t lie: the CCS811 is a more reliable gas sensor.

March 1, 2018 at 1:23 pm Leave a comment


Feeds