Specific Mycodo Version: Current sensor implementation in mh_z19.py
Problem Description
The MH-Z19B sensor is shipped with automatic baseline correction enabled. This means the sensor will recalibrate every 24 hours to a baseline (400ppm) assuming the current measured concentration is back to ~400ppm. If used in an enclosure that is not vented it is possible to disrupt the linear response of the sensor and make readings incorrect. This re-calibration is not usually needed more often that about 4-6 months.
Re-calibrating zero and span is not trivial and shouldn't be necessary.
Errors
The error will be in the linearity of response for this sensor if ABC is not disabled in long term use.
Steps to Reproduce the issue:
How can this issue be reproduced?
Use the MH-Z19B sensor in enclosure with either persistent high or low concentrations of CO2.
Observe comparison readings from MH-Z16 sensor without ABC
Note the large differences in readings over time.
Place both sensors in normal room (~400ppm) air for 48 hours
Note that eventually readings will match as MH-Z19B re-corrects improper offset.
Additional Notes
I saw this issue in experimentation by running multiple sensors in the same graph and observing odd readings. Further research online surfaced this problem - eventually I found a version of the datasheet that mentioned explicitly how to turn the ABC feature off.
Mycodo Issue Report:
Problem Description
The MH-Z19B sensor is shipped with automatic baseline correction enabled. This means the sensor will recalibrate every 24 hours to a baseline (400ppm) assuming the current measured concentration is back to ~400ppm. If used in an enclosure that is not vented it is possible to disrupt the linear response of the sensor and make readings incorrect. This re-calibration is not usually needed more often that about 4-6 months.
Re-calibrating zero and span is not trivial and shouldn't be necessary.
Errors
The error will be in the linearity of response for this sensor if ABC is not disabled in long term use.
Steps to Reproduce the issue:
How can this issue be reproduced?
Additional Notes
I saw this issue in experimentation by running multiple sensors in the same graph and observing odd readings. Further research online surfaced this problem - eventually I found a version of the datasheet that mentioned explicitly how to turn the ABC feature off.
mh-z19b-co2-ver1_0.pdf
When you look at the notes section for the command to turn off ABC, Winsen declares:
All Winsen sensor with ABC logic on before delivery if no special request.
I have found discussions ( one google translated from russian, so kinda fun to read ) that focus on hacking these by just fuzzing the serial port.
MH-Z19 should disable ABC mode (Auto Base Calibration) upon init · Issue #466 · letscontrolit:ESPEas.pdf
MHZ19 - RevSpace.pdf
In Russian - use google translate and it mostly comes through. Mostly.
I'll work on the code changes to address this and submit a pull request.