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 Banggood, Ebay.
- At banggood.com you can purchase MH-Z19 0-5000PPM Infrared CO2 Sensor For CO2 Indoor Air Quality Monitor UART/PWM for only CHF 24.99, which is 14% less than the cost in Ebay ($28.99).
- The lowest price of New MH-Z19B Infrared Carbon Dioxide CO2 Monitor Sensor Module UART PWM Output was obtained on 22 October 2021 3 h 04 min.