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 Z19b - Running CO2 sensor on batteries

MH Z19b - Running CO2 sensor on batteries

Scheduled Pinned Locked Moved Hardware
sensorsco2z19battery sensorz19bbatterymh z19bmh z19co2 sensorsmhz19bbattery poweredmhz19
3 Posts 3 Posters 2.9k Views 3 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.
  • S Offline
    S Offline
    Siddharth Velappan
    wrote on last edited by
    #1

    I'm trying to run the MH Z19b CO2 sensors interfaced by a PIC microcontroller, powered by 3.6V batteries.
    I would like to get the most out of the battery life. So, I have used a transistor and a GPIO pin from PIC to control the power supply to the CO2 sensor programmatically.

    Please find below, the pseudo code of the programming logic I had used to take CO2 measurements from the MH Z19b sensor. I would like to know if this logic will provide me valid measurements. I am trying to measure the CO2 concentration once in every 15 minutes.

    start_PIC();
    while(true) {
        MHZ19_power_on();
        PIC_sleep(120 seconds);
        /** Till 120 seconds, CO2 sensor was giving 400ppm and only after that I started getting realtime values **/
        MHZ19_get_CO2_concentration_value();
        MHZ19_power_off();
        PIC_sleep(900 seconds);
    }
    
    1 Reply Last reply
    0
    • alowhumA Offline
      alowhumA Offline
      alowhum
      Plugin Developer
      wrote on last edited by
      #2

      These type of sensors often have a warm-up time, often measured in minutes. The datasheet will tell you. If you don't let it warm up you will get poor readings.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bitttttten
        wrote on last edited by
        #3

        Hi @Siddharth-Velappan

        The warmup time of the MH Z19b is 3 minutes. So 2 is probably fine, but you could probably do 3 just in case. Although 2 would save your more battery time.

        Do you mind explaining your setup a bit more? I would love to do something similar but I do not know where to get started with the PIC microcontroller!

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        14

        Online

        12.0k

        Users

        11.2k

        Topics

        113.4k

        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