I can't get the TVOC sensor working

I am having issues getting the TVOC readings from the Airgradient DIY Pro.
I used the code here:

Except I fixed the conditional checks for each method to fix the order of operations.
if (currentMillis - previousTVOC >= tvocInterval) {
if ((currentMillis - previousTVOC) >= tvocInterval) {

Now all my other readings are working as expected except TVOC is showing 0.

Here are the steps I’ve done to get attempt to get the TVOC sensor working.

  1. I bought the “SGP41 TVOC Module for PRO Kits”
  • Didn’t fix the issue.
  1. I removed the resistors from the “SHT3x module”.
  • Didn’t fix the issue.
  1. I used the default Arduino code directly from your site with the exact libraries and versions.
  • Didn’t fix the issue and broke some of the other sensors.
  1. Corrected some order of operation issues with the default Arduino code.
  • Didn’t fix the TVOC issue but fixed all the other sensors.
  1. Updated the Arduino libraries to their current versions.
  • Didn’t fix the issue.
  1. Switched the TVOC sensor from the I2C 5v to the I2C 3v.
  • Didn’t fix the issue.

At this point I don’t know whats left to try.

I got it working.

I’m not too bight … I missed the part in the build guide telling me to use the Arduino IDE > File > Examples > AirGradient Air Quality Sensors > DIY_PRO_WITH_SGP** (** being the sensor version needed.)

It might be good to bold that piece in the build instructions. As well as update the blog articles code that I linked.

Anyways, I’m back to a flaky temp and humidity readings going back and forth from the actual temp/humidity to 0/0.

Among several other issues, my new DIY Pro build also has very flaky temp/humidity reading too. Usually, after a few minutes or within a couple of hours, the temp/hum all read back as 0/0 and get stuck there until I power cycle.

In the little experience I have, issues like this have usually been related to Arduino Serial.println() statements outside of the setup. These print statement tend to slowly use all the available memory and tend to mess up the output and sometimes crash the ESP8266. So, if you happened to change the code to print out the sensor values to the serial monitor, I would just comment them back out. If you didn’t change the code to print out to the serial terminal, I’m really not sure what it could be if you’re using the default Airgradient Arduino Examples. Unless it’s something in the Airgradient code that is echoing the MAC address over and over again.

For me, I solved my flaky temp and humidity issues by replacing my sensor with a new SHT3X from Amazon that still had the resistors I removed per an older tutorial.

I think some of the older tutorials on the Airgradient site need to be removed or have a link to the updated build instructions. Maybe have specific/separate build instructions for the SGP3X and the SGP4X, using Dozuki/Dokit → OSS Wikifab/Folge.