CO₂ meter with MQ-135 sensor (Don't miss it, it's not what it seems)

Last modified March 19, 2021

In this article I am going to tell you what you have to do to set up a CO2 meter with an MQ-135 sensor (sic). An easy and cheap tutorial (it's free).

I hope that, if you are reading this article, it is because you have thought about build an easy and cheap meter with an MQ-135 sensor and an Arduino or ESP8266, you have searched the internet and this page came out.

He single objective of this page is that people who want to build a CO₂ meter with an MQ-135 sensor find this information AND DON'T DO IT!

The very title of CO₂ meter with an MQ-135 sensor is an incongruity in itself, read on to find out why.

There are many projects that promise to measure CO2 but actually use, as in this case, electrochemical sensors commonly used for detecting organic volatile that not only measure CO2, but all those gases together, so really you don't know what you are measuring.

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 taking 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 only parameter you could get with sensors like the MQ-135 would be a: «Value in unknown units of something unknown in the air, which is not known what it is or in what quantity it is«. As you see, something very unhelpful.

Maybe you are also interested in:  Connect an SSD1306 OLED screen to ESPEasy

What a CO₂ meter has to do, as obvious as it may seem, is to measure the CO₂, and do it with as much more precision better.


I have written this article because many users have reached the Telegram group or have written in comments, full of illusion, because they had built a CO2 meter with it MQ-135but it is not working well and they were asking for help. The best help would be if they had read an article like this.

If you really want to build a reliable, accurate CO2 meter that actually measures CO2, check out this tutorial:

The rest of the article, hereafter, is of no importance. I have written it simply so that if you want to mount a meter with the MQ-135 sensor to waste time and waste money, you know how to do it.

Necessary materials

To mount the MQ-135 sensor meter you will need the following:

  • 1 Sensor called MQ-135 that is worthless
  • 1 Arduino

Since I don't want you to build this meter (have you already read why?), I'm not going to leave you the schematic here. You will have to search for it yourself on the internet.

Code for Arduino

I leave you here any code to use this sensor with Arduino. In case you want to build the meter, really and despite my caveats, I recommend you look around because this one I don't even know if it works.

/ * Library Repository: Author: Damrongwit Nusuk Email: [email protected] Website: * / #include "MQ135.h" #define ANALOGPIN A0 / / Define Analog PIN on Arduino Board #define RZERO 206.85 // Define RZERO Calibration Value MQ135 gasSensor = MQ135 (ANALOGPIN); void setup () {Serial.begin (9600); float rzero = gasSensor.getRZero (); delay (3000); Serial.print ("MQ135 RZERO Calibration Value:"); Serial.println (rzero); } void loop () {float ppm = gasSensor.getPPM (); delay (1000); digitalWrite (13, HIGH); Serial.print ("CO2 ppm value:"); Serial.println (ppm); }

You can find the page where this code is published on GitHub here.

Maybe you are also interested in:  3D printed box for CO2 meter

Final advice

How could it be otherwise, my only advice is that you click below and build a CO₂ meter in conditions:

Leave a Comment