Change correction formula
This commit is contained in:
parent
d39b92dba0
commit
45d730d85c
@ -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) {
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
2
MQ135.h
2
MQ135.h
@ -31,11 +31,13 @@ v1.0 - First release
|
|||||||
#define PARA 117.185
|
#define PARA 117.185
|
||||||
#define PARB 2.65797
|
#define PARB 2.65797
|
||||||
|
|
||||||
|
/*
|
||||||
/// Parameters to model temperature and humidity dependence
|
/// Parameters to model temperature and humidity dependence
|
||||||
#define CORA 0.00035
|
#define CORA 0.00035
|
||||||
#define CORB 0.02718
|
#define CORB 0.02718
|
||||||
#define CORC 1.39538
|
#define CORC 1.39538
|
||||||
#define CORD 0.0018
|
#define CORD 0.0018
|
||||||
|
*/
|
||||||
|
|
||||||
/// Atmospheric CO2 level for calibration purposes, in PPM.
|
/// Atmospheric CO2 level for calibration purposes, in PPM.
|
||||||
/// See http://co2now.org/
|
/// See http://co2now.org/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user