The MH-Z19 from Winsen is a self-calibrated sensor that measures the concentration of CO2 in the atmosphere. It is a digital sensor capable of delivering a directly readable digital value expressed in ppm. The MH-Z19 has a PWM type digital output. The signal is proportional to the concentration of CO2 in the atmosphere (see below).
Presentation of the self-calibrated MH-Z19 CO2 sensor
The MH-Z19 is a self-calibrated sensor, ie the measurement sent by the sensor does not require any mathematical treatment. In other words, the CO2 content expressed in ppm (parts per million) is recovered. The MH-Z19 has a PWM output and a UART digital interface (serial port). For this tutorial, we will already start by exploiting the PWM output.
|Measuring range||0 – 5000ppm|
|Power supply||3.6 ~ 5.5 VDC|
|Current||< 18 mA|
|Numerical outputs||UART and PWM|
|Heat time||3 minutes|
|Working temperature||0 ~ 50 ℃|
|Working humidity||0 – 95% (without condensation)|
|Dimensions||33 mm×20 mm×9 mm (L×W×H)|
|Lifetime annonced||> 5 years|
The PWM signal is proportional to the CO2 concentration.
It will therefore be necessary to measure the time during which the signal remains at the high level. Then, the following formula allows to deduce the CO2 rate.
- Cppm represents the concentration of CO2 in the atmosphere in ppm
- Th, the time during which the signal remained high
- Tl, the time during which the signal has remained low
For a 0-5000ppm sensor, simply replace 2000 by 5000 in the formula. The complete documentation is available here.
Tutorials and DIY projects based on the MH-Z19
- Publish the CO2 concentration of an MH-Z19 sensor to Domoticz, Arduino code compatible ESP32 / ESP8266
CO2 detector MH-Z19 deals
- This product is available at Ebay, Banggood, Amazon.com.
- At ebay.com you can purchase New MH-Z19B Infrared Carbon Dioxide CO2 Monitor Sensor Module UART PWM Output for only $27.99, which is 23% less than the cost in Amazon.com ($36.55).
- The lowest price of 1PCS Infrared Carbon Dioxide Sensor MH-Z19 CO2 Detection Sensor Module was obtained on 15 April 2021 3 h 06 min.