MH-Z-CO2-Sensors/README.md
牧羊犬真Q 7be7cf0f22
fixed typoes in readme and fixed error in MHZ.cpp files (#24)
* correct the type of sensor in readme

* fix overflow in int datatype in arduino Uno.
In Uno, it's 16 bits in int variable. So I add a explicit type cast in MHZ.cpp file

* fix the warning of implicit convert from hex to char.
I change the data type to unit_8t, and it also helps to unify the datatype of these cmd arrays.
2021-09-28 10:15:22 +02:00

848 B

MH-Z14A, MH-Z19B CO2 ... Module

Arduino implementation for MH-Z CO2 sensors such as MH-Z14A, MH-Z19B (as I didn't find all info in one place).

The sensor is available for ~20 bucks at the usual places.

Implementation

See example.

PPMuart: 602, PPMpwm: 595, Temperature: 23

Implementation details

C ppm = 5000 * (T_high - 2 ms) / (T_high + T_low - 4ms)

The implementation is mostly based on https://forum.arduino.cc/index.php?topic=525459.msg3587557#msg3587557

Resources:

Datasheet: http://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19b-co2-ver1_0.pdf

More info about the sensor: https://revspace.nl/MHZ19

Further reading:

(russuian, but google translate does a good job)