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. MH-Z19 CO2 sensor

MH-Z19 CO2 sensor

Scheduled Pinned Locked Moved Hardware
23 Posts 10 Posters 21.4k Views 9 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.
  • Daniel OliveiraD Offline
    Daniel OliveiraD Offline
    Daniel Oliveira
    wrote on last edited by
    #14

    Hello,

    I finally got this sensor to work but instead I use this lib: https://github.com/nara256/mhz19_uart
    Another very useful source of information is this: https://revspace.nl/MHZ19#command_0x62_.28device_name_.2F_id.29

    Take note that is the MH-Z19B the methods isWarming() and getStatus() do not work.

    Can you please share the values that you are getting? I'm getting around 1500ppm and it is alarming by these website standards:
    https://www.engineeringtoolbox.com/co2-comfort-level-d_1024.html
    https://www.kane.co.uk/knowledge-centre/what-are-safe-levels-of-co-and-co2-in-rooms

    I didn't have the opportunity yet to get the sensor outdoors.

    Thank you in advance

    MySensors rules my home :)

    1 Reply Last reply
    0
    • alowhumA Offline
      alowhumA Offline
      alowhum
      Plugin Developer
      wrote on last edited by
      #15

      I get values between 300 and 1500 I believe.

      1 Reply Last reply
      0
      • noliN Offline
        noliN Offline
        noli
        wrote on last edited by noli
        #16

        Hi there,
        I'm currently trying to make it work (on an arduino pro mini 3.3), but won't succeed.
        I keep having the following output :

        CO2 - Sending data request to sensor.
        1 - 40 - 1 - 0 - 1 - 21 - 3 - 15 - 0 - END
        Wrong starting byte from co2 sensor! (should be FF)
        Co2 - PPM = -1
        Co2 - zzzzZZZZzzzzZZZZzzzz
        

        Sometimes the second value is different but the first one is always 1. And obviously 1 is not FF :) . However I don't understand what's wrong in there.

        I have to mention I'm using the MH-Z19B, and powering it with 5V, as opposed to the 3.3v of the arduino.
        I also tried with the mhz19_uart lib, but didn't go further with it as the samples where not working out of the box with the z19B. Will probably give it another try, though...

        1 Reply Last reply
        0
        • noliN Offline
          noliN Offline
          noli
          wrote on last edited by
          #17

          Hmm, tried wiht the uart lib, after removing the unsupported parts, no luck either.

          skywatchS 1 Reply Last reply
          0
          • noliN noli

            Hmm, tried wiht the uart lib, after removing the unsupported parts, no luck either.

            skywatchS Offline
            skywatchS Offline
            skywatch
            wrote on last edited by skywatch
            #18

            @alowhum

            Thank you for posting this..... I tried it today and it works well! :)

            To test it I wondered where to get a source of co2 from, then an idea hit me......So I opened a beer :)
            I tipped it into a pint glass and drank most of it. Then, when I remembered the reason for opening the beer, I dangled the sensor into the glass, well above the liquid, placed my hand on top to seal it and swirled the beer around to release the co2 that makes it fizzy - result?

            Well in the room I was getting a constant reading of 395, but in the beer glass it went to 1711, 3055, 5000 !!! - So it works!

            Removing the sensor back to normal room air and it dropped back to 396 within 90 seconds.

            So quite impressed at the moment. So far this it the most expensive sensor I have used. About $18 for the 'B' version.

            1 Reply Last reply
            2
            • alowhumA Offline
              alowhumA Offline
              alowhum
              Plugin Developer
              wrote on last edited by
              #19

              @skywatch you're welcome. Did you use a 5v or 3.3v Arduino? I still have to figure out if this sensor's serial port is 5v tolerant. The MH-Z14 is.

              Nca78N 1 Reply Last reply
              0
              • alowhumA alowhum

                @skywatch you're welcome. Did you use a 5v or 3.3v Arduino? I still have to figure out if this sensor's serial port is 5v tolerant. The MH-Z14 is.

                Nca78N Offline
                Nca78N Offline
                Nca78
                Hardware Contributor
                wrote on last edited by
                #20

                @alowhum said in MH-Z19 CO2 sensor:

                @skywatch you're welcome. Did you use a 5v or 3.3v Arduino? I still have to figure out if this sensor's serial port is 5v tolerant. The MH-Z14 is.

                Datasheet (for model B) says "3.3 V(Compatible with 5V)"

                1 Reply Last reply
                1
                • Joseph GillJ Offline
                  Joseph GillJ Offline
                  Joseph Gill
                  wrote on last edited by
                  #21

                  I know I'm resurrecting an ancient topic here...

                  How have these sensors worked? I need the ability to monitor CO2 and evacuate it when it get's too high. This isn't super mission critical stuff here but I would like to use a sensor like this to get a better idea of how much air I need to evacuate.

                  I'm looking at building something to interface with a MQTT broker to control other IoT devices on my hub. How hard would it be to add that capability to an arduino type solution like this one here?

                  I'm more familiar with RPi's but am interested in this because of the "simplicity".

                  Thanks!

                  Cheers,

                  Joe

                  skywatchS TRS-80T 2 Replies Last reply
                  0
                  • Joseph GillJ Joseph Gill

                    I know I'm resurrecting an ancient topic here...

                    How have these sensors worked? I need the ability to monitor CO2 and evacuate it when it get's too high. This isn't super mission critical stuff here but I would like to use a sensor like this to get a better idea of how much air I need to evacuate.

                    I'm looking at building something to interface with a MQTT broker to control other IoT devices on my hub. How hard would it be to add that capability to an arduino type solution like this one here?

                    I'm more familiar with RPi's but am interested in this because of the "simplicity".

                    Thanks!

                    Cheers,

                    Joe

                    skywatchS Offline
                    skywatchS Offline
                    skywatch
                    wrote on last edited by
                    #22

                    @Joseph-Gill My sensor has taken a few knocks but still works really well. I have got another one now to use in the car (when I get around MYSing the car that is).

                    The last readings from my sensor.....

                    co2.jpg

                    Readings are high as the sensor is currently too low to the ground. I will attend to this when I have time to make it into a cased unit.

                    1 Reply Last reply
                    1
                    • Joseph GillJ Joseph Gill

                      I know I'm resurrecting an ancient topic here...

                      How have these sensors worked? I need the ability to monitor CO2 and evacuate it when it get's too high. This isn't super mission critical stuff here but I would like to use a sensor like this to get a better idea of how much air I need to evacuate.

                      I'm looking at building something to interface with a MQTT broker to control other IoT devices on my hub. How hard would it be to add that capability to an arduino type solution like this one here?

                      I'm more familiar with RPi's but am interested in this because of the "simplicity".

                      Thanks!

                      Cheers,

                      Joe

                      TRS-80T Offline
                      TRS-80T Offline
                      TRS-80
                      wrote on last edited by
                      #23

                      @Joseph-Gill said in MH-Z19 CO2 sensor:

                      "simplicity"

                      Welcome to the forums, Joseph.

                      I am glad to see you put "simplicity" in quotes. Personally, I think that the level of difficulty that is portrayed towards new people (i.e., "it's easy!") is a little misleading. It is easy if you have "The Knack" but perhaps not so for everyone.

                      @Joseph-Gill said in MH-Z19 CO2 sensor:

                      How hard would it be

                      I think this depends mostly on an honest evaluation of your own skills. You will need to have at least basic understanding of the technologies involved: radio propagation, electronics, coding, etc...

                      Now, all of this can be learned of course, especially if you have interest, and time...

                      So another part of it is also your expectations. If you need something "right now" then you might be happier to go buy something "off the shelf."

                      OTOH, if you enjoy tinkering, learning, and want to eventually be able to build all different sort of devices exactly to your specifications and needs, then MySensors might be the right thing for you.

                      IMO, I think the best approach is to take this as a hobby, slowly acquiring parts (the least expensive ones take a long time to come from China!) as well as knowledge, and eventually increasing your capabilities over a long period of time. And you will learn (IMO) very valuable skills in the process...

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


                      24

                      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