SenseAir CO2 random spikes in readings

I have built two air quality monitors which use a bme680 for temperature and humidity, sps30 for particulate matter and the Senseair s8 co2 sensor. Both use a esp32 for communication and are exactly identical except for the co2 sensor itself. I have unfortunately ordered the S8-4B 004-0-0024 Version for the first monitor. This sensor is not ideal since it doesn’t offer a very high resolution and should only be used for alarm. So for the second one i used the S8 004-0-0053 Version. I’ve wired both sensors the same, except of course for the different pin locations. The first monitor is powered by a 12v to 5v dc converter, since i connected a small 5v fan to both units in order to guarantee a better airflow, i noticed that the fan of the first monitor (the one with the 12v to 5v) was a bit louder than the one of the second monitor, which is powered by a USB cable which I’ve cut and. The wires are soldered directly on the esp-32.

Now the problem is that the second monitor with the S8 004-0-0053 randomly shows high spikes in the readings. When i reset the device (cutting power for 3 seconds) the spikes go away and the readings are accurate again. I tried to turn the baseline calibration on or off, define manual baseline points, and rewire the whole thing, but nothing so far worked. I am unsure if this is a software or hardware fault. One more thing. The last 3-4 times i updated esphome and subsequently the esp-32. The readings were stable for 1-2 weeks straight.

This is the part of the code for the co2 sensor.

- platform: senseair
  co2:
    name: "name Zimmer CO2"
  update_interval: 60s
  id: name_zimmer_co2

This is how it looks in the history tab of homeassistant.

Does anyone know why this happens or how to fix it. I found nothing so far except for a few people with different periodic spikes, but not as random and high as these.

Generally, applying a .01 uFd capacitor between the GPIO being read and the DC power supply (3v3 or 5v pins) helps alleviate such issues.

And I guarantee you, if I’m wrong, someone will be right along to correct me. :wink:
(Not criticism, just a bit of very dry humour for everyone’s enjoyment.)

I don’t know, but here’s some things I’d probably try.

  1. Remove everything else and just run the sensor (remove fan etc)
  2. Use my best quality usb cables and power supply (maybe test powering via USB) to test. Like the ones for my smartphone.
  3. Try another good quality ESP32, like a QuinLED. Definitely try something other than cheap clones, if that’s what I was using.
  4. Try other GPIOs.
  5. Consider soldering connections (if not already).

While I don’t think it is likely the cause, I do find other things such as opening a door, being near the sensor, or turning on the air con can result in a spike (for the latter, I think the AC can circulate a CO2 layer settled on the floor, maybe).

This is really weird. I’ve tried a different power supply and esp. But i think the reason it is currently working is the fact that I’ve updated esphome. Maybe this is a software issue after all. Maybe it clears the cache of the device or resets it (differently?). I have no clue why it suddenly works again, I’m sure however that it’ll break again as soon as a new version is available, so maybe I’m just forced to update it then.

1 Like