strange-v / MHZ19

Arduino library for MH-Z19/MH-Z19B CO2 sensor
GNU General Public License v3.0
57 stars 12 forks source link

How to calibrate? #7

Closed oleksandr-kuzmenko closed 5 years ago

oleksandr-kuzmenko commented 5 years ago

Hello! Thanks for the great library!

Could you prompt how to calibrate sensor using your library?

Is that all I need to do (of course with more than 20 minutes of clean air)?

#include <SoftwareSerial.h>
#include <MHZ19.h>

SoftwareSerial ss(10, 11);
MHZ19 mhz(&ss);

void setup()
{
  ss.begin(9600);
  mhz.calibrateZero();
}

void loop() {}
strange-v commented 5 years ago

Hello. Unfortunately, you haven't specified what sensor you are going to calibrate.

As far as I remember MH-Z19' zero point calibration is really ZERO points. In contrast, a datasheet for MH-Z19B says: "ZERO POINT is 400PPM, PLS MAKE SURE THE SENSOR HAD BEEN WORKED UNDER 400PPM FOR OVER 20MINUTES".

So the answer is yes, the code above sends zero point calibration command to the sensor but depending on the sensor you will get a different result.

oleksandr-kuzmenko commented 5 years ago

I uploaded this code to arduino nano with connected MH-Z19B and wait 20 minutes near by open window. But it did not help. Hm, maybe I have different problem (bad power by example).

Thank!