Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MQ135 module arduino
13-07-2016, 04:28 PM, (This post was last modified: 13-07-2016, 04:46 PM by walk_porto.)
MQ135 module arduino
Hello everybody,

I am using a PIC32MX440F256H (PIC32-PINGUINO-OTG) and I am working with a "SainSmart MQ135 Sensor Hazardous Gas Detection Module Arduino".

This sensor can get back data of air quality, it can detect many gases ( NH3, NOx, alcohol, benzene, smoke and CO2)
I would like to know if it's possible to get back values of each one using datasheets of this sensor for example ? Or, I just can calibrate each of these gases with datasheets ?
This is the code I'm using below. Enclosed results in Putty terminal.

int sensorValue;

void setup()
 // CDC.begin(9600);      // sets the serial port to 9600

void loop()
 sensorValue = analogRead(A0);       // read analog input pin 0
 CDC.printf("%d \r\n", sensorValue); // prints the value read
 delay(100);                        // wait 100ms for next reading

Attached Files Thumbnail(s)
13-07-2016, 05:56 PM,
RE: MQ135 module arduino
Eventually I can help to convert the MQ135 Arduino lib found in
to use it with the Pinguino IDE.
It appears that there are many sites dealing with the MQ135 sensor on the Web but they are not easy to understand. I assume you already know them.
13-07-2016, 06:10 PM,
RE: MQ135 module arduino
Demat Andre,
Yes, you are right, I read a lot of information but it's not clear in my head for the moment.
I think I would be able to get back data from different gases but apparently, I just can calibrate them.
Meanwhile, on the link you gave, it is possible to get back data of C02 if I understand well.
I first followed this link but it's quite complicated to understand :
His explanations are not detailled and clear.
Then, I think I will use this solution :
This last solution seems easier to understand and to applicate.
What do you think ?
13-07-2016, 07:02 PM,
RE: MQ135 module arduino
Sorry ! I do not understand at all the Youtube video. My hearing is very bad !!!

I dive back in the written explanation from

To better understand I rely on the content of the  Arduino lib of which I previously talked.
See you soon.
13-07-2016, 07:30 PM,
RE: MQ135 module arduino
It's very complicated to understand the video, you are not the only one to say that.
I am working with the same tutorial as you :
His author flipped the main figure of the datasheet ! That's why he said :

Quote:y = a*x^b
ppm = a*(Rs/Ro)^b
He explained that in the commentaries. Read this commentary : Ashutosh BhattJune 1, 2015 at 11:06 AM

I have to understand how he did exactly because I think I will use his results. It's possible to find many information on the MQ135 calibration code for Arduino.
I found this which is very interesting, it's for MQ2 calibration but it can be adapted for MQ135 I think :
See you.

Forum Jump:

Users browsing this thread: 1 Guest(s)