Particle electron i2c clock stretching

I would like to use this co2 sensor (https://learn.adafruit.com/adafruit-ccs811-air-quality-sensor/overview) , but it says it uses i2c clock stretching. It warns not to use it for the raspberry pi because the clock stretching may dramatically slow down the i2c clock speed. That being said, can the particle electron handle this sensor?

@lunchboxp, given that @ScruffR contributed a modified version of the Adafruit_CCS811 library for it on the Web IDE, I would say yes to that.

1 Like

I do get readings from the sensor, but I haven’t figured out how to keep the readings from drifting considerably over time to the degree of utter guestimation.

1 Like

Oh? Can you explain more? Are you talking about the co2, tvoc, or temperature readings?

Also, have you tried using their other co2 sensor?
(https://www.adafruit.com/product/3709?gclid=Cj0KCQjw08XeBRC0ARIsAP_gaQAXJRoX9SIDyjsbjvt06UTfFDP8autCGmC-RWkRMAKS_L7IoXd15NAaAojiEALw_wcB)

Same experience with the CCS811 VoC sensor I had tested for many months.

The levels will drift higher and higher over time to the point you have no idea what is real or just drifted garbage readings.

The solution is to use this VoC sensor instead. It is advertised as a non drift sensor and after 5-6 months of testing it out I can say it certainly does not drift and stays stable for me.

If I remember correctly the default Adafruit library works out of the box on the Particle P1 & Photons. I have it working just fine.

You can see in the graph below that over a 30-day time frame the “Baseline” VOC & Co2 levels remain very stable. This is placed in a shop with a Laser Cutting Machine, where cleaning alcohol & glues are used regularly which cause the spikes in VOC levels you see.

Here is what a 12 hour reading looks like updated every min

1 Like

Can I see your code? And are you using pins D0 and D1 on the electron? Do you have that sensor connected with any other sensors? I can get mine to work when it’s just the particle electron and the sgp30, but not when it’s with other sensors…?