Categories

CO2 meter using NDIR infrared MH-Z14 sensor library for AVR ATmega

Posted on Thursday, January 16th, 2014 in AVR, library by DP

atmega_mhz14_co2_meter

Davide Gironi writes:

MH-Z14 NDIR Infrared gas module is a common type, small size sensor, using non-dispersive infrared (NDIR) principle to detect the existence of CO2 in the air, with good selectivity, non-oxygen dependant and long life.
MH-Z14 has a PWM output, with a sensitivity range of 0ppm to 2000ppm CO2, an accurancy of ±200ppm.
The cycle is 1004ms±5%, given the duty cicle Th (pulse high), Tl is 1004-Th, we can convert it to CO2 value using the formula: CO2ppm = 2000 * (Th – 2ms) /(Th + Tl – 4ms)
This library read PWM output, and convert it to CO2ppm. This library was developed on Eclipse, built with avr-gcc on Atmega8 @ 8MHz

Check out the video after the break.

This entry was posted on Thursday, January 16th, 2014 at 1:30 pm and is filed under AVR, library. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

5 Responses to “CO2 meter using NDIR infrared MH-Z14 sensor library for AVR ATmega”

  1. Rubi says:

    Nice!
    Where have you bought this sensor?

  2. Martin says:

    I can totally see CO2 sensors being used to optimize room atmosphere in crowded office spaces or even at home. Nice project.

    • Martin, CO2 meters are rather expensive for home use; $100 and up. Because of my interest in building science, I have a CO2 meter (stand-alone unit with USB interface so you can log to a computer as well). Because animals exhale a lot of water vapor, RH is a good (and cheap) proxy for indoor CO2. For the times it’s not (i.e. cooking and showering increase RH without increasing CO2), you generally want to increase air changes anyway to reduce the RH.
      You also need a *REALLY* tight building to get elevated CO2 levels. My house tested out at 1.2ACH@50pa, and the only time CO2 got over 1000ppm was during one of my son’s birthday parties with over a dozen young boys running around the house.

      • Martin says:

        Ralph, thanks for the heads up. $100+ doesnt necessarily put me off, but the tight building seems to be an important point. I’ll have to check that, thanks.

  3. Martin says:

    Ralph, thanks for the heads up. $100+ doesnt necessarily put me off, but the tight building seems to be an important point. I’ll have to check that, thanks.

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recent Comments

  • Geert Jordaens: I'm not sure what kind of licensing I have to add since it is a fairly straight forward implementation of the adaptive Huffman Decoding. For...
  • erich: For anyone interested, I've added some c++ code for adaptive huffman decoding in the git repository.
  • Sjaak: I would add some more protection in the used trigger file (on the serverpilot site) then not using a standard name :) hopefully they use...
  • Pete Castagna: My friend Charlie who worked in synthesizers at a DOD type of place made a modification to this avalanche pulse generator that allowed him to...
  • Sam Catchpole: Yes please :D