@ -17,9 +17,9 @@ El usuario reporta desbordamiento ("ovf") al utilizar valores muy altos en `setA
Se detectó que la resistencia del sensor se calculaba con `_VOLT_RESOLUTION` en lugar del voltaje de alimentación real. Se añadieron los métodos `setVCC` y `getVCC` y se modificaron las ecuaciones para usar `VCC`. Esta corrección se refleja en la versión 3.0.1 de la biblioteca.
### #70 Parameters to model temperature and humidity dependence
**Estado:** abierto
**Estado:** resuelto en la rama `work`
Los usuarios solicitan factores de corrección para temperatura y humedad aplicables a otros sensores (MQ-4 y MQ-8) además del MQ-135. Aún no se han añadido estos parámetros. Se anima a la comunidad a contribuir con implementaciones y ejemplos.
Se añadieron variables opcionales de "correction factor" en todos los ejemplos y se extendieron las funciones `calibrate` y `readSensorR0Rs` para aceptar este parámetro opcional. Así, el usuario puede ajustar las lecturas en función de temperatura y humedad cuando el datasheet lo permita. Los coeficientes deben consultarse para cada sensor.
### #67 Sensor won't finish the Calibration process if done in clean air
alcoholPPM=MQ3.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
Serial.print(MQ2.readSensor(false,correctionFactor));// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ4.setA(-0.318);MQ4.setB(1.133);// A -> Slope, B -> Intersect with X - Axis
floatLPG1=MQ4.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatLPG1=MQ4.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
//Set math model to calculate the PPM concentration and the value of constants
MQ4.setRegressionMethod(1);//_PPM = a*ratio^b
MQ4.setA(1012.7);MQ4.setB(-2.786);// Configure the equation to to calculate CH4 concentration
floatLPG2=MQ4.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatLPG2=MQ4.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
// exposure to 2000 ppm of LPG gas is immediately dangerous to life and health. In this section
if(LPG1>=2000||LPG2>=2000)Serial.println("Warning - Very high concentrations detected!");
MQ135.setA(605.18);MQ135.setB(-3.937);// Configure the equation to calculate CO concentration value
floatCO=MQ135.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatCO=MQ135.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ135.setA(77.255);MQ135.setB(-3.18);//Configure the equation to calculate Alcohol concentration value
floatAlcohol=MQ135.readSensor();// SSensor will read PPM concentration using the model, a and b values set previously or from the setup
floatAlcohol=MQ135.readSensor(false,correctionFactor);// SSensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ135.setA(110.47);MQ135.setB(-2.862);// Configure the equation to calculate CO2 concentration value
floatCO2=MQ135.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatCO2=MQ135.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ135.setA(44.947);MQ135.setB(-3.445);// Configure the equation to calculate Toluen concentration value
floatToluen=MQ135.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatToluen=MQ135.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ135.setA(102.2);MQ135.setB(-2.473);// Configure the equation to calculate NH4 concentration value
floatNH4=MQ135.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatNH4=MQ135.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ135.setA(34.668);MQ135.setB(-3.369);// Configure the equation to calculate Aceton concentration value
floatAceton=MQ135.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatAceton=MQ135.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
Serial.print("| ");Serial.print(CO);
Serial.print(" | ");Serial.print(Alcohol);
// Note: 400 Offset for CO2 source: https://github.com/miguel5612/MQSensorsLib/issues/29
MQ4.setA(3811.9);MQ4.setB(-3.113);// Configure the equation to to calculate CH4 concentration
floatLPG=MQ4.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatLPG=MQ4.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ4.setA(1012.7);MQ4.setB(-2.786);// Configure the equation to to calculate CH4 concentration
floatCH4=MQ4.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatCH4=MQ4.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ4.setA(200000000000000);MQ4.setB(-19.05);// Configure the equation to to calculate CH4 concentration
floatCO=MQ4.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatCO=MQ4.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ4.setA(60000000000);MQ4.setB(-14.01);// Configure the equation to to calculate CH4 concentration
floatAlcohol=MQ4.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatAlcohol=MQ4.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ4.setA(30000000);MQ4.setB(-8.308);// Configure the equation to to calculate CH4 concentration
floatSmoke=MQ4.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatSmoke=MQ4.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ135.setA(605.18);MQ135.setB(-3.937);// Configure the equation to calculate CO concentration value
floatCO=MQ135.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatCO=MQ135.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ135.setA(77.255);MQ135.setB(-3.18);//Configure the equation to calculate Alcohol concentration value
floatAlcohol=MQ135.readSensor();// SSensor will read PPM concentration using the model, a and b values set previously or from the setup
floatAlcohol=MQ135.readSensor(false,correctionFactor);// SSensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ135.setA(110.47);MQ135.setB(-2.862);// Configure the equation to calculate CO2 concentration value
floatCO2=MQ135.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatCO2=MQ135.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ135.setA(44.947);MQ135.setB(-3.445);// Configure the equation to calculate Toluen concentration value
floatToluen=MQ135.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatToluen=MQ135.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ135.setA(102.2);MQ135.setB(-2.473);// Configure the equation to calculate NH4 concentration value
floatNH4=MQ135.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatNH4=MQ135.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
MQ135.setA(34.668);MQ135.setB(-3.369);// Configure the equation to calculate Aceton concentration value
floatAceton=MQ135.readSensor();// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
floatAceton=MQ135.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
Serial.print("| ");Serial.print(CO);
Serial.print(" | ");Serial.print(Alcohol);
// Note: 200 Offset for CO2 source: https://github.com/miguel5612/MQSensorsLib/issues/29
floatsmokePPM=MQ4.readSensor(false,correctionFactor);// Sensor will read PPM concentration using the model, a and b values set previously or from the setup
if(smokePPM>1000){Serial.println("Warning: High concentrations of smoke detected");}
MQ4.serialDebug();// Will print the table on the serial port