Closed gert-ineke closed 11 months ago
Thanks for catching I will try to verify and patch today.
Looking again at the code, I saw that there might be a race condition in the receive function too. I will investigate to fix that one too.
Created a develop branch, Do you have time to test it?
@gert-ineke You might need to edit your last post as there might be some private information in it. (I can do it for you)
setPPM(2000) works as expected. setPPM(5000) does not work. I use a MH-Z19C. The results are 56831, 65414, 65414 (3 minute interval) instead of about 532. I assume this is not a problem of the code, but the MH-Z19C. Is it?
From the MH-Z19C-DZ User’s Manual (Version 1.21)
5000 is within range of the spec above. However the PWM output can only do up to 2000
https://emariete.com/en/sensor-co2-mh-z19b/ states at the bottom that there are 2 different models of the 19C
Model MH-Z19C 400~2000 ppm range. This version has an accuracy of 50 ppm + 5% of measurement.
Model MH-Z19C 400~5000 ppm range. This version has an accuracy of 50 ppm + 5% of measurement.
Model MH-Z19C 400~10000 ppm range. This version has an accuracy of 50 ppm + 5% of measurement.
Some googling
10000 PPM model niet kunnen vinden.
Very strange. I did a re-test with setPPM(5000). It works :-) It gives 579, 558, 559. I have to gather a lot of people to get above 2000. With Christmas this was easy to accomplish. Thank you very much.
Not convinced yet it will output above 2000. Sending 5000 to the device does not change hardware. You could test it with a car exhaust or the breath of a smoker or put a plastic bag over it and keep breathing the air in the bag?
I will merge the change
Version 0.2.0 released. Thanks again for finding the bug!
Not convinced yet it will output above 2000. Sending 5000 to the device does not change hardware. You could test it with a car exhaust or the breath of a smoker or put a plastic bag over it and keep breathing the air in the bag?
With setPPM(5000) the sensor has got a limit of 5000 ppm. With setPPM(2000) a limit of 2000 ppm. I measured these limit values. According to the label (from Tinytronics?) it is a 400-2000ppm model. I assume the difference between the DC en PH models is just a preset of the limit.
Ok, did you read values above 2000 too? That would be interesting.
Ok, did you read values above 2000 too? That would be interesting.
Yes, I used a bag. The values cannot get higher than 5000. I did not verify on setPPM(10000). Maybe I get values above 5000, but I am satisfied with a limit of 5000 ppm.
Question: Is the setPPM() persistent when you reboot / disconnect the power? Could you test with the bag?
Question: Is the setPPM() persistent when you reboot / disconnect the power? Could you test with the bag?
Yes. It is persistent. And yes I measure values like 500, 3000 and 5000 (max).
Super, i make a note for the readme.md
line 41 in cpp is: data[8] = PPM >> 8; must be: data[6] = PPM >> 8;