MH-Z19 CO2 meter


Posted on Sunday, June 5, 2016 at 12:00 AM, 65499 views


MH-Z19 CO2 Meter

Have you ever wondering why you often feel sleepy or even tired in the morning after sleeping all night? There are many things that can lead to poor quality sleep. One of the reason could be inappropriate concentration of carbon dioxide (CO2). As people emit carbon dioxide during respiration, the CO2 concentration is one of the main factors affecting the air quality.

Sleep quality

So I decided to make some CO2 meter to understand whether CO2 concentration in our bedroom (where sleeping three of us) affects air quality. At first I tried to use cheap (2$) air quality MQ135 sensor, which detects NH3, NOx, alcohol, benzene, smoke, CO2. After some experiments I realized that it has poor precision even after applying temperature and humidity correction. And also it has high power consumption (800mw) and over 24h preheating time. Quite a lot of drawbacks to abandon it and to try another sensor. MQ135 sensor

There are quite a lot of CO2 sensors: MG811(~40$), MH-Z14 WINSEN(~40$), MH-Z19 WINSEN(~30$), K-30(~85$), VERNIER CO2-BTA(~330$). NDIR (nondispersive infrared) CO2 sensor is the most common type of sensor used to measure CO2, which has good precision and low power consumption. Prices are very various. MH-Z19 sensor has good characteristics and great price, so I decided to buy this one.

MH-Z19 sensor technical parameters:

Working voltage4.5 V ~ 5.5V DC
Average current< 85 mA
Interface level3.3 V
Measuring range0~5%VOL optional
Output signalPWM, UART
Preheat time3min
Response TimeT90 < 90s
Working temperature0-50C
Working humidity0~95%RH
Weight15 g
Lifespan>5 year
Dimension57.5×34.7×16mm(L×W×H)

There are two variants of this sensor with different measuring range:

  • 0 ~ 2000ppm
  • 0 ~ 5000ppm

I choose the first one because more than 2000ppm CO2 level isn't appropriate for leaving. MH-Z19 sensor

I decided to make some mobile device to be able to measure CO2 level wherever I want - bedroom, children room, kitchen and office. As MH-Z19 working voltage is 4.5 ~ 5.5V DC I can use USB output, smartphone charger or 3xAA (3xAAA) batteries as power source.

Hardware:

  • MH-Z19 infrared co2 sensor 24$
  • Arduino Pro Micro 4$
  • OLED LCD Display 0.96" I2C IIC SPI Serial 128X64 5$
  • 3 AAA 1.5V Battery Holder 1.2$
  • Mini Boat Rocker Switch 0.1$
  • Enclosure Z-14 Kradex1$

Software:

Schematic:

MH-Z19 CO2 Meter

Implementation:

MH-Z19 CO2 Meter
MH-Z19 CO2 Meter

Code:

Source code on Git Hub

Video:



Back to List