Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to read temperature #5

Closed
rzarajczyk opened this issue Feb 23, 2019 · 4 comments
Closed

Add option to read temperature #5

rzarajczyk opened this issue Feb 23, 2019 · 4 comments

Comments

@rzarajczyk
Copy link

According to this webpage https://revspace.nl/MHZ19 it should be possible (although not documented in official datasheet) to read the temperature along with CO2 level. Would it be possible to include this information in the result?

@UedaTakeyuki
Copy link
Owner

UedaTakeyuki commented Feb 23, 2019

Hi Rafał,

Thank you for your good request. It sound to be nice idea!
I'll try to add it soon.

@UedaTakeyuki
Copy link
Owner

UedaTakeyuki commented Feb 24, 2019

Hi Rafał,

I've updated mh_z19.py to return all of command 0x86 feedback as follows:

sudo python3 mh_z19.py --all
{"UhUl": 10523, "temperature": 17, "TT": 57, "co2": 539, "SS": 232}

sudo python -m mh_z19 --all
{"SS": 232, "UhUl": 10523, "TT": 57, "co2": 551, "temperature": 17}

How do you feel about it? Thank you for your feedback!

@rzarajczyk
Copy link
Author

I'm really impressed with the implementation time! The implementation itself seems to be correct - it does provide results according to the spec.

However I'm disappointed with the accuracy of MH-Z19 thermometer - in my setup (RPI 1B + MH-Z19 [TBH I don't know which version]) it shows 29-30 °C in the room where actual temperature is 22 °C. So either the the thermometer is inaccurate, or the revspace article was wrong.

Anyway thank you for immediate response! I really appreciate your code!

@UedaTakeyuki
Copy link
Owner

UedaTakeyuki commented Feb 24, 2019

Hi Rafał,

IMHO, the TT value might be related temperature, but this may NOT be a ambient temperature, but also heated temperature for measuring CO2.

The principle of CO2 concentration detection is called NDIR(Nondispersive Infrared ). As a rule of thum, this calibrate the temperature near the thermal infrared heater which is falling due to absorption by CO2. Detail explanation of NDIR is available here. Figure 1. of the document might be informative to get intuitive understanding.

I think TT value must be related the NIDR calibration value which is heated a bit.

For calibrate room temperature, I think DHT22 might be one of the good sensor module with good accurate and inexpensiveness.

By the way, please feel free to ask me anything. I also really appreciate if I can help you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants