|
|
|
|
@ -142,11 +142,13 @@ float MQUnifiedsensor::validateEcuation(float ratioInput)
|
|
|
|
|
float MQUnifiedsensor::readSensor(bool isMQ303A, float correctionFactor, bool injected)
|
|
|
|
|
{
|
|
|
|
|
//More explained in: https://jayconsystems.com/blog/understanding-a-gas-sensor
|
|
|
|
|
|
|
|
|
|
float voltRes = _VOLT_RESOLUTION; // preserve global resolution
|
|
|
|
|
if(isMQ303A) {
|
|
|
|
|
voltRes = voltRes - 0.45; //Calculations for RS using mq303a sensor look wrong #42
|
|
|
|
|
}
|
|
|
|
|
_RS_Calc = ((voltRes*_RL)/_sensor_volt)-_RL; //Get value of RS in a gas
|
|
|
|
|
|
|
|
|
|
if(_RS_Calc < 0) _RS_Calc = 0; //No negative values accepted.
|
|
|
|
|
if(!injected) _ratio = _RS_Calc / this->_R0; // Get ratio RS_gas/RS_air
|
|
|
|
|
_ratio += correctionFactor;
|
|
|
|
|
|