Commit 1831e304 authored by Dmitry Frolov's avatar Dmitry Frolov

Parameters from Davide Gironi

parent 45d730d8
......@@ -99,7 +99,7 @@ float MQ135::getCorrectedResistance(float t, float h) {
*/
/**************************************************************************/
float MQ135::getPPM() {
return PARA * pow((getResistance()/_rzero), -PARB);
return PARA * pow((getResistance()/_rzero), PARB);
}
/**************************************************************************/
......@@ -114,7 +114,7 @@ float MQ135::getPPM() {
*/
/**************************************************************************/
float MQ135::getCorrectedPPM(float t, float h) {
return PARA * pow((getCorrectedResistance(t, h)/_rzero), -PARB);
return PARA * pow((getCorrectedResistance(t, h)/_rzero), PARB);
}
/**************************************************************************/
......@@ -125,7 +125,7 @@ float MQ135::getCorrectedPPM(float t, float h) {
*/
/**************************************************************************/
float MQ135::getRZero() {
return getResistance() * pow((_atmoco2/PARA), (1./PARB));
return getResistance() * pow((_atmoco2/PARA), (1./-PARB));
}
/**************************************************************************/
......@@ -140,5 +140,5 @@ float MQ135::getRZero() {
*/
/**************************************************************************/
float MQ135::getCorrectedRZero(float t, float h) {
return getCorrectedResistance(t, h) * pow((_atmoco2/PARA), (1./PARB));
return getCorrectedResistance(t, h) * pow((_atmoco2/PARA), (1./-PARB));
}
......@@ -27,9 +27,10 @@ v1.0 - First release
#define MQ135_RZERO 76.63
/// Parameters for calculating ppm of CO2 from sensor resistance
//#define PARA 116.6020682
//#define PARB 2.769034857
#define PARA 117.185
#define PARB 2.65797
//#define PARB (-2.769034857)
/// Correlation parameters from Davide Gironi <http://davidegironi.blogspot.ru/2014/01/cheap-co2-meter-using-mq135-sensor-with.html>
#define PARA 56.0820
#define PARB (-5.9603)
/*
/// Parameters to model temperature and humidity dependence
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment