Decent inexpensive CO2 sensor

Hi all,

I am relatively new with Arduino. I am doing a project were I need to measure CO2.

I have been working with the cheap MQ 135 but I am unhappy about its accuracy and range. Could it be that I am doing something wrong?

The code I have been using belongs to Davide Gironi:

I burned it in for 48 hours and used his code here posted. The values are not stable at all and after calibrating outside (to 408 ppm), I get lower values in my room (which is not possible). I have tried to include his temperature and humidity correction but I can not add his library and I can not write comments in his blog either.

Anyway, I do not think that this correction would help, as the values continuously jump up to +-200 ppm. I must also say that the equation from the library was corrected according to Rob Berg:

I have been banging my head against the wall for days now and I have not found anything that can solve my issue on the internet either.

//sensor input PIN
int mqInput = A1;
//pull-down resistor value
int mqR = 22000;
//rO sensor value
long rO = 41763;
//min value for Rs/Ro
float minRsRo = 0.358;
//max value for Rs/Ro
float maxRsRo = 2.428;
//sensor a coefficient value
float a = 116.6020682;
//sensor b coefficient value
float b = -2.769034857;
 
void setup() {
  pinMode(mqInput, INPUT);
  Serial.begin(9600);
}
 
void loop() {
  int adcRaw = analogRead(mqInput);
  long rS = ((1024.0 * mqR) / adcRaw) - mqR;
  Serial.print("Rs: ");
  Serial.println(rS);
  float rSrO = (float)rS / (float)rO;
  Serial.print("Rs/Ro: ");
  Serial.println(rSrO);
  if(rSrO < maxRsRo && rSrO > minRsRo) {
 float ppm = a * pow((float)rS / (float)rO, b);
 Serial.print("ppm: ");
 Serial.println(ppm);
  } else {
 Serial.println("Out of range.");
  }
  delay(1000);
}

Has anyone a suggestion of a better one that is not too expensive? I have read good things about the "CCS811 Sensor Module GY-811" (sold in Aliexpress for 12 Euros). It can read up to 8500 ppm in contrast to the MQ 135 (up to 1000 ppm).

Thanks in advance!!

CO2meter.com has a good range. They import some of their sensors from Europe, so you can probably find the identical ones locally.

Hi Morgan,

Thanks for your idea! I checked it and the prices are a bit higher than in other places but the quality is better. I will keep the page for the future.

Has anyone else tips for the MQ 135 or experiences with the "CCS811 Sensor Module GY-811" or similar? I read it had humidity and temperature correction but I am not sure about the source.

The MQ135 is just about as sensitive to several other gases as it is to CO2 (in fact it is MORE sensitive to CO), and the response depends strongly on temperature and humidity.

Unless you use it under carefully controlled circumstances, it is impossible to know what you are actually measuring. You don't get much for $2.

Maybe this can be an idea.

Used in:
Safera’s Smart Cooking Sensor

With CO2 sensors unsurprisingly you get what you pay for. Stuff that is accurate to ±6ppm will set you back about £3,000. Sensors that are ±70ppm are about £70 or less (they often appear on a well known auction site). Both these use a principle called Non Dispersive Infra Red (NDIR) and are what is generally used in commercial and agri-business applications. If you use lower cost parts based on other technologies they will be susceptible to cross sensitivity from other gases (including water / humidity), more suceptible to signal drift, less acurate as calibration is expensive etc.

Our T6713 or T6613 parts would work well in your application, and there is some code on github already available (search AmphenolAdvancedSensors/Telaire).

Good luck with your project.

I went from the MQ-135 to the MH-Z19B and have been happy with the results I get (for household CO2 levels).

Sensor is about $20-27 online.

1 Like

Hi.

I´m also looking for a cheap co2 sensor, but for outdoor measurements, it should have high range (=>10000ppm) , but the accuracy is not a requirement, i´m looking for in the thousands range.

Giving an example:
-A street has 2 street sewage drain, i want to check if any has a high volume of co2..but i´m not interested to know if sewage drain 1 has more 123ppm than sewage drain 2..i´m looking for abnormal values, like, sewage drain 1 has 1000ppm, and sewage drain 2 has 4000ppm.

Since i never worked with similar sensors, i dont know if is even possible to do measurements in the outdoor (not placing the sensor inside the sewage drain), in a relative fast way (ie: not leaving the sensor for hours in the location).

Sewers are likely to have methane too , may affect sensor type choice . Very humid/condensing environment too , so a that could be an issue . Due to the possibility of methane you may also need an intrinsically safe/ flame proof device - not something you can make yourself.
This is really a professional type project not for a hobby forum !

I hope you are not trying to make a system to decide if it’s safe to enter a sewer . A home made device is not suitable for this task, get an approved monitor.

My suspicion is that better sensors are inherently not cheap as they have to use spectroscopy or specialized
sensitive coatings.