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.
  • rollercontainerR rollercontainer

    @alexsh1 I dont think so, in epierres sketch both values appear:

    https://github.com/empierre/arduino/blob/master/AirQuality-MQ135.ino#L25
    https://github.com/empierre/arduino/blob/master/AirQuality-MQ135.ino#L33

    So, what the heck is mq135_ro? And what to tune to?

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

    @rollercontainer said:

    @alexsh1 I dont think so, in epierres sketch both values appear:

    https://github.com/empierre/arduino/blob/master/AirQuality-MQ135.ino#L25
    https://github.com/empierre/arduino/blob/master/AirQuality-MQ135.ino#L33

    So, what the heck is mq135_ro? And what to tune to?

    I think https://github.com/empierre/arduino/blob/master/AirQuality-MQ135.ino#L25

    is identical to

    https://github.com/GeorgK/MQ135/blob/master/MQ135.h#L27 multiplied by a factor is 1000

    Maybe @epierre can clarify it?

    1 Reply Last reply
    0
    • rollercontainerR Offline
      rollercontainerR Offline
      rollercontainer
      wrote on last edited by rollercontainer
      #218

      Hm, in the loop, mq135_ro will be read and used. As written in line 78, the MQ135_DEFAULTRO can be overwritten by the messured mq135_ro. Ok, but where is the 10kOhm voltage divider in this calculation? Included in the measurement of mq135_ro?
      https://github.com/empierre/arduino/blob/master/AirQuality-MQ135.ino#L78

      alexsh1A 1 Reply Last reply
      0
      • rollercontainerR rollercontainer

        Hm, in the loop, mq135_ro will be read and used. As written in line 78, the MQ135_DEFAULTRO can be overwritten by the messured mq135_ro. Ok, but where is the 10kOhm voltage divider in this calculation? Included in the measurement of mq135_ro?
        https://github.com/empierre/arduino/blob/master/AirQuality-MQ135.ino#L78

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

        @rollercontainer you are correct - mq135_ro is overwritten in the loop and I do not see a point in float mq135_ro = 10000.0; unless the mq135_ro function is deactivated during calibration. However, #define MQ135_DEFAULTRO 68550 this is the parameter you should change during the calibration process. Try to calibrate with the function mq135_ro and deactivating it though I am sure the result will be the same.

        1 Reply Last reply
        0
        • tantt2810T Offline
          tantt2810T Offline
          tantt2810
          wrote on last edited by
          #220

          Hi all,

          I have my library for reading sensor. It is open source and its name is OpenSensor. I think that it's useful for every body.

          Besides, I have my a monitoring system in real time using Arduino, MQ2, MQ135, MG811, GP2Y10 sensors and shield wifi ESP8266. It use OpenSensor library to read value from sensor and push it to database of WebServer by ESP826.

          This is link: https://github.com/tantt2810

          Hoping it helpful for all,

          Good job,

          alexsh1A 1 Reply Last reply
          0
          • tantt2810T tantt2810

            Hi all,

            I have my library for reading sensor. It is open source and its name is OpenSensor. I think that it's useful for every body.

            Besides, I have my a monitoring system in real time using Arduino, MQ2, MQ135, MG811, GP2Y10 sensors and shield wifi ESP8266. It use OpenSensor library to read value from sensor and push it to database of WebServer by ESP826.

            This is link: https://github.com/tantt2810

            Hoping it helpful for all,

            Good job,

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

            @tantt2810 Thanks

            #define RSRO_CLEAN_AIR_FACTOR        3.7                                    //The value of Rs/Ro in clean air. According chart in datasheet.
            #define RL_VALUE                     20                                     //The value of the load resistance on the board, in kilo ohms.
            #define GET_RO_SAMPLE_TIMES          10                                     //The times of calibrating 
            #define GET_RS_SAMPLE_TIMES          10
            

            Can you please elaborate on how to calibrate the sensor?
            Also how do you connect it if it comes on the board like this?

            http://i.ebayimg.com/00/s/NjAwWDYwMA==/z/vMIAAOxycD9TTOVW/$_1.JPG

            epierreE 1 Reply Last reply
            0
            • alexsh1A alexsh1

              @tantt2810 Thanks

              #define RSRO_CLEAN_AIR_FACTOR        3.7                                    //The value of Rs/Ro in clean air. According chart in datasheet.
              #define RL_VALUE                     20                                     //The value of the load resistance on the board, in kilo ohms.
              #define GET_RO_SAMPLE_TIMES          10                                     //The times of calibrating 
              #define GET_RS_SAMPLE_TIMES          10
              

              Can you please elaborate on how to calibrate the sensor?
              Also how do you connect it if it comes on the board like this?

              http://i.ebayimg.com/00/s/NjAwWDYwMA==/z/vMIAAOxycD9TTOVW/$_1.JPG

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

              @alexsh1 said:

              Also how do you connect it if it comes on the board like this?
              http://i.ebayimg.com/00/s/NjAwWDYwMA==/z/vMIAAOxycD9TTOVW/$_1.JPG

              easy here, the AOUT is the one you will put on an analog one.

              the DOUT (Digital OUT) is just an alarm linked to a level you could change on the board)

              z-wave - Vera -> Domoticz
              rfx - Domoticz <- MyDomoAtHome <- Imperihome
              mysensors -> mysensors-gw -> Domoticz

              alexsh1A 1 Reply Last reply
              0
              • epierreE epierre

                @alexsh1 said:

                Also how do you connect it if it comes on the board like this?
                http://i.ebayimg.com/00/s/NjAwWDYwMA==/z/vMIAAOxycD9TTOVW/$_1.JPG

                easy here, the AOUT is the one you will put on an analog one.

                the DOUT (Digital OUT) is just an alarm linked to a level you could change on the board)

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

                @epierre said:

                the DOUT (Digital OUT) is just an alarm linked to a level you could change on the board)

                So DOUT is not used. Just AOUT?

                epierreE 1 Reply Last reply
                0
                • alexsh1A alexsh1

                  @epierre said:

                  the DOUT (Digital OUT) is just an alarm linked to a level you could change on the board)

                  So DOUT is not used. Just AOUT?

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

                  @alexsh1 said:

                  @epierre said:

                  the DOUT (Digital OUT) is just an alarm linked to a level you could change on the board)

                  So DOUT is not used. Just AOUT?

                  yes !

                  z-wave - Vera -> Domoticz
                  rfx - Domoticz <- MyDomoAtHome <- Imperihome
                  mysensors -> mysensors-gw -> Domoticz

                  1 Reply Last reply
                  0
                  • alexsh1A Offline
                    alexsh1A Offline
                    alexsh1
                    wrote on last edited by alexsh1
                    #225

                    @epierre For the air quality purpose which sensor would you recommend TSG-2600 or TS2602? They are slightly different, but both detect aiir contaminants (based on ppm of H2 and EtOH).

                    So far, I got MH-Z14A and the Dust sensor working with OLED screen and Domoticz and I just want to add 1-2 sensors to finish the project.

                    1 Reply Last reply
                    0
                    • epierreE Offline
                      epierreE Offline
                      epierre
                      Hero Member
                      wrote on last edited by
                      #226

                      @alexsh1 well any I would think for they are similar technology

                      z-wave - Vera -> Domoticz
                      rfx - Domoticz <- MyDomoAtHome <- Imperihome
                      mysensors -> mysensors-gw -> Domoticz

                      alexsh1A 1 Reply Last reply
                      0
                      • epierreE epierre

                        @alexsh1 well any I would think for they are similar technology

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

                        @epierre What about MICS-4514 or MICS-5524?

                        I am thinking ordering this board:
                        https://sgx.cdistore.com/ProductDetail/MICSVZ86F-SGX-Sensortech-Limited-formerly-e2v/556306/#.V2Bw7jVUmec

                        1 Reply Last reply
                        0
                        • Tore André RosanderT Offline
                          Tore André RosanderT Offline
                          Tore André Rosander
                          wrote on last edited by Tore André Rosander
                          #228

                          How do i get the Airquality sensor to show in domoticz? I use the AirQuality example from the library and MQ2.
                          I can see that it works in the serial, and it shows as a node under the mysensors hardware, but nothing in log or the device list when i expose it for gas.

                          0_1466081228162_upload-0f9ebe47-10d5-446c-a3bd-24c1649c94c1

                          epierreE 1 Reply Last reply
                          0
                          • Tore André RosanderT Tore André Rosander

                            How do i get the Airquality sensor to show in domoticz? I use the AirQuality example from the library and MQ2.
                            I can see that it works in the serial, and it shows as a node under the mysensors hardware, but nothing in log or the device list when i expose it for gas.

                            0_1466081228162_upload-0f9ebe47-10d5-446c-a3bd-24c1649c94c1

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

                            @Tore-André-Rosander said:

                            ut nothing in log or the device list when i expose it for gas.

                            huh you're on which version of mysensors ? have you tried the console (in arduino programmer) to see if there are some readings or a good wiring ?

                            z-wave - Vera -> Domoticz
                            rfx - Domoticz <- MyDomoAtHome <- Imperihome
                            mysensors -> mysensors-gw -> Domoticz

                            1 Reply Last reply
                            0
                            • Tore André RosanderT Offline
                              Tore André RosanderT Offline
                              Tore André Rosander
                              wrote on last edited by Tore André Rosander
                              #230

                              @epierre Hi! The dev branch (v 2) and the raspberry pi gateway (nrf24 directly connected to RPi GPIO). This is what i get in the serial console when i test with gas from a lighter:

                              Starting sensor (RNNNA-, 2.0.0-beta)
                              Radio init successful.
                              find parent
                              send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
                              find parent
                              send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
                              read: 0-0-255 s=255,c=3,t=8,pt=1,l=1,sg=0:0
                              parent=0, d=1
                              req id
                              send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
                              req id
                              send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
                              read: 0-0-255 s=255,c=3,t=4,pt=0,l=2,sg=0:5
                              
                              send: 5-5-0-0 s=255,c=3,t=15,pt=0,l=2,sg=0,st=ok:
                              send: 5-5-0-0 s=255,c=0,t=17,pt=0,l=10,sg=0,st=ok:2.0.0-beta
                              send: 5-5-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=fail:0
                              id=5
                              Init complete, id=5, parent=0, distance=1
                              0
                              LPG:0ppm    CO:0ppm    SMOKE:0ppm
                              0
                              LPG:8ppm    CO:47ppm    SMOKE:18ppm
                              send: 5-5-0-0 s=0,c=1,t=37,pt=2,l=2,sg=0,st=ok:95
                              0
                              LPG:0ppm    CO:0ppm    SMOKE:0ppm
                              send: 5-5-0-0 s=0,c=1,t=37,pt=2,l=2,sg=0,st=ok:0```
                              1 Reply Last reply
                              0
                              • epierreE Offline
                                epierreE Offline
                                epierre
                                Hero Member
                                wrote on last edited by
                                #231

                                @Tore-André-Rosander said:

                                t=37

                                I don't know, would it be possible to have someone knowing the difference of the gateway with domoticz for 2.0 ? here it seems correct to me, some value are well seend from the sensor, so it is between the gateway and domoticz for me.

                                z-wave - Vera -> Domoticz
                                rfx - Domoticz <- MyDomoAtHome <- Imperihome
                                mysensors -> mysensors-gw -> Domoticz

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

                                  @epierre I am attempting to apply this code to work with the MQ-8. I am trying to get rid of all of the radio and gw stuff that is in the code. Do you have anything that just calibrates the sensor and reads out the value without of all these other libraries?

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

                                    @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 1 Reply Last reply
                                    0
                                    • 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
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          14

                                          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