Go Down

Topic: MQ-135 Waveshare, load resistance (Read 563 times) previous topic - next topic


Mar 28, 2018, 11:03 pm Last Edit: Mar 28, 2018, 11:18 pm by Ins0maniaC
I'm trying to measure PPM of different gases with my MQ-135 Waveshare sensor and ESP8266. I've read milions of articles about how should I do this and I understand everything except one parameter which influences readings vastly- RL (Load resistance). What I can read from Datasheet https://www.waveshare.com/w/upload/7/71/MQ-135.pdf is that it can be adjusted (10kOhm to 47 kOhm) but what I don't understand is how can i adjust it! There's nothing I can do with my sensor to change anything physically. I've analyzed multiple programs, mostly in arduino https://github.com/ViliusKraujutis/MQ135, and almost every program  contains RL with the same value- 10. Which is stupid because from what I understand it should be 10 000 and given plot is based on 20 kOhm RL- what is the point of using 10 kOhm in program? I know that there's voltage divider which gives RS (actuall reading of resistance) based on voltage reading and RL. So without fully understanding load resistance I can't do anything because I can't be sure that calculated PPM will be correct. Can someone explain to me the load resistance concept and what value should I use in my project? There's MQ135 schematic, maybe it'll help- https://www.waveshare.com/w/upload/6/62/MQ-135-Gas-Sensor-Schematic.pdf


Why the producer have chosen 4k7 and also added 5R to the heater circuit.. I can't tell.
Calibrate the sensor with that 4k7.  It will probably be all OK.
The resistor that alters the heater.. short it


I agree with knut_ny, the manufacturer of the MQ135 does not specify that 5R1 resistor. You can short it.
The MQ135 should have a RL of 10k to 47k, not 4k7.
The comparator LM393 is also not very useful, you better use the analog value.

The load resistor depends on how sensitive it will be and the load resistor depends on the sensor itself.
Changing the load resistor means using a solder iron and replacing the load resistor.
The MQ135 is an electro-chemical sensor, and its resistance can change. The load resistor has to match it, and that should be done for each MQ135 sensor.

The preheat time is over 24 hours. You can turn it on and leave it on during 24 hours. After that, the sensor's resistance is more consistant. During the preheat the resistance might change, so perhaps a different load resistor is needed.


I can't really change anything on the sensor since it's not mine (I'm doing a project for some small IT firm). The way I'm reading resistance is by using voltage divider formula- 1023/(value-1)*RL. (Value is a 10 bit number in the range from 0 to 1023 which represents voltage from 0 to 1 V). With given RL and voltage value I get my RS (actual reading needed for calculations). Also- with RL I know how to calibrate the sensor (just need to calucalte R0 in known PPM of CO2).

I don't fully understand what you are trying to tell me. I was thinking that if every resistance calculation is based on voltage divider, potentiometer MQ_R4 is the thing I should look at (it's an adjustable voltage divider, isn't it?) and there's 10K value on the schematic.

With a simple test, RL= 10 (since you can short it from 10000 is that right?), R0= 76,63 (also short from 76630?) I've mananged to read RS around 50 (50k) in clean air and 40 (40K) when breathing on it. It's then easy to calculate PPM, I know how to read plot given in the Datasheet. So in clean air it was around 400 PPM and when breathing on it- around 730 PPM. Looks good?

So producer, when saying that RL can be adjusted he means that you can replace it with new resistor (10K-47K) and in the default there's a resistor with 10K value?
If so- why every plot in the datasheet is based on 20K RL? This datasheet is retarded.


The datasheet is correct. The MQ135 sensor itself (the metal part) is cheap with limitations but useful.

The module with the schematic is not very good.

MQ_R2 is the load resistor, in the schematic it is 4k7.

MQ_R4 has nothing to do with the sensor. It is for the comparator when the digital output will flip.

All that is needed is the voltage over RL, that is the voltage over MQ_R2, which is connected to AOUT.

Did you already turn it on for 24 hours ? for a more consistent value of the sensor.
If the analog output is between 0 and 1V, that is low. A RL of 20k would make that signal higher. But perhaps you can use that low voltage.

I don't know if those ppm are okay. The sensor is sensitive for a number of gasses.
This is a test with the MQ135: http://davidegironi.blogspot.nl/2014/01/cheap-co2-meter-using-mq135-sensor-with.html

Do you understand the schematic ? Since you use the AOUT, the comparator LM393 is not used and the MQ_R4 is not used. Those are only for the digital output DOUT.


Mar 29, 2018, 08:39 pm Last Edit: Mar 29, 2018, 08:47 pm by Ins0maniaC
Oh, I got it now, thanks for clarification. If load resistor is 4,7K in schematic- I can't apply the same value in my program since datasheet states it should be 10-47K value. I'll do the preheating tomorrow. About analog output- I THINK it is 0 to 1V basing on every program I've read so far, 0 information about that in datasheet. So "adjusting" the load resistance simplifies to using variable with the chosen value in my program?

Btw. I was reading some of the datasheets of MQ family sensors and in some of them it simply states that RL is 20K (even though datasheet says to calibrate the sensor with 10-47K value of RL in tip at the end ^^)

About analog output part 2- In ESP8266 is states that "Please note that this input can only tolerate a maximum of 1.0 volts and you must use a voltage divider circuit to measure larger voltages." Don't know what does it mean. The only thing I'm sure is that sensor is powered up by 5V at VCC pin.


Mar 29, 2018, 09:35 pm Last Edit: Mar 29, 2018, 09:38 pm by Koepel
Some ESP8266 modules already have a voltage divider. The pin of the EPS8266 itself is limited to 1.0V. Some EPS8266 modules don't even have an analog input. You have to read the specifications of your ESP8266 board.

"Adjusting" the RL means to replace RL with another resistor. With you module you have to use a solder iron to replace RL.
In your sketch you should always use the actual value of the used RL. On the module that is 4k7, so you must use 4k7 in the calculation in the sketch.

You are using that module. The datasheet of the MQ135 has nothing to do with that module. The datasheet assumes that you use the MQ135 (the metal component) and a load resistor, nothing else.

When RL is has a low value (for example 10k), then the output voltage is lower and it is less sensitive for gasses.
When RL is higher (for example 47k) the output voltage is higher and it is more sensitive for tiny amount of gasses, but it is harder to measure high concentrations.

Normally an Arduino Uno would be used, which can measure 0 ... 5V. After the preheat of 24 hours, if the output voltage (the voltage over RL) is too high then the RL can be replaced with a lower value and vice versa.

I think the 4k7 for RL will work, but then the measurments are less sensitive. If I remember it correctly, the RS will get lower after the preheat. That means the sensitivity will get better after the preheat. Perhaps twice as good as you have now.


Mar 29, 2018, 11:02 pm Last Edit: Mar 29, 2018, 11:20 pm by Ins0maniaC
I'm using WiFi ESP8266 Witty Mini NodeMCU (http://www.icstation.com/esp8266-serial-wifi-witty-cloud-development-board-module-mini-nodemcu-p-8154.html), no real documentation found- only schematic http://www.icstation.com/images/uploads/8154_7.jpg . Can't locate any voltage divider. Same when looking at ESP8266 12F specs (NodeMCU is 12F type). https://www.elecrow.com/download/ESP-12F.pdf (ignoring the fact that this isn't probably the same module because of different pins). Maximum reading for voltage so far was about 0,25 V (when breathing on it from close distance so a lot of CO2)

About RL- I understand it now, thanks again. But what about figure attached to the MQ135 datasheet- it's the only way I can calculate PPM with resistance reading. It's stated that sensitivity characteristic is right for RL= 20K. Should I just ignore that and apply the function anyway?

Wait a minute- I think the problem now is that I don't know what output voltage range of sensor is. Can't find any info about that, only input voltage- 5V.


Mar 29, 2018, 11:23 pm Last Edit: Mar 29, 2018, 11:28 pm by Koepel
Those schematics show no voltage divider, so the input range is 0...1V.

The sensor output voltage is actually 0...5V.
Your output voltage is so low, because the 4k7 is low.
Perhaps you need some protection for the input pin.

The voltage for the heater has a large influence.
I suppose that RL has only little influence on RS. I think the characteristic is the same, once RS is calculated.

If the total accuracy would be 10%, that would be extremely good. But it can be 50% (in)accurate as well. The MQ gas sensors are very cheap.


Now I understand everything, thanks again :)


What is the purpose of the onboard potentiometer used for the MQ sensor (the small little blue box)? Isit represents RL here? or we need to add on extra resistor to represent the RL here?

Go Up