diff --git a/examples/Alcoholimeter/Alcoholimeter.ino b/examples/Alcoholimeter/Alcoholimeter.ino index 8d85c4b..6bca692 100644 --- a/examples/Alcoholimeter/Alcoholimeter.ino +++ b/examples/Alcoholimeter/Alcoholimeter.ino @@ -66,7 +66,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -80,8 +80,8 @@ void setup() { MQ3.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ } diff --git a/examples/ESP32/ESP32_WROOM_32D/ESP32_WROOM_32D.ino b/examples/ESP32/ESP32_WROOM_32D/ESP32_WROOM_32D.ino index 055b5f3..9784e9d 100644 --- a/examples/ESP32/ESP32_WROOM_32D/ESP32_WROOM_32D.ino +++ b/examples/ESP32/ESP32_WROOM_32D/ESP32_WROOM_32D.ino @@ -86,7 +86,7 @@ void setup() // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -100,8 +100,8 @@ void setup() MQ2.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ //MQ2.serialDebug(true); uncomment if you want to print the table on the serial port diff --git a/examples/ESP32/esp32.ino b/examples/ESP32/esp32.ino index 8413a4c..cf7c862 100644 --- a/examples/ESP32/esp32.ino +++ b/examples/ESP32/esp32.ino @@ -65,7 +65,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -79,8 +79,8 @@ void setup() { MQ3.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ3.serialDebug(true); } diff --git a/examples/ESP8266/ESP8266.ino b/examples/ESP8266/ESP8266.ino index 586a262..99c1fb2 100644 --- a/examples/ESP8266/ESP8266.ino +++ b/examples/ESP8266/ESP8266.ino @@ -65,7 +65,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -79,8 +79,8 @@ void setup() { MQ3.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ3.serialDebug(true); } diff --git a/examples/LinearVsExponential/LinearVsExponential.ino b/examples/LinearVsExponential/LinearVsExponential.ino index 60a7f71..9634e1a 100644 --- a/examples/LinearVsExponential/LinearVsExponential.ino +++ b/examples/LinearVsExponential/LinearVsExponential.ino @@ -45,7 +45,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -59,8 +59,8 @@ void setup() { MQ4.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ /* diff --git a/examples/MQ-131/MQ-131.ino b/examples/MQ-131/MQ-131.ino index 14f1d1f..10211a5 100644 --- a/examples/MQ-131/MQ-131.ino +++ b/examples/MQ-131/MQ-131.ino @@ -67,7 +67,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -81,8 +81,8 @@ void setup() { MQ131.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ131.serialDebug(true); Serial.println("Ignore Ratio = RS/R0, for this example we will use readSensorR0Rs, the ratio calculated will be R0/Rs. Thanks :)"); diff --git a/examples/MQ-135-ALL/MQ-135-ALL.ino b/examples/MQ-135-ALL/MQ-135-ALL.ino index 7454bcf..8220570 100644 --- a/examples/MQ-135-ALL/MQ-135-ALL.ino +++ b/examples/MQ-135-ALL/MQ-135-ALL.ino @@ -55,7 +55,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -69,8 +69,8 @@ void setup() { MQ135.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ Serial.println("** Values from MQ-135 ****"); Serial.println("| CO | Alcohol | CO2 | Toluen | NH4 | Aceton |"); diff --git a/examples/MQ-135-CorrectionFactorDHT11/MQ-135-CorrectionFactorDHT11.ino b/examples/MQ-135-CorrectionFactorDHT11/MQ-135-CorrectionFactorDHT11.ino index 63d761a..e8700c4 100644 --- a/examples/MQ-135-CorrectionFactorDHT11/MQ-135-CorrectionFactorDHT11.ino +++ b/examples/MQ-135-CorrectionFactorDHT11/MQ-135-CorrectionFactorDHT11.ino @@ -106,7 +106,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -120,8 +120,8 @@ void setup() { MQ135.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ135.serialDebug(true); // Set delay between sensor readings based on sensor details. diff --git a/examples/MQ-135/MQ-135.ino b/examples/MQ-135/MQ-135.ino index 20c8c7e..dfbc5e4 100644 --- a/examples/MQ-135/MQ-135.ino +++ b/examples/MQ-135/MQ-135.ino @@ -67,7 +67,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -81,8 +81,8 @@ void setup() { MQ135.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ135.serialDebug(true); } diff --git a/examples/MQ-136/MQ-136.ino b/examples/MQ-136/MQ-136.ino index 161096a..9c68f01 100644 --- a/examples/MQ-136/MQ-136.ino +++ b/examples/MQ-136/MQ-136.ino @@ -60,7 +60,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -74,8 +74,8 @@ void setup() { MQ136.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ136.serialDebug(true); } diff --git a/examples/MQ-2/MQ-2.ino b/examples/MQ-2/MQ-2.ino index b3b7e3f..28ade0c 100644 --- a/examples/MQ-2/MQ-2.ino +++ b/examples/MQ-2/MQ-2.ino @@ -64,7 +64,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -78,8 +78,8 @@ void setup() { MQ2.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ2.serialDebug(true); diff --git a/examples/MQ-3/MQ-3.ino b/examples/MQ-3/MQ-3.ino index 498923a..1266d8e 100644 --- a/examples/MQ-3/MQ-3.ino +++ b/examples/MQ-3/MQ-3.ino @@ -66,7 +66,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -80,8 +80,8 @@ void setup() { MQ3.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ3.serialDebug(true); } diff --git a/examples/MQ-303A/MQ-303A.ino b/examples/MQ-303A/MQ-303A.ino index f8350bd..65c3039 100644 --- a/examples/MQ-303A/MQ-303A.ino +++ b/examples/MQ-303A/MQ-303A.ino @@ -64,7 +64,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -78,8 +78,8 @@ void setup() { MQ303.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ303.serialDebug(true); } diff --git a/examples/MQ-309A/MQ-309A.ino b/examples/MQ-309A/MQ-309A.ino index 8a43245..6141b39 100644 --- a/examples/MQ-309A/MQ-309A.ino +++ b/examples/MQ-309A/MQ-309A.ino @@ -67,7 +67,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -81,8 +81,8 @@ void setup() { MQ309.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ309.serialDebug(true); } diff --git a/examples/MQ-4-ALL/MQ-4-ALL.ino b/examples/MQ-4-ALL/MQ-4-ALL.ino index ff7692b..329e747 100644 --- a/examples/MQ-4-ALL/MQ-4-ALL.ino +++ b/examples/MQ-4-ALL/MQ-4-ALL.ino @@ -55,7 +55,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -69,8 +69,8 @@ void setup() { MQ4.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ Serial.println("*************** Values from MQ-4 **********************"); diff --git a/examples/MQ-4-LINEAR/MQ-4-LINEAR.ino b/examples/MQ-4-LINEAR/MQ-4-LINEAR.ino index 73730f7..15a5091 100644 --- a/examples/MQ-4-LINEAR/MQ-4-LINEAR.ino +++ b/examples/MQ-4-LINEAR/MQ-4-LINEAR.ino @@ -54,7 +54,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -68,8 +68,8 @@ void setup() { MQ4.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ Serial.println("** Values from MQ-4**********"); diff --git a/examples/MQ-4/MQ-4.ino b/examples/MQ-4/MQ-4.ino index 9f6b722..0265adc 100644 --- a/examples/MQ-4/MQ-4.ino +++ b/examples/MQ-4/MQ-4.ino @@ -65,7 +65,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -79,8 +79,8 @@ void setup() { MQ4.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ4.serialDebug(true); } diff --git a/examples/MQ-5/MQ-5.ino b/examples/MQ-5/MQ-5.ino index 1c22831..add61e9 100644 --- a/examples/MQ-5/MQ-5.ino +++ b/examples/MQ-5/MQ-5.ino @@ -65,7 +65,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -79,8 +79,8 @@ void setup() { MQ5.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ5.serialDebug(true); } diff --git a/examples/MQ-6/MQ-6.ino b/examples/MQ-6/MQ-6.ino index 4f03526..bc8308e 100644 --- a/examples/MQ-6/MQ-6.ino +++ b/examples/MQ-6/MQ-6.ino @@ -65,7 +65,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -79,8 +79,8 @@ void setup() { MQ6.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ6.serialDebug(true); } diff --git a/examples/MQ-7/MQ-7.ino b/examples/MQ-7/MQ-7.ino index 22aa7f1..5a7eace 100644 --- a/examples/MQ-7/MQ-7.ino +++ b/examples/MQ-7/MQ-7.ino @@ -72,7 +72,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -86,8 +86,8 @@ void setup() { MQ7.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ7.serialDebug(true); } diff --git a/examples/MQ-8/MQ-8.ino b/examples/MQ-8/MQ-8.ino index ca1972c..14658d3 100644 --- a/examples/MQ-8/MQ-8.ino +++ b/examples/MQ-8/MQ-8.ino @@ -66,7 +66,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -80,8 +80,8 @@ void setup() { MQ8.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ8.serialDebug(true); } diff --git a/examples/MQ-9-ALL/MQ-9-ALL.ino b/examples/MQ-9-ALL/MQ-9-ALL.ino index eaf1de3..57ea32b 100644 --- a/examples/MQ-9-ALL/MQ-9-ALL.ino +++ b/examples/MQ-9-ALL/MQ-9-ALL.ino @@ -55,7 +55,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -69,8 +69,8 @@ void setup() { MQ9.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ Serial.println("** Values from MQ-9 ****"); Serial.println("| LPG | CH4 | CO |"); diff --git a/examples/MQ-9/MQ-9.ino b/examples/MQ-9/MQ-9.ino index 0950140..d7c3197 100644 --- a/examples/MQ-9/MQ-9.ino +++ b/examples/MQ-9/MQ-9.ino @@ -67,7 +67,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor // ISSUE 44 - MQ9 needs a low/high temperature cycle like MQ7 #44 @@ -101,8 +101,8 @@ void setup() { MQ9.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ9.serialDebug(true); } diff --git a/examples/MQ-Board/MQ-Board.ino b/examples/MQ-Board/MQ-Board.ino index a13932d..be2b3ee 100644 --- a/examples/MQ-Board/MQ-Board.ino +++ b/examples/MQ-Board/MQ-Board.ino @@ -103,7 +103,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -158,8 +158,8 @@ void setup() { Serial.print(MQ8calcR0/10); Serial.print(" | "); Serial.print(MQ9calcR0/10); Serial.println(" |"); - if(isinf(MQ2calcR0) || isinf(MQ3calcR0) || isinf(MQ4calcR0) || isinf(MQ5calcR0) || isinf(MQ6calcR0) || isinf(MQ7calcR0) || isinf(MQ8calcR0) || isinf(MQ9calcR0)) {Serial.println("Warning: Conection issue founded, R0 is infite (Open circuit detected) please check your wiring and supply"); while(1);} - if(MQ2calcR0 == 0 || MQ3calcR0 == 0 || MQ4calcR0 == 0 || MQ5calcR0 == 0 || MQ6calcR0 == 0 || MQ7calcR0 == 0 || MQ8calcR0 == 0 || MQ9calcR0 == 0){Serial.println("Warning: Conection issue founded, R0 is zero (Analog pin with short circuit to ground) please check your wiring and supply"); while(1);} + if(isinf(MQ2calcR0) || isinf(MQ3calcR0) || isinf(MQ4calcR0) || isinf(MQ5calcR0) || isinf(MQ6calcR0) || isinf(MQ7calcR0) || isinf(MQ8calcR0) || isinf(MQ9calcR0)) {Serial.println("Warning: Connection issue found, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(MQ2calcR0 == 0 || MQ3calcR0 == 0 || MQ4calcR0 == 0 || MQ5calcR0 == 0 || MQ6calcR0 == 0 || MQ7calcR0 == 0 || MQ8calcR0 == 0 || MQ9calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin with short circuit to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ //Print in serial monitor diff --git a/examples/MQ135-ADS1115/MQ135-ADS1115.ino b/examples/MQ135-ADS1115/MQ135-ADS1115.ino index e1b625a..0a2aded 100644 --- a/examples/MQ135-ADS1115/MQ135-ADS1115.ino +++ b/examples/MQ135-ADS1115/MQ135-ADS1115.ino @@ -62,8 +62,8 @@ void setup(void) MQ135.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ Serial.println("** Values from MQ-135 ****"); Serial.println("| CO | Alcohol | CO2 | Toluen | NH4 | Aceton |"); diff --git a/examples/external_A2D/external_A2D.ino b/examples/external_A2D/external_A2D.ino index 8228eda..b3249e9 100644 --- a/examples/external_A2D/external_A2D.ino +++ b/examples/external_A2D/external_A2D.ino @@ -37,7 +37,7 @@ //Definitions #define placa "Arduino UNO" #define Voltage_Resolution 5 -#define pin A0 //Analog input 0 -> This value can have any number, we recomend use A0 +#define pin A0 //Analog input 0 -> This value can have any number, we recommend use A0 #define type "MQ-3 With A2D External connected" //MQ3 #define ADC_Bit_Resolution 10 // Resolution of your external A2D #define RatioMQ3CleanAir 60 //RS / R0 = 60 ppm @@ -74,7 +74,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -89,8 +89,8 @@ void setup() { MQ3.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ3.serialDebug(true); diff --git a/examples/smokeDetector/smokeDetector.ino b/examples/smokeDetector/smokeDetector.ino index 346919a..60e52a4 100644 --- a/examples/smokeDetector/smokeDetector.ino +++ b/examples/smokeDetector/smokeDetector.ino @@ -59,7 +59,7 @@ void setup() { // Explanation: // In this routine the sensor will measure the resistance of the sensor supposedly before being pre-heated // and on clean air (Calibration conditions), setting up R0 value. - // We recomend executing this routine only on setup in laboratory conditions. + // We recommend executing this routine only on setup in laboratory conditions. // This routine does not need to be executed on each restart, you can load your R0 value from eeprom. // Acknowledgements: https://jayconsystems.com/blog/understanding-a-gas-sensor Serial.print("Calibrating please wait."); @@ -73,8 +73,8 @@ void setup() { MQ4.setR0(calcR0/10); Serial.println(" done!."); - if(isinf(calcR0)) {Serial.println("Warning: Conection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} - if(calcR0 == 0){Serial.println("Warning: Conection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} + if(isinf(calcR0)) {Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected) please check your wiring and supply"); while(1);} + if(calcR0 == 0){Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground) please check your wiring and supply"); while(1);} /***************************** MQ CAlibration ********************************************/ MQ4.serialDebug(true); } diff --git a/src/MQUnifiedsensor.cpp b/src/MQUnifiedsensor.cpp index 49bed51..3e07eb6 100644 --- a/src/MQUnifiedsensor.cpp +++ b/src/MQUnifiedsensor.cpp @@ -161,16 +161,16 @@ float MQUnifiedsensor::readSensor(bool isMQ303A, float correctionFactor, bool in 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; - if(_ratio <= 0) _ratio = 0; //No negative values accepted or upper datasheet recomendation. - if(_regressionMethod == 1) _PPM= _a*pow(_ratio, _b); // <- Source excel analisis https://github.com/miguel5612/MQSensorsLib_Docs/tree/master/Internal_design_documents + if(_ratio <= 0) _ratio = 0; //No negative values accepted or upper datasheet recommendation. + if(_regressionMethod == 1) _PPM= _a*pow(_ratio, _b); // <- Source excel analysis https://github.com/miguel5612/MQSensorsLib_Docs/tree/master/Internal_design_documents else { - // https://jayconsystems.com/blog/understanding-a-gas-sensor <- Source of linear ecuation + // https://jayconsystems.com/blog/understanding-a-gas-sensor <- Source of linear equation double ppm_log = (log10(_ratio)-_b)/_a; //Get ppm value in linear scale according to the the ratio value _PPM = pow(10, ppm_log); //Convert ppm value to log scale } - if(_PPM < 0) _PPM = 0; //No negative values accepted or upper datasheet recomendation. - //if(_PPM > 10000) _PPM = 99999999; //No negative values accepted or upper datasheet recomendation. + if(_PPM < 0) _PPM = 0; //No negative values accepted or upper datasheet recommendation. + //if(_PPM > 10000) _PPM = 99999999; //No negative values accepted or upper datasheet recommendation. return _PPM; } float MQUnifiedsensor::readSensorR0Rs() @@ -179,16 +179,16 @@ float MQUnifiedsensor::readSensorR0Rs() _RS_Calc = ((_VCC*_RL)/_sensor_volt)-_RL; //Get value of RS in a gas if(_RS_Calc < 0) _RS_Calc = 0; //No negative values accepted. _ratio = this->_R0/_RS_Calc; // Get ratio RS_air/RS_gas <- INVERTED for MQ-131 issue 28 https://github.com/miguel5612/MQSensorsLib/issues/28 - if(_ratio <= 0) _ratio = 0; //No negative values accepted or upper datasheet recomendation. - if(_regressionMethod == 1) _PPM= _a*pow(_ratio, _b); // <- Source excel analisis https://github.com/miguel5612/MQSensorsLib_Docs/tree/master/Internal_design_documents + if(_ratio <= 0) _ratio = 0; //No negative values accepted or upper datasheet recommendation. + if(_regressionMethod == 1) _PPM= _a*pow(_ratio, _b); // <- Source excel analysis https://github.com/miguel5612/MQSensorsLib_Docs/tree/master/Internal_design_documents else { - // https://jayconsystems.com/blog/understanding-a-gas-sensor <- Source of linear ecuation + // https://jayconsystems.com/blog/understanding-a-gas-sensor <- Source of linear equation double ppm_log = (log10(_ratio)-_b)/_a; //Get ppm value in linear scale according to the the ratio value _PPM = pow(10, ppm_log); //Convert ppm value to log scale } - if(_PPM < 0) _PPM = 0; //No negative values accepted or upper datasheet recomendation. - //if(_PPM > 10000) _PPM = 99999999; //No negative values accepted or upper datasheet recomendation. + if(_PPM < 0) _PPM = 0; //No negative values accepted or upper datasheet recommendation. + //if(_PPM > 10000) _PPM = 99999999; //No negative values accepted or upper datasheet recommendation. return _PPM; } float MQUnifiedsensor::calibrate(float ratioInCleanAir) {