Change correction formula

This commit is contained in:
Dmitry Frolov 2015-07-09 22:20:55 +06:00
parent d39b92dba0
commit 45d730d85c
2 changed files with 8 additions and 1 deletions

View File

@ -50,7 +50,12 @@ MQ135::MQ135(uint8_t pin, float rload, float rzero, float atmoco2, float vref, f
*/
/**************************************************************************/
float MQ135::getCorrectionFactor(float t, float h) {
return CORA * t * t - CORB * t + CORC - (h-33.)*CORD;
//return CORA * t * t - CORB * t + CORC - (h-33.)*CORD;
// This formula is reduced from temperature and humidity dependency graph,
// found in this datasheet:
// http://china-total.com/Product/meter/gas-sensor/MQ135.pdf
return (1.30732 - 0.0116044 * t) * (2.20591 - 0.296456 * log(h));
}
/**************************************************************************/

View File

@ -31,11 +31,13 @@ v1.0 - First release
#define PARA 117.185
#define PARB 2.65797
/*
/// Parameters to model temperature and humidity dependence
#define CORA 0.00035
#define CORB 0.02718
#define CORC 1.39538
#define CORD 0.0018
*/
/// Atmospheric CO2 level for calibration purposes, in PPM.
/// See http://co2now.org/