Saturday, August 5, 2017

MQ gas sensor correlation coefficients

I've have talk about MQ sensors here:

In the post linked above I've discuss a method to correlate the sensor resistance to a gas ppm using the datasheet curve named "sensitivity characteristics of the MQ-135" and the formula:
Someone ask me about sensor and correlation coefficients of various gasses, so here I will post some correlation coefficient for the a few MQ sensor and gasses.

sensor gas a b min Rs/Ro max Rs/Ro
MQ2 LPG 591.283 -2.076502 0.256166 1.68543
MQ3 alcohol 0.3923202 -1.493249 0.1143375 2.497754
MQ4 CH4 1041.333 -2.729007 0.4365277 1.830508
MQ5 CH4 217.4972 -2.422111 0.2058715 1.035233
MQ6 LPG 940.2178 -2.521573 0.3915661 1.847477
MQ7 H2 64.86522 -1.405261 0.05323301 1.203488
MQ8 H2 1079.683 -0.6416874 0.03115283 13.84067
MQ135 CO2 110.3794 -2.721706 0.8038119 2.416431

Those values have been found using the method proposed in the above post, and the figures posted below.
In order to use the correlation function, you now need to compute the Ro value. You can find this value reading the sensor resistance at a know amount of ppm, compy in the gases ppm limits of the datasheet, and then use this formula:

Those are the
 - collected points:
that has been processes using the following
 - R script:

  • read risk disclaimer
  • excuse my bad english


  1. This comment has been removed by a blog administrator.

  2. Hello Sir. I have been working on this for a course project. I have finished extracting data from the datasheet but I m somehow not able to run the R- Program. It shows up a lot of errors of which the first one is "There is no package called data.table". I do not hold any knowledge in R programming. So can you please help me go past this step. Thank you

    1. Hello, for the error you encouter, you have to set your datapoints in pointsdata array. You could try light to run the R script.

  3. Hello sir! My question is how to find R/Ro by the analog output we receive, what is the correlation between the two? Is it same for all sensors?

    1. Hello, you should not find R/Ro. Take a look here:

  4. How can I find the CO correlation coefficients for MQ-9 sensor? I tried doing your method, by taking the data points from the datasheet, but I got around:
    Estimated a
    Estimated b

    Using the coefficients to calculate ppm, my values were absurd! Can you help me?

    1. Hello, here i explain the method i've use to search values:

  5. How does one go about a linear or systematic way of identification of gas, given a array of mq sensors? My math sucks, it's multivariate analysis.

    1. You can't with this type of sensor identify a specific gas, they react to a bounch of gases.