WifWaf / MH-Z19

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

Incorrect PPM range with sensor #55

Open ccloned opened 12 months ago

ccloned commented 12 months ago

Hi, so I've started playing with this library, and I'm confused a little about range which .getCO2() returns. My MH-Z19B has a sticker which states 0-5000ppm. I've called getRange(), it returned 5000. But when I call getCO2 - I get a value between 0-10000ppm, which looks like 0-5000 stretched into 10000, for example I get something like 1100 in fresh air, which should be close to 400-500, and I get 10000 when do a couple of breaths near it for a minute.

Am I missing something? Thanks in advance.

I've ran RetrieveDeviceInfo.ino:

Firmware Version: 04.30 Range: 5000 Background CO2: 400 Temperature Cal: 40 ABC Status: OFF

WifWaf commented 11 months ago

In regards to the values above 5000 ppm, this is due to getCO2(). It doesn't limit the values that the sensor thinks it's reading. This includes values below 400ppm.

If you use getCO2(false), it will use the capped versions, but it shouldn't change the scale of the results you are seeing.

Has it been calibrated?