WifWaf / MH-Z19

For Arduino Boards (&ESP32). Additional Examples/Commands., Hardware/Software Serial
GNU Lesser General Public License v3.0
197 stars 41 forks source link

Reasoning behind sensor zero-calibration ? #39

Open etodorovich opened 3 years ago

etodorovich commented 3 years ago

Hi there,

I don't know if the question is about the library or about the sensor itself. I am using the method calibrate (); to calibrate the sensor but it does not have the behavior I expect, which is to determine the zero (400 ppm). Instead, other baselines appear. After calibrating, I print the sensor information and get results such as:

Outdoor: imagen

Indoor: imagen

Background CO2 seems to have been defined in the calibration process. Does that make sense to you? In that case, how can that Background CO2 be set with such a high value, if the calibration is done outdoors?

Thank you!

Note: By the way, outdoor temperatures were lower, at 7-9 °C.

WifWaf commented 3 years ago

Firmware updates changed the behaviour of the getBackgroundCO2() function (and getTemperature()). Previously, it would store a static variable of 400 ppm which represented the assumed background ppm zeroing was equivalent to.

In newer firmware versions, background CO2 instead holds a value akin to getCO2(), however, I'm not sure what it represents.

The sensor does store the 400ppm equivalent calibration reading as a raw value - which I think is what you're after. I plan to expose this to a function in future, but it's a bit awkward due to the different versions and a lack of time right now.

I hope to have an update next week on this - so check back then and feel free to ping me on this thread.