Help Needed Converting MQ Sensor’s Output To PPM Concentration!

I am currently working on a LPG gas sensing module, everything is working fine, only thing i stuck at is converting mVolts reading from my analog sensors to ACTUAL PPM concentration of gas and CALIBRATING my gas sensors.

The code is:

#include <SoftwareSerial.h>

int buzzer = 13;

int smoke_sensor = A1;

int lpg_sensor = A0;

int sensorThres = 400;

int analogLPG,analogSmoke;

String readString;

SoftwareSerial esp8266(10,11);

String espSerial;

void setup() {

pinMode(buzzer, OUTPUT);

pinMode(smoke_sensor, INPUT);

pinMode(lpg_sensor, INPUT);

Serial.begin(9600);

esp8266.begin(115200);

}

void loop() {

getLPG();

delay(5000);

}

void getLPG(){

analogLPG = analogRead(lpg_sensor);

Serial.print("Pin LPG: ");

Serial.println (analogLPG);

if (esp8266.available()){

esp8266.write(analogLPG);

while (esp8266.available() > 0) {

espSerial = esp8266.read(); //data is the incoming data

}

Serial.print(espSerial);

}

}

void getSmoke(){

analogSmoke = analogRead(smoke_sensor);

//Serial.print("Pin Smoke: ");

//Serial.println(analogSmoke);

}

Thanks in advance.

submitted by /u/appsmaven2014
[link] [comments]

Tags :

Leave Your Comment

Leave a Reply

%d bloggers like this: