A homemade CO2 meter with Wifi against the coronavirus

Last modified January 17, 2021

Contents

❔ Is it possible to reduce the possibility of contracting Covid with a CO₂ meter of less than 20 Euros?

Well, the answer is a resounding YES!, Y In this article I am going to tell you why this is so, and how you can build your own homemade CO₂ meter.

What I propose is a CO₂ (carbon dioxide) meter with home wifi, what you can build for less than 20 Euros, and that I guarantee that the result is a more precise instrument with more functionalities than commercial CO₂ meters costing several hundred euros..

This meter uses a CO2 sensor with NDIR technology And it has nothing to do with the € 40 or € 50 meters sold online in terms of reliability and accuracy. It has an internal temperature sensor, so that measurements are automatically recalculated based on variations in ambient temperature.

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. I really could have written a much shorter article explaining how to build this CO2 meter, but it wouldn't have been that comprehensive.

The idea is that anyone can build this CO2 meter, no need for prior knowledge or special equipment (Except for the welder, which, as we will see later, we can even do without).

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

❓ What does CO₂ (Carbon Dioxide) have to do with Covid?

Absolutely nothing. However, these two words together are on the lips of many experts in the health and scientific community. Why? Keep reading…

CO₂ is a dangerous gas for humans. In high concentrations it can cause ailments such as vertigo, headaches, increased blood pressure, accelerated heart rate, and in the most severe cases it can lead to suffocation and loss of consciousness.

The Covid, it is not the name of the virus, is the name of the disease caused by Coronavirus SARS-CoV-2.

We have been talking and hearing about the Coronavirus for months at all times, maybe too much for our good mental health, so I'm not going to comment on anything about him. Everything I can say about the Coronavirus, surely, you already know.

Just remember that, today, the only way to prevent Covid is to protect yourself against the SARS-CoV-2 coronavirus and this is achieved through fairly basic, almost hygienic practices. And at the bottom of all this is that who avoids the occasion avoids the danger.

⚠️ The air we breathe and the Covid

Even though CO₂ has no direct relationship with Covid, If that there is a very important indirect relationship and, this is, the quality of the air we breathe and the viral load that air may have.

When there are several people in a room and one of them is a carrier of the virus, this remains suspended in the air for a variable time, at the expense of other people sharing the room they can be infected. These are the famous aerosol sprays, of which we have heard so much lately.

The more time passes, the more the viral load present in the air increases, with which more it goes increasing the danger from other people catching it.

For this reason, adequate air renewal in the room is essential, and this is achieved by ventilating.

In work environments it is more or less common to have a forced air system that facilitates ventilation and air exchange (and even filtering through HEPA filters) but this it is very rare in private homes, where the only option is usually to ventilate by opening the windows.

The problem is that the virus is invisible, we cannot look at the air and see the viral load it has to decide to ventilate when we see that it is necessary. This is where the CO₂ meter comes into play.

As the Superior Council of Scientific Investigations (CSIC), in its guide to reduce the risk of contagion, CO₂ measurements are one of the best ways to control that we are maintaining adequate ventilation:

CO₂ (carbon dioxide) it is a gas that we expel naturally when we breathe, so that knowing the concentration of this gas in the environment we can have an idea of what «loaded»What is the air in that room, what allows us to decide when to ventilate and for when to do it.

This is especially important in winter, since, due to the low temperatures, we tend to ventilate much less, delaying the time to open the windows.

💹 The CO meter figures

CO₂ is naturally present in the air in an approximate proportion of 420 ppm (420 parts per million, or what is the same 420 parts of CO2 per million parts of air).

The trick is in control how many parts per million CO₂ we have at all times and ventilate when that number reaches a certain figure, which we consider too high, and continue to ventilate until that value drops again around 420 ppm.

And what is that magic number, or from how many parts per million of CO₂ do we have to ventilate?

There is no magic number, but we can use some standards to help us understand when the number is too high. The maximum CO₂ concentration recommended by the WHO for healthy environments is 1000 ppm. As a general rule, a concentration of CO₂ less than 800 ppm is considered adequate, although the ideal is that it should be closer to 500 ppm.

RITE regulations in educational centers

To have an idea of what the standards on air quality indicate, we can take as an example the regulations for educational centers.

In Spain the main regulatory framework on indoor air quality is the Regulation of Thermal Installations in Buildings (RITE), which classifies air quality into 4 categories: IDA 1, IDA 2, IDA 3 and IDA 4 (for its acronym of English “indoor air”).

  • EDUCATIONAL CLASSROOMS, IDA category 2 (good quality air) is required to which the RITE assigns a limit value of +500 ppm on the CO₂ concentration of the outside. 
  • NURSERIES the requirement is increased to IDA 1 (optimum quality air) to which the RITE assigns a limit value of +350 ppm on the CO₂ concentration of the outside. 

Examples and actual figures of CO₂ concentrations in a home

To better understand where these CO₂ values move, I am going to put you as an example my own house.

This graph corresponds to the concentration of CO₂ in the living room of my house on a Saturday in November (all closed tight due to the cold).

CO2 Salon data chart

What can we see in this graph?

Basically that CO₂ levels are very high, and that they remain above the values recommended by the WHO almost all day.

  • Despite the fact that, when the room is ventilated, around 2:00 p.m. and for half an hour, the CO₂ values fall close to 450 ppm, the zero air renewal causes the values to rise again quickly, reaching dangerous levels 2300 ppm.
  • This day, the five members of the family (and the dog) have seen a movie on the projector in the living room, which explains this notable increase in CO₂ in the afternoon.
  • It is clearly appreciated how the CO₂ has risen rapidly from 3:00 p.m. (when we have all gathered to eat).

Of course, the air quality in this room leaves a lot to be desired and is something I am going to work on. I'm going to have the home automation system (which has voice prompts in almost every room) announce alerts when the numbers get too high and do reminders that you have to ventilate at the best hours.

The data in the living room is taken with a Netatmo weather station, which has an indoor CO₂ sensor.

In the following graph you can see the CO2 data from my cave (my room of tinker):

This data is updated in real time, if you stay a while looking at it, you will see how each minute, approximately, a new measure appears.

Below I explain how you can create a graph like this, free and easily.

👁️‍🗨️ Homemade CO₂ meter structure

The CO₂ meter that I am going to describe it has nothing to envy to commercial units of several hundred euros, being superior in many cases, both for precision and functionalities.

It has the following characteristics, advantages and functionalities:

Economic. Less than 20 Euros

  • High accuracy (50 ppm + 3% of reading)
  • Connection Wifi
  • Portable
  • Smart (can perform many tasks based on the data)
  • Web server internal
  • Integration with home automation system
  • Publication of data on the internet
  • Support of MQTT
  • LCD display optional

The CO₂ meter with WiFi is composed of only two components, Low cost:

  • NodeMCU module, with ESP8266 microcontroller with integrated WiFi
  • CO₂ sensor MH-Z19B

Its construction, commissioning and use is very easy, I estimate that you can do this project in one or two hours. We just have to follow these steps to build our CO₂ meter with WiFi:

  1. Download the firmware from this website
  2. Record ESP8266 Microcontroller Module
  3. Connect CO₂ sensor MH-Z19B using only four wires

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 in AliExpress, with shipping from China, the costs would be:

MH-Z19B Some 18 Euros for the CO₂ sensor MH-Z19B in this AliExpress link. It is a store with many positive reviews and shipping is by AliExpress Standard Shipping, so you should have it at home in about two weeks.

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


* I temporarily withdraw it until I find a better provider. See below for other options.

Be careful not to buy the MH-Z19C version for the moment because it might not be compatible. I'm working in it.
NodeMCU Some 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«

* IMPORTANT: If you are going to make your first purchase on AliExpress, enter through this link you will receive € 21 in discount coupons for your purchases.

There is a real avalanche of fake MH-Z19B sensors, both on AliExpress and Amazon. These sensors give measures very far from reality, 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 don't mind spending a little more, I suggest you use the sensor instead of the MH-Z19B Senseair S8 LP. In addition to being less likely to receive a fake one, it is a better quality than MH-Z19B.

I leave you here the link to which I bought. It seems original and it came to me very quickly (one week):

If you don't mind spending a little more, I recommend the sensor Senseair S8 LP.

Costs about 24 Euros in this AliExpress link.

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

I bought it here. I arrive very fast (one week) and it seems original.

The maximum allowable voltage for this sensor, according to the manufacturer's data sheet, is 5.25 volts. In some cases (due to tolerances of the USB port used and the components) the voltage at the Vin pin of the NodeMCU could reach up to 5.55 volts, so I recommend that you have a measuring instrument to check it before connecting the sensor.

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.

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 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 or Arduino code. Plus, with a motherboard-compatible design (28mm 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!
  • ⭐️ Welcome to the AZDelivery family! Here you will find high-quality products for your Arduino and Raspberry Pi projects. We are pleased to offer you a series of application examples, comprehensive installation guides, E-Books, libraries, and personalized assistance. AZDelivery: Your Microelectronics Expert!
SeeKool 2pcs ESP8266 ESP-12E CP2102 Module NodeMcu Lua Internet WiFi Development Board Open Source Serial Wireless Module Works with Arduino IDE / Micropython
  • ESP8266 CP2102 NodeMCU LUA ESP-12E WIFI serial wireless module.
  • Efficient Microcontroller ESP8266 (ESP-12E) with WLAN 802.11 b / g / n and integrated 25dBm antenna.
  • Built-in micro-USB, with flash and reset switches, easy to program.
  • Convenient prototyping through simple programming by Lua-Script or Ar duino-Code and compatible Breadboard construction.
  • Full I / O port and Wireless 802.11 compatible download, no reboot required.

Other purchase options:

Right now, when there are so many fake MH-Z19B sensors, the most advisable thing would be to buy it in the official store of the sensor manufacturer (Winsen), in this way you will have the security of receiving the original sensor.

The problem is that the manufacturer does not sell the MH-Z19B one by one, but it has to be two by two. So if you want to build two, or have someone who wants another, this may be a good option:

MH-Z19B2 CO₂ sensors MH-Z19B for about 36 Euros in which it says it is the official manufacturer store on AliExpress.

Here you will have the sure to receive the original sensor, and not a copy.

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

Just missing a box.

As a box I propose 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 from 10 to 10 in several similar assemblies. Simple and cheap. You can find it here, 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 on this blog.

You have to consider two important things: You have to try keep the MH-Z19B as hot 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 (Do not put it in a closed box or with little ventilation).

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

ModelMH-Z19B
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
exit signSerial (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 ESP8266 module

The ESP8266 module 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 we can connect it directly to our computer to record the ESP8266
  • Has all the additional components what are we going to need
  • It has many inputs and outputs for extensions

I could have chosen any other module, such as the very large and 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 everything is much easier.

That said, there are other versions of the NodeMCU module, like the little Wemos D1 Mini, which you can choose. The assembly will be very similar, although you will not be able to use the instructions and photos on this page directly.

I have a Wemon D1 Mini around here, so if there are many requests, I will consider making a prototype with it to document it on the blog and take pictures.

✔️ Build the homemade CO₂ meter

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 easier for you. 

The construction of the CO₂ meter, commissioning and use is very easy, I estimate that you can do this project in one or two hours. We just have to follow these steps to build our CO₂ meter with Wifi:

  1. Download the firmware from this website
  2. Record ESP8266 Microcontroller Module
  3. Connect CO₂ sensor MH-Z19B using only four wires

I find it a useful and quick project for the experienced hobbyist and a excellent first project for the newcomer to electronic gadgets. (Only four welds! Who gives more for less?)

Download the CO meter firmware

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

This program is based on the fantastic project ESPEasy, 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 Y 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 the ESPEasy recording in the NodeMCU.

IF you have a board other than NodeMCU (4MB memory) you may have to download the complete package from the ESPEasy releases page on GitHub. This is necessary, for example, with the Wemos D1 Mini Lite board.

Connect CO₂ sensor MH-Z19B

Connecting the MH-Z19B sensor to the NodeMCU is very easy, it only requires four connections.

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

For connection of the MH-Z19B sensor to the NodeMCU, we will use the cable that comes with the MH-Z19B, cutting the connector on the end.

If your sensor is not the version that comes with a connector, nothing happens, you will need some cables to connect it.

Once we have cut the connector, we strip the cables and make the following connections (please note that this pin number 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

Check that your sensor matches the connections and uses the same colors.


The user Joaquin tells us in the comments below (thanks Joaquin!), That the sensor he has received has the cables of other colors. 

The manufacturer recommends that, when welding with a soldering iron, it be done at a temperature of (350 ± 5) ° C, and that the soldering time is 3 seconds maximum.

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.

Remove unnecessary cables

The connector comes with all seven wires attached.

Since we only have to connect four (Black, Red, Blue and Green), I remove the other three cables so they are out of the way.

Stripping the wires

We strip the end of the four cables.

It is enough to peel one or two millimeters. The shorter the "cleaner" will be when soldered.

Solder feed

We carefully solder the supply of the MH-Z19B sensor to the NodeMCU

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

Solder the data cables

We solder the data input and output cables from the MH-Z19B 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)

Complete wiring

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

The finished CO2 meter

Now it only remains to connect the sensor to the NodeMCU, being careful not to put the connector backwards.

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

We only need to place it in the box or in a place where it is protected (even if it is on air).

📺 Video with the complete CO2 Meter tutorial

🔵 Using the CO₂ meter

At this point, the CO₂ meter with Wi-Fi is finished. We only have to configure it, place it in the room we want to control and read the CO₂ data from time to time.

CO₂ meter setup with Wifi

The meter needs a basic configuration to function, which basically consists of: Setting up the Wi-Fi to connect it to our home network and tell ESP Easy which sensors it has connected (in this case only the MH-Z19B) and what to do with them.

ESP8266 Wifi 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 we have to do is connect from our computer, tablet or telephone 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.

Configuration of the ESP8266 inputs and outputs

Through the same web page that we have used to configure the Wifi connection, we 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 MH-Z19B sensor and we are going to configure it so that it knows how to read the values that this generates 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 temperature and humidity sensors, LCD screens, etc. We can even make our circuit control the air conditioner of the room.

Reading the CO₂ data from our meter

Our CO₂ meter with Wifi is already working, reading the CO₂ data from the air in the room where we have placed it and processing that data.

To read and process this data we have many possibilities that will allow us 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, integrate them with our home automation system and much more.

The most basic use is see the CO₂ present in the room in real time. For that we only have to connect to a meter web page, with the web browser of our computer, tablet or mobile phone and access the "Devices" tab, where we can see the existing value at that very moment. The most recommended is save this page to our favorites, for access it easily and directly whenever we want.

Benefits of this CO₂ meter project

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

I am going to present here what I think are the main advantages and benefits and the advantages 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 enough 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 like the MQ-135 or the CCS811, but these sensors they are not used 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 shoot.

The project that I present here uses an NDIR sensor that only measures CO₂. The same sensor used in commercial meters for hundreds of euros. When we obtain a measure we will know that that measure it is from CO₂ and not from other gases, which may not interest us.

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 to be exceptionally easy to build and is within reach of anyone with no knowledge of electronics. You only have to make four connections and it does not require measuring instruments or adjustments of any kind.

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. Everything is pre-programmed and all you have to do is record the supplied program, which you can download from this page, in NodeMCU with a very simple process, following the video that I have prepared.

Easy to set up

Many projects have very complicated configuration processes, for non-experts, in which it is necessary to modify multiple parameters, in many cases modifying parameter files by hand or even the source code of the program before 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 have to be repeated daily.

This project does not require any type of calibration. The sensor comes already factory calibrated and then I know autocalibrate him alone periodically.

Expandable modular design

Most existing designs on the internet have certain functionalities and these 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 no need for programming changes nor in the basic circuit. We can start with a basic CO₂ meter and later expand it, in a very simple way, with different types of screens, LEDs, additional sensors (such as temperature and humidity), 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 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 possibilities like MQTT, HTTP, Telnet, UDP, P2P, etc.

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, we 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 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 (such as Thingspeak, IFTTT and similar), the storage of measurements in your 4Mb SPIFFS internal memory, databases like InfluxDB (both local and remote) and even the recording data to SD card for long-term non-connectivity operation.

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 permanent configuration of two wifi 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 configure any other Wi-Fi network in a few seconds.

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).

I will also shortly publish a extension to equip our meter with internal lithium-ion battery (also called Li-Ion) with built-in charger.

🌀 Home CO₂ Meter Options and Extensions

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

Next, we are going to see some of the simpler possibilities that this carbon dioxide meter allows us.

These extensions are those that are explained in this blog and in my YouTube videos (some have been contributions that users like you have made to the blog), 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 the need for a mobile or computer.

Add a custom box

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

Add notices and audible alarms

You can easily add a buzzer and set alarms and warnings when certain CO2 levels 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

As a second example, we are going to create, in a very easy way, a graph with the evolution of CO₂ of the room, using the free cloud service from ThingSpeak like this:

ThingSpeak, from the Mathworks company, allows us to store the data from our sensors in the cloud for free and consult them from our mobile, tablet or computer.

Thanks to user ManeKoYou can see quick instructions in the comments below for sending data to ThingSpeak.

Prepare yourself a console

I have it ready to see the graphics of all the sensors on the mobile, and the truth is that it looks great.

Sale
realme 7 Pro - 6.4 "Smartphone, 8GB RAM + 128GB ROM, SuperAMOLED FHD + Screen, Octa-Core Snapdragon 720G Processor, Blue
  • 65W SuperDart load
  • Snapdragon 720G processor
  • Sony 64MP Quad Camera
  • 6.4 '' Super AMOLED Fullscreen screen
  • Screen size: 6.4 inches

🛒 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 a commercial meter that is not very expensive and that works well, I would propose one of these two options:

CO2 Meter, Kecheer Carbon Dioxide Detector, Co2 Detector CO2 Gas Analyzer with Thermometer and Hygrometer, Air Quality Detector
  • Date, time, CO2, humidity, temperature (℃ / ℉ switchable) full color, 3.2-inch screen, and other data clearly.
  • The application field of the carbon dioxide detector is public site, agriculture, animal husbandry, industry and more. With professional-grade detection technology, this CO2 meter has stable performance and high precision.
  • You can store up to 999 groups of data and have a historical data trend table for you to review.
  • Real-time CO2 monitoring by the high precision sensor, and it will alarm you once the CO2 exceeds the setting value.
  • Compact size with portable storage, easy to operate and carry. The rechargeable lithium battery is included or can be powered via a 5V USB cable.
Netatmo Quality control of your home environment, indoor air, temperature, humidity, sound and CO2, NHC-EC
  • Level of air quality, humidity, temperature and noise
  • Tips on creating a healthier environment
  • 3 profiles in the app: baby, person with asthma, general
  • Real-time notifications (ios 9 or higher for iphone, ipad, ipod, android 4.2 or higher)
  • Connect multiple healthy home coaches to your smartphone to control multiple rooms

I have this one down here that is very similar, but with some additional things that make it a weather station:

Netatmo Wireless Indoor Outdoor Weather Station With Wifi, Compatible with Amazon Alexa and Apple HomeKit, NWS01-EC
  • 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

You also have the option to visit this CO2 meter buying guide.

📢 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.

Here are the most frequent questions asked by users who have been encouraged to build the CO2 meter.

📜 History of the eMariete CO2 meter

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

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

If you liked this page, share it.

215 thoughts on “Un medidor de CO2 casero con Wifi contra el coronavirus”

  1. Hi. Very good article. I wanted to tell you that I am also working on a personal project for a CO2 meter with an MH-Z19B sensor.
    My project is even more rustic than yours. I have directly connected the MH-Z19B to a personal computer using a USB-UART adapter. This same one costs about 60 cents on aliexpress https://es.aliexpress.com/item/4001223872783.html?spm=a2g0s.9042311.0.0.74b063c0ua5Kx
    With this the assembly is very simple, since neither breadboard nor external power supply is used, although the advantage of mobility is lost.

    I have also managed to validate that the sensor measures correctly. I have put the sensor in a sealed container of known volume, and have injected two cubic centimeters of CO2 gas with a syringe. After performing the calculations I get that the sensor error is approximately 4%.
    It is a very good piece of information, taking into account that the entire assembly is very rustic, the Co2 I have taken from a soda bottle and the watertight container is a chickpea jar sealed with film.
    Greetings

    Reply
    • Very interesting. Would it be possible to get all the material in physical stores or, at least, in online stores in Spain?

      Reply
      • Hello Mª José.

        To buy it in physical stores, it will depend on your location, although, the truth is that it is increasingly difficult to get these things in physical stores.

        If you look at the article you have links to buy the components both on Amazon and AliExpress.

        Reply
    • Hi, what connector exactly. Three are coming. Understand that many people have no idea. And then what software?

      It is easy?

      Thank you

      Reply
      • Hello Jesus.

        I have taken it with connectors on both sides, but you can choose the one you prefer.

        As it says in the article, there will be more instructions, photos, video and link to the firmware shortly. I'm finishing it.

        You will see that it is very easy.

        A greeting.

        Reply
          • Hi Carlos.

            You may have already seen it, but I wanted to warn you that you already have the finished article (although I keep updating it almost daily).

    • Hello Master.

      As I mentioned I have commented to Pepe, I am finalizing details of the assembly and in a few days it will be finished and I will upload the files and update all the links. If you want you can subscribe and you will receive an email when the article is finished.

      Reply
  2. Good morning, Mariete. Thank you very much for the article, it is very interesting. I'm going to get on with it. But when you say in some parts of the article "you can download it from here", there is no link. For example, when you download the software you say "you can download it from here with a single click and all in a single package that I have prepared and that contains everything you need"… I don't see a link. Is it me or is it really missing?

    Thanks again.

    Reply
    • Hello Pepe.

      As I comment in the article, although I already had the meter made for some time (there are other entries in this blog talking about it), I have asked for a new CO2 sensor (it arrived just yesterday!) To be able to complete the article with the photos and videos of the whole process. In a few days it will be finished and I will upload the exact files that I will use to take the photos and record the video. I suggest you subscribe so you will receive an email when the article is finished.

      Reply
      • Thank you very much Luis, I'm glad you like it.

        Soon there will be everything that is missing, I am editing the video. Although I already built the prototype many years ago (if you look on the blog, there is an article that talks about it), I have not wanted to upload anything until everything is finished and tested to match exactly with photos and videos.

        There is little left!

        A greeting.

        Reply
    • Hello Pepe.

      You may have already seen it, but I wanted to let you know that you already have the finished article (although I keep updating it almost daily).

      Reply
  3. Thank you very much for the article, super interesting and detailed. I would only recommend changing a small detail, and they are the links to aliexpress, since the sensor is no longer available, and the ESP8266 that you link has the CH340 chip for the usb interface, which from what I have read is quite unstable, and it is more advisable to buy the one with the CP2102 chip although it costs a little more (https://arduino.stackexchange.com/questions/54640/difference-between-these-two-nodemcu-boards/54641#:~:text=The%20biggest%20difference%20is%20difference%20is%20 , die%20at%20a%20moments%20notice.)
    For the rest, thank you very much, more articles like this and in Spanish are needed to bring people closer to a world as fascinating as that of microcontrollers and their home applications.

    Reply
    • Hi Joaquin.

      Thank you very much for your input.

      I put the link MH-Z19B that I asked to make a couple of weeks so that the photos were the same, but it seems that, as you say, it is no longer available. I have updated the link to the detector with another, the same, as if it is available at the moment.

      As for the ESP8266 with CH340 chip, the truth is that I have not had any problems and it is usually cheaper (and I have at least 10 at home, most with CH340, if you look at the rest of the blog posts, where there are several projects). Anyway, if someone prefers the NodeMCU with the CP1202 chip, they have, for example, this: https://s.click.aliexpress.com/e/_AsKr3s
      Regardless of this, I have decided to recommend the link for the LoLin brand because it works well (at least for me) and is very well documented on the internet.

      Reply
      • Hello! Thanks for the article and for the next update.

        I have a Wemos D1 Mini Lite at home. Would I be able to use it with the sensor you propose? Could I follow your tutorial or would the recording / uploading and connections be totally different?

        Reply
        • Hi Carlos!

          You can use a Wemos D1 Mini Lite without any problem. I have some at home, I will try to build a meter with it to be able to put some photo and instructions for those who prefer to do it with this one.

          Reply
          • In case someone else has the Wemos D1 Mini, notice that it has given me a problem because mine was the LITE version, with only 1M flash and the ESP8285 instead of the ESP8266 of the article.

            After much fiddling around, the solution has gone through:
            1) download ESPEasy_ESP82xx_mega-20201130.zip from:
            https://github.com/letscontrolit/ESPEasy/releases/tag/mega-20201130
            (bring the binaries for many different ESP82xx)

            2) Run ESP.Easy.Flasher.exe (the one I downloaded, not the one in the co2 meter folder in this post) and select the binary corresponding to my chip and flash size: ESP_Easy_mega_20201130_normal_ESP8285_1M.bin

            3) If the WIFI does not generate correctly to configure it, you can try to load this other:
            ESP_Easy_mega_20201130_hard_other_POW_ESP8285_1M.bin
            (This has worked for me and I have been able to configure the wifi and the Advanced part, BUT IT DOES NOT BRING THE CO2 SENSOR in the list of devices ...

            4) put back the ESP_Easy_mega_20201130_normal_ESP8285_1M.bin
            Hopefully the AP will already appear configured and connected to your home Wi-Fi and you will be able to access the ESP_EASY IP directly (look at your router to find out what it is)

            5) now if you have the sensor in devices: add it, configure as in the video and working!

    • Hello, Enrique.

      The truth is that I don't know why it can be. Today several people have subscribed without problem and I just tried a test email and I had no problem.

      It occurs to me that it may be a problem with the configuration of cookies in your browser or that you have not accepted them.

      Reply
  4. Hello, thank you very much for the tutorial!!!

    I am very interested and want to build one, but I would like to integrate it into HA.

    Would it be possible ???

    Reply
    • Hello Sergio.

      I assume that with HA you mean Home Automation system (domotics).

      There are many options to integrate it, but it will depend on your specific system.
      I have it completely integrated into my home automation system through MQTT. In this same blog there are several articles in which I talk about the integrations of my system.

      What integration options does your home automation system allow?

      Reply
      • Yes. I mean HOME ASSISTANT, I would also do well for mqtt, I have the mosquitto brocker and several sensors that use it so it would be perfect for me !!

        I have already ordered the material, when it arrives I will follow the tutorial, and if there is something I will ask.

        Thank you very much for your work. EXCELLENT!!!

        Reply
      • Hello, I follow your updates ..

        In the article, you comment that with the box that you have designed we will not even have to weld, the issue of welding gives me a little qualm, apart from that I have no material to do it, I have asked for all the material, but since it is taking me to arrive, is it possible for you to update with the data from the box ?? so I could go asking a colleague to print it for me, and whenever it is feasible not to have to weld, otherwise I will have to look to buy material or see how I organize myself to weld ...

        THANKS!!

        Reply
        • Hello Sergio.

          Until everything is finished I would prefer not to upload anything so that everything matches exactly with photos and videos.

          I have to give the box without solder a turn because the one I designed to print in 3D (which is the one I used in the prototypes seen in other articles on this blog) is for a NodeMCU that they sold before with the pins (the strips of pins that go on the sides) already soldered. With that box you just had to tighten, catching the cable by pressure, and that's it. The problem is that now I cannot find any supplier of the NodeMCU with the pins already soldered. I'll keep looking.

          In the worst case, think that, the basic version, it is only four very easy welds.

          A greeting.

          Reply
  5. hello, the meter is 0 to 5000 or 0 to 10000? I would like to mount it, but I need measurements above 5000 ppm.
    Thanks for the article.

    Reply
    • The same sensor that I use in this article is available in a version with a range from 0 to 10000dpi.
      For example, here https://s.click.aliexpress.com/e/_ABNQgW you can choose from 0 to 2000, from 0 to 5000 and from 0 to 10000

      But be careful, I get the feeling, from the information I have so far, that all or most of the 10000ppm sensors are false.

      Reply
      • I'm also going to be encouraged to make this thing, the first question I've had is just this since I know a little about these sensors and I know that the higher the sampling range, the higher the precision error tends to be.

        In the datasheet I have found the error is calculated like this: ~ 50ppm + 5%, the 5% of 2k: 100ppm, 5k: 250ppm, 10k: 500ppm.

        That is, the higher the range, the more imprecise in the reading. I have searched the limits of environmental co2 toxicity and it is 30k so with this type of sensor it does not make sense to take it into account. Everyone in their application must decide if they want to precisely control the concentration using a 2k (eg portable meter) or want to monitor values without reaching the limits with a 5k (eg fixed meter for a room) ... the 10k for its high mistake I would not recommend it for this purpose.

        Cheers

        Reply
  6. Hi, I'm going to build the device you show. I think the guide is excellent. Could you indicate how to add an LCD display and show the reading in real time? Do you have a paypal account to thank you for this great article? Thanks and best regards!

    Reply
    • Hi Jordi.

      Thank you very much for your words. I'm very glad you liked it and found it useful.

      Yes, it can be done without problem. If you notice, in the photo that illustrates this article, the meter has an LCD screen (it has two) and shows the CO2 reading in real time.

      As soon as I have time, I will put it as an optional modification ...

      I appreciate the Paypal. Better, when you have the meter working, send me a photo 🙂

      Reply
      • Your contribution is very interesting. I could do the same with the Arduino one that I just forgot at the bottom of the drawer. Although I know that it does not have Wi-Fi, but the code could be modified to connect the ldc to see the data in real time and a small buzzer to warn that the room is ventilated.

        My question is, do I need to know the volume of the room where the sensor is placed?

        Reply
        • Hello Rocio.

          Sorry, but the firmware is not valid for Arduino boards.

          The volume of the room is not necessary. The measurement is relative (parts per million), not absolute, so it doesn't matter how big the room is.

          A greeting.

          Reply
    • The project is very interesting, I have already ordered the articles and looking forward to them arriving and learning.
      Are you a Fp teacher?
      a greeting

      Reply
    • I answer to myself: you have to wait for the article to be finished and upload the files (you have to be less impatient and read the previous comments: - |)

      Reply
  7. Hello, interesting project and scalable to make it bigger or with more functions! In which you update the links ... Could you tell us the name of the firmware that you upload to the microcontroller?

    Reply
  8. 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.

    Reply
  9. 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

    Reply
  10. 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 ...

    Reply
    • 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.

      Reply
      • 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.

        Reply
        • 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.

          Reply
    • 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).

      Reply
      • 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.

        Reply
  11. 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 ... 🙁

    Reply
  12. 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.

    Reply
  13. 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.

    Reply
    • 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.

      Reply
  14. 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 !!!! 🙂

    Reply
  15. 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.

    Reply
    • 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.

      Reply
  16. 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.

    Reply
  17. 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?

    Reply
    • 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.

      Reply
  18. 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?

    Reply
    • 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.

      Reply
      • 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.

        Reply
        • 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?

          Reply
          • 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.

  19. 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.

    Beware!

    Reply
    • 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

      Reply
  20. 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.

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

    Let's see…
    .

    Reply
  22. 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!

    Reply
  23. 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.

    Reply
    • 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.

      Reply
  24. 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.

    Reply
    • Hi Jordi.

      You have the software here: Download the CO meter firmware

      On the screen, I have already started to write the article and record the video with the tutorial to install it. I hope it is available this weekend at the latest.

      Reply
      • 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!

        Reply
        • 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.

          Reply
  25. 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 !!!!

    Reply
  26. 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

    Reply
  27. 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?

    Reply
    • 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.

      Reply
      • 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 ...

        Reply
  28. 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?

    Reply
    • 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.

      Reply
    • 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 bare 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

      Reply
  29. I HAVE GOT IT !!!
    I mean…
    YOU'VE GOT IT

    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

    Reply
  30. 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

    Reply
    • 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]
      endon

      Reply
      • 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

        Reply
        • 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! ?

          Reply
  31. 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.

    Reply
    • Hose Jose.

      The connections you comment on are correct.

      Have you looked at the log at http://192.168.1.77/log (changing 192.168.1.77 for the IP of your device)? Maybe some message appears that could be revealing.

      This is what my log looks like when it boots:

      Reply
    • 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….

      Reply
      • 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

        Reply
      • 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.

        Reply
        • 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.

          Reply
  32. 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.

    Reply
    • 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.

      Reply
      • 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.

        Reply
        • 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.

          Reply
    • 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?

      Reply
  33. 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!

    Reply
    • 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.

      Reply
      • 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?

        Reply
        • 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.

          Reply
          • Thanks for the options Mariete, finally it was just a problem to change the UBS cable: -O !! Node Mcu flashed!

          • 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«?

  34. 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.
    Regards.

    Reply
  35. 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.

    Reply
    • 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.

      Reply
      • 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:
        ######2020-12-23######
        #######0.04.007#######
        ######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,

        Reply
        • 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.

          Reply
  36. 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?

    Reply
    • 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?

      Reply
      • 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 ...

        Reply
        • 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.

          Reply
  37. Wonderful tutorial Mariete,

    Congratulations!!!

    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

    Reply
    • 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.

      Reply
  38. 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!

    Reply
    • 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 ...

      Reply
      • 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 🙂

        Reply
        • 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… 🤞

          Reply
  39. Hi.
    Interesting project that I have been looking at for a few days because I am currently working on another for a PM 2.5 and PM 10 pollutant particle meter, in addition to 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.

    Reply
    • 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 ...

      Reply
  40. 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.
    Regards.

    Reply
    • 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! 😀

      Reply
    • Hello Zulu.

      I have not been able to contain myself and have written an article on using the buzzer with ESPEasy and how to integrate it with the CO2 meter using rules.

      You can find it at https://emariete.com/utilizar-un-zumbador-buzzer-con-espeasy/

      Reply
      • 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.
        Regards.

        Reply
        • 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]

          Reply
          • 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.
            Regards.

    • 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«.

      Reply
      • 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!

        Reply
        • 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.

          Reply
  41. 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
    n00s1mp0rt4

    Reply
    • 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.

      Reply
  42. 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?

    Reply
    • 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.

      Reply
      • 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.

        Reply
        • 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.

          Reply
          • 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.

  43. 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

    Reply
    • 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).

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

    https://revspace.nl/MH-Z19B

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

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

    Cheers

    Reply
    • 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.

      Reply
      • 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

        Reply
  45. 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!

    Reply
    • 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.

      Reply
  46. 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:

    https://thingspeak.com/channels/1279169/charts/1?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&type=line&update=15

    THANK YOU VERY MUCH FOR EVERYTHING

    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)

    Reply
    • 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.

      Reply
      • 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?

        Reply
        • 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.

          Reply
  47. 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.

    ######2021-01-11######
    #######0.04.007#######
    ######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

    Reply
    • 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.

      Reply
      • 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.

        Reply
        • 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.

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

            What comes out of the ESP Easy's serial port when it starts up? It is possible that this is 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: 192.168.1.49 (ESP-Easy-0) GW: 192.168.1.1 SN: 255.255.255.0 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

          Reply
          • 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 that ESP Easy creates is temporary, it only appears so that you can connect to it to configure the Wi-Fi network (enter SSID and password). Once you connect to the Wi-Fi network, the access point disappears.

  48. Hello, thank you very much for the article, but I have a problem. I still do not have the co2 detector but I have done everything you say in the video But when I try to connect a web page should appear but http://www.msftconnecttest.com/setup not found

    Reply
    • Hi Ernesto.

      As far as I know, www.msftconnecttest.com is an address that the Windows 10 troubleshooter uses for something, but I won't give you more details.

      I suggest you try to restart NodeMCU, flash it, try another browser, computer or phone.

      Reply
      • 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?

        Reply
        • Hi Ernesto.

          I'm glad you made it.

          As far as I know, ESP Easy 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.

          Reply
  49. 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?

    Reply
    • 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) ..

      Reply
        • Indeed, it is practically the same. The connections are the same and you only have to select in ESP Easy 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.

          Reply
  50. 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.

    Reply
    • 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).

      Reply
  51. good afternoon, to unify module and screen this device found in amazon would be valid:
    https://amzn.to/2XP3KZK
    It would be the same process of installing drivers and driver esp easy?
    Thank you very much for your magnificent work

    Reply
    • Hi.

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

      There is a version experimental of ESP Easy for ESP32 but it would be necessary to test because being experimental there is no guarantee that it will work with all the boards or with all the 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 https: // s .click.aliexpress.com / e / _9fYNJZ or this https://amzn.to/3bQsRDs but I have not tried them to do this project).

      Reply
      • 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

        Reply
  52. 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?

    Reply
  53. 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

    Reply

Leave a Comment