Air Quality Sensor
-
I tried to analyze what is on the small ciscuitboar for my MQ-2 sensor an here is what I think it contains:
So adding the 10K between AOUT and GND is pointless. So what now? Can I use it as is and just use the 1K value for RL in the sketch or is it recommended to change the 1K to something else (10K)??
-
@epierre Couldn't find it either, sorry...
I wouldn't buy a $52,- component without a datasheet, if I were you...@Yveaux right, I opened a dispute with the seller, since I observed also no/nearly no answer to match burning with the sensor, he didn't even answer thus closing the dispute in my favor... that will be a good warning to me about those undocumented sensors comming from only one supplier without datasheet... there are other around, I shall avoid them..
-
I tried to analyze what is on the small ciscuitboar for my MQ-2 sensor an here is what I think it contains:
So adding the 10K between AOUT and GND is pointless. So what now? Can I use it as is and just use the 1K value for RL in the sketch or is it recommended to change the 1K to something else (10K)??
@korttoma You've been lucky finding such a schema, but it is strange there is a resistance on the other side of the sensor, and the variable one is not where expected... maybe the 1K is wrong on the schema, can you mesure it on the board?
5.1 Ohm is low...
The RL here is for the voltage comparator that gives the digital output with led.
MQ-2 datasheet asks for Rs in 3KΩ-30KΩ
If this is right, then the value that the autocalibration "in clean air" should give you something around 1K.The MQ-9 datasheet is a bit more versatile:
Power of Sensitivity body(Ps): Ps=Vc^2×Rs/(Rs+RL)^2
Resistance of sensor(Rs): Rs=(Vc/VRL-1)×RLMQ-9: Rs(in air)/Rs(100ppm CO)≥5
I fear they are using a standard board for all sensors and that the resistance value may be wrong from this, just because they want to deliver a digital signal...
-
@korttoma You've been lucky finding such a schema, but it is strange there is a resistance on the other side of the sensor, and the variable one is not where expected... maybe the 1K is wrong on the schema, can you mesure it on the board?
5.1 Ohm is low...
The RL here is for the voltage comparator that gives the digital output with led.
MQ-2 datasheet asks for Rs in 3KΩ-30KΩ
If this is right, then the value that the autocalibration "in clean air" should give you something around 1K.The MQ-9 datasheet is a bit more versatile:
Power of Sensitivity body(Ps): Ps=Vc^2×Rs/(Rs+RL)^2
Resistance of sensor(Rs): Rs=(Vc/VRL-1)×RLMQ-9: Rs(in air)/Rs(100ppm CO)≥5
I fear they are using a standard board for all sensors and that the resistance value may be wrong from this, just because they want to deliver a digital signal...
I did not find the schema, I measured the board and figured it out myself so it might be wrong.
Could you draw a schema that would show me exactly how it would preferably look so I can change it? Because I'm clearly not smart enough to understand it from your descriptions. Please explain it to me like I was 4 years old ;)
-
Now changed my sensor according to this (disconnected the OP related to DOUT) :
Please confirm that this is how it is preferred to be connected.
-
Now changed my sensor according to this (disconnected the OP related to DOUT) :
Please confirm that this is how it is preferred to be connected.
Hello,
I guess here you have the same that the datasheet, so I assume it is ok ;-)
I've been working to port sketches to a Spark Core with good results, the 12 bits ADC gives more precise values, at least the MQ135 is now very sensitive.
I am also correcting errors in the sketches I have produced.
-
Hello,
A good article on the comparison of 3 same MQ-7 sensors
A lot of good questions, not easy to answer! It is good you tryed it with three sensors instead of just one, and you can see there is a lot of variation from one sensor to the next of the same batch. [...] As to the value of Ro, that is the million dollar question. You have to have a known calibration source of CO in order to determine that! Each MQ-7 sensor will be different. The normal levels in a lab or home will be (should be!) well below the level that this sensor can detect and discriminate. It's lower limit implied in the data sheet is around 50ppm, which is where it begins to be dangerous for continuous exposure. Do read wiki and other sources about carbon monoxide and levels that can occur under different conditions. -
During the weekend I did the hardware changes and tried my MQ-2 sensor again and now if I hit it with smoke (I have smoke on a can) I do get values in Vera under the Variable1 property. No values on the dashboard device itself. I guess some changes are needed for the device file to display the V_VAR1 or we should use something else than V_VAR1.
If you have already updated the sketch for the MQ-2 please let me know where I can get the latest version so I can try it out.
btw, is the MQ-2 supposed to give the value 0 after it is calibrated in clean air? My sensor sends the value 0 all the time unless I hit it with my smoke can.
-
@korttoma said:
If you have already updated the sketch for the MQ-2 please let me know where I can get the latest version so I can try it out.
btw, is the MQ-2 supposed to give the value 0 after it is calibrated in clean air? My sensor sends the value 0 all the time unless I hit it with my smoke can.
Yes I am deeply modifying it, and will have a question for @hek : to have something consistant in time, it owuld be better to have the initial calibration stored, either in EEPROM or as a VAR on the server. Could it be possible that I introduce a loop that wait till the var is answered and if not go into calibration ?
@korttoma the best sketch so far is the following, to be scaled down to one sensor, remove specific Mega initialization. I will make a simpler one based on this soon, as I have already done it for the Spark core.
https://github.com/empierre/arduino/blob/master/MQv01dgi_1_4.ino -
@korttoma said:
If you have already updated the sketch for the MQ-2 please let me know where I can get the latest version so I can try it out.
btw, is the MQ-2 supposed to give the value 0 after it is calibrated in clean air? My sensor sends the value 0 all the time unless I hit it with my smoke can.
Yes I am deeply modifying it, and will have a question for @hek : to have something consistant in time, it owuld be better to have the initial calibration stored, either in EEPROM or as a VAR on the server. Could it be possible that I introduce a loop that wait till the var is answered and if not go into calibration ?
@korttoma the best sketch so far is the following, to be scaled down to one sensor, remove specific Mega initialization. I will make a simpler one based on this soon, as I have already done it for the Spark core.
https://github.com/empierre/arduino/blob/master/MQv01dgi_1_4.ino -
Now some questions I have currently:
I've used your clean air calibration in open air given values of air concentration where appropriate. Around sept 20th I applied this method t omy sketches and I have since sensors that are very much more reactive ! Only 2SH12 has no curve, it is voltage for this (damn) sensor doesn't have a datasheet...
I don't know if this was this predictible...
They are all placed inside a room that I sometime open to clean air. Also there are restarts that calculates again those values where you see it drop maybe, but anyway it will still go to the previous values.
MQ135 in CO2:

MQ2 in Smoke:

2SH12 in SO2 in voltage:

MQ6 in O3:

-
Now changed my sensor according to this (disconnected the OP related to DOUT) :
Please confirm that this is how it is preferred to be connected.
@korttoma I have found a sketch that may interrest you about the gas sensors boards:
http://www.parallax.com/sites/default/files/downloads/27983-Gas-Sensor-Board-A-Schematic.pdf
Their document speaks also about calibrating some gases:
http://www.parallax.com/sites/default/files/downloads/27983-Gas-Sensor-Board-Guide-v1.0.pdf -
@Yveaux you mean something like this ?
return ( (((float)RL_VALUE*(1023.0 - (float) raw_adc)) / (float) raw_adc));I somehow forked the discussion on arduino.cc and sent an email in parallel do Davide Gironi for I would like to understand his formula as opposed to the curve approach.
@Yveaux I have doubts about calculing the resistance, for it is depending on the steps, either 1024 or 4096, and/or the voltage either 5V or 3.3V.
I started with this formulae:
return ( ((float)RL_VALUE*(1023-raw_adc)/raw_adc));But saw Davide Gironi using this one:
return (long)((long)(1024*(long)RL_VALUE)/raw_adc-(long)RL_VALUE);RL_VALUE=22000
-
@Yveaux @korttoma
Bummer... this is the same formula when doing the reduction.... one is 1023 the other 1024 the only change.The RL_VALUE for Davide was 22k, when I mesure the resistance with Analog out with ground, I get 0,996 or 0,999 ohms depending on the sensor. I guess this is the RL_VALUE of the board which is way below the sensor maker recommendation (between 10K and 47K for a MQ135).
Also, I saw that the pot on the board does not change the analog to ground resistance, meaning it is used only for comparison of the digital output....
Am I correct in mesuring this ?
-
@Yveaux @korttoma
Bummer... this is the same formula when doing the reduction.... one is 1023 the other 1024 the only change.The RL_VALUE for Davide was 22k, when I mesure the resistance with Analog out with ground, I get 0,996 or 0,999 ohms depending on the sensor. I guess this is the RL_VALUE of the board which is way below the sensor maker recommendation (between 10K and 47K for a MQ135).
Also, I saw that the pot on the board does not change the analog to ground resistance, meaning it is used only for comparison of the digital output....
Am I correct in mesuring this ?
-
@Yveaux Doing so, I have used a RL_VALUE for each board I mesured, one went to 5MOhms...
MQ2:-8.85 MQ6:0.00 MQ131:0.00 TGS2600:0.00 MQ135:0.00 2SH12:-155004.00 TGZS2602:0.00Something to be noted: same boards have the same resistance, whatever the sensor maker recommendation, this is a pity...
The output I have:
MQ2 :LPG :7ppm CO :0ppm SMOKE :10ppm MQ6 :LPG :0ppm CH4 :0ppm MQ131 :CL2 :0ppm O3 :0ppm TGS2600:H2 :0ppm C2H5OH:0ppm C4H10 :0ppm MQ135 :CO2 :0ppm CO :0ppm CH3 :0ppm NH4 :0ppm 2SH12 :SO2 :-154588.20 raw TGS2602:C7H8 :0ppm Dust :raw : 0 Voltage: 0.00 - Dust Density: -0.10something to remember: MQ135 was calibrated for 1ppm of CO, not 399ppm of CO2, so the calculated value is very low, a per gas Ro must be calculated (clean air calibration) if several gas on one sensor is required to be displayed.
-
Some interresting points from another discussion on the MQ138 that is given for HCHO.
Historically a datasheet said so, but it is impossible to read the datasheet curves:
http://china-total.com/Product/meter/gas-sensor/MQ138.pdfThe latest ones do not speak of HCHO any more.
An available alternative: grove is a wsp2110 and datasheet can be found.
http://www.seeedstudio.com/wiki/Grove_-_HCHO_Sensor -
Hello all,
I'm new here, thanks to this topic very interesting for my personal project: a mobile air quality sensor.
(sorry for my english, i'm french)Fistly, congrat's @epierre and the other, for having shared all this informations!
(it's a litte funny because we had the same idea in the almost same time)
So after having read the entire subject, here my questions (the number in front is the number post):_
17 - @epierre, I haven't well understand How you can distinguish individual gas from a sensor who react with several gas.45 - The "Wunder Weather" list that you talked about, it's a website?
55 - What David did you answer to you about "if he speaks of the organic sensor or the ceramic ones"?
Moreover, what are the organic sensors? Have you example?72- On winsensor.com, an chinese gas sensor producer, the MQ-7 is more powerfull... I don't know who trust, maybe it's not the same?? See the PDF datasheet here.
81 - Where did you read that the lastest one don't speak of HCHO anymore?
After some research, I founded two, one who speak about HCHO here in english , and the other who don't....but I'm not sure (beacause in chinese) here.Otherwise, for the WSP2110 datasheet, it is here! But chinese too =/
Regards,
Alex. -
Hello,
This is a short post, half has been lost in a forum crash, I hope the best remains ;-)
17 - @epierre, I haven't well understand How you can distinguish individual gas from a sensor who react with several gas.You cannot as I showed below with the broken perfume bottle, you can guess there is one, but not which one.
45 - The "Wunder Weather" list that you talked about, it's a website?This is wunderground.com
55 - What David did you answer to you about "if he speaks of the organic sensor or the ceramic ones"? Moreover, what are the organic sensors? Have you example?The organic are the one that have a lifetime of 2 years, calibrated but wery expensive (aroung $150+ apiece), the winseng one for example, big and round.
72- On winsensor.com, an chinese gas sensor producer, the MQ-7 is more powerfull... I don't know who trust, maybe it's not the same?? See the PDF datasheet here.this is hard to say... the MQ-7 is quite special with a sequence to power it up, and readings every period.
81 - Where did you read that the lastest one don't speak of HCHO anymore? After some research, I found two, one who speak about HCHO here in english , and the other who don't....but I'm not sure (beacause in chinese) here.I don't see mention of HCHO (formaldehyde) in the english one (n-Hexane, Benzene, NH3, alcohol, ,smoke, CO. I found one in chinese with the link above but the curve couldn't be exploited. Please remark that Alcohool has not a single formula, but here they show only one curve, not very precise.
Otherwise, for the WSP2110 datasheet, it is here! But chinese too =/Yes for this one something can be done, but there is no for WSP1110 there is no...