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);




void loop() {




void getLPG(){

analogLPG = analogRead(lpg_sensor);

Serial.print("Pin LPG: ");

Serial.println (analogLPG);

if (esp8266.available()){


while (esp8266.available() > 0) {

espSerial =; //data is the incoming data





void getSmoke(){

analogSmoke = analogRead(smoke_sensor);

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



Thanks in advance.

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

Tags :

Leave Your Comment

Leave a Reply

%d bloggers like this: