Closed kordian-kowalski closed 4 years ago
Also the reading itself is way off, it starts off at ~8000 and goes down to ~3000 after a minute.
It seems that using .getCO2(false);
will issue the correct command - not sure why this is not the default behavior.
The default is an alternative not documented which allows you to return a CO2 reading uncapped (unlimited by range or background CO2); it's useful to see if the sensor is misbehaving. For example in your case it might be above your defined range - you know there's an issue. You can find these details in the examples (though not in BasicUsage, I've updated this) or in the library it's self which is mostly annotated.
I would guess that your sensor has not been calibrated correctly, which can be awkward. If you're not having any luck with the example, try pulling the zero HD pin low for 7 Sec (see the datasheets in extras) or the Calibration example (which has been updated to be clearer also).
Closing due to inactivity - feel free to reopen.
According to the MH-Z19's manual, the command to get the co2 reading is 0x86. Following the basic usage example in this repository, it seems that 0x85 is being sent instead. Here's a screenshot from a logic analyzer showing Tasmota correctly polling for the reading: Here's your arduino library:
The code I'm using:
Am I doing something wrong here?