arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.96k stars 4.77k forks source link

How to calibrate MH-Z19? #3860

Closed ThinkPadNL closed 5 years ago

ThinkPadNL commented 5 years ago

Hi,

I am using MH-Z19B CO2-sensor. I bought a second one for my bedroom and i see that it is a bit off from the one i was already using. I would like to calibrate it to 400 ppm. In the sensor code i see the command is available: https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/xsns_15_mhz19.ino#L81

But how do i access that command from the webgui console for example? Or via some sort of JSON URL, so i can schedule it (crontab) to run at night when the room is empty.

Jason2866 commented 5 years ago

No need for:

/*********************************************************************************************\
 * Source: http://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19b-co2-ver1_0.pdf
 *
 * Automatic Baseline Correction (ABC logic function)
 *
 * ABC logic function refers to that sensor itself do zero point judgment and automatic calibration procedure
 * intelligently after a continuous operation period. The automatic calibration cycle is every 24 hours after powered on.
 *
 * The zero point of automatic calibration is 400ppm.
 *
 * This function is usually suitable for indoor air quality monitor such as offices, schools and homes,
 * not suitable for greenhouse, farm and refrigeratory where this function should be off.
 *
 * Please do zero calibration timely, such as manual or commend calibration.
\*********************************************************************************************/

#define MHZ19_ABC_ENABLE             1       // Automatic Baseline Correction (0 = off, 1 = on (default))

/*********************************************************************************************/
Jason2866 commented 5 years ago

I can say after a few month of use this selfcalibration does work. You have to open window or door open a long time to get 400ppm !

ThinkPadNL commented 5 years ago

I read that, but what if i want to do it myself anyway?

Jason2866 commented 5 years ago

Code has to be changed for that. Not implemented

ThinkPadNL commented 5 years ago

OK. I will put it near a open window for 24h and see what that brings.

ascillato commented 5 years ago

I'm just asking because there is nothing in the wiki and I don't have this sensor to test.

the command MHZ_CMND_ZEROPOINT does not work from the console?

Jason2866 commented 5 years ago

Nope.

ascillato2 commented 5 years ago

Ok, Thanks. So, the calibration is done automatically at power on. Thanks

ThinkPadNL commented 5 years ago

I forgot that calibration is also possible by hardware, instead of software only. When you connect the pins 'Hd' and 'Gnd' together for 7s, it should assume current level is 400 ppm.

From the manual

Sensor HD pin with low level(0V) and lasting for over 7s (under 400ppm for at least 20 minutes)

arifintajul4 commented 4 years ago

Hi,

I am using MH-Z19B CO2-sensor. I bought a second one for my bedroom and i see that it is a bit off from the one i was already using. I would like to calibrate it to 400 ppm. In the sensor code i see the command is available: https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/xsns_15_mhz19.ino#L81

But how do i access that command from the webgui console for example? Or via some sort of JSON URL, so i can schedule it (crontab) to run at night when the room is empty.

The repository is 404 not found

ascillato commented 4 years ago

Sorry, you are reading a very old and obsolete issue (2 years!!!).

Please, address this to the Tasmota Support Chat. The chat is a better and more dynamic channel for helping you. Github issues are meant for Tasmota Software Bug Reporting.

Please check the Contributing Guideline and Policy and the Support Guide.

Thanks.


Support Information

See Wiki for more information. See FAQ for common questions/answers and links if none of your question is in the list See Chat for more user experience. See Community for forum. See Code of Conduct