WifWaf / MH-Z19

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

Getting wrong temperature on MH-z19c #43

Open vignesh8458 opened 2 years ago

vignesh8458 commented 2 years ago

Hi,

I am usning MH-Z19c sensor on esp8266.

I am getting the same temperature value:

CO2: 672 Temperature: -40 Accuracy: 0 CO2: 675 Temperature: -40 Accuracy: 0 CO2: 682 Temperature: -40 Accuracy: 0 CO2: 684 Temperature: -40 Accuracy: 0 CO2: 689 Temperature: -40 Accuracy: 0 CO2: 691 Temperature: -40 Accuracy: 0 CO2: 693 Temperature: -40 Accuracy: 0

Please help me on this.

WifWaf commented 2 years ago

This is due to the newer version of the sensor, the manufacturer shuffles the registries around and I'm currently not sure the best way to go about fixing these types of unpredictable changes.

I would like to have a fix in place soon, but I can't make any promises right now.

vignesh8458 commented 2 years ago

Thanks for the reply.

I will wait.

Cybolord commented 2 years ago

me too; thank you in advance for your effort!

etodorovich commented 2 years ago

Me too, and thank you!

WifWaf commented 1 year ago

This should have been fixed in https://github.com/WifWaf/MH-Z19/commit/04a6f85f980cae100f6c9472a1bbe484cc10dd3c.

I'll add a new release shortly.

I only have two sensors to test the changes on, so hoping I'm correct in that it fixes all sensor versions over 5.00. If not, the firmware version (which can be found in the get device info example) would be helpful.

Dixhom commented 1 year ago

I have a similar issue with MH-Z19

CO2 (ppm): 0 !Error: Timed out waiting for response Temperature (C): -17

The product is this. https://www.aliexpress.com/item/32706795833.html (the silver one on the leftmost pic)

WifWaf commented 1 year ago

I have a similar issue with MH-Z19

CO2 (ppm): 0 !Error: Timed out waiting for response Temperature (C): -17

The product is this. https://www.aliexpress.com/item/32706795833.html (the silver one on the leftmost pic)

I've not seen the silver version before, so it might be running significantly different firmware. Try using getCO2(false) as this uses the most documented command.