Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Air Quality Sensor

Air Quality Sensor

Scheduled Pinned Locked Moved Hardware
calibrationaqigas sensorhchoair quality
270 Posts 46 Posters 308.9k Views 35 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • tuimansoT tuimanso

    @epierre Also, what is the purpose of #define MQ135_MAXRSRO 2.428 //for CO2
    #define MQ135_MINRSRO? I don't see them being referenced after they're defined?

    epierreE Offline
    epierreE Offline
    epierre
    Hero Member
    wrote on last edited by
    #234

    @tuimanso said:

    @epierre Also, what is the purpose of #define MQ135_MAXRSRO 2.428 //for CO2
    #define MQ135_MINRSRO? I don't see them being referenced after they're defined?

    Datasheet defines min and max values they should guarantee, this is an application of it.

    if(validinterval<MQ135_MAXRSRO && validinterval>MQ135_MINRSRO) {
    

    z-wave - Vera -&gt; Domoticz
    rfx - Domoticz &lt;- MyDomoAtHome &lt;- Imperihome
    mysensors -&gt; mysensors-gw -&gt; Domoticz

    1 Reply Last reply
    0
    • tuimansoT Offline
      tuimansoT Offline
      tuimanso
      wrote on last edited by
      #235

      Your previous message

      Hello,

      I have a question about the MQ-8 sensor module . The potentiometer that is soldered onto the board, is it to control the sensitivity of the LED light or for the sensor itself? According to the datasheet for the sensor, the RL (load resistance) for the sensor should be at minimum 10k Ohm, yet I only see an SMD 102 resistor on the board, which is a 1K Ohm resistor. I have used a multimeter to connect the 5V pin and the AOUT pin, and I get precisely a measurement of about 1K Ohm... Does that mean that I should connect a load resistor to this?

      This value seems very important since it is referenced in the code, the RL is part of the calculations, yet it is already pre-written 10K ohms...

      Please Clarify
      Thanks

      ysinhY 1 Reply Last reply
      0
      • AtmosChemeA Offline
        AtmosChemeA Offline
        AtmosCheme
        wrote on last edited by
        #236

        Hello everyone,

        I have a few of these sensors, but lately I have been concentrating on a MQ131 ozone sensor module from SainSmart. I am building an array utilizing MQ gas sensors and an Arduino that can be attached to a drone to measure vertical concnentration profiles of ground level ozone.

        I am using an ozone generator and a 2B Technologies Ozone Monitor for the calibration of the sensor.

        I have done the 24 hour burn in period on my sensors.
        I have warmed them up to get steady values on my serial monitor.

        The problem that I am having is that I am creating nearly 20,000 ppb O3 and the analog output is only around 25 to 30 units. It works out to around 922 ppb per unit.

        Example before ozone is added the sensor reading is steady at 41. After raising the concentration of O3 to 18,727.5 ppb the reading drops to around 17-18.

        Recently I have added a 22,000 ohm resistor in series with the analog output so that my readings start out at 971. But I am still only dropping around 20 units to 951 when ozone levels rise to nearly 20,000 ppb.

        My question is how do I use a larger range of the units. There are 1023 possible values and I would like to see my reading drop from 971 to maybe the 200 area so that I am using more of the range. I would like each unit to be worth about 0.5 ppb. Ambient outdoor concentrations very rarely go higher than maybe 150 ppb so with the setup I have that would not even register on the serial output.

        Thank you in advance for any help.

        epierreE 1 Reply Last reply
        1
        • AtmosChemeA AtmosCheme

          Hello everyone,

          I have a few of these sensors, but lately I have been concentrating on a MQ131 ozone sensor module from SainSmart. I am building an array utilizing MQ gas sensors and an Arduino that can be attached to a drone to measure vertical concnentration profiles of ground level ozone.

          I am using an ozone generator and a 2B Technologies Ozone Monitor for the calibration of the sensor.

          I have done the 24 hour burn in period on my sensors.
          I have warmed them up to get steady values on my serial monitor.

          The problem that I am having is that I am creating nearly 20,000 ppb O3 and the analog output is only around 25 to 30 units. It works out to around 922 ppb per unit.

          Example before ozone is added the sensor reading is steady at 41. After raising the concentration of O3 to 18,727.5 ppb the reading drops to around 17-18.

          Recently I have added a 22,000 ohm resistor in series with the analog output so that my readings start out at 971. But I am still only dropping around 20 units to 951 when ozone levels rise to nearly 20,000 ppb.

          My question is how do I use a larger range of the units. There are 1023 possible values and I would like to see my reading drop from 971 to maybe the 200 area so that I am using more of the range. I would like each unit to be worth about 0.5 ppb. Ambient outdoor concentrations very rarely go higher than maybe 150 ppb so with the setup I have that would not even register on the serial output.

          Thank you in advance for any help.

          epierreE Offline
          epierreE Offline
          epierre
          Hero Member
          wrote on last edited by
          #237

          @AtmosCheme the datasheet gives the MQ131from 1 to 1000 ppb, so you reach the limit obviously

          http://eph.ccs.miami.edu/precise/GasSensorSpecs/Ozone.pdf

          z-wave - Vera -&gt; Domoticz
          rfx - Domoticz &lt;- MyDomoAtHome &lt;- Imperihome
          mysensors -&gt; mysensors-gw -&gt; Domoticz

          AtmosChemeA 1 Reply Last reply
          0
          • epierreE epierre

            @AtmosCheme the datasheet gives the MQ131from 1 to 1000 ppb, so you reach the limit obviously

            http://eph.ccs.miami.edu/precise/GasSensorSpecs/Ozone.pdf

            AtmosChemeA Offline
            AtmosChemeA Offline
            AtmosCheme
            wrote on last edited by
            #238

            @epierre

            Thank you for the reply epierre.

            I was going off of the SainSmart website that says the range for their module is 10 ppb to 200 ppm. That would cover 10 ppb to 200,000 ppb.

            http://www.sainsmart.com/sensors/eco/sainsmart-mq131-gas-sensor-ozone-module-for-arduino-uno-mega2560-r3-raspberry-pi.html

            The values keep dropping down as more and more ozone is added, I'm not thinking it is a problem with range as much as a problem with resolution. I have gone as high as around 50,000 ppb and continue to get response from the sensor.

            Ive thought of using mapping functions in my code as well as resolution functions. But I just wasn't sure if there was a component I could add to the circuit to improve resolution.

            In my latest sketch I have used a calibration code that analog reads the sensor for 6 minutes, and then remaps the min and max values observed during that time. I though this would get a broader range of values. The problem is that the longer the sensor is on it becomes stable so the min and max values become the same and there is nothing to map. So the longer it runs the smaller the range of values in the serial monitor.

            epierreE 1 Reply Last reply
            0
            • AtmosChemeA AtmosCheme

              @epierre

              Thank you for the reply epierre.

              I was going off of the SainSmart website that says the range for their module is 10 ppb to 200 ppm. That would cover 10 ppb to 200,000 ppb.

              http://www.sainsmart.com/sensors/eco/sainsmart-mq131-gas-sensor-ozone-module-for-arduino-uno-mega2560-r3-raspberry-pi.html

              The values keep dropping down as more and more ozone is added, I'm not thinking it is a problem with range as much as a problem with resolution. I have gone as high as around 50,000 ppb and continue to get response from the sensor.

              Ive thought of using mapping functions in my code as well as resolution functions. But I just wasn't sure if there was a component I could add to the circuit to improve resolution.

              In my latest sketch I have used a calibration code that analog reads the sensor for 6 minutes, and then remaps the min and max values observed during that time. I though this would get a broader range of values. The problem is that the longer the sensor is on it becomes stable so the min and max values become the same and there is nothing to map. So the longer it runs the smaller the range of values in the serial monitor.

              epierreE Offline
              epierreE Offline
              epierre
              Hero Member
              wrote on last edited by
              #239

              @AtmosCheme said:

              I was going off of the SainSmart website that says the range for their module is 10 ppb to 200 ppm. That would cover 10 ppb to 200,000 ppb.

              check their datasheet (or ask for it !)

              The values keep dropping down as more and more ozone is added, I'm not thinking it is a problem with range as much as a problem with resolution. I have gone as high as around 50,000 ppb and continue to get response from the sensor.

              yes it should be possible but you don't know from the datasheet the value. On a power regression you make an estimation with error, but that may change outside of know datapoints.

              Ive thought of using mapping functions in my code as well as resolution functions. But I just wasn't sure if there was a component I could add to the circuit to improve resolution.

              some as the Particle Photon has a better ADC that goes up to 4096

              z-wave - Vera -&gt; Domoticz
              rfx - Domoticz &lt;- MyDomoAtHome &lt;- Imperihome
              mysensors -&gt; mysensors-gw -&gt; Domoticz

              1 Reply Last reply
              0
              • jnewton957J Offline
                jnewton957J Offline
                jnewton957
                wrote on last edited by
                #240

                Hi,

                I just try to connect 7 sensors to an nano.
                MQ-2, MQ-3, MQ-4,MQ-6, MQ-7,MQ-9, MQ-135

                With sketch form robosensor https://forum.mysensors.org/topic/1595/mq2-sensor-w-airquality-sketch/2

                I get data like MQ-7:1020 ,MQ135: 294, MQ-2:191

                So it looks really good.
                As i would like to have also the correct names an value names of the sensor and a correct calibration I think I should use a sketch like AirQuality-Multiple_Gas_Sensor1_4.ino
                But I only see 3 of my 7 sensors in this sketch.

                What would be a good sketch for my 7 sensors ??

                Thanks
                Jorg

                1 Reply Last reply
                0
                • walk_portoW Offline
                  walk_portoW Offline
                  walk_porto
                  wrote on last edited by
                  #241

                  Hello everybody,

                  I am working with an Arduino Uno and a MQ135 module arduino : http://www.sainsmart.com/sainsmart-mq135-sensor-air-quality-sensor-hazardous-gas-detection-module-arduino.html

                  I can get back data from this sensor, I got 100 ppm when I launched serial terminal after compiling and uploading this code below.

                  int sensorValue;
                  
                  void setup()
                  {
                    Serial.begin(9600);      // sets the serial port to 9600
                  }
                  
                  void loop()
                  {
                    sensorValue = analogRead(0);       // read analog input pin 0
                    Serial.println(sensorValue, DEC);  // prints the value read
                    delay(100);                        // wait 100ms for next reading
                  }
                  

                  But, I would like to get back data from gases like NH3, NOx, alcohol, benzene, smoke and CO2 . I read a lot of topics and the datasheets of the sensor but I don't see how to do.

                  If someone could help me, it will be great.

                  Thanks.

                  AtmosChemeA 1 Reply Last reply
                  0
                  • walk_portoW walk_porto

                    Hello everybody,

                    I am working with an Arduino Uno and a MQ135 module arduino : http://www.sainsmart.com/sainsmart-mq135-sensor-air-quality-sensor-hazardous-gas-detection-module-arduino.html

                    I can get back data from this sensor, I got 100 ppm when I launched serial terminal after compiling and uploading this code below.

                    int sensorValue;
                    
                    void setup()
                    {
                      Serial.begin(9600);      // sets the serial port to 9600
                    }
                    
                    void loop()
                    {
                      sensorValue = analogRead(0);       // read analog input pin 0
                      Serial.println(sensorValue, DEC);  // prints the value read
                      delay(100);                        // wait 100ms for next reading
                    }
                    

                    But, I would like to get back data from gases like NH3, NOx, alcohol, benzene, smoke and CO2 . I read a lot of topics and the datasheets of the sensor but I don't see how to do.

                    If someone could help me, it will be great.

                    Thanks.

                    AtmosChemeA Offline
                    AtmosChemeA Offline
                    AtmosCheme
                    wrote on last edited by
                    #242

                    @walk_porto

                    I think that the only way you are going to be able to distinguish between different gases is to have a known concentration of that gas and adjust load resistance. This sensor will detect all of these gase because of cross sensitivity to the gases mentioned in the filament. You can not use just one MQ135 sensor and get readings for all of the gases.

                    1 Reply Last reply
                    0
                    • Thanh-VietT Offline
                      Thanh-VietT Offline
                      Thanh-Viet
                      wrote on last edited by
                      #243

                      Hi Guys,

                      Nice work. I'm based in Hong Kong, and what matters to us is PM2.5, NO2 and Ozone (and indoor CO2/VOC).

                      Have you guys checked the laser based particle sensors like the Plantower G1-G3-G5, Innovafitness SDS011/021 ?
                      http://aqicn.org/sensor

                      alexsh1A 1 Reply Last reply
                      0
                      • Thanh-VietT Thanh-Viet

                        Hi Guys,

                        Nice work. I'm based in Hong Kong, and what matters to us is PM2.5, NO2 and Ozone (and indoor CO2/VOC).

                        Have you guys checked the laser based particle sensors like the Plantower G1-G3-G5, Innovafitness SDS011/021 ?
                        http://aqicn.org/sensor

                        alexsh1A Offline
                        alexsh1A Offline
                        alexsh1
                        wrote on last edited by
                        #244

                        @Thanh-Viet Hello. Yes, I have Plantower G3 on order from Aliexpress and won't be able to test it before September. I think adopting it for MySensors is going to be easy

                        1 Reply Last reply
                        1
                        • paqorP Offline
                          paqorP Offline
                          paqor
                          wrote on last edited by
                          #245

                          Hello, there are statements if the values increase the MQ135 when a room ventilated, without people and is furnished? I I have several rooms here an increase over time. Perhaps this is also by the increase in temperature, sunlight or gases from the furniture. I have not found any literature on this. Is this behavior with other users as well?

                          1 Reply Last reply
                          0
                          • paqorP Offline
                            paqorP Offline
                            paqor
                            wrote on last edited by
                            #246

                            Has the type of installation (horizontal or vertical) have an impact on the values of MQ135? I have found no photos of built-in sensors already exist in the data sheet a statement.

                            alexsh1A 1 Reply Last reply
                            0
                            • paqorP paqor

                              Has the type of installation (horizontal or vertical) have an impact on the values of MQ135? I have found no photos of built-in sensors already exist in the data sheet a statement.

                              alexsh1A Offline
                              alexsh1A Offline
                              alexsh1
                              wrote on last edited by
                              #247

                              @paqor yes, in fact my MQ-135 was so unreliable that I had to move on to a different sensor

                              1 Reply Last reply
                              1
                              • paqorP Offline
                                paqorP Offline
                                paqor
                                wrote on last edited by paqor
                                #248

                                Those interested in a 4 sensors Sketch FHEM (CO2, Temp, Hum, Motion) has ...

                                ? 1 Reply Last reply
                                1
                                • paqorP paqor

                                  Those interested in a 4 sensors Sketch FHEM (CO2, Temp, Hum, Motion) has ...

                                  ? Offline
                                  ? Offline
                                  A Former User
                                  wrote on last edited by
                                  #249

                                  @paqor
                                  I'm interested, but i'm using mysensors 2.0. Can you update your sketch?

                                  paqorP 1 Reply Last reply
                                  0
                                  • ? A Former User

                                    @paqor
                                    I'm interested, but i'm using mysensors 2.0. Can you update your sketch?

                                    paqorP Offline
                                    paqorP Offline
                                    paqor
                                    wrote on last edited by
                                    #250

                                    @gieljnssns said:

                                    @paqor
                                    I'm interested, but i'm using mysensors 2.0. Can you update your sketch?

                                    Yes, sure but I need time. I'm not a good programmer and need a lot of testing. My Englich is not particularly good. As some patience please, because I have to house, garden, woman and taking care of animals. :two_men_holding_hands:

                                    paqorP 1 Reply Last reply
                                    0
                                    • paqorP paqor

                                      @gieljnssns said:

                                      @paqor
                                      I'm interested, but i'm using mysensors 2.0. Can you update your sketch?

                                      Yes, sure but I need time. I'm not a good programmer and need a lot of testing. My Englich is not particularly good. As some patience please, because I have to house, garden, woman and taking care of animals. :two_men_holding_hands:

                                      paqorP Offline
                                      paqorP Offline
                                      paqor
                                      wrote on last edited by paqor
                                      #251

                                      @gieljnssns said in Air Quality Sensor:

                                      @paqor
                                      I'm interested, but i'm using mysensors 2.0. Can you update your sketch?

                                      @paqor
                                      https://gleisnetze.de/2016/08/07/sensoren4sketch/

                                      • v0.8 korrigierte Lib von RSTOICA
                                      • EEPROM set R0Cor
                                      • amended mq135.h required!
                                      • Temp, Hum --> CO2Cor
                                      • Api 2.0
                                      • Motion is not yet tested
                                      • Auto base value set r0corr if Co2cor <390
                                      • R0Cor set by TextField runs (incoming message)
                                      • Redesign
                                      paqorP 1 Reply Last reply
                                      0
                                      • paqorP paqor

                                        @gieljnssns said in Air Quality Sensor:

                                        @paqor
                                        I'm interested, but i'm using mysensors 2.0. Can you update your sketch?

                                        @paqor
                                        https://gleisnetze.de/2016/08/07/sensoren4sketch/

                                        • v0.8 korrigierte Lib von RSTOICA
                                        • EEPROM set R0Cor
                                        • amended mq135.h required!
                                        • Temp, Hum --> CO2Cor
                                        • Api 2.0
                                        • Motion is not yet tested
                                        • Auto base value set r0corr if Co2cor <390
                                        • R0Cor set by TextField runs (incoming message)
                                        • Redesign
                                        paqorP Offline
                                        paqorP Offline
                                        paqor
                                        wrote on last edited by paqor
                                        #252

                                        @paqor
                                        Probably one should not speak of a sensor CO2 value as well as responding to many other particles at the MQ135. The most accurate CO2 measurement we certainly be possible only with a MH-Z14. I now have to buy me a part and will then calibrate the MQ135 so. With the MQ135 can z. B. only say something about the air quality in relation to the outside air. It is rather a relative value.

                                        Here the comparison of MH-14T (yellow) and MQ135 (red). One sees the calibration and as yet are both curves to each other.
                                        [https://smarthome.gleisnetze.de/38-mhz-14-erste-erfahrungen-mit-dem-co2-sensor-fuer-mysensors-arduino-fhem]

                                        Wahrscheinlich sollte man beim MQ135 nicht von einem CO2 Wert sprechen da der Sensor auch auf viele andere Partikel reagiert. Die genaueste CO2 Messung wir sicher nur mit einem MH-Z14 möglich sein. Ich habe mir jetzt so ein Teil bestellt und werde dann den MQ135 damit kalibrieren. Mit dem MQ135 lässt sich z. B. nur etwas zur Luftgüte im Verhältnis zur Außenluft sagen. Es ist also eher ein relativer Wert.

                                        1 Reply Last reply
                                        0
                                        • tuimansoT tuimanso

                                          Your previous message

                                          Hello,

                                          I have a question about the MQ-8 sensor module . The potentiometer that is soldered onto the board, is it to control the sensitivity of the LED light or for the sensor itself? According to the datasheet for the sensor, the RL (load resistance) for the sensor should be at minimum 10k Ohm, yet I only see an SMD 102 resistor on the board, which is a 1K Ohm resistor. I have used a multimeter to connect the 5V pin and the AOUT pin, and I get precisely a measurement of about 1K Ohm... Does that mean that I should connect a load resistor to this?

                                          This value seems very important since it is referenced in the code, the RL is part of the calculations, yet it is already pre-written 10K ohms...

                                          Please Clarify
                                          Thanks

                                          ysinhY Offline
                                          ysinhY Offline
                                          ysinh
                                          wrote on last edited by
                                          #253

                                          @tuimanso
                                          There seems a general misunderstanding about how those gas sensors really work: the "heater" must be switched on (5v) and "off"(1.4v) for the air sample going in and out of the sensor, when heating the air sample expands and goes out of the sensor, then in the cool down period the remaining air contracts and sucks in a new sample.
                                          Those boards with mq... sensors only provide fixed 5v heating, so this can never work reliable
                                          the 1.4v is needed to keep the sensor on a minimum temperature,example 40'c for the catalyst to react, the 5v will heat it up to example 80'c, to clean the catalyst and air flows out of the sensor
                                          http://i49.tinypic.com/2rzdqgn.png something like this will work
                                          Soon I will report my results together with a modified sketch for mysensors 2.0

                                          1 Reply Last reply
                                          1
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          13

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular