Easy CO2 Meter with ESP8266 (NodeMCU) and Senseair S8 Sensor

Last modified 12 months

Let's see how to assemble the Easy CO2 meter with a SCD30 Senseair S8 LP.

This is going to be a very short article, only with the important differences from mounting with the MH-Z19B or MH-Z19C sensor. We will go "Straight to the point«.

If you haven't seen the article «DIY: Homemade CO2 monitor with Wifi against coronavirus«, You should see it now since this build is based on it. Most of the build is the same and here we will only deal with the differences.

Why should you use the Senseair S8 sensor?

I think the right question would be, why mount the CO2 Easy meter with another sensor?

There are several important reasons we can think of to use this sensor, instead of the MH-Z19B or MH-Z19C.

  • The Senseair S8 NDIR Sensor is a Best Quality, from a swedish company
  • Provides more accurate measurements
  • Has longer lifespan
  • At the moment no fakes
  • Gives less problems with power supplies

Similar in assembly

The making of the monitor with this sensor is practically identical. The sensor is very similar, it has almost the same physical form and the connections are the same.

For the assembly part, you can follow the tutorial «DIY: Homemade CO2 monitor with Wifi against coronavirus«. The connections are exactly the same.

NodeMCU connection diagram to Senseair S8

As in other cases, I recommend that if your NodeMCU board has a VU pin (not all have it), connect the positive of the Senseair S8 LP (VCC) to that pin, instead of Vin.


The differences in the building of the meter are focused on the firmware, since the communication with this sensor is different, although the configuration, in general, is basically the same as with the MH-Z19B or MH-Z19C sensors.

Configure ESP Easy for the Senseair S8

The biggest difference is that we have to choose the correct device in the "Devices" menu.

Next, the ESPEasy web page will appear in which we will do the sensor configuration.

We simply have to enter the information as shown below:

Where to buy the Senseair S8 sensor?

Here is the link where I bought it: Senseair S8 LP. It was delivered to me very fast (one week):

Costs about 24 Euros here: Senseair S8 LP

It is a store with many positive feedback and shipping is by AliExpress Standard Shipping, so you should have it at home in less than two weeks.

Be careful because there are other versions of the Senseair S8 sensor that are not valid for the purpose we want (there are similar ones, for example, for the automotive sector).

Senseair S8 LP CO2 Sensor Calibration

The Senseair S8 LP has a very good Automatic Baseline Correction (ABC) system so, under normal conditions, you won't have to do manual calibration and you will be able to disengage from it.

The ABC algorithm permanently monitors the minimum CO2 reading for a preset period and slowly corrects any drift in the long term compared to the 400 ppm (or 0.004%vol) CO2 concentration expected in fresh air.

The maximum adjustment allowed by the ABC algorithm of the Senseair S8 is 30-50 ppm for each ABC period.

The factory set ABC period is 8 days.

Due to a bug in the Senseair S8 sensor itself, avoid problems and mismatch a sensor, ESPEasy does not allow to start sensor calibration by software (I explain below how to calibrate it using an ESPEasy ruler).

If you want manually calibrate the sensor you must do the following:

You have to connect the bCAL_in pin to GND for a minimum of 4 seconds and a maximum of 8 seconds and you will start a manual calibration.

Before starting the manual calibration, the sensor should be at around 400 ppm for a few minutes (I suggest a minimum of 15 minutes) for the sensor to stabilize. This is: you will have to leave the sensor working outside, in fresh air, for at least 15 minutes before starting calibration.

The procedure is very easy:

  • Leave the sensor working outdoors for, at least, 15 minutes
  • Connect the bCAL_in pin to GND during more than 4 seconds and less than 8 seconds
  • Keep the sensor outside for about 5 minutes to complete its calibration and stabilize.
  • It is done. The sensor will assume the current concentration as 400 ppm

It is important that don't leave the bCAL_in pin attached to GND for more than 8 seconds, as if the 13 seconds are exceeded the sensor starts a different calibration mode, which is not the one you are interested in (it is a calibration mode with a concentration of 0 ppm of CO2, for which you would have to immerse the sensor in nitrogen, for example).

In my experience, if the sensor receives air from outside from time to time, manual calibration is completely unnecessary.

However, if the sensor is placed in a place rarely ventilated with outside airI recommend that you manually calibrate it in fresh air from time to time.

Calibration of the Senseair S8 CO2 sensor with an ESPEasy ruler

Having to manually jumper the bCal_in pin to GND every time you want to calibrate it can be inconvenient, so here's how to do the calibration using an ESPEasy ruler conveniently and without having to access the meter directly.

What we are going to do is to tell ESPEasy to control the bCal_in pin and to set the PIN to GND for 5 seconds when we want to calibrate by means of a command.

To do this we will need to do two things:

  • Connect the bCal_in pin of the Senseair S8 to an ESP8266 pin.
  • Include a rule that connects bCal_in to GND for 5 seconds

The first step is to connect bCal_in to an ESP8266 pin using a small cable. I have used pin D5 (GPIO14).

In the "Rules" tab of ESPEasy we will have to include the following:

On CalibrateS8 do

On rules#timer=1 do

On System#Boot do
  GPIO,14,2 // Sets GPIO14 (calibration PIN) to high impedance

The first block "On CalibrateS8" to "EndOnThe timer is set to "low", sets the GPIO14 pin (D5) to logic low (ties it to GND) and sets timer number 1 to run five seconds later.

The second block "On rules#timer=1 do" to "EndOn"This is executed when timer number 1 reaches zero (at five seconds) and sets the GPIO14 pin (D5) to high impedance logic level (as if it were "loose" again, disconnecting it from GND).

The third block "On System#Boot do" to "EndOn"It is automatically executed every time ESPEasy is started (when we turn it on or reboot it) and makes sure that the GPIO14 pin (D5) is left at the high impedance logic level (as if it were "loose") every time the meter starts up.

Image of the rules using timer number 2 instead of 1 (you can use any timer you want, that you are not using for something else).

That's it. Now all we have to do when we want to calibrate our Senseair S8 is to enter the following line in our browser (replacing by the IP of your CO2 meter):,CalibrateS8  

You will see the browser load an "OK" page and the sensor will be calibrated.

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 2

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

15 thoughts on “Medidor CO2 Easy con ESP8266 (NodeMCU) y sensor Senseair S8”

  1. Hi Mariete,
    thanks for your «bring it on the point» tutorial. Everything works well with a little exception. It is not possible to calibrate the sensor, when I connect the bcal pin to the GND pin. May be I made something wrong. My question is, should I connect both pins during running or should I disconnect the GND pin first before the bcal pin get in touch with the GND pin? And whats about restart the sensor?
    Thanks a lot

    • Hi Dirk.

      Please, review the procedure for calibration.

      You should have no problem calibrating the Senseair S8 if you follow the procedure described in "Senseair S8 LP CO2 Sensor Calibration" to the letter (pay attention to details, such as pin connection times and stabilization).

      You must connect the bCAL and GND pins while the sensor is running (this causes the Senseair S8's internal processor to run a calibration program, so it must be powered on).

      You do not need to reset the Senseair S8 to calibrate it.

      Best regards.

  2. Hello,

    I know nothing about electronics.

    I just received the Senseair S8 sensor and am waiting for the NodeMCU CP2102 kit that includes a SSD1306 OLED.

    The diagrams above don't show how to build a CO2 detector with those two parts, and how to power them.

    Should I use those:
    Senseair G + → NMCU VU

    Thank you.

  3. I really liked this project!
    Can you also get the sensor readings with a voltmeter? If yes can you explain how and how to convert them to ppm?

  4. Hi.
    Nothing ... this is making me a little desperate ... after the war that gave me soldering the cables to the Senseair, the installation of the firmware was impossible. It gives me an error that I do not see that you have it reported by anyone in the main tutorial. It is with the second Nodemcu Lolin V3 that I try and it gives me the same error when flashing it. Yes I load the firmware of the project particle meter https://sensor.community/fr/sensors/airrohr/ that I already have working perfectly.
    It gives me the following error and a log that I don't understand anything about (I tried with the 2 ports COM3 and COM4 that I can select. On another PC it won't let me load the CH341 drivers ... I don't know for what reason, tonight I'll try another PC, Let's see….):
    Flash didn't complete due to error [3], please read log file:
    (or try pressing reset on the unit)
    Start flashing on COM3 (approx 105 seconds).
    The log you reference says:

    ######FLASH INFO######
    BIN file: ESP_Easy_mega_20201130_normal_ESP8266_4M1M.bin
    COM port: (COM3) USB-SERIAL CH340 (Port_#0001.Hub_#0001)
    Baud rate: 115200
    ######POST FLASH######
    No post flash information entered…
    ######FLASH LOG######
    [esptool.exe -vv -cd nodemcu -cb 115200 -cp COM3 -ca 0x00000 -cf "C: \ Users \ meteo2 \ Downloads \ espyeasy CO2 Meter \ bin \ ESP_Easy_mega_20201130_normal_ESP8266_4M1M.bin"]
    [02/09/2021 19:42:53] esptool v0.4.12 - (c) 2014 Ch. Klippel
    [02/09/2021 19:42:53] setting board to nodemcu
    [02/09/2021 19:42:53] setting baudrate from 115200 to 115200
    [02/09/2021 19:42:53] setting port from to COM3
    [02/09/2021 19:42:53] setting address from 0x00000000 to 0x00000000
    [02/09/2021 19:42:53] espcomm_upload_file
    [02/09/2021 19:42:53] espcomm_upload_mem
    [02/09/2021 19:42:53] error: Failed to open COM3
    [02/09/2021 19:42:53] error: espcomm_open failed
    [02/09/2021 19:42:53] error: espcomm_upload_mem failed
    [2021-02-09 19:42:53] STOPPED due to 3 errors! (try reset on the unit, then start a new flash attempt)

    (I reset a few times with the button on the left of the nodemcu ... but nothing, it gives me an error and a new log)
    Sorry for the length of the message ... once you read it you can delete everything you see unnecessary.
    Thanks and regards.

    • Hello Llorinte.

      Wow, sorry you are in trouble and sorry for your frustration. 😞

      What the log tells you is just that it can't open the COM3 port.

      Check these points:

      1. Don't you have some other program that is using COM3?
      2. Make sure the NodeMCU is actually connected to COM3
      3. Try to run the recording program as administrator (right click on the icon and "Run as administrator")
      4. Another option is to load the firmware file with the same recording program that you are using with the other project and it doesn't give you any problems.
      5. Uninstall the drivers and install them again.
      6. Make sure you don't have the CO2 sensor (and better yet, no other sensors) connected when you go to flash.

      Anyway, I suggest you go through the Telegram group: https://t.me/emariete_chat surely between all of us we will find a solution.

      A greeting.

  5. Hello Mariete. Thanks for this tutorial. I already have the sensor and the plate arrives today. I have a question, how to hold the sensor correctly? I have bought the plastic box that you recommend, with the plate I suppose there will be no problems screwing it but I don't know how to place the sensor to fix it well. Thank you!
    A greeting.

      • I think it's a good idea. Just a while ago the rest of the pieces just arrived. The box looks very good, you will have to DIY with it too.
        Thank you! A greeting.

  6. Hello again.
    Yesterday I received the Sensair s8, today the screen and tomorrow I expect the ESP to arrive, so I will start the assembly work at the weekend. Mind you, I just got a bit of a scare when reading the specifications of the S8 https://rmtplusstoragesenseair.blob.core.windows.net/docs/publicerat/PSP126.pdf that warns that NEVER TOUCH THE SENSOR WITH NAKED HANDS (you should use ESD gloves, I think a latex one works) and I was already handling it yesterday to take a look at it…. As it seems to me that you do not indicate anything about it in this and other tutorials, do you know if it really could have been annoyed by the fact of having played it for a few minutes? With my audacity and your permission ... as soon as I get to work, if I have a problem that I cannot solve, I will stop by to consult.

    • Hello Llorinte.

      The datasheet from which you put the link does not correspond to this sensor but to another model and is linked to a website that is not the official one. With your permission I have edited your message to put the correct one and that it does not confuse any user.

      The correct one, official from the manufacturer, is the one linked in this blog (which is this: https://rmtplusstoragesenseair.blob.core.windows.net/docs/publicerat/PSP126.pdf).

      That said: These types of components tend, in general, to be sensitive to electrostatic discharge so they must be handled with some care. Another thing is that they are easily damaged by that, and it is not that easy. I do not know a single case of the users of this blog who have mounted the meter (and believe me there are many) that the sensor has been damaged by having touched it with their hands.

      The possibility, being strict, is there, but it is quite small. I myself have here for years several sensors of this type from different manufacturers and not only do I touch them with my hands, but I have them piled up on the table with things on top ...

      However, I will put a notice in the tutorial just in case.

      • Perfect. Thanks for the correction, I had taken it from a Russian YouTube without noticing that the link was from a different model than the one you put, and I was only left with that warning that I had also seen in another series of videos about calibration of the S8 that it manipulated with gloves and if it is the same as the one in your tutorial (https://www.youtube.com/watch?v=n059hQpybsE) ,


Leave a Comment