Updated examples to MQ-4

This commit is contained in:
miguel5612
2020-03-26 12:37:12 -05:00
parent 3b578869ad
commit 1311d9446d
3 changed files with 59 additions and 59 deletions

View File

@ -31,9 +31,6 @@
//Declare Sensor
MQUnifiedsensor MQ3(placa, Voltage_Resolution, ADC_Bit_Resolution, pin, type);
//Variables
float CH4, LPG, CO, Alcohol, Hexane, Benzine;
void setup() {
//Init the serial port communication - to debug the library
Serial.begin(9600); //Init serial port
@ -41,7 +38,17 @@ void setup() {
//Set math model to calculate the PPM concentration and the value of constants
MQ3.setRegressionMethod("Exponential"); //_PPM = a*ratio^b
MQ3.setA(4.8387); MQ3.setB(-2.68); // Configurate the ecuation values to get Benzene concentration
/*
Exponential regression:
Gas | a | b
LPG | 44771 | -3.245
CH4 | 2*10^31| 19.01
CO | 521853 | -3.821
Alcohol| 0.3934 | -1.504
Benzene| 4.8387 | -2.68
Hexane | 7585.3 | -2.849
*/
// Calibration setup
MQ3.setR0(3.86018237);