CO2 monitoring with SCD30 sensor and HA integration

I’m sure there’s some source of CO2 you never noticed until now, in this case probably is your boiler.
It’s been few months I’m using the SCD30 now, and its behavior is quite regular.

According to the datasheet this sensor uses the temperature sensor to correct the CO2 reading, and in some cases it can be even fed by a pressure input to have very accurate readings (seems that NDIR readings are influenced by the altitude). Perhaps the latter is an extreme case where really accurate ppm reading is a must.

Further reading of the docs explaining the large temperature difference of the C sensor is due to the heat generated by the unit itself, therefore as someone said before changing the offset fix the problem.

2 Likes

I do not think it has an issue, I think it is just venting carbon dioxide when it boils, since water naturally absorbs it from the atmosphere, and will release it when it gets near boiling

2 Likes

That makes sense, I notice my SCD30’s temperature reads about 4F higher than it should. Perhaps that is throwing off my readings a bit, do you have any idea if the temp is reading higher than it actually is would that make the CO2 reading higher or lower?

I am going to look into calibrating/offset the temp sensor as I saw some posts about it in this thread.

The boiler is most definitely the source of the increased CO2, I am sure of that now but richieframe says its probably normal so that is good atleast.

Thanks that is really interesting and good to know. It also makes me feel a lot better than I dont have some kind of major issue. I posted in a heating forum and they had me worried because they were saying its likely I had a gas leak in the boiler breaching. The only CO sensor I have is my Nest protect so I am not sure how sensitive it is. I dont really want to spend $50-$100 for a low level CO detector if I dont have to but I guess it might be the only way to know for sure?

Thanks!

The temperature sensor onboard it’s used to correct the CO2 readings using an internal algoritm, my understanding is that altough they provide you access to the temp sensor, showing you the actual temperature is not its main purpose.

A boiler having a gas leak would produce gas/methane emissions rather than CO2.
An incomplete combustion or a leakage from the gas chamber or the exhaust would produce either CO2 and the more dangerous CO. If you suspect anything like that, after a check of you system I’d rather suggest a carbon monoxyde sensor (and spend some money for a very good one, when it comes to health nothing is too much expensive).

Can you share your esphome yaml. I’m struggling with the ic2

@paulcusick3, this is the entirety of my esphome config:

(I have 3 sensors connected to 1 nodemcu. Sensors are scd30, sgp30, hm3301)

esphome:
  name: co2_sensor
  platform: ESP8266
  board: nodemcuv2

wifi:
  fast_connect: true
  power_save_mode: none
  ssid: "MYSSID"
  password: "somepass"

  # Enable fallback hotspot (captive portal) in case wifi connection
  # fails
  ap:
    ssid: "Co2 Sensor Fallback Hotspot"
    password: "somepass"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

i2c:
  sda: D2
  scl: D1
  scan: True
  id: bus_a

sensor:
  - platform: scd30
    co2:
      name: "SCD30 CO2"
      accuracy_decimals: 1
    temperature:
      name: "SCD30 Temperature"
      accuracy_decimals: 1
    humidity:
      name: "SCD30 Humidity"
      accuracy_decimals: 1
    address: 0x61
    update_interval: 5s
  # Cheaper SGP30 sensor, also by Grove
  - platform: sgp30
    eco2:
      name: "SGP30 CO2"
      accuracy_decimals: 1
    tvoc:
      name: "SGP30 TVOC"
      accuracy_decimals: 1
    address: 0x58
    update_interval: 5s
  - platform: hm3301
    pm_1_0:
      name: "hm3301_pm1"
    pm_2_5:
      name: "hm3301_pm2d5"
    pm_10_0:
      name: "hm3301_pm10"
    aqi:
      name: "hm3301_aqi"
      calculation_type: "AQI"
3 Likes

To the OP, I just wanted to say thank you for this, I was looking for ways to monitor the air quality in my home, particularly the bedrooms and this has helped me immensely. For the record, I purchased a NodeMCU V2, the sensor and installed ESPHome on it, integrated very easily with HA and now I’m monitoring away. Seems the main bedroom sits “naturally” (at least now in the winter with no windows open) at about 900-1000ppm and unfortunately spikes to around 1500ppm at night when sleeping. I’m investigating options to remediate this!

1 Like

@rsachoc Happy that you found the project useful.
It’s been a while I’m testing this sensor and I’ve found some reliable path you can use as a reference to achieve a safe level of CO2.

The “test” environment is my parent’s bedroom, it’s winter time here therefore we tend to keep the windows closed most of the time, and the heater runs to mantain an average temp of 24c.

As you can see on this 24h graphics there are some trends which can also reflect the room occupancy.
More into the path from the left:

  • 20:00 to around 01:00 : people going in an out of the room, CO2 is variable at around 700ppm.
  • around 02:00 to 08:00 : people sleeping, CO2 steadily increasing to a peak of 1200ppm, seldom have exceeded such value.
  • 08:00 to 14:00 : windows opened to recirculate air, and people going in and out multiple times.
  • 14:00 to 16:00 : some “siesta” time, again CO2 increase till window opened to recirculate.

Based on these observation you can guess you’re having consistent measuring observing the room occupancy to achieve a similar pattern.
Hope this helped.

Thanks for the great description of building a cost-efficient CO2 sensor.

What case are you using? Could you send a link?

It’s a small case I bought in an eletronic shop in Hong Kong, I guess you can find a similar one easily.
Here are the sizes:

I have a question: there is an MH-Z19 sensor in the ESP home documentation, but I got an MH-Z14A. Can I use the MH-Z19 setting if I omit the temperature measurement?

I’m using scd30 and esphome on a nodemcu. I could set it up running smoothly, thanks guys!
I have trouble adding temperature_offset key to the yaml: it builds and uploads the fw, but sensor data don’t update afterwards. Also tried to add the altitude_compensation key, but yaml is invalid then. Any hints?

Thanks for sharing this project, got it working after a few hours troubleshooting.
Works for Wemos d1 mini (if u wire it correct, else all values are 0). Also had issues with MQTT authenticating, fixed it by removing capital letter in the username and removing exclamation mark from password.

1 Like

@Foosman
Download the library from here:

1 Like

@Ombra Great project! Congratulations. I’ll try it using the ESP-01 but I have one question, can I use the GPIO0 and GPIO2 to connect the SCD30 or will have to use the tx / rx?
Thanks in advance.

Hello Joao, sorry for late answer. I haven’t tried with different pins, I guess you can map any Dx, make some tries with the coming.

1 Like

Screen Shot 2021-12-15 at 11.26.30

Put the two sensors SenseAir S8 and SCD30 side by side. The results are quite different :frowning:

Waiting for the SCD30 Automatic Self-Calibration (ASC).

1 Like

@LeNT thank you! I’m actually pretty happy to see how well their values corelate.
looks like it might be enough to set an offset for one of them if you figure out which one is closer to the real values.Can you share a photo of your setup with some details about the methodology (how you calibrated them, …)? mind that the measurements are influenced by temperature and the air circulation, so the positioning of the sensors matters. Also, at least for SCD30, you might need to apply pressure correction (you either pass pressure sensor value to it or just set the altitude of your location).

The SCD30 is a newly installed one. Therefore, its readings could be not reliable.

Since the SCD30 needs at least 5 days to do its automatic self-calibration. I will report again here after the required period passed.