A homemade CO2 meter with Wifi against the coronavirus: The CO2 Easy

Last modified on 15 January, 2022


In this article I am going to explain how you can build your own homemade DIY CO2 Monitor (carbon dioxide monitor) easily and cheaply.

What I propose is a CO2 (carbon dioxide) meter with wifi, homemade, that you can build for less than 30 euros, I I can guarantee you that the result you will get will be an instrument that is the same or more precise and with many more functionalities than many commercial CO₂ meters costing several hundred euros.

The CO2 monitor CO2 Easy uses a CO2 sensor with NDIR technology and It has nothing to do with the € 60 or € 80 meters that are sold online in terms of reliability, precision and functionalities.

Don't be scared by the length of this article. Yes, it is long, but it has nothing to do with the difficulty. This article is long because I have decided to explain everything step by step, in great detail and with captures, photographs and even videos of each step. Really I could have written a much shorter article explaining how to build this CO2 meter, but it would not have been so complete.

The idea is that anyone can build this CO2 monitor, no need for prior knowledge or special equipment (except for the soldering iron, although you could even do without it).

In addition, it is fully modular, so you can easily expand it with all kinds of accessories, visual and audible alarms and even a touch screen.

However, if you don't want to build your own CO2 monitor, because you do not have time, you do not like to thinker around, or any other reason, you can access a buying guide with the best offers in commercial CO₂ monitors by clicking here.. You can buy it at a good price and have it at home in 24 hours.

Is it possible to reduce the possibility of contracting Covid with a CO₂ meter of less than 30 euros?

Virtually all scientists have agreed in recent months: The virus is transmitted and contagious through the air, mainly, and one of the most effective ways to reduce the possibility of contracting Covid is to adequately ventilating spaces.

The best way to ensure that a space is properly ventilated is to measure the CO2 present in the air.

If you are still not convinced of this, and want to know more, I suggest you to read the following article:

👁️‍🗨️ Structure of the CO2 Easy Home CO₂ Meter

The CO₂ monitor that I am about to describe has nothing to envy to commercial units of several hundred euros, being superior in the vast majority of cases, both for precision and for functionalities.

You will see how to make the homemade CO2 Easy meter with these main characteristics:

  • Economic. Less than € 30
  • High accuracy (50ppm +/- 3% of reading)
  • Wireless connection by Wifi
  • Portable
  • Smart (can perform many tasks based on data)
  • Web server built-in
  • Integration with home automation system
  • Publication of data to the internet
  • Support for MQTT and HTTP
  • LCD display and touch screen optional

The CO2 Easy meter is composed of only two components, low cost and easy to source:

  • Module NodeMCU, Wemos D1 Mini or similar, with microcontroller ESP8266 with built-in Wifi
  • Sensor CO₂ MH-Z19B or Senseair S8 (There are other sensors available and supported by this project such as the MH-Z14A, the Cubic CM1106, among others).

I have chosen low cost components to build the carbon dioxide meter, in order to keep the price very low.

Buying the components in the links that I propose you on AliExpress:

MH-Z19B Some 18 Euros for the CO₂ sensor MH-Z19B on AliExpress.

I recommend that you order the one with a range of 5000 ppm.

* See below my recommendation to use the Senseair S8 sensor.

Be careful not to buy the MH-Z19C version without looking at its downsides (below).

Many vendors advertise the MH-Z19B but they actually ship the MH-Z19C.
NodeMCULittle more than 2 Euros from the plate NodeMCU with ESP8266 microcontroller in this AliExpress link.

It also has many positive reviews and if you choose AliExpress Standard Shipping, which costs less than € 2, you should receive it in a couple of weeks.

You will see that there are several models. I recommend that you ask for the one that says «CP2102 serial port »


Use the CO2 sensor Senseair S8 LP.

Due to the high demand of CO2 sensors produced in recent months, there is a real avalanche of fake MH-Z19B sensors, both on AliExpress and Amazon. These sensors give fluctuating and far from reality measurements, in the best case.

I spend a lot of time checking purchase links that I put and trying to make sure, as much as possible, that they are original, but sometimes there are surprises.

If you want to play it safe, and you can afford to spend a little more, I recommend that you use the sensor Senseair S8 LP. Besides being less likely to get a fake one, it's a sensor, from a European company, of better quality and more precision than the MH-Z19B.

I leave you here the link in which I bought: Senseair S8 LP. It's original and it came 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.

You can find more information about fake sensors by clicking on: MH-Z19B FALSE CO2 Sensors

If you don't want to wait that long, you have the option of buying these components on Amazon, with fast shipping. It is more expensive, but if you want it quickly, you will have it at home in 24 hours, in many cases.

A major advantage, now that there are so many fake MH-Z19B sensors, on Amazon you know what it is easy to return it, if you are not satisfied.

ICQUANZX MH-Z19 Infrared CO2 Sensor Module Carbon Dioxide Gas Sensor MH-Z19B for CO2 Monitor 0-5000ppm MH Z19B
  • This MH - Z19 C02 gas sensor has high sensitivity, high resolution.
  • Provides a variety of forms output modes, such as UART and PWM wave.
  • Anti water vapor interference, no poisoning.
  • Temperature compensated, excellent linear output.
AZDelivery NodeMCU Lolin V3 ESP8266 ESP-12F WiFi Module with CH340 2.4 GHz WiFi Development Board Arduino Compatible with E-Book Included!
  • ✅ Powerful Microcontroller: The AZ-Delivery Module is a powerful ESP8266 (ESP-12F) microcontroller with 802.11 b / g / n WLAN and integrated antenna.
  • ✅ Rapid Prototyping: It is simple to use, allowing you to easily create prototypes through simple programming through Lua code. Plus, with a motherboard-compatible design (27.5mm pin spacing).
  • ✅ Dimensions (L x W x H): 58mm x 31mm x 13mm.
  • ✅ Large storage and processing space: AZ-Delivery ESP8266 with Wi-Fi has large storage and processing space on board that allows it to integrate with application-specific sensors and devices and support minimal load during runtime. Boost your development in the fastest way combining with NodeMcu Firmware!
  • ✅ This product includes an E-Book that provides helpful information on how to get started on your project, helps with quick setup, and saves time in the setup process. We provide a series of application examples, comprehensive installation guides, and libraries.

Depending on the material you use, you probably need some cables.

You can use some cables that you have lying around. I recommend that they be from different colors, to prevent confusions.

Many people use "Dupont" connectors, which you can connect directly to the pins without soldering:

Movilideas - Dupont Bridge Connectors, 40 Male to Male Cables, 40 Female to Female Cables, 40 Male to Female Cables, 120 Cables
  • 120 jumper cables are shipped: 40 male-male, 40 male-female, 40 female-female.
  • Approximate length 20 cm
  • 0.127mm wire, 36 AWG

In case you prefer, I leave you the link where I usually buy the Dupont cables on AliExpress, which are cheaper.

Just missing a box.

As a box for CO2 Easy I propose you four options:

  • Leave it «in the air«. If it is going to be hidden, it is an inaccessible place, there should be no major problem.
  • Put it somewhere ornamental element, any adornment or accessory that is in the room and that allows to hide and protect it.
  • Buy one plastic box. I use one that I buy 10 by 10 in several similar assemblies. Simple and cheap. You can find the one I use here on AliExpress, although there are many similar ones. You can also use one of the gray boxes that are usually used in outdoor electrical installations, drilling it properly.
  • A 3d printed box. It is the solution that I used. You can find the design and tutorial in this blog, as well as others boxes that users have designed and have been made available to readers selflessly.
CO2 meter box available for download

You have to consider two important things: You have to try that the CO₂ sensor is heated as little as possible because its measurements are sensitive to temperature and you have to install it so that it receives the air from the room without problems, so do not put it in a hermetically sealed box (although it should not be given direct drafts).

A solution fast, available and very good is to use an outdoor junction box (discovering a hole for air inlet):

IDE EL231 IP65-IP67 Watertight Junction Box with Opaque Lid and Plain Sides, Gray, 180mm x 241mm x 95mm
  • Impact resistance: ik07
  • Glow wire resistance: 650 ° c
  • Ball pressure: 70 ° c
  • Ambient temperature range: -25 ° c / +40 ° c
  • Maximum operating voltage: 1000 v ac / 1500 v dc

CO₂ sensor MH-Z19B

The MH-Z19B carbon dioxide gas sensor is a general-purpose, small-size smart sensor that uses the principle of non-scattered infrared (NDIR) to detect the presence of CO₂ in the air. It has good selectivity, long service life, and other characteristics, such as built-in temperature compensation.

It has simultaneous serial, analog and PWM output and is easy to use. It is a high-performance sensor that combines reliable infrared absorption gas detection technology with good design and an attractive price.

MH-Z19B sensor parameters

Gas detectedCarbon dioxide
Operating voltage4.5 ~ 5.5 V DC
Average current<60m A (@ 5V supply)
Peak current150 mA (supply @ 5V)
Interface level3.3 V (compatible with 5V)
Measuring range0 ~ 2000 ppm
0 ~ 5000 ppm
Output signalSerial (UART) - TTL level 3.3 V - PWM analog output
Preheating time3 minutes
Response timeT90<120s
Operating temperature0 ~ 50 ° C
Operating humidity0 to 90% RH (non-condensing)
Dimensions33mm × 20mm × 9mm (Length * Width * Height)
Weight5 grams
Lifetime> 5 years

MH-Z19B Features

Gold-plated gas chamber, waterproof and corrosion resistant
High sensitivity, low power consumption
Excellent stability
Temperature compensation, excellent linear output
Long duration

MH-Z19B Sensor Applications

HVAC Refrigeration Equipment
Surveillance and air quality equipment
Fresh air systems
Air purification equipment
Smart home
Schools and educational centers

You can see here his datasheet.

The module with ESP8266

The ESP8266 is a complete microcontroller on a small chip that includes Wifi and TCP / IP stack and is also very cheap.

ESP8266 usually used mounted on a moduleas it does not include flash memory or USB and needs some external components to work.

For this montage I have chosen the NodeMCU module why:
  • It's very cheap, between € 2 and € 4 depending on where you buy it (or about € 7 on Amazon)
  • Has USB so you can connect it directly to your computer by USB to record the ESP8266
  • Has all the additional components what are you going to need
  • It has many inputs and outputs for extensions

Also, you can power it with a mobile charger ordinary.
Although the video tutorial that you will find below is made with the NodeMCU Module, you can also use the small Wemos D1 Mini.

Below you will find his connection diagram, in case you decide for him.
I could have chosen any other module, such as the small ESP12E, but it would have complicated the assembly a lot, due to the additional components that would have been necessary and also its programming, as it does not have a USB port. 

With the NodeMCU and the Wemos D1 Mini everything is much easier.

✔️ Build the CO meter «CO2 Easy»

Enough of introduction, explanations, data and verbiage and Let's go to the mess! To construction!

You have, below, a video with the entire detailed process, to make it even easier for you. 

The construction of the CO₂ meter, the start-up and its use is very simple, I estimate that you can do this project in one or two hours. You just have to follow these steps to build the CO₂ meter with Wifi:

  1. Write firmware to ESP8266 microcontroller with the program that I provide you
  2. Connect the CO sensor sensor using just four wires

It is a super useful and quick project for the experienced hobbyist and a excellent first project for the newcomer to electronic gadget. (Only four cables! Who gives more for less?)

Download the CO meter firmware


Burn the firmware now is even easier. From now on you will not have to download anything to your computer (you can skip the entire procedure below).

You simply have to press the "Install ESP Easy" button, select the port where you have your board connected and press "Connect".

Your browser is not supported! You have to use Windows with Microsoft Edge or Google Chrome to see the button

This procedure can only be done (for now) in Windows and using the Chome and Edge browsers.

The first thing you have to do is download the program to your computer what then you will load in the NodeMCU or Wemos D1 Mini and that it will control the operation of the CO₂ meter.

This program is based on the fantastic project ESP Easy, that I have been using for several years with very good results.

To simplify the task as much as possible, and that you do not have to search and download the different necessary programs and files (and find which are the correct ones to use, because there are many), you can download it from here with one click and in one package that I have prepared and that it contains just what is necessary.

Below you can find the video with detailed instructions for ESP Easy recording.

Note: If you have a board other than the NodeMCU or Wemos D1 Mini that I have recommended, you may have to download the complete package from the ESPEasy releases page on GitHub and find the necessary files yourself.

It is very important that when you go to record the firmware on the board, do not have the CO2 sensor connected to the RX and TX pins (temporarily disconnect them if you already connected them). This is because the board shares these pins with the USB port and conflicts could occur.

Connect CO₂ sensor MH-Z19B

The connection of the MH-Z19B or Senseair S8 sensors (they connect exactly the same) to the NodeMCU is very easy, it only requires four connections.

There are two types of NodeMCU boards. Some that have a pin marked VU and others that do not.

If your board has a pin marked VU (not all have it) connect the positive of the sensor to that pin.

If your badge DOES NOT have a VU pin, connect it like this:

If you are going to use the plate Wemos D1 Mini, follow the diagram below:

You will need to a soldering iron, tin and a pay a little attention, but it shouldn't take you more than 10 minutes, even if you have little experience in these matters, or be your first electronics project.

For connection of the MH-Z19B or Senseair S8 LP sensor to the NodeMCU or Wemos D1 Mini, you can use the cable that comes with the MH-Z19B, cutting the connector at the end, as I show you in the video. If your sensor is not the version that comes with a connector, nothing happens, you will need some cables to connect it.

Once you have cut the connector, strip the wires and make the following connections (note that this pin numbering does not match the manufacturer's):

Pin MH-Z19BColourFunctionNodeMCU connection
1BrownAnalog outputWithout connection
2WhiteNoneWithout connection
3BlackNegative power supply (GND) Pin GND
4RedPositive feeding (Vin) Pin Vin
5blueData input (RXD)Pin TX
6GreenData output (TXD)RX pin
7YellowNoneWithout connection

In the following images you can see the assembly process, including its connections, in detail:

Cut the CO2 sensor connector

In my case, I ordered the MH-Z19B sensor version with connector.

The first thing I do is, since the cable has a connector on both sides, cut the connector on one side.

Optional: Remove unnecessary cables

The connector comes with all seven wires attached.

As we only have to connect four (Black, Red, Blue and Green), I remove the other three cables so that they do not get in the way and that the assembly is cleaner.

Stripping the wires

We strip the end of the four cables.

It is enough to peel one or two millimeters. The shorter the more "cleansed" will remain when soldered.

Solder feed

We carefully weld the sensor supply to the NodeMCU

  • Red wire (positive) to terminal marked Vin
  • Black wire (negative) to terminal marked GND

Remember: If you use the Senseair S8 sensor, it connects exactly the same.

If you are using the Wemos D1 Mini board, the Vin pin will be marked 5V.

Solder the data cables

We solder the sensor data input and output cables to the NodeMCU

  • Blue wire (RXD, data input) to terminal marked TX (data output)
  • Green wire (TXD, data out) to terminal marked RX (data in)

If you use the Wemos D1 Mini board, these pins are called the same.

Remember: If you use the Senseair S8 sensor, it connects exactly the same.

Complete wiring

This is how the wiring will be, once we have soldered the four cables.

The finished CO2 Easy meter

All that remains is to connect the sensor to the NodeMCU, once you have recorded the firmware on the board, being careful not to put the connector upside down.

This will be how our CO2 meter will look, once the four cables are soldered and the sensor connected.

📺 Video with the complete CO2 Meter tutorial

In this video you can see everything you need to build the CO₂ meterincluding electronics, ESPEasy recording and configuration.

Remember: it is important that when you go to record the firmware on the board, you do not have the CO2 sensor connected to the RX and TX pins (temporarily disconnect them if you already connected them).

The video has been recorded using an MH-Z19B sensor and a NodeMCU board. Remember that, if you use the Senseair S8 sensor (recommended) its connection is exactly the same (in this case see also this article I've written with the differences when using the Senseair S8).

Making these videos takes a lot of work. If you like the video, please, Don't forget to "Like" and subscribe to the channel. That It will motivate me to keep making more videos like these.

🔵 Using the CO₂ meter

Your CO₂ meter with Wifi is now finished. You just have to configure it, place it in the room you want to control and read the CO₂ concentration values from time to time.

I recommend that you see in detail the part corresponding to the configuration in the video, where it is explained in detail. However, below you have additional information.

CO₂ meter setup with Wifi

The meter needs a minimal configuration to work, which basically consists of configuring the wifi to connect it to the network of your home, office, school, etc. and tell ESPEasy which sensors you have connected (in this case only the CO2 sensor) and what to do with them.

ESP8266 Wi-Fi Configuration

As soon as you record the ESP8266, and to facilitate the configuration of the Wifi, you will see that it creates an access point called ESP-Easy.

All you have to do is connect from your computer, tablet or phone to that access point and configure the meter, in a very simple way, through a web page, thanks to the fact that the program that we have recorded in the ESP8266 includes a web server with the necessary pages for easy setup.

Normally your phone or tablet will open the configuration web page automatically as soon as it connects to the ESP-Easy access point, as you have seen in the video. If it doesn't, open a browser on your mobile or tablet (Chrome, for example), type in the address and hit enter.

The password to connect to this access point is configesp.

Configuration of the ESP8266 inputs and outputs

Through the same web page that you used to configure the Wi-Fi connection, you can now configure the inputs and outputs of the ESP8266 to tell you what's connected.

In our case, the only thing our ESP8266 has connected is the CO2 sensor and you are going to configure it so that it knows how to read the values and what to do with them.

As you will discover, it is very easy to expand the project to include other sensors and actuators as sensors temperature and humidity, LCD screens, colored LEDs, etc. (you have links to detailed tutorials below).

Reading the CO₂ data from our meter

Your CO₂ meter with Wifi is already working, reading the CO₂ concentration in the room where you have placed it and processing that data.

To read and process this data you have many possibilities that will allow you to read the CO₂ value directly and do many other things, such as: store them, create graphics, create alarms of various types when certain values are reached, send them to the internet, integrate them with your home automation system and much more.

The most basic use is see the CO₂ present in the room in real time. For that you only have to connect to the meter web page, with your web browser computer, tablet or mobile phone and access the "Devices" tab, where you will see the current value. The most recommended is save this page to your favorites, for access it easily, directly, whenever you want.

CO2 meter calibration

Both MH-Z19B and Senseair S8 LP sensors they are already factory calibrated. That does not mean that you can ignore them forever (as in any CO2 meter, commercial or not).

Over time it is usually necessary calibrate the sensor, but don't worry, it's very easy.

You can find the instructions to calibrate the sensor here: Zero Point Calibration.

Where to put the CO2 meter?

Ideally, place the meter at the point with the worst ventilation in the room, away from the wall, at head height (1.5 meters in height can be a good indication depending on whether people are usually sitting or standing) Y away from drafts.

Keep in mind that if you place the meter near a window you will be measuring a CO2 concentration that does not correspond to the real one in the room because you are measuring with that «additional ventilation«.

Benefits of CO2 Easy

There are several projects similar to this on the internet. From small basic prototypes with the minimum functionalities to obtain local CO2 measurements to complete systems that include all kinds of functionalities, its own software platform for capture and visualization, etc.

I am going to present you here what I think are the main advantages and benefits From this project of CO2 meter.

Reliability of measurements

What a CO₂ meter has to do, as obvious as it may seem, is to measure and CO₂, and do it with a certain precision (that you know how much CO₂, there is with sufficient precision), reliability (that the meter works correctly at all times) and repeatability (always measure the same thing under the same conditions).

There are many projects that promise to measure CO2 but actually use electrochemical sensors of general use for the detection of organic volatiles that do not measure only CO2, but all those gases together, so you really don't know what you are measuring.

There are, for example, many 'CO2 meters' using sensors such as the MQ-135 or CCS811, but these sensors are no useful to measure CO2. These sensors measure all organic gases together (Ammonia, Nitrogen Dioxide, Alcohol, Benzene, Carbon Dioxide and Monoxide, smoke, etc.), so if there is someone who is throwing hydroalcoholic gel or someone smoking or there is a source of combustion, such as a fireplace, the measurements will trigger without the possibility of knowing what is causing them to rise.

In case I have not made it clear: DO NOT MOUNT A METER BASED ON THE MQ-135 or CCS811 SENSORS IF YOU WANT TO MEASURE CO₂!

The project that I present here, uses an NDIR type sensor that only measures CO₂. The same sensor used in commercial meters for hundreds of euros. When you get a measure you will know that that measure it is from CO₂ and not from other gases, that surely do not interest you.

Many commercial meters that call themselves "CO₂ meters"Up to € 200 in price, they use the MQ-135 and CCS811 sensors. Run away from them if you want to measure CO₂!

In case it is not clear, the only parameter that you could obtain with sensors like the MQ-135 or the CCS811 would be: «Value in unknown units of something unknown in the air, which is not known what it is or in what quantity it is«. As you can see, something very little useful.

Ease of construction

In many projects that are online, we see that they are relatively complex to build, with many components and welds. Sometimes it is necessary to have measuring instruments to make adjustments.

This project has been designed and documented to be extraordinarily easy to build and is within reach of anyone with no knowledge of electronics. Only four connections have to be made and it does not require measuring instruments or adjustments of any kind.

There are teachers who are building this meter with children, as an activity in class. See if it's simple!

Ease of programming

Many of the projects that we find on the internet are complicated to program. It is even necessary to have programming tools, such as compilers, IDEs, or specific editors.

Also in many projects we have to edit configuration files by hand, which makes it difficult for the non-expert user.

In this project, no need to program anything. It's all pre-programmed and all you have to do is save the supplied program, which you can download from this page, on ESP8266 with a very simple process, following the video I have prepared.

Easy to set up

Many projects have very complicated configuration processes for non-experts, in which it is necessary to modify many parameters, sometimes modifying parameter files by hand or even the source code of the program before compiling and loading it into the meter.

In this project, all the configuration is done very easily, through a web page. No need to edit files by hand or modify code.

Easy to calibrate

Many projects, especially those based on sensors like the MQ-135 and the like, need tedious and very complicated calibration processes, which sometimes has to be repeated daily or every time it is going to be measured. Worse still, some don't even have the ability to calibrate the sensor.

This project does not require any type of calibration. The sensor comes already factory calibrated and then I know autor calibrate by himself, periodically.

Expandable modular design

Most of the existing CO2 meter designs on the internet have certain functionalities and these they are what they are. It is not possible to reduce or expand the design without making changes to the electronics and, above all, programming.

This project is completely modular and expandable without the need for changes in programming nor in the basic circuit. You can start with a basic CO₂ meter and later expand it, in a very simple way, with different types of screens, LEDs, additional temperature and humidity sensors, etc.

Communications and integration

That the CO2 meter can communicate with the outside and send its data (and even receive it) is very useful on many occasions. In most of the projects available on the internet, either the meter you have no possibility of communication, or your possibilities are very limited.

This project, on the contrary, has some huge communication possibilities that allows you to send data to virtually any device or system, without making any changes to your programming, supporting most of the possibilities like MQTT, HTTP, Telnet, UDP, P2P, etc.

Don't you know what all that I've put on you is? Don't worry! You don't have to know anything about it, they are just options that are there for whoever wants to use them.

Data visualization

In most projects the possibilities to consult the data are very limited. Being necessary to do major changes in your design or programming to be able to add new display options.

In this project, you can visualize the data, both in real time and historical, very easily in multiple ways: integrated web page, screens of various types, multi-color LEDs, mobile app, historical graphics on cloud platforms such as Thinkspeak, etc..

Mobile app

On many occasions it is interesting to know the CO2 concentration or historical remotely.

With most of the devices that we find on the internet this would be impossible or would require important changes in your programming.

With this project this is very simple, being able to consult from the mobile, at any time and from anywhere in the world, current and historical measurements.

Data persistence

Most projects offer real-time measurements, but do not have any data persistence system, to be able to store measurements for later analysis or integration into other systems.

This project allows, in addition to the easy use of cloud services (as Thingspeak, IFTTT and the like), databases like InfluxDB (both local and remote), etc.

Portability and mobility

Sometimes it is interesting to be able use the CO2 meter portable or on the move. Most of the existing projects on the internet do not contemplate this possibility.

This project contemplates the configuration, permanently, of two Wi-Fi networks, so that if the first is not available, the meter connects to the second automatically.

Not only that, but if we turn on the meter in a place where there is no Wi-Fi network that it has configured, It will automatically enable us a web page to which we can connect from the mobile to connect in a few seconds any other Wi-Fi network.

We can also configure the second wifi network so that use the internet connection that our mobile provides automatically.

In addition, being fed by a standard micro USB port, we can use a normal powerbank to run the meter on battery (based on my tests we can expect a autonomy of up to 48 hours, depending on the powerbank we use).

You also have a complete tutorial with a expansion to equip our rechargeable battery meter with built-in charger.

🌀 Options and Extensions of the CO2 Easy Home CO₂ Meter

The ESP8266 controller and the firmware it is based on are very powerful and you allows you to add endless possibilities.

Then you will see some of the simplest possibilities that this carbon dioxide meter allows you.

These extensions they are explained in detail in this blog and in my YouTube videos, but you can easily make many more extensions yourself.

Add an OLED screen

In the following article you can see the step-by-step tutorial to add an OLED screen to the meter, in case you prefer to see the values easily, without using your mobile or computer. It is also interesting to be able use meter without Wifi connection.

Add a custom box

A custom box is the perfect complement to your meter. It will give a more professional finish and will protect the assembly from bumps and snags.

In the following article you will find custom boxes for 3D print, both the one designed by me, and others, shared disinterestedly by users who have built this CO₂ meter.

Adding temperature, humidity and atmospheric pressure data

Add easily and for a few euros thermometer, hygrometer and barometer high precision to the CO₂ meter.

Add notices and audible alarms

You can easily add a buzzer and set alarms and warnings when certain levels of CO2 are reached.

In this article you have a complete explanation with everything you have to do prepared to copy and paste.

Creation of CO₂ evolution graph

You can create, in a very easy way, a graph with the evolution of CO₂ like this, using the free cloud service from ThingSpeak.

The ThingSpeak service allows you to store the data from your sensors in the cloud for free and consult them from your mobile, tablet or computer.

Thanks to user ManeKoYou can see quick instructions in the comments below to automatically send your CO2 meter data to ThingSpeak (press here if you want to go directly to the comment where it is explained).

Using the meter as portable / portable

Sometimes it may be convenient to use the meter in portable (in a different place than you normally have it).

This use, so convenient, is very simple and for this you have several possibilities:

Setting up a second Wi-Fi network

You can configure a second wifi network with its SSID and password, to which the CO2 meter will connect automatically if you can't find the main wifi network.

For it you only have to include the data of the second wifi (SSID and password) in the configuration tab («Config«) And you won't have to do anything else.

Set up two Wi-Fi networks

A very interesting use of this possibility is to use, when you are away from home, the access point you can create your cellphone. In this way it easily becomes a connected portable meter. Perfect for IoT solutions.

Connection to any Wi-Fi network, when neither of the two configured is available

When neither the main Wi-Fi network nor the secondary network is available, the CO₂ meter will automatically create a wifi network to which you can connect from any cell phone, tablet or computer. Just search for the "ESPEasy" network and connect to it in order to set up a new wifi network.

Equip the battery meter (portable CO2 meter)

In the following article I explain, step by step and with video, how you can equip the meter with a rechargeable battery and thus convert it into a portable CO₂ meter with sufficient autonomy to use it throughout the day.

🛒 What if I want to buy a ready-made CO2 meter?

If, for whatever reason, you don't want to build your own homemade CO2 meter, you have the option of buying a commercial one. Plug and play.

There are many models on the market, but, I must warn you that many of them are worth absolutely nothing, in order to measure the concentration of CO2, because they have a type of sensor that is affected by all types of gases and the meter is not capable of distinguishing CO2 from any other gas (and there are many gases in the air that go and they come, so you'll never know if it's measuring CO2 or something else).

Whichever meter you buy, I recommend that you buy one that has an NDIR sensor (And keep in mind that, if it doesn't wear it, it probably won't wear it).

If you want to see more models available at a good price, best sellers, best offers, etc. you have the option to visit this CO2 meter buying guide.

I, in addition to several homemade meters, have in the east room down here that has some additional things that make it a weather station:

Netatmo NWS01-EC Wireless Indoor Outdoor Weather Station With Wifi, Compatible with Amazon Alexa and Apple HomeKit
  • Control your indoor and outdoor environment in real time: indoor and outdoor temperature, humidity and air quality, indoor noise level, barometric pressure
  • Receive alerts in real time: with our weather station, configure indoor and outdoor alerts and receive notifications on your smartphone; you will know when to ventilate with the ventilation alert
  • Access your data remotely and with your voice: access your weather measurements with ease and at any time from your smartphone, tablet or computer, or by using your voice to interact with alexa on amazon echo or with siri thanks to the compatibility with apple homekit
  • Analyze the past: access the history of your data to observe what happens when you are not there or analyze the graphs to understand the weather trends
  • Foresee the future: check the 7-day weather forecast to adapt your clothing and your outdoor activities

📢 Do you have problems? CO2 meter faq

Although the project is really simple, there is always the possibility that you may have a question or that some kind of problem will appear.

In the list that you will see below, you have answers to solutions to a lot of things that you can ask yourself.

IMPORTANT: If you have any problem building your CO2 Easy, read this section.

The vast majority of doubts and problems that users have had are resolved in the following lines.

It is not that there are many things because of many problems (most are simple doubts and the problems are almost always the same, and almost always have to do with the charger or the USB cable), but because It has been built by hundreds of people and any little doubt that has arisen I have documented it so that if it happens to someone else it can be easily solved.

Here I leave you the Frequently asked questions made by users who have been encouraged to build the CO2 meter.

Share this article

Thank you very much for collaborating with the most difficult part of this project: SHARE IT AND MAKE IT KNOWN. It is useless how much I can work on these tutorials and projects if people don't get to know them. THANK YOU SO MUCH TO EVERYONE WHO SHARES!

Just below you have some buttons that will make it easy for you to share it on Facebook, Twitter, WhatsApp and Telegram.


📜 History of the eMariete CO2 meter

Here you can see the articles related to the CO₂ meter that I have published over the years (since the year 2017 when I published the first version meter).

In these articles you can find a lot of information to expand the meter with new functionalities, learn more, etc.

300 thoughts on “Un medidor de CO2 casero con Wifi contra el coronavirus: El CO2 Easy”

  1. Hello,

    Thanks a lot for providing all those tutorials to newbies like me 🙂

    I just ordered a Senseair S8-0053 and a NodeMCU CP2101 + OLED kit from AliExpress.

    The FAQ says that using an MH-Z19B sensor, "the meter consumes about 2400mA in 24 hours."

    How much would a Senseair S8 + NodeMCU use?

    For occasional use eg. leaving it on for a couple of hours at the movies or in a restaurant, would a 1,000mAh USB powerbank do? I'd like to avoid getting a uselessly big and heavy battery.

    Thank you.

    • Hi Gilles.

      In the following chart you can see the voltage discharge curve of a CO2 Easy with NodeMCU + Senseair S8 + OLED Display working on battery:

      As you can see it was working for approx. 16 hours on a 2700 mAh battery.

      With a 1000mAh USB powerbank you should get at least 4 or 5 hours, so plenty of time to go to cinema or to a restaurant (or maybe both 😀).

      Just take care as most powerbank doesn't meet the battery capacity the seller says (and state the battery capacity inside at 3.7V and not the powerbank's capacity at 5V, accounting for the voltage conversion and losses).

      Best regards.

  2. Congratulations on your work. For those of us who are struggling with the MHZ19b sensors it is great to have so much information gathered from this sensor.

    A greeting.

  3. Hi, I'm a super newbie to this topic. I would like to make a meter for the office (I am a covid tracker and not a meter has been given to us ...) and after seeing the videos and ordering the components I find myself with a great doubt. What type of cables do I have to use? The Sense8 came wirelessly and the truth is that I have no idea what to buy.

    Thank you.

  4. Hello. I am happy that I discovered and realized your project. Works perfect, but I need help for another step for full automation. I want to control a relay module with wi-fi ESP-01S to turn on a fan at 1500 ppm to inject air. How should such a system be set up?

  5. First of all thank you for this great job!
    I have a question to be able to access the data outside the home.
    I configured the access point of my mobile as the second wifi, and the connection is made since I see on my mobile that it appears to me as a connected device in my mobile access point.
    The problem is that now I don't know how to access the meter data. I put the same local IP as when I was at home (with my "fixed" Wi-Fi network to understand us) and it doesn't work for me. Does the IP change when connecting to a different Wi-Fi network?
    Thank you

    • Hello Jorge.

      Indeed, the IP can change each time you connect to a different Wi-Fi network, depending on the particular configuration of that network.
      The simplest thing, in a meter for this use, is that it has an OLED screen and that way you can see the IP on the screen itself.
      If you can't use apps like Fing.
      I think that, depending on the versions of Android, in some it tells you directly the IP of the connected devices.
      As a last resort, if you use Android, you can use an app like Hotspot Manager https://play.google.com/store/apps/details?id=com.codedstar.hotspotmanager

  6. The information published here is very useful and has allowed me to build the detector for my high school work (a NodeMCU and a SenseAir S8 LP), but nevertheless I am having problems with the sensor output values, it gives me values that are too high, of 2000 up in the open air and despite having been manually calibrated with bCal.
    What could be what makes you give these values?

    • Hi Jan.

      I don't know what the "bCal" you are referring to is, but the problem is probably due to an incorrect calibration.

      These sensors are very well calibrated at the factory and it is best to use the automatic calibration (ABC) of the sensor itself. If you do manual calibration you have to make sure you do it very well, following all the correct steps.

      I recommend that you calibrate again outdoors, carefully.

      A greeting.

  7. I really appreciate the information posted here on how to build the detector. I will try to build it where I live, in Chile. I have been lucky to find a store that has both the sensor and the board. I am waiting for them to come home to me. I would like to know if anyone could program the board using a Linux computer. I did some research and saw that there is a python script esptool.py that allows it, but for espeasy firmware:




  8. How can we know what the last thing you have updated on the blog is? For example, what did you change on 3/9/21?

    • Hi Josep.

      Unfortunately there is no detailed record of the changes.

      The most effective way is through the eMariete Telegram group because there I usually comment on the changes and / or additions that I am making. In many cases, these changes are also the consequence of a conversation that has taken place in the group or the contribution of one of the participants.

      A greeting.

  9. One of the best articles that I have found related to a homemade CO2 meter but with some rigor. The explanations can be followed by anyone with some basic notions, and although as you say at the beginning it is long, but not difficult. Seeing the recommendations of the already manufactured ones that you recommend from amazon I came across one like it in our friend Aliexpress that says it has an NDIR sensor -> https://s.click.aliexpress.com/e/_9jitPG, which for € 37 can be an excellent option. Any opinion?

    Thank you

    • Hello Paco.

      Thank you very much for your words.

      I don't know that meter first hand, I can't tell you. What I do know is that there are different versions.

      Of course, if you are going to buy it, I recommend that you do it on the manufacturer's home page, it costs 25 cents more and is much more reliable (with the explosion in demand for CO2 meters there are a huge number of false sensors). I have taken the liberty of changing the link to the one on the manufacturer's official website on AliExpress so as not to confuse readers.

      Of course, if it works well, it can be a great option.

      A greeting.

      • Thanks, well seen. Better to buy at the Winsen store. What I will do is buy it and then disassemble it to see what it has inside 🙂

        a greeting

        • Great. I would appreciate it if you keep us up to date. Maybe with some pictures of the interior?

          I'm sure a lot of people find it interesting.

          Thank you.

          • It would be missing more, I have already bought it. Upon reaching me I return to the blog and take detailed photographs to be able to analyze them since my knowledge of electronics is somewhat limited 🙂

  10. Hello,

    I connected a Wemos D1 Mini V3 - ESP8266 - CH340 and a MH-Z19C sensor as described in your article and flashed the file «ESP_Easy_mega_20201227_normal_ESP8266_4M1M.bin».

    After a few minutes, the D1 mini gives a wifi SSID ESP-DODAA8 without any security. When i connect, i get ip-address, but when i browse to, the connection is refused.
    The serial monitor shows
    B0 or B1 unknown
    Checksum incorrect; discarding data ...

    Any suggestion on what could be wrong or what I can do next?

    Best regards


  11. Good Morning! I have been encouraged to do the meter but the first in the forehead!

    I plug it in via USB and windows do not recognize any device, the only thing I see is a flash of a blue LED on the board every 10 seconds approx.

    Some clue

    • Hi Josep.

      Check in the section «📢 Do you have problems? CO2 Meter FAQ » the point called «The computer does not recognize the NodeMCU when connected»It is most likely a driver problem.

      If that doesn't solve it, head over to the Telegram group so we can help you.

      A greeting.

  12. Hello,
    I ordered the MH-Z19B on AliExpress and they sent me the MH-z19C. I have configured it following your instructions and it apparently works perfectly.

    Thank you very much for your instructions, everything is wonderfully well explained!

  13. Hello, I want to congratulate you on this project!
    I have a question, my nodeMCU does not give me the 5v in the VIN connector, after several attempts I measured the voltage and I get 0.2. I had to connect it to the VU. Would you know why

    Thank you!!!

    • Hello david.

      Is rare. The Schottky diode may be bad. Anyway, if your board has a VU pin, it is best to use that one, as it says in the article.

      A greeting.

  14. Hi, I really don't know where to start but say THANK YOU !!! for a million times it would fall short.
    I had been looking for a project like this for a couple of months and when I found it it was like a revelation. EASY, SIMPLE AND FOR THE WHOLE FAMILY!!! even an amoeba could do it thanks mainly to the enormous didactic work of the author with the blog complemented perfectly with the videos and with the contributions of Maneko for the configuration of thingspeak and Danimod for his design of the box which I will talk about more later.
    To begin with, comment that I bought the sensors in the link of the official distributor that Mariete recommended and they were received without problem and perfectly packaged, only without a connector cable, it is a pin version but as I will comment later for me it was not an impediment.
    Once I received the parts from aliexpress (sensor and NodeMCU module) the first thing I thought about was to change the connection system in order to be able to modify it in the future or to recycle both the sensor and the NodeMCU in other projects. Also my welding skills are nil and I did not want to spoil anything by welding it wrong. That is why I decided on Dupont connectors that simplify the wiring and allow you not to use the soldering iron.
    Once connected and always following the instructions, say that I had some setbacks when installing the drivers since they were not automatically downloaded (Windows 10).
    Next step is the printed box, in my opinion the emariete box is very well designed but due to circumstances I have a long-standing fight with the retractions and the design of the box made it unusable after 4 long hours of printing (I insist it is for me printer ). even so at 0.20 layer and 60mm / s seemed like an excessive printing time. Obviously the ventilation of that box is excellent and premium in design.
    However, the box designed by Danimod seemed perfect to me. I only retouched it to cover the hole in the screen and made it a little higher so that the Dupont connectors would fit correctly (I would attach photos or videos but I don't know if I can or do it here).
    Once the components are housed in the modified Danimod box, I feed it by usb and logically the next step is to accumulate the data in order to draw conclusions.
    For this, and following the excellent explanations of Maneko, I configure the thingspeak to start creating graphics.

    Thank you very much, the project has seemed super interesting and enjoyable. Above all, many thanks to Mariete for the time invested in creating a place in which to synthesize all the knowledge about this challenge of the economic and reliable CO2 sensor.
    Thanks for sharing!!!

    • Thank you very much, CONTRACOVID, for your words and for your fantastic analysis of the project!
      Undoubtedly very useful opinions, especially for those who have not yet taken the step out of fear of the project.

      I'm glad you already have it up and running.

      And now, don't stop the mess ...

      A greeting.

  15. Thank you very much Mariete! for the speed in answering, for the project and for keeping us entertained in this time of confinement!

    Thank you!!

  16. Good afternoon and thank you very much Mariete for this contribution. One question, in the SenseAir S8 LP that you advise, do you know if the cables come? In no photo appears and I see that they are necessary for the union with the NodeMCU.

    Thanks again!

  17. Hello, I am a professor at an IES and I think we are going to do this project with my students, my problem is that everything I buy must come on the invoice on behalf of the IES, my question may be silly, but I have found many sellers of amazon that do not give invoices ... the links you put provide official invoices? If you know one that does, could you pass it to me?
    Thanks a lot

    • Hello Francisco.

      The truth is that I have been asked several times, so I have included the question and the answer in the section «You have problems? CO2 meter faq", higher

      A greeting.

  18. Hello Mariete!

    Excellent tutorial! I have followed the steps of Maneko and integrated the data in Thingspeak, everything works "almost" well 🙂 I send the data of a MHZ-19B and a BME280 the problem every 60 seconds, the problem is that I do not know why there is data that shows them Wrong, that is, I see a value of 500ppm in the serial port of the wemos and in thingspeak it appears 28 ppm, then in other measurements it presents them well, but then it returns to mark rare values such as temperatures of 50 degrees etc.
    I don't know if I should specify something else in thingspeak, has something similar happened to you?
    I leave you a link to the channel where you can see clearly.

    Thank you very much in advance

    a greeting

    • Hi.

      It looks like there is some kind of "jumble" of data when sending it to Thingspeak.

      Please send me screenshots of the rules (delete the APIs for security) and the configuration of the sensors, to see if I see anything.

      Better in the Telegram group, if you can, it is much easier and faster than in the comments: https://t.me/emariete_chat

  19. Hello I think I had left this comment but it does not appear.
    The issue is where can I buy a detector in Aliexpres that is not very expensive and that is not fake

      • Excellent and very useful article, I have already recommended it in several forums.
        A small correction regarding the NDIR, and that is that the IR measures CO2 and H2O, and that is why some industrial / scientific models incorporate a humidity sensor to eliminate the part of the signal due to H20, but which is small and irrelevant for this use.
        A question from ignorance, why do you recommend the z19b instead of the z14a? The latter seems to have the optical "path" online and that in theory is much better.

        • Hi Anton.

          Thank you very much for your words and for sharing the article.

          In my opinion, in the margins in which we move and taking into account the end of these meters, really the effect of humidity in the measurements is not something that we should worry about.

          At the time I made this meter with the MH-Z19B because it was the one I got. Keep in mind that when I built the first one (about four or five years ago, there is an article in the blog from that date) it was not so easy to get these types of sensors nor were they so affordable.

          I've never heard of the MH-Z14A's online optical path. I don't know what you can refer to. If you have a link to an article with reliable information about this, I would appreciate if you share it. In any case, the project is perfectly compatible with the MH-Z14A if someone wants to do it with it.

          Regards, and thank you very much.

  20. Hello Mariete, I already have the components at home !!!, but the sensor has gotten me with a black plate and the colors of the cables do not match.
    I have configured it but it does not give me a reading (0,0,0), the sensor may be false and not working? Could you tell me how to identify the sensor pins? Let me explain, the diagram of the part below (5 + 5 pins) does match my sensor but when I check with the colors of the cables they do not match (eg Rxd: Yellow, Txd: Brown ...)
    Thank you very much for your great effort and your work

    • Hello Luis.

      Thank you very much for your words. 😀

      I guess you haven't read the blog post I wrote about fake sensors (it's called "FAKE MH-Z19B CO2 Sensors") and the accompanying video. In it I explain it in great detail.
      In the video I talk about the issue of cables, precisely. In which I received the color of the cables did not match either.

      Watch the video because it will be very informative.

      I put it all over the place, but I'm going to put it here in bold for everyone: At this time I do not recommend that you buy the MH-Z19B unless it is the one with the link that I put, from the manufacturer's store, but it comes in pairs. Better go on insurance and buy the Senseair S8 LP, even if it is somewhat more expensive (it is also more accurate and of better quality). These are the problems that the demand for CO2 sensors has skyrocketed.

      • Thank you very much for responding so quickly.
        I tell you, if I have read the post about the false sensors, I am clear that mine is, black plate and smooth upper part.
        What I find strange is that it does not take measurements, it gives me a red voltage light, but in esp it tells me that it does not detect it, I suppose you cannot think of any other test, right?
        If so, I will initiate the dispute and order the senseair that you recommend, to see if this time I am lucky..hehehehe. I really want to start seeing values 😉, I also have the screen, the buzzer… waiting, to mount it, I want to do it alloooo hahahaha.
        Thank you very much again for your time and congratulations on your blog.

        • Hello Luis.

          I was trying to answer the two questions you asked me in your original message:

          "Could the sensor be false and not working?"

          In this case, I was referring you to the article on false sensors because that is where you could see that your sensor was indeed false and that is where I am putting all the information that I am getting to know about false sensors.

          The other question was: "Could you tell me how to identify the sensor pins?" and you were referring to the colors of the cables.

          I told you to watch the video because that is where it is explained in detail and its correspondence can be seen in it.

          This image I just took from the video:

          In it you can see the correspondence between the colors between the correct and the wrong cable (the one that comes with the false sensor). This way you can make sure it is well connected. Of course, the ideal would be to check it with a multimeter (maybe not all fake sensors come with the same cable, and there are other color combinations), but if you don't have a multimeter, you can make sure with the images and explanations from the video (although the cable of your sensor is different from the one I used to make the video).

          From what we know so far, those sensors measure poorly, but give data, yes they do. So it is not that your mount does not detect the sensor because it is false, but that is there any additional problem and most likely it is a connection error (or that the sensor is simply damaged, of course).

          Maybe for these consultations it is more practical the Telegram group (https://t.me/emariete_chat), because there I can easily ask you to send me pictures of your cable, the connections or any other question or information that may help me.

          • Thank you, already on the Telegram channel. We are in contact there. I've finally gotten myself stock. 550 ppm in the street and 700-850 ppm in living rooms. Could they be good? I will check it, although the temperature is very high over 33 ° thanks

            • I'm glad that I already gave you values, but, I am very afraid that, being a sensor with a black plate, the values are far from reality.

              Temperature is the least of it (it is an undocumented internal value).

  21. Hello, I want to order an MH-Z19B, but I have a sea of doubts about what you say about counterfeits. There is a site in Aliexpres that is reliable and that is not very expensive, I have seen some "About € 15" but I do not know if they are reliable

    • Hi Ernesto.

      I am putting the links to the providers that seem to me to be trusted, from my own experience or the information provided by the users.

      I think all the MH-Z19Bs that go for € 15 are fake. The original MH-Z19Bs are more in the range of € 18 to € 22, they have risen quite a bit in recent weeks due to the increase in demand.

      The MH-Z19C are somewhat cheaper, but they are a bit delicate with the 5V supply (it has to be very precise and it is not so easy to obtain without adding additional components) so, at the moment, I do not recommend them to people "usually".

      At this time my recommendation would be to buy the Senseair S8 sensor, which for three or four euros more has several advantages, or buy the original MH-Z19B in the official Winsen store (what happens is that you have to buy two units, not the they sell one at a time right now). Both links to buy them are on this page.

  22. thank you…. One more doubt, to complete the meter, would it be possible to implement a dht 11/12 sensor in the assembly, to be able to measure room temperature?

    a greeting

    • Hello Jose.

      Yes you can, and it is also very easy.

      I am waiting for a DHT22 that I have ordered to do and document it (the DHT11 / 12 are almost the same as the DHT22, I will comment on the differences to do it with any of them).

  23. a mariete doubt ... how can you put the results of the CO2 measurement in several lines of the oled screen so that the ppm value is larger?

    thank you

  24. Hello again, Everything was fine but now you can't run ESP Easy, because in "COM port Plese wait while scanning", it just stays there and doesn't detect any port, I keep thinking about it and nothing, I have even reinstalled windows. But there is no way, before if it worked but now no port appears

  25. good, a doubt…. In your article do you expose to which via telegram the measurements of the meter could be sent ??? How would this be possible?

    • Hello Jose.

      I have yet to do a tutorial on this topic. I have not removed it yet because to send messages by Telegram you have to connect with its API through SSL (https) and ESPEasy does not support this type of connection. I used to use a proxy service on the internet that allowed to solve this limitation, but either it no longer exists or I have not been able to find it again.

      Maybe some user knows a proxy service that allows it and can share it with us.

      I currently do it with Node-red, which I have running on a Raspberry Pi, but, of course, it is a solution that requires something more than ESPEasy.

    • Hi.

      This device does not have an ESP8266 but an ESP32 so it would not be valid directly.

      There is a version experimental ESPEasy for ESP32 but it would have to be tested because as it is experimental there is no certainty that it will work with all boards or with all sensors and other peripherals.

      If you want to experiment, it may be very good (leave us a message later, telling us how it went), otherwise I recommend that you play it safe and use a plate with ESP8266 (there are them with an integrated display, like this one https://s.click.aliexpress.com/e/_9fYNJZ or this one https://amzn.to/3bQsRDs but I have not tried them to do this project).

      • Thank you very much, I will follow your original project and comment on the results, that if I will mount it on a breadboard, and make connections without tinning. I do not have a 3 d printer

  26. Hi.
    Thank you very much for this tutorial. It is the first time I have done an electronics project and it has been very easy thanks to your explanations. It works perfectly and sending the data to ThingSpeak, it is very interesting to download it and draw your own graphs. I was thinking of adding a humidity and temperature sensor to have a more complete monitoring of the living conditions and to be able to better manage the ventilation of the rooms. I have seen sensors of this type, specifically the BME280 and DHT22. But I have no idea which sensor is more suitable and I suppose there will be other options. I would like one that is accurate, what humidity sensor would you recommend? On the other hand I will also put an oled screen following your tutoring in this regard. Thank you very much again for the work you do, you get rid of the fear of messing with these pots and we think about doing our own projects.

    • Hello Raul.

      Thanks a lot. I'm glad it worked perfectly for you and that it was easy for you! 😀

      On the temperature and humidity sensors, I have yet to write a series of good articles, in depth, on the main sensors. I don't think it will take long to do it.

      If I anticipate you, about the BME280 that has a problem and that is that the sensor heats up a bit and usually gives slightly high values (1 or 2º above the real temperature). It can be compensated for by software, up to a point, but it wouldn't be the one I would recommend when you don't want to complicate your life.

      To measure temperature, I use, almost exclusively, the ds18b20. It's small, cheap, easy to use with ESP Easy, accurate enough (± 0.5 ° C), it provides measurements to one or two decimal places. The temperature range is -10 to 85 ° C so it must be taken into account if it is to be used outdoors and where (if it is in a place where the temperature can drop below -10ºC it is not recommended).

  27. Sorry Mario, the link of the sensor you have put is from an MH-Z19C, I have asked the seller (Shenzhen) and he confirmed it. I can't find a link to the MH-Z19B on this page or in the "Bible" page. Do you have someone you trust to send the green one and not the black one? Is the version with pins instead of cables supposed to be good too?

    • Hello Jose.

      Thanks for the warning. I think the seller has changed the item from MH-Z19B to MH-Z19C (if you look closely, it still has the product images of the MH-Z19B although later, in the description, there are photos of the MH-Z19C).

      I have removed the link, for now, and I am waiting to do a good analysis of the providers that exist right now because some, which were trustworthy, are no longer so. Let's see if between today and tomorrow I can do it.

      At this time, I would recommend anyone using the Senseair S8 LP (recommended to have a multimeter, as I say in the article, to measure the supply voltage, which is less than 5.25 volts) ..

        • Indeed, it is practically the same. The connections are the same and you only have to select in ESPEasy that the device is a Senseair instead of an MH-Z19.

          I will add to the article with the details, showing how to use the Senseair instead of the MH-Z19B, but it is almost the same.

      • Hello, thank you very much for answering so quickly, I have solved the issue by entering the IP that appears by pressing the button on the Left, the problem is that I have not received the sensor. Would it be possible to connect the MQ 135 detector that I have in the meantime?

        • Hi Ernesto.

          I'm glad you made it.

          As far as I know, ESPEasy does not support the MQ-135 sensor. You would have to write your own plugin if you wanted to use it.

          However, keep in mind that the MQ-135 detects a lot of things, all at once. You really don't know what you are detecting so it does not serve as a CO2 meter. It can be used to warn you that there is "something" in the air (like someone has lit a cigarette) but not more. In other words, it gives you an idea of the air quality, but since you do not know what it is detecting or if it is something important or not, or in what proportion ...

          That said, there are many projects with MQ-135 on the internet. I think the easiest thing is for you to follow one of those projects, which are designed for that sensor.

  28. Hello again,

    I have two NodeMCU v3 lolin, yesterday I got something to work, but now the ESP-EASY access point does not appear in the WIFI networks, I flash them both but nothing. I attach the log.

    ######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 \ FRAN \ Desktop \ CO2 Meter \ bin \ ESP_Easy_mega_20201130_normal_ESP8266_4M1M.bin"]
    [01/11/2021 18:34:30] esptool v0.4.12 - (c) 2014 Ch. Klippel
    [01/11/2021 18:34:30] setting board to nodemcu
    [01/11/2021 18:34:30] setting baudrate from 115200 to 115200
    [01/11/2021 18:34:30] setting port from to COM3
    [01/11/2021 18:34:30] setting address from 0x00000000 to 0x00000000
    [01/11/2021 18:34:30] espcomm_upload_file
    [01/11/2021 18:34:30] espcomm_upload_mem
    [01/11/2021 18:34:30] setting serial port timeouts to 1000 ms
    [01/11/2021 18:34:30] opening bootloader
    [01/11/2021 18:34:30] resetting board
    [01/11/2021 18:34:30] trying to connect
    [01/11/2021 18:34:30] flush start
    [01/11/2021 18:34:30] setting serial port timeouts to 1 ms
    [01/11/2021 18:34:30] setting serial port timeouts to 1000 ms
    [01/11/2021 18:34:30] flush complete
    [01/11/2021 18:34:30] espcomm_send_command: sending command header
    [01/11/2021 18:34:30] espcomm_send_command: sending command payload
    [11/01/2021 18:34:30] read 0, requested 1
    [01/11/2021 18:34:30] trying to connect
    [01/11/2021 18:34:30] flush start
    [01/11/2021 18:34:30] setting serial port timeouts to 1 ms
    [01/11/2021 18:34:30] setting serial port timeouts to 1000 ms
    [01/11/2021 18:34:30] flush complete
    [01/11/2021 18:34:30] espcomm_send_command: sending command header
    [01/11/2021 18:34:30] espcomm_send_command: sending command payload
    [01/11/2021 18:34:30] espcomm_send_command: receiving 2 bytes of data
    [01/11/2021 18:34:30] espcomm_send_command: receiving 2 bytes of data
    [01/11/2021 18:34:30] espcomm_send_command: receiving 2 bytes of data
    [01/11/2021 18:34:30] espcomm_send_command: receiving 2 bytes of data
    [01/11/2021 18:34:30] espcomm_send_command: receiving 2 bytes of data
    [01/11/2021 18:34:30] espcomm_send_command: receiving 2 bytes of data
    [01/11/2021 18:34:30] espcomm_send_command: receiving 2 bytes of data
    [01/11/2021 18:34:30] espcomm_send_command: receiving 2 bytes of data
    [01/11/2021 18:34:30] Uploading 910944 bytes from C: \ Users \ FRAN \ Desktop \ CO2 Meter \ bin \ ESP_Easy_mega_20201130_normal_ESP8266_4M1M.bin to flash at 0x00000000
    [01/11/2021 18:34:30] erasing flash
    [01/11/2021 18:34:30] size: 0de660 address: 000000
    [01/11/2021 18:34:30] first_sector_index: 0
    [01/11/2021 18:34:30] total_sector_count: 223
    [01/11/2021 18:34:30] head_sector_count: 16
    [01/11/2021 18:34:30] adjusted_sector_count: 207
    [01/11/2021 18:34:30] erase_size: 0cf000
    [01/11/2021 18:34:30] espcomm_send_command: sending command header
    [01/11/2021 18:34:30] espcomm_send_command: sending command payload
    [01/11/2021 18:34:30] setting serial port timeouts to 15000 ms
    [01/11/2021 18:34:30] setting serial port timeouts to 1000 ms
    [01/11/2021 18:34:30] espcomm_send_command: receiving 2 bytes of data
    [01/11/2021 18:34:30] writing flash
    [11/01/2021 18:34:38] …………………………………………………………………….. [ 8% ]
    [11/01/2021 18:34:47] …………………………………………………………………….. [ 17% ]
    [11/01/2021 18:34:55] …………………………………………………………………….. [ 26% ]
    [11/01/2021 18:35:03] …………………………………………………………………….. [ 35% ]
    [11/01/2021 18:35:12] …………………………………………………………………….. [ 44% ]
    [11/01/2021 18:35:20] …………………………………………………………………….. [ 53% ]
    [11/01/2021 18:35:28] …………………………………………………………………….. [ 62% ]
    [11/01/2021 18:35:37] …………………………………………………………………….. [ 71% ]
    [11/01/2021 18:35:45] …………………………………………………………………….. [ 80% ]
    [11/01/2021 18:35:53] …………………………………………………………………….. [ 89% ]
    [11/01/2021 18:36:02] …………………………………………………………………….. [ 98% ]
    [11/01/2021 18:36:03] ………. [ 100% ]
    [01/11/2021 18:36:03] starting app without reboot
    [01/11/2021 18:36:03] espcomm_send_command: sending command header
    [01/11/2021 18:36:03] espcomm_send_command: sending command payload
    [01/11/2021 18:36:03] espcomm_send_command: receiving 2 bytes of data
    [01/11/2021 18:36:03] closing bootloader
    [01/11/2021 18:36:03] flush start
    [01/11/2021 18:36:03] setting serial port timeouts to 1 ms
    [01/11/2021 18:36:03] setting serial port timeouts to 1000 ms
    [01/11/2021 18:36:03] flush complete
    [2021-01-11 18:36:03] DONATE!
    [2021-01-11 18:36:03] The COM port was already in use… the post-flash did not complete.
    [2021-01-11 18:36:03] JOB COMPLETED, over and out!

    I have reset both with the physical method of the TX RX cable and also in the Arduino IDE and nothing. If it has happened to someone and they have the solution, I would appreciate your help.


    • Fran something similar has happened to me. But I have not found any solution. I also reset it with the TX-Rx cable attached. It worked well for me, but I wanted to change the network and it was impossible, it detects the ESP Easy Access point but when entering an impossible password, it tells me that the password is incorrect. So I can't get it to connect to any Wifi network.

      • I have two NodeMCU lolin V3 with CH340, I have configured them as an access point with arduino and the other through arduinoblocks for a humidity sensor, no problem with the access point appears immediately in the list of wifi networks, but with esp easy there is no way, I have downloaded the full esp and not even with those. The plates work fine but something is wrong with the esp easy. If anyone has the solution I would be very grateful.

        • Good Francisco Javier, I have the same problem, the ESP 8266 works well with the Arduino IDE but not with the ESP Easy, the first time I connected it I did it without problem but wanting to change the network impossible.

          • Let's see if we can go a little further with this to give you a solution ...

            What comes out of the ESPEasy serial port when it boots up? That may be the key to the problem.

            You can use any serial port terminal like the Arduino IDE itself for this.

        • In the arduino serial monitor I get the following data:

          INIT: Booting version: mega-20191130 (ESP82xx Core 2_6_1, NONOS SDK 2.2.2-dev (38a443e), LWIP: 2.1.2 PUYA support)
          72: Info: INIT: Free RAM: 32656
          73: Info: INIT: Warm boot #2 Last Task: Background Task - Restart Reason: External System
          75: Info: FS: Mounting…
          100: Info: FS: Mount successful, used 75802 bytes of 957314
          488: Info: CRC: program checksum… OK
          498: Info: CRC: SecuritySettings CRC… OK
          604: Info: INIT: Free RAM: 29496
          606: Info: INIT: I2C
          606: Info: INIT: SPI not enabled
          696: Info: INFO: Plugins: 46 [Normal] (ESP82xx Core 2_6_1, NONOS SDK 2.2.2-dev (38a443e), LWIP: 2.1.2 PUYA support)
          800: Info: WIFI: Set WiFi to STA
          833: Info: WIFI: Connecting ONO6C1E attempt #0
          2458: Info: WD: Uptime 0 ConnectFailures 0 FreeMem 25384 WiFiStatus 6
          4788: Info: WIFI: Connected! AP: ONO6C1E (DC: 53: 7C: 20: 46: 0E) Ch: 1 Duration: 3752 ms
          6670: Info: WIFI: DHCP IP: (ESP-Easy-0) GW: SN: duration: 2062 ms
          6675: Info: Webserver: start
          6676: Info: firstLoopConnectionsEstablished
          32169: Info: WD: Uptime 1 ConnectFailures 0 FreeMem 21440 WiFiStatus 3
          62169: Info: WD: Uptime 1 ConnectFailures 0 FreeMem 21440 WiFiStatus 3
          92169: Info: WD: Uptime 2 ConnectFailures 0 FreeMem 21440 WiFiStatus 3
          122169: Info: WD: Uptime 2 ConnectFailures 0 FreeMem 21440 WiFiStatus 3
          152169: Info: WD: Uptime 3 ConnectFailures 0 FreeMem 21440 WiFiStatus 3
          182169: Info: WD: Uptime 3 ConnectFailures 0 FreeMem 21440 WiFiStatus 3

          Here I get lost enough, I would appreciate your help.

          Greetings and thank you

          • It is true, the access point does not appear in the list of wifi networks but with the ip address the esp easy appears. Thanks a lot..

            • The access point created by ESPEasy is temporary, it appears only so that you can connect to it to configure the Wifi network (enter SSID and password). Once you connect to the wifi network the access point disappears.

  29. Good Mariete,

    First of all, I would like to thank you infinitely for the work (discovered through Menéame) behind this project: I have made the meter work!

    And I have achieved it from absolute zero, no idea of electronics or any of this. Even though I studied it in college, I'm a black-legged jerk.

    It has not been easy and I would like to point out a couple of problems that I have had in case some other followers of yours can be useful.

    First of all, silly, the computer did not detect ESP when connecting it. Not waiting half an hour. Solution: manually download the drivers. Google is your friend, this problem was easy to solve but perhaps it would be convenient to indicate it in your tutorial.

    The second, the ESPEasy recording program did not work for me: it froze, I executed it, it detected the ESP, all good, but when you click on "record", don't ask me why, because I don't know yet, but the subject is that she was left hanging without doing anything with the 105 second message (waiting much more than the famous 105 seconds). I solved it directly by putting the complete recording command that I took from the log in a cmd window "bareback" in the executable directory. This was a bit more troublesome.

    The third is more relevant and is related to the sensor: it can even screw up the project for many people. The point is that even though I bought the MH-Z19B, after many dizziness with the aliexpress seller, he sent me the MH-Z19C. It is physically different ... but also electronically, as you will see. I tried to assemble the circuit with the tutorial, but instead of soldering I did it with a breadboard that I had also bought for fretting (I am very new to this). The point is that after having connected everything ... it did not work well. The red light was blinking. Values came out, I even connected them to Thingspeak with the partner's tutor. But the values were very unstable: they jumped 50 or more PPM up and down, and the temperature did not add up either. It came out 2 or 3 degrees less than the real thing.

    Total, I thought they had put a fake on me and it bothered me a lot ... until I saw the 19C sheet. It turns out that there is a substantial difference between the 19B and the 19C in electronics: while the 19B works by powering it with 5V + -0.5 (from 4.5 to 5.5V), the 19C needs 5V + -0.1 (from 4, 9 to 5.1V). Also at the end of the sheet he insists that if the voltage is not in that range ... the measurements become UNSTABLE. I looked at what the ESP was giving it on the Vin / GND… et voila, 4.57V. Insufficient.

    I have been documenting myself and it turns out that the ESP is unable to give 5V. The Vin / GND is to supply it with "unregulated" voltage between 5V and 12V. But not to get 5V out of there. In fact, the power supply when connecting with micro USB is a by-product, not a specification. In fact, in any project that needs 5V (motors), you need a specific power supply, you can't pull Vin (from what I've been reading). With the MH-Z19B you are lucky because its input range is wider (although it is so close to the limit that it is almost certain that it is not working for some and it comes out jumping values), but not with the MH-Z19C.

    When buying the breadboard came a feeder. I connected the MH-Z19C to 5V (by the way, it gives 4.92V, a little low) and… BINGO, everything perfect:



    By the way, what are the boxes you buy 10 by 10? I can't 3D print anything, but you mention those boxes a couple of times but don't say what they are. you can tell me?

    (Note: I am going to copy the voltage of the MH-Z19C in the sensor's "bible" in case anyone needs it)

    • Hello Jesus.

      Thank you very much for your words and for the comment you have written, full of really interesting information.

      I have updated the section with your contributions and suggestions "You have problems? CO2 Meter FAQ " with the following:

      The computer does not recognize the NodeMCU when connecting it (possible problem of lack of drivers)
      I'm having trouble with my MH-Z19C sensor (possible problem with sensor supply voltage)

      I have also added a clearer notice, although I had already said it in a comment before, so that people do not buy the MH-Z19C inadvertently (at least for now). This project is made for the MH-Z19B (and now that I have already tried it first hand, also for the Senseair S8 LP, which is the one I would recommend to anyone right now).

      Regarding the voltage provided by Vin:

      I have spent a long time trying to reply to the message, but the more I wrote, the more I had to write because it is a complex subject.

      In the end, I have decided to write a complete article about it, which will be, I hope, in a few days (I am already very advanced in text, although I want to put photos, diagrams, graphics and some practical tests).

      In summary (I will develop it in the article): YES peripherals can be connected to the Vin pin without any problem in most cases (the MH-Z19C can be one of those exceptions, I'm still with it).

      Regarding what you ask me for the boxes, I have included in the article the link to the type of box that I buy (not from the same seller, because I can't find him), although there are many to choose from.

      Greetings and thanks for everything. I hope you keep contributing, it's very interesting.

      • Thank you. I look at the boxes!

        And, hey, sure you can connect things to the Vin, but keeping in mind the requirements of what you connect… And the 19c sadly is not one of the things you can put there.

        I will try to get a senseair, especially considering that the AliExpress dispute has gone well and the 19C has been free. Things that happen. I don't know about the 19C ... Since you surely have one, can you compare it with the 19B in terms of measurement reliability?

        • Hello Jesus.

          The first version is already ready "presentable" from the article on «Feed things from the Vin» (It was difficult to give it a title). It's called "Power from NodeMCU, Wemos Mini D1 and Arduino." I want to complete it with a few more things and change the structure a bit, but it's late and I'm tired (and I have to get up early tomorrow), so I've decided to publish it like this and I'll improve it later.

          I don't have an MH-Z19C to be able to make measurements and buy it with the MH-Z19C and the Senseair S8, unfortunately. I trust that, being new, for now there are no false copies as is happening with the other.

  30. I want to thank you for all the work you have given yourself, the amount of information, and the detail of the process, even with the faqs, I have made the project very simply thanks to all your instructions.

    Thank you!

    • Thank you very much, Zirpin.

      Your words are greatly appreciated. 😀

      I'm really glad that it was easy for you to build and that it works for you the first time.

  31. Hello!
    I keep getting sensors from blacks, I have found this article in which they talk about their inaccuracy


    Do you know of an AliExpress link that you are getting green?

    I think that may be the reason for my low measurements.


    • Hello Jose.

      The link you indicate is in the entry «The MH-Z19B CO2 Sensor Bible«.

      I am writing an article on fake sensors. Fortunately or unfortunately (I say «luck»Because you are allowing me to write this article), I received one of these fake sensors a few days ago and, since I have several CO2 sensors, trustworthy, has allowed me to make some comparisons that I will share with you in this article. I'm writing about things like how to avoid buying a fake sensor? How to identify a fake sensor if i already have it? How do I return a fake sensor that I have been sold?

      The link out there right now is supposed to be good.

      Every time I change the link I spend a lot of time before comparing and checking. The problem I am seeing is that apparently the same sellers who ship the original sensors, occasionally ship fake sensors (the one I received with the black plate is from a seller that I have had put on this page and who shipped sensors original).

      The good thing is that you open a dispute and, at least in my case, AliExpress fails in your favor and returns the money (it took me less than 24 hours). In the article I will also give some guidelines to open the dispute and claim a refund.

      • Thanks Mario, in my case I have opened two disputes and they have returned my money, let's see if I'm lucky and I get a green one.

        a greeting

    • I have a half video / article on just that. I hope to get it out in a few days.

      Anyway, I'm finishing another one about a 3D printed box where I also talk about how to add LEDs, and this one I will upload before because it is almost finished (maybe tomorrow or the day after).

  32. I confirm, the connections are fine, everything you connect on that board does not turn on, I do not have to test but everything points to that. Thank you

  33. Hi, I have managed to carry out the project, without problem, but now I would like to take the detector to another place with a different wifi. How do i have to do it? Do you have to redo the whole process from the beginning?
    It is that I have tried to change the wifi network and the password in Esp Easy and it has not caught me. That is, I went into config and changed the name of the Wifi network, the WPA Key and the WPA AP Mode Key (which I put the same as the previous one), but it has not worked for me.
    And this has generated a second problem for me since when trying to return to the previous configuration I have flashed the board again, but when I enter the password of ESP Easy: configesp does not allow me to configure a Wifi network since it appears on the computer «it is not It is possible to connect to that network »and with the mobile phone does not appear to touch to log in. I have entered the password correctly. What am I doing wrong?

    • In the configuration you can put a second wifi network (Fallback SSID and Fallback WPA Key) to which it will try to connect.

      However, if when it starts up it does not find the Wi-Fi access point that it has configured, it will activate in access point mode so you can configure it again.

      Regarding what happens to you now: Towards the end of the article, in the section «Do you have problems? CO2 Meter FAQ »You have some possible solutions. One of the points is "I connect to the ESP-Easy access point, but I enter the password configesp and it does not connect", which is exactly what happens to you:

      Sometimes you have to enter the password more than once (two or three times) until it connects.

      If you have already tried several times, you may have to reset the ESPEasy. For it:

      1. With the NodeMCU off, make a bridge between TX and RX with a small wire
      2. Turn on the NodeMCU (connect it to USB) and wait fifteen seconds
      3. Turn off the NodeMCU and remove the cable that you have put between RX and TX

      With the above procedure the ESPEasy should have returned to its initial configuration.

      Note: Rereading, I think it does not accept the configesp key because you have put another one in "WPA AP Mode Key". Try that one.

      • Good Mario I reset it but it has not helped at all. I have entered the password «configesp» a lot of times, not only from my mobile but from my pc and there is no way to display the screen to select the Wifi to which I want the ESP to connect. I have flashed it again and neither. The truth is that I don't know what happens.

        • Hello Jose.

          Check everything well. It is rare that neither flashing nor resetting is solved. Yes, once everything is reviewed, the same thing continues, I am inclined to think that the module is wrong.

          • It is rare that the module is bad, since I have been using it before without problem. Even the Arduino IDE recognizes it to me well. The truth is that I can't think of anything else.

    • Hello Pepe. The same thing happened to me, it was not detected by the software and the red light did not turn on either. I thought it was a matter of connections (I have not done soldering yet). I connected it to VU and now the red light has turned on and it is giving values (yes, 550 and 50, so I'll wait to see if it stabilizes).

      My sensor seems to be one of the fake ones, because it has the black plate, but let's see how it works. I would like to link it to one of my SDS011 particle sensors.

      Thank you!

      • Thanks for the contribution, Pepe and Silvia.

        The problem is that not all NodeMCUs have the VU pin (of which I have none). Anyway, I'm going to put a note so that whoever has it can take advantage of it.

  34. Good night, Emariete and company

    I'm stuck, I'm very stuck I've been fighting for a week and I can't get out of the loop I'm in, I'll explain to you I have a nodemcu esp-12E ch340 and following your instructions I haven't had any problem in the absence of putting it in its box, now another A nodemcu esp-12F ch340 (one 12E another 12F) and I don't get anything, but nothing is NOTHING, no mh-z19B or C sensor recognizes me, the log always tells me MHZ19: Unknown response: 0 0 0 0 0 0 0 0 0 there is no difference if I connect it or not, I have tried exchanging the TX and RX cables, with the same result, the meter light never turns on, more things, I connect the oled and it does not turn on or do anything but I look for i2c scan and it recognizes it, but there is no way to flash it, I do the RX and TX bridge as you indicate but without soldering with a dupont cable and I can't flash it there is no way, I'll tell you about all this in case there was a solution or I'll give it directly hammer, I imagine 2 nodemcu CP2102 will arrive this week. Thank you

    a greeting

    • If the meter light never comes on, there is most likely an error with the 5V supply.

      The meter light should come on every 5 seconds.

      Check all the connections well.

    • Hello Jose.

      It seems a bit high to me but nothing has to happen. Do you have the sensor enough airy?

      Please note that the temperature sensor is only for internal use of the sensor, to be able to make the compensation of the measure. Its use is really undocumented by the manufacturer and we are using it based on reverse engineering of the possible commands and responses (come on, it's a hack).

      If you turn off the sensor for a while, to allow time for it to cool down, and turn it on again, does it give you a lower value for the first few measurements? Yesterday I left a sensor outside for a self-calibration test (the minimum that was outside my house tonight was 1ºC) and the measurement that the sensor gave was 8ºC. That same sensor is now in a room at 23ºC and gives a measurement of 27ºC.

      I wouldn't worry if the CO2 measurements it gives you are «reasonable«.

      • Well, in principle it ranges from 38-41 always, even if it turns off.
        It is aired, in several rooms, it ranges from 480-600 ppm, in the absence of calibration, that anyone now comes out with the storm that does hahaha.

        I will be observing and I will comment on anything.

        Thank you!

        • They seem to me to be very low measurements for normal rooms in a normal house.

          The truth is that, as much as the CSIC, the WHO and everyone you want, advise maximum values of 800-1000 ppm, that is incredibly hard to come by, and you don't realize it until you have something to measure it by.
          In companies, with more or less modern offices, things change, but in normal houses where we are careful to maintain the temperature, so that the heating bill does not go off, and where we do not usually have active ventilation systems, things change.

          Look, for a reference, these are the readings of the last 24 hours in my living room:

          Netatmo Salon CO2 measurements

          If the measurements of 480-600 ppm that you comment are from normal rooms, with people, and without forced or permanent ventilation (windows permanently open), I would say that there is something wrong.

  35. Would it be possible to add a buzzer to the project to warn us when a certain level of CO2 is exceeded?
    Currently I am using the Widget indicated by ManeKo, which allows to put warnings whether a high or low level is exceeded, in this way it tells me to open the window and then to close it. It is very good, but it requires that the sensor be connected via Wi-Fi, if a buzzer could be put it would be totally autonomous, more suitable for some situations and for people who are not used to handling this type of thing.
    This home automation and all this world of IoT is hooking me.
    Thank you.

    • Hello Zulu.

      Of course it can be added, and the good thing is that it is super easy!

      I am writing the article and recording the video for the control of colored LEDs, to have visual warnings, but, as soon as I have it finished, I put the buzzer to have audible warnings.

      I'm glad that you like the world of home automation and IoT. The truth is that I am very hooked! 😀

      • Thank you very much, I have already seen it and am working on it, but unfortunately the buzzer I have does not work for me, for something I had it at the bottom of the drawer. :-))
        But since I found a BM280 pressure and temperature sensor out there, I managed to put it in the I2C port along with the OLED screen. Now I just need to send that data well to Thingspeak to be able to add it to the mobile Widget, at the moment I am fighting and I have not succeeded, as soon as I put another field, the whole channel is deconfigured, I have to study it in more depth.
        As for the buzzer, I'm waiting for a colleague to pass me one that he has unused while the ones I just ordered on Aliexpress arrive.

        • Hello Zulu.

          There are several types of buzzer and for it to work well it has to be a passive buzzer module.

          I'm glad you included the BM280 sensor without problem.
          Adding it to Thingspeak shouldn't be a problem. You only have to change in the ESPEasy rule, where it says Field1 for Field2 and Field3.

          If the line to send the CO2 is: SendToHTTP api.thingspeak.com, 80, / update? Api_key = tu_api_key &field1= [DeviceNameMHZ19B#PPM]

          You have to put, for the temperature: SendToHTTP api.thingspeak.com, 80, / update? Api_key = your_api_key &field2= [DeviceNameBM280#VTemperature Value]
          And for humidity: SendToHTTP api.thingspeak.com, 80, / update? Api_key = tu_api_key &field3= [DeviceNameBM280#VHumidity Value]

          • Hello,
            I have already managed to send the three sensors through the rules, from the Thingspeak menu there was no way.
            As in each widget of the phone you can only put 2 sensors I have created another widget so I can receive the sensors I want.
            Thank you very much for your indications.

  36. Hi.
    Interesting project that I have been looking at for a few days because I am currently working on another for a meter for PM 2.5 and PM 10 pollutants, as well as temperature, pressure and humidity from the Sensor Community association: https://sensor.community/fr/sensors/airrohr/ .
    In this particle meter the NodeMCU ESP8266 is also used in V3, but it has the pins already soldered to directly connect the cables without soldering ... and is that reading the previous comments, I think someone tried to use this model, but I did not It is clear if it helped them to make the meter work correctly or if you have to use the NodeMCU without welding indicated in the tutorial.
    As I have read that in some cases it is difficult to install the firmware in the nodeMCU, I take the opportunity to comment that in the particle meter project they indicate that a USB cable less than 1 meter in length is used for this operation
    Thanks for the response and greetings from a new initiate in these gimmicks.

    • Hello Llorinte.

      The project is very interesting. I have it on the to-do list to expand the CO2 meter and make it a air quality monitoring station. As soon as I can I get on with it.

      I have not seen the NodeMCU for sale with the pins already soldered in a long time. In any case, and answering your question, you can use the NodeMCU with or without soldering without problems and in both cases it will work correctly. Soldering the pins is very simple and takes five minutes.

      Indeed, the quality of the USB cable is important. In my experience, not so much the length of the cable, but its overall quality. Unfortunately, there are very low quality cables out there ...

  37. Good Morning!

    I'm very excited about this project, I haven't been messing around for a long time and it's hooking me hehe.

    I already have the screen on the way to add it when it works.

    I have the problem that it marks zero in all parameters.

    Yes, the red led turns on, but the sensor does not appear as «detected».

    To say that I have done it with the MHZ of the Amazon link, which must be the false one, because it is the black plate and I had to follow the cables with the multimeter because they did not match me. Can I claim Amazon? I have two from Aliexpress on the way, hope it's the green ones :)

    Besides, the esp easy is the ch340, I have the "good" on the way ...

    The log that appears to me is this, in case you could tell me what you see strange, I have no idea ...

    526537: MHZ19: Unknown response: 0 0 0 0 0 0 0 0 0
    541538: MHZ19: Unknown response: 0 0 0 0 0 0 0 0 0
    541539: MHZ19: Init OK
    544332: WD: Uptime 9 ConnectFailures 0 FreeMem 19752 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init
    556843: MHZ19: Unknown response: ff 0 0 0 0 0 0 0 0

    Do I try to flash again or wait for the green sensor to arrive?

    Thank you!

    • Hello Jose.

      When it gives all zeros, it is usually because it does not detect absolutely nothing sensor, it is as if it is not connected.

      First of all, check well the connections to the RX and TX pins of the NodeMCU (and feed it with a mobile charger, not from the PC, to rule out conflicts with the computer's USB) and make sure that the configuration of the ESPEasy serial port, is exactly the same as the one that appears in the video.

      If all this does not work, there is another option: Make the NodeMCU use a serial port «software emulated«, Instead of the hardware port. You have the instructions in the section «You have problems? CO2 meter faq»At the end of the article, before the comments.

      If it doesn't work for you either, flash it again to see if you're lucky.

      I know that quite a few people are building the meter using the CH340 chip NodeMCU and the black plate MH-Z19B sensor and they are working.

      Come on, we are sure to solve it! Unless something is really broken, of course ...

      • I have tried everything, and in the end, I have managed to work with the option to emulate the serial port by software.

        EUREKA !!

        Thank you very much Mario !!

        Now I'll get to the screen when I arrive, and if you dare, the Swedish sensor 🙂

        • Hello Jose.

          Great, that you managed to make it work, I was sure!

          I have already decided that I am going to post a version of the CO2 meter with the Senseair S8 LP sensor, and in fact I have already started working on it. There will be news shortly. 😉

          I've written two emails in the last few days to the folks at Senseair, but they still haven't answered me. In any case, I will advance in the project, with them or without them… 🤞

  38. Wonderful tutorial Mariete,


    I'm fighting because after not having readings and checking connections, now I can't connect to the ESP-easy access point ("check password. And try again ..." configesp ... and there is no way). Any suggestion?

    a greeting

    • Hi Nando.

      You may have to restart the ESPEasy. In the FAQ section, at the end of the article, you have the instructions to restart it.

      If that doesn't work for you, you will have to flash it again.

  39. Very good Thank you very much for the tutorial. I have done everything and when configuring the MH-Z19 it does not give me any value ... I have checked all the wiring and I do not see anything strange ... what could it be?

    • Hello Santi.

      Do you see the internal sensor light turn on every 5 seconds (it is very little visible, you will have to look at it almost in the dark)?

      Does the sensor detect ESPEasy?

      • Hello, thank you very much for responding so quickly! I do not see any light, and it does not appear as detected either ... I am going to check continuity in the cables to rule out bad contacts but apparently there is nothing strange ...

        • If, in near dark, you don't see the light inside the MH-Z19B turn on every five seconds, suspect power.

          Ideally, you would have some means (a multimeter or voltmeter) to check that there are 5 volts between the GND and Vin pins of the MH-Z19B.

          However, the circuit is so straightforward that a careful visual inspection should suffice.

  40. Hello, thank you for sharing your project, I bought the parts and when trying to program it, the first problem appeared, since I achieved it by pressing the boot button for a few seconds until it entered programming mode, so I think I have another plate even if I bought it in your Aliexpress link. It ends with an error and then the WIFI that you mention does not appear but the esp_c6b5b9 and I can no longer follow. For me that is ESP32.

    If you can give me a hand, I would appreciate it.

    • Hello Luis.

      It sounds to me that the esp_c6b5b9 access point corresponds to the one created when it is new from the factory, before recording the ESPEasy.

      It is not very clear to me if you have two plates and in one you have been able to record the ESPEasy and in another not.

      If you give us more information about the steps you take exactly, what happens, error messages, content of the log, etc. surely we can help you better.

      In a generic way, I can suggest you follow the following chop:

      Some things you can try:

      1. Restart the computer
      2. Use another port (especially switch between USB 2.0 and 3.0 ports)
      3. Disconnect other USB-connected devices
      4. Try a different USB cable

      Another thing that can happen is that the ESP Easy is corrupt or has a bad configuration. In this case you would have to restart it:

      1. Disconnect the NodeMCU (turn it off)
      2. Jumper RX and TX (solder a wire, for example)
      3. Plug in the NodeMCU (turn it on) for about 10-15 seconds
      4. Disconnect the NodeMCU (turn it off)
      5. Remove the bridge between RX and TX

      With this the ESP Easy should be rebooted, so you can flash it again.

      • Hello Mariete, thanks for the answer.
        I have carried out all the steps without success, I have also tried on another computer with usb 2.0.
        I leave you the log. I only have one unit that I buy from Aliexpress.
        I have also tried to erase it and program it with these instructions and they do not give an error :, but it does not work like yours, it does not even emit the SSID of the WIFI
        esptool.py –-port COM7 erase_flash
        esptool.py –port com7 –baud 19200 write_flash –flash_size = detect -fm gave 0 "c: \ python391 \ ESP_Easy_mega_20201130_normal_ESP8266_4M1M.bin"

        The log is this:
        ######FLASH INFO######
        BIN file: ESP_Easy_mega_20201130_normal_ESP8266_4M1M.bin
        COM port: (COM3) Silicon Labs CP210x USB to UART Bridge (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: \ Applications \ __ Projects \ CO2 Meter \ bin \ ESP_Easy_mega_20201130_normal_ESP8266_4M1M.bin"]
        [12/23/2020 21:12:19] esptool v0.4.12 - (c) 2014 Ch. Klippel
        [12/23/2020 21:12:19] setting board to nodemcu
        [12/23/2020 21:12:19] setting baudrate from 115200 to 115200
        [12/23/2020 21:12:19] setting port from to COM3
        [12/23/2020 21:12:19] setting address from 0x00000000 to 0x00000000
        [12/23/2020 21:12:19] espcomm_upload_file
        [12/23/2020 21:12:19] espcomm_upload_mem
        [12/23/2020 21:12:19] setting serial port timeouts to 1000 ms
        [12/23/2020 21:12:19] opening bootloader
        [12/23/2020 21:12:19] resetting board
        [12/23/2020 21:12:19] trying to connect
        [12/23/2020 21:12:19] flush start
        [12/23/2020 21:12:19] setting serial port timeouts to 1 ms
        [12/23/2020 21:12:19] setting serial port timeouts to 1000 ms
        [12/23/2020 21:12:19] flush complete
        [12/23/2020 21:12:19] espcomm_send_command: sending command header
        [12/23/2020 21:12:19] espcomm_send_command: sending command payload
        [12/23/2020 21:12:19] read 0, requested 1
        [12/23/2020 21:12:19] trying to connect
        [12/23/2020 21:12:19] flush start
        [12/23/2020 21:12:19] setting serial port timeouts to 1 ms
        [12/23/2020 21:12:19] setting serial port timeouts to 1000 ms
        [12/23/2020 21:12:19] flush complete
        [12/23/2020 21:12:19] espcomm_send_command: sending command header
        [12/23/2020 21:12:19] espcomm_send_command: sending command payload
        [12/23/2020 21:12:19] espcomm_send_command: receiving 4 bytes of data
        [12/23/2020 21:12:19] trying to connect
        [12/23/2020 21:12:19] flush start
        [12/23/2020 21:12:19] setting serial port timeouts to 1 ms
        [12/23/2020 21:12:19] setting serial port timeouts to 1000 ms
        [12/23/2020 21:12:19] flush complete
        [12/23/2020 21:12:19] espcomm_send_command: sending command header
        [12/23/2020 21:12:19] espcomm_send_command: sending command payload
        [12/23/2020 21:12:19] espcomm_send_command: receiving 4 bytes of data
        [12/23/2020 21:12:19] espcomm_send_command: receiving 4 bytes of data
        [12/23/2020 21:12:19] espcomm_send_command: receiving 4 bytes of data
        [12/23/2020 21:12:19] espcomm_send_command: receiving 4 bytes of data
        [12/23/2020 21:12:19] espcomm_send_command: receiving 4 bytes of data
        [12/23/2020 21:12:19] espcomm_send_command: receiving 4 bytes of data
        [12/23/2020 21:12:19] espcomm_send_command: receiving 4 bytes of data
        [12/23/2020 21:12:19] espcomm_send_command: receiving 4 bytes of data
        [12/23/2020 21:12:19] Uploading 910944 bytes from C: \ Applications \ __ Projects \ CO2 Meter \ bin \ ESP_Easy_mega_20201130_normal_ESP8266_4M1M.bin to flash at 0x00000000
        [12/23/2020 21:12:19] erasing flash
        [12/23/2020 21:12:19] size: 0de660 address: 000000
        [12/23/2020 21:12:19] first_sector_index: 0
        [12/23/2020 21:12:19] total_sector_count: 223
        [12/23/2020 21:12:19] head_sector_count: 16
        [12/23/2020 21:12:19] adjusted_sector_count: 207
        [12/23/2020 21:12:19] erase_size: 0cf000
        [12/23/2020 21:12:19] espcomm_send_command: sending command header
        [12/23/2020 21:12:19] espcomm_send_command: sending command payload
        [12/23/2020 21:12:19] setting serial port timeouts to 15000 ms
        [12/23/2020 21:12:19] read 0, requested 1
        [12/23/2020 21:12:19] setting serial port timeouts to 1000 ms
        [12/23/2020 21:12:19] warning: espcomm_send_command: didn't receive command response
        [12/23/2020 21:12:19] warning: espcomm_send_command (FLASH_DOWNLOAD_BEGIN) failed
        [12/23/2020 21:12:19] closing bootloader
        [12/23/2020 21:12:19] flush start
        [12/23/2020 21:12:19] setting serial port timeouts to 1 ms
        [12/23/2020 21:12:19] setting serial port timeouts to 1000 ms
        [12/23/2020 21:12:19] flush complete
        [12/23/2020 21:12:19] error: espcomm_upload_mem failed
        [2020-12-23 21:12:19] DONATE! BUT WITH (1) ERRORS!
        [2020-12-23 21:12:19] The COM port was already in use… the post-flash did not complete.
        [2020-12-23 21:12:19] JOB COMPLETED, over and out!

        Thank you,

        • Could it be that this board is an ESP32, as you said in your previous message?

          The truth is that some plates have given me a tremendous war, but they have not been the NodeMCU, which has always been relatively easy for me to record.

          In the end you end up following all the tutorials you find online, with different software until one of them works.

          I have also seen that, for some reason, based on retrying many times, sometimes the flashing ends.

  41. Hello, unfortunately the drivers of the Mcu are not installed when plugging it into the USB.
    I have tried to manually install the CH340G driver following some instructions on other pages, but without success.
    I have tried with two different Mcu modules on two different computers and nothing is not installed.
    What I can do ?
    Thank you.

  42. Hello, as my sensor came without a connector (black plate), I have carried out the soldering as indicated, the problem that gives the following error when trying to flash the unit:
    [12/20/2020 12:37:41 AM] flush start
    [12/20/2020 0:37:41] setting serial port timeouts to 1 ms
    [12/20/2020 0:37:41] setting serial port timeouts to 1000 ms
    [12/20/2020 12:37:41] flush complete
    [12/20/2020 0:37:41] espcomm_send_command: sending command header
    [12/20/2020 0:37:41] espcomm_send_command: sending command payload
    [12/20/2020 0:37:41] read 0, requested 1
    [12/20/2020 0:37:41] warning: espcomm_sync failed
    [12/20/2020 0:37:41] error: espcomm_open failed
    [12/20/2020 0:37:41] error: espcomm_upload_mem failed
    [2020-12-20 00:37:41] STOPPED due to 2 errors! (try reset on the unit, then start a new flash attempt)

    Could it be that I am trying to flash the Node NCU with the sensor already soldered?

    Thanks for all the work!

    • Hello Jorge.

      That is most likely it.

      Unfortunately, you are going to have to unsolder the sensor and test.

      No need to unsolder Vin and GND, just RX and TX

      You will tell us if it has worked for you. If not, we will try to find the problem elsewhere.

      • It doesn't seem like that's not the problem, basically I get the same error when using another Node NCU without soldering, did the same thing happen to someone?

        • From time to time someone has given me a bit of war, but I have always managed to program it.

          Some things you can try:

          1. Restart the computer
          2. Use another port (especially switch between USB 2.0 and 3.0 ports)
          3. Disconnect other USB-connected devices
          4. Try a different USB cable

          Another thing that can happen is that the ESP Easy is corrupt or has a bad configuration. In this case you would have to restart it:

          1. Disconnect the NodeMCU (turn it off)
          2. Jumper RX and TX (solder a wire, for example)
          3. Plug in the NodeMCU (turn it on) for about 10-15 seconds
          4. Disconnect the NodeMCU (turn it off)
          5. Remove the bridge between RX and TX

          With this the ESP Easy should be rebooted, so you can flash it again.

          • Good afternoon Mariete,

            Yesterday I mounted the device, set up ESP easy and got to read readings, but only 410 and then it would go to 5000 all the time. I turned it off all night. This morning when connecting and looking for it with the IP address, I could not connect. I have flashed it several times, even made the bridge between RX and TX and nothing does not appear the ESP easy access point in the wifi networks. Something is escaping me and I don't know what it is. I accept any idea.
            Thank you.

            • The truth is that I can't think of what else is going on. Disconnect everything from NodeMCU when you go to flash, just in case.

              Have you checked all the tips in the section «You have problems? CO2 meter faq«?

  43. Hi.
    Thank you very much for sharing the project. I am trying to disable autocalibration (ABC). But when I send the command 0x79:
    FF 01 79 00 00 00 00 00 77
    I returned:
    FF 7E 01 00 00 00 00 00 86

    Which is strange because according to the manufacturer's manual there should be no answer. And the 01 seems to indicate that ABC has not been disabled.
    I wonder if my sensor is fake. Have you tried calibrating it manually or turning off autocalibration?

    Another thing I have tried is to decrease the frequency of the sensor. The default is 5 sec. But I don't see the use of making such frequent measurements. Taking measurements every 30 seconds would extend the life of the sensor much more. Apparently the 0x & E command allows it, however I have not managed to make it work either. The answer is always 05 sec and the sensor continues to light the internal led with that period.

    • From what you say you are not using the ESP Easy menus. In my case, using ESP Easy, I have no problem deactivating ABC calibration.

      As for the sensor led, , it turns on every 5 seconds always even if the measurements are set every minute for example. I don't know if there is any other part of the setup where to "turn off" or change the frequency of the power LED.

      • I have compared the versions of the datasheet. In the latest version, the commands to deactivate ABC do not appear. While in version 1.o they did. The manufacturer may have substantially changed the firmware.

        • Be careful that you are not looking at the datasheet of the MH-Z19 (the old one).

          I, in the last datasheet of the MH-Z19B (the modern one) that I could find (from 01-16-2020) it does appear.

          There is a datasheet of the MH-Z19C (which I have not seen for sale yet) in which the ABC continues to appear (although it is now called differently, maybe because ABC is registered by Senseair and they have had to stop using it) .

          Anyway, I think the one that MH-Z19 (the old one) also had ABC, even though it didn't appear in the datasheet.

    • Hi.

      The truth is that I have never communicated with the sensor directly, it has always been using ESP Easy, so I could not tell you.

      What I can tell you is that, from what I've heard so far, the way to identify fake MH-Z19Bs is:
      1. It has a black printed circuit
      2. It does not have screen printing of the pins on the printed circuit board.
      3. The case is not completely black (without that kind of 3D frame in the vents or that "bulky little circle"

      If any of these three conditions are met, it is probably false.

      I have not found the command to change the sensor measurement frequency. Does it appear on the datasheet?

  44. Congratulations on your work Mariete, I have done everything, but the sensor (black plate) does not read me any temperature values, ppm and U at 0 and they do not move. I have connected: (sensor / ESP8266 => V + / Vin; V- / GND; Rxd / Tx; Txd / Rx) I don't know what can happen. And the ESP8266 board connected to the USB of the computer.

    • I would also try to put a mobile charger that has 5v / 2A in Output. 2 things have happened to me: with a 1A charger my value was always 5000, and with an old external battery that I had at home it gave me 0.0.0

      Jose, your sensor when it is connected lights a little red light every 5 seconds?

      It didn't turn on me when it gave me 0,0,0….

      • EXTRA: in devices it appears as "DETECTED" and the name of the sensor automatically?

        I was doing tests and for 30 minutes it has returned values of 0/0/0, and although the sensor LED lit up, the ESP Easy did not show it as detected. I have restarted it a couple of times and it has already picked it up without problem

      • Hi, it seems to me that the problem is going to be that they have sold me one of the fake ones. Because the little circle that appears to me is barely marked and the color of the PCB is black. Right now the led turns on every 5 seconds as you said. I have it powered via USB from the computer. It started at 550 but after a few minutes it has gone up to 5000 ppm and has remained fixed.

        • I would try to connect it to a mobile charger that draws 5v at 2 amps.

          A couple of days ago, using a charger of only 1 amp, the same thing happened to me as you: value of 5000 all the time.

  45. Thank you very much for the project. I have assembled it and it works very well. I found it to be a very interesting platform, I had heard of it but never decided to try anything.
    On Monday I will compare it to a calibrated CO2 meter, see if the readings are good.

    Could you say what tutorials are there to start getting your hands on? I have no idea, I have looked at how to do the graphics but I can't find anything. I suppose that the code must be rewritten with the data from the thingspeak api write key, but when I see that what is flashed to the board is a binary, I get completely lost.

    Stay tuned for more project information

    • Hi Jamie.

      I'm really glad you already have it working!

      Sending to Thingspeak is very easy. I have a detailed tutorial pending, but in the meantime, you only have to create a rule with the call to Thingspeak like here, which is the one I use:

      On CO2#PPM do
      SendToHTTP api.thingspeak.com, 80, / update? Api_key = aqui_tu_api_key & field1 = [CO2#PPM]

      • Hello Mariete,
        Where are these rules added?

        Jaime, I have achieved it through the ESP Easy controllers menu

        1) sign up for ThingSpeak (free). You verify your email and you log in on the web.
        2) give a new channel and set only 1 value

        You could also set the temperature and the "U" value but they are not of much use ...
        3) copy the write API KEY

        4) In the browser go to Controllers and add a new one (at number 1 !!!):

        (the IP address put that of your ESP Easy)
        5) in the configuration of this new controller you select from the THINGSPEAK list and put this data

        (web, interval, client response time, writing API KEY) and you hit Submit / Send

        6) In the browser go to Devices and edit the CO2:

        7) You configure the sending of data to the Controller as you see here:

        the IDX is the same number in which you have added section 4), which I have mentioned the value 1

        And that's it. On the ThinkSpeak website the first data should arrive in 1 minute (if you have set 60sec / 60000ms).

        EXTRA: if you want the info to come out directly on your mobile, you can install the IoT widget for ThingSpeak that is on Google Play. The configuration is super simple:

        Once configured, add the Widget to any screen on your mobile and:
        a) tap on the value to get the last data (it's automatic, but you can force it)
        b) tap on the channel name to configure it
        c) tap on the time in the widget base to open the charts

        • Hello ManeKo.

          Thank you very much for these instructions. Although I am preparing a detailed tutorial on this, with video, I am sure that many people find it great. I have taken the liberty of hosting the images on my server so as not to depend on external sites that, over time, may disappear, and because external images and links give me many problems with server protections, anti-SPAM system and others ...

          You were wondering where these rules are added:

          First you have to activate the ESP Easy rules system in the Tools -> Advanced -> Rules menu (I also have the "Old Engine" option activated for compatibility, because I have rules created years ago, with very old versions of ESP Easy) .

          A new tab called «Rules» will appear. That's where the rules are written:

          By the way, very interesting the IoT widget for ThingSpeak, I did not know it! ?

      • Hello Mariete, how often does this rule run? Shouldn't we add the frequency of sending data to ThingSpeak (and maybe other parameters)? Is this method of the rules compatible with creating a controler for ThingSpeak?
        I have used both together, but nothing comes out in ThingSpeak.
        I also see that neither with the controller, nor with the rules, the ChannelID of Thingspeak is used, while, for example, with the library for the Arduino IDE it is necessary.

        • Hello Jesus.

          The truth is that I do not use the ThingSpeak Controller because in the past it has given me problems (and I know that it has caused other users as well). I send everything directly from the rules:

          On CO2#PPM do
          SendToHTTP api.thingspeak.com, 80, / update? Api_key = your_api_key & field1 = [CO2#PPM]

          This rule is automatically executed every time CO2#PPM has a new value (and this can be changed by changing the "Interval" in the sensor configuration).

          If you want to send the data with another interval you can do it, also with rules, using a timer (on the blog you have several examples of the use of timers in rules).

          The ChannelID is not necessary because we are using the api_key of that ChannelID, so it is implicit (each ChannelID has its own api_key).

          However, if you prefer to use the Controller, the ManeKo example explains where and how to set the interval.

          If you need help, the best thing is that you join the Telegram group, where there are several users who send to Thingspeak, both with Controller as if it.

          • Thanks Mariete, I have accepted your telegram invitation and I keep asking for that channel.
            By the way, what do you prefer, Mario or Mariete?
            A greeting.

  46. I HAVE GOT IT !!!
    I mean…

    Surprisingly, it works !!!
    (Obviously I say it because of my inexperience on the subject)

    Thanks, I think I'm going to get into this mess around. jjjj

  47. What rage. The type you had linked before for the sensor must have run out of it and canceled the shipment (the pasta has not been returned, it will be necessary to pull the dispute and cross your fingers)…. The new one that you put seems to have neither connector nor cables ... The thing with it would be a little more complicated, right?

    • Wow, bad luck.

      The one that's on right now is the best option I've found at the moment. I have reviewed a lot and put the one that seems most reliable and at the best price at all times, although sometimes it is not exactly the one that comes with the connector.

      Anyway, the difference in complication is not much, it is only soldering four wires.

    • With the dispute, the money will be returned to you in a short time. The truth has always been good for me.

      For the issue of cable soldering, I have avoided it by putting the stripped cables through the holes and then inserting the pins that came with the ESP module (they look like these https://prnt.sc/w5lkqj ). They are VERY well attached and I can remove them if necessary

  48. Working! Thank you very much for the tutorial. I have a couple of doubts:

    1) what is the «U» value exactly? I currently have it at 2304.00 and it doesn't stop going up

    2) Power: the laptop USB (3.1 gen) goes to 5V and 500 to 900 mA. If I connect it to a 5v 2000 mA mobile charger, could it damage the Chip or Sensor? Better if I take a charger with a maximum 1000mA? Can be connected «without risk» to external batteries (5v 1000mA too)
    (If you also know the answer to my phenomenal WEMOS D1 MINI LITE… I can't find it online!)

    3) I understand that the ABC (Automatic Baseline Correction) calibration is using the minimum value taken every 24 hours to self-calibrate. Bearing in mind that the minimum should be 420 ppm (concentration of CO2 in the air), if you measure less than that it "increases" that base, and if it always measures 600, for example, after X days it will be recalibrated so that the 600 previous becomes 420. medium correct?

    • Hi Carlos.

      1. The "U" value is not documented and no one is clear about exactly what it is. Some people say that it is an indicator of the «stability / quality of the reading» and some say that it has to do with atmospheric pressure. The truth is that, as far as I know, it is not clear.

      2. Any mobile charger from 500mA will do. As long as it has more than 500mA, real, you will not have any problems. You can have anything you want above 500mA, nothing will go wrong. You can use it with the battery "power banks" without problem (I use them to leave them sometime, one night, outside so that they can calibrate themselves).

      3. Nobody knows at 100% how the ABC works but it is more or less how you say, although it is not something «direct» because the sensor can be several days above 400 ppm without lowering (and indoors it is completely normal) and yes that operation of the ABC was so "direct" would drop every day to 400 ppm, which suggests that it is something more complex.

      • Thank you very much for the reply.

        1) Ok to the U-Value. If it is not documented anywhere it is probably an internal value (I have also read that it may be used for calibration). In any case, I rule it out

        Regarding the Temperature value, it seems that this value does not collect the ambient temperature but that of the sensor itself, since it gives me a constant 19-21 degrees when other thermometers that I have at home collect totally different values. I guess the sensor uses it to provide a correct PPM value.

        2) Thanks for the confirmation. I have tried an old 1000mA charger and the PPM stayed at 5000 (the maximum for my model). Searching online I found a user with the same problem and simply switching to a 2000mA charger would work again. In my case, hand of saint too.

        3) As I have read for interiors, they recommend not using ABC (because it will hardly go down to 400ppm). Unless it is calibrated outdoors with ABC (minimum 25 hours) and then placed indoors. I'll be doing tests ...

  49. Goodnight

    I have not seen the video yet but before doing so I would like to thank you for the work you have done and the level of it and as a megatorpe that I am, thanks to your work I will be able to do some other meter. THANKS

  50. Great project !!! what a crack !!

    I just ordered the components, my idea is also to add a display, could you please provide me with a purchase link?
    When I have everything assembled, including display, I will design a box to print in 3d, since I have a printer.

    MANY THANKS !!!!

  51. Hello, I already have the sensor and the arduino, I just want to know which screen model is easier to adapt. Also looking forward to the software to start experimenting. Thank you very much for the project which is the most interesting and educational, I bet it will help raise awareness in more than one about the importance of airing the rooms especially now. I'm going to make one to leave it at my parents' house so that they can see the level, so I think it's easier for them to see it on the screen. Greetings and thanks for this project.

      • How nice about the screen! I guess I'll have no luck and it won't work for my DotMatrix screen (4 modules) ... but I'm sure that messing around I get it to pull 😉

        Thanks for the input!

        • Confirmed: after searching in many forums I see that for the Dot Matrix MAX7219 (which is the one I have) nobody has managed to make it work with ESP Easy.
          I will have to buy a 7 segment or OLED for this project.

  52. I think in the video you forgot to comment that the esp wifi key when starting the first time is configesp, I have searched for it in google ...
    The video very well explained, it makes me a little slow, but you set the speed to X2 and that's it

    I want to integrate the sensor with home assist, by mqtt, I don't think it's complicated, but I have no idea. As the sensor has not yet arrived, I have time to look for info. After integrating it, I will be able to control the ventilation with a € 4 sonoff to activate the extractor.

    • Thank you very much, Hector.

      Affectively, I missed saying it. The video is already modified with that information added, I started as soon as David commented.

      Integration with Home Assistant using MQTT is very simple. Later, I will write a new article explaining how it is done. My idea is to write several additional articles with interesting extensions and improvements.

      A greeting.

  53. Good morning Emariete,

    In the video you do not explain that the SSID ESP-Easy has a password: configesp

    Nothing that Google can not help solve, but hey, you know in case you want to add it.

    Thank you!

  54. Now the pool is that AliExpress does not send the sensor ... It must have run out of them for your project !!!

    Let's see…

  55. I can only congratulate you on the clarity of the video.
    If from my ignorance you make me able to mount this and make it work, it is that anyone can do it.
    I don't have all the ingredients yet, but when I do, you'll be the first to know.
    It seems to me that you are releasing information of public utility.
    Thank you.

  56. Hi crack,

    I've been following the project since you first published it and you have me hooked. I have already got the components and I am waiting for you to release the firmware so I can continue.

    To save me soldering, I'm going to use the front panel wiring connectors from an old computer. As the ESP8266 has pins and your solders are correlative, I am going to use these connectors and I save it (if I'm saying a stupid thing, tell me)

    I have seen the video and it is great, only that it gave me the feeling that it stuck in some moments (the clock kept on but the image remained static).

    Thank you very much for the work you are doing.


    • David be careful that the solders in the ESP8266 are not correlative, three of them are (GND, TX and RX), but that the sensor must be connected to 5v instead of 3.3v, and the 5v pin is «Vin» which is on the other side of the plate

  57. I have just received the H-Z19B sensor but the color of the cables is different (and I have ordered it using the same link on Aliexpress ...), could you indicate the method you have followed to know which cable corresponds to each pin?

    • Hi Joaquin.

      It is rare that the colors do not match, in all the MH-Z19 sensors that I have seen the colors of the cables were the same.

      Check each wire to which pin on the MH-Z19B's board it goes. You have them in the datasheet that I left in the article, but I leave you here this image, which I have taken from the datasheet. with the important part:

      If you have any questions, tell me and I will take some pictures so you can see it in detail.

      Is the printed circuit board of the sensor you received by any chance black instead of green? It has recently come to my ears that there are fake MH-Z19B sensors with a black plate.

      A greeting.

      • The sensor PCB is black so I hope it's not fake. In the end I have done what you say, check with the multimeter which pin corresponded to each pin, and as expected the pins were in the same order as yours, only with a different color of wire. Maybe in case it happens to someone else you can include in the table of connections a photo where you can see how to start counting from 1 to 7 (from left to right or from right to left, depending on how you are looking at the sensor).
        I have to confess that I could not bear for you to upload all the instructions, and I have investigated there and I already have it working and sending the data to Home Assistant through MQTT, but still thank you so much for the idea and the level of detail of the instructions, I will be attentive to see the solution you upload, and to see if I like it better than the one I found.

        • Hello, it has also come to me with the black plate, also with excess glue visible, will it be false? It also has the colors of the cables changed although the pinset is the same. Is there any way to check if it is fake or not?

          • Hello German.

            Almost certainly yes, it is false.

            I am finishing writing an article precisely speaking in depth about this with an explanatory video with tests and comparisons. I hope to have it ready throughout this week.

  58. Very good video.

    Only perhaps advance the curtain of the photo of the park sensor that does not cover when you remove it.

    But everything is very clear.

    By the way, you can tell I'm a jerk: do you put tin before but not during soldering? And what seems to be diffused when welding, what is it? Resin?

    • Thank you Jesus.

      Sure enough, for some reason, that curtain went wrong in the rendering. In the final version I will check that it goes well.

      In this case, since the cables are freshly pre-tinned and the pins have a bit of flux (which is the resin you mean, although it is not necessary at all, but it makes soldering a bit easier), it is not necessary to add more tin.

      A greeting.

  59. I am not able to download the source code. Could you tell me where the link is ???
    Thanks a lot. A great job, which I will start shortly.

  60. Good afternoon

    The video is very good, that should be the line, all the steps are very clear and it is easy to follow this, someone who has no idea of any of this tells you, it is appreciated that you have not done either the web or the video for ready you have made a project available to anyone and that is highly appreciated. Greetings and congratulations for your work and attitude.

    • Thanks a lot. I am very glad that you like the line of the videos.

      I keep putting them together, which is a lot of work… I hope, if everything goes well, to have them ready throughout the week.

      A greeting.

  61. Hello Mariete

    Thank you very much for your article. You have me (and I think several) on edge. I am also on edge with the chip and the CO2 meter already in my hands trying to put your advice into practice.

    Waiting with great desire that you put the link to the firmware and if you reveal us how to connect to the wifi and the web and to the night.
    Hey by the way, one question ... Wouldn't this system need a power supply?

    Thanks again.
    I am waiting ... with much expectation !!!! 🙂

  62. Good,

    Thanks for the post. He is very cool and the bug bit me. So I have ordered the parts. However, in addition to the lack of links as some other people have already told you, I also miss an explanation for beginners of how to perform the ESP8266 WiFi Configuration. Would an Arduino board or some other component be missing? Come on, I don't know how you do it. I would appreciate if you could explain it in more detail.
    Thank you.

    • Hi Aitor.

      As I said, the article was unfinished. Now you have the video with the step-by-step tutorial, where this part is explained. Hope you don't have any problem.

  63. Very interesting article, so much so that I have already bought the sensor and waiting for it to arrive. Wanting to continue that practical part.

  64. Hi, I think it's my thing, but I can't find the links to download the firmware. I have seen that the post is updated but I am unable to find them ... 🙁

    • Hello José Miguel. These modules are somewhat more expensive, perhaps the project did not cost less than 20 euros, in addition to complicating / lengthening the base project.

      Bearing in mind that you can see all the info via wifi in a browser or even send it to services like Thingspeak. In my opinion, I think that not including a display makes the project a lot easier without reducing functionality.

      As an addition / possibility it seems great to me (in fact I will buy one with an integrated Oled screen or a loose screen to put it on the Wemos D1 mini lite in which I have connected the sensor).

      By the way, if someone in Thingspeak does not get the data correctly, try to increase the Client Timeout value in the Controller configuration in EspEasy to 1000ms (by default it is 100ms and it is too little).

      • I was referring to the possibility of, instead of putting a NodeMCU ESP8266 plus a separate screen, putting it all together, an ESP8266 with an integrated OLED screen, which is even cheaper than separately and also does not have to do additional wiring.

        Although from what I see the problem is that this module with a screen should not be supported natively in ESPEasy or at least I cannot find it.

  65. Thanks Mario (my son is Mario tb), I bought the sensor and I have several nodeMCUs so I subscribe and wait for updates to do so. Thank you. I only have the question of how we feed the system, battery, to the grid with a transformer ...

    • Hello Fernando.

      It needs to be connected to power because it consumes a lot (relatively). The problem is that the sensor has a warm-up time of three minutes (it has to be on for three minutes before giving valid readings) so it cannot be “turned on and off” by software for an instant to read the sensor every, say, minute, and the rest of the time is off.

      That said, I sometimes leave it outside overnight, to self-calibrate, connected to a "power bank", the kind used to charge mobile phones, and it works perfectly.

      • Mario, do you know if the sensor calibration is "lost" when it is disconnected from the power supply? That is, do we have to calibrate the sensor every time we plug it in? My idea was to have it well calibrated and then take it to various locations to make measurements.

        It is not a problem to wait 3min to obtain reliable measurements, but if I have to recalibrate it every time I plug it in ... ufff ...

        By the way, I have also read that the 420ppm of CO2 in the air is at sea level, and that for every 300 meters of altitude this value would have to be reduced by 4% (I cannot find the source of this information now). In this case I suppose the sensor value would have to be corrected in the part of the «formula» in ESP Easy so that it shows:

        ValorPPM * (1 - (0.04 * Elevation / 300) —– where «Elevation» is the MSNM that our city has.

        Thank you very much again for the post, the videos and all the responses to our comments.

        • Hi Carlos.

          About calibration, I can't tell you… at the time I was looking for information, but I didn't find anything definitive. What I can tell you is that I have not noticed sudden changes when removing the power. I have an MH-Z19 sensor (not the MH-Z19B, but an older one) working permanently for four years (it can be said that it is the prototype of this project) and I have never noticed anything strange because the power has gone out or temporarily disconnected.

          About the height I had not heard. In any case, I don't think the height affects much because Senseair, which is a fairly serious Swedish manufacturer, has a sensor very similar to this and in its documentation (which is quite complete) it does not say anything about it. I have it fairly recent because I am writing an article about it for the blog.

          A greeting.

  66. Very interesting. It is appreciated that you share the source code.

    If you allow me the suggestion, it could be useful that in some way, the name of the wifi includes the current value of the CO2 measurement of the device. In this way, just by seeing the name of the network we would already have the value of the measure.

    I don't know if 2 hotspots could be generated from the same device. One to be able to connect and configure the device, and another encryption that does not support connections that indicates the name of the device and the CO2 measurement. For example METER_xxxxppm

  67. Very interesting article and very well explained everything. I hope you add the links you are preparing to get my hands on the cables.
    A greeting.