mirror of
https://github.com/miguel5612/MQSensorsLib.git
synced 2025-03-25 10:10:01 +03:00
Fixed voltage calculation
This commit is contained in:
parent
12695e75a6
commit
abac48da38
@ -64,7 +64,7 @@ void MQUnifiedsensor::serialDebug(bool onSetup)
|
|||||||
{
|
{
|
||||||
if(!_firstFlag)
|
if(!_firstFlag)
|
||||||
{
|
{
|
||||||
Serial.println("| ****************************************************************" + _type + "****************************************************************|");
|
Serial.println("| ********************************************************************" + _type + "*********************************************************************|");
|
||||||
Serial.println("|ADC_In | Equation_V_ADC | Voltage_ADC | Equation_R | Resistance_RS | EQ_Ratio | Ratio (RS/R0) | Equation_PPM | PPM |");
|
Serial.println("|ADC_In | Equation_V_ADC | Voltage_ADC | Equation_R | Resistance_RS | EQ_Ratio | Ratio (RS/R0) | Equation_PPM | PPM |");
|
||||||
_firstFlag = true; //Headers are printed
|
_firstFlag = true; //Headers are printed
|
||||||
}
|
}
|
||||||
|
@ -42,10 +42,10 @@ class MQUnifiedsensor
|
|||||||
byte _pin;
|
byte _pin;
|
||||||
byte _firstFlag = false;
|
byte _firstFlag = false;
|
||||||
byte _VOLT_RESOLUTION = 5.0; // if 3.3v use 3.3
|
byte _VOLT_RESOLUTION = 5.0; // if 3.3v use 3.3
|
||||||
byte _ratioInCleanAir, _sensor_volt;
|
byte _ratioInCleanAir;
|
||||||
byte _RL = 10; //Value in KiloOhms
|
byte _RL = 10; //Value in KiloOhms
|
||||||
|
|
||||||
double _adc, _a, _b;
|
double _adc, _a, _b, _sensor_volt;
|
||||||
float _R0, RS_air, _ratio, _PPM, _RS_Calc;
|
float _R0, RS_air, _ratio, _PPM, _RS_Calc;
|
||||||
|
|
||||||
String _type;
|
String _type;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user