Problem in facing with MQ2 gas sensor?

How do i measure LPG and Smoke using MQ2 sensor?What is range of LPG and Smoke values in ppm?Here is my arduino code:

#define sensor A0    
#define load_Res 35    
#define air_factor 9.83  
                                                    
float SmokeCurve[3] ={2.3,0.53,-0.44};    // (x, y, slope) x,y coordinate of one point and the slope between two points
float LPGCurve[3]  =  {2.3,0.21,-0.47};
                                                                                        
float Res=0; 
float result;
float result1;
float air_quality; 
float val;
//float SensorCalibration();
String myString = String(result);
String myString1 = String(air_quality);
//String myString2 = String(SensorCalibration());
String data;  
String Home_id="CSLM1";
String device_id = "CSLS1";
int I_high=100;
int I_low=0;
int B_high=50;
int B_low=0;   
        
void setup()
{  
  Serial.begin(9600); 
  Serial.println("");
  
  int i;
  float val=0;    
//   Serial.print("SMOKE:"); 
  val=resistance(5,250);  
  Serial.println(val);              
  val = val/air_factor; 
  Res = val; 
//  Serial.println(val);
//  return val;                                                                                          
  Serial.print("Calibration done."); 
  Serial.print("Res=");
  Serial.print(Res);
  Serial.print("kohm");
  delay(2000);
  pinMode(5,OUTPUT);
}
  
void loop()
{  
   float res=resistance(5,50);
   res/=Res;
   result=pow(10,(((log(res)-LPGCurve[1])/LPGCurve[2]) + LPGCurve[0]));
//   result1=pow(10,(((log(res)-SmokeCurve[1])/SmokeCurve[2]) + SmokeCurve[0]));   
   Serial.print("LPG:"); 
   Serial.println(result);
   if(result>=0.4)
   {
    digitalWrite(5,HIGH);
    Serial.println("GAS LEAKAGE");
    delay(1000);
    digitalWrite(5,LOW);
    delay(500);
   }
  ////////////////////////////////SMOKE//////////////////////////////////// 
  
   Serial.print("SMOKE:"); 
   val=resistance(5,250);  
  Serial.println(val);
//   SensorCalibration();
//   Serial.println(result1);
//   delay(1000);
//   POST();

   air_quality=((I_high-50)*(result-50))/(result-50); 
//   Serial.println(air_quality);
   if(val<=100)
   {
    Serial.println(air_quality);
    Serial.println("Fresh Air");
   }
   air_quality=((I_high-50)*(result-50))/(result-50)+50;
   
   if(val>=101 && val<=200)
   {
    Serial.println(air_quality);
    Serial.println("Satisfactory Air");
   }
   air_quality=((I_high-50)*(result-50))/(result-50)+50;

   if(val>=201 && val<=350)
   {
    Serial.println(air_quality);
    Serial.println("Poor Air");
   }  
}
float resistance(int samples, int interval)
{
   int i;
   float res=0; 
   for (i=0;i<samples;i++) 
   {
      int adc_value=analogRead(sensor);
      res+=((float)load_Res*(1023-adc_value)/adc_value);
      delay(interval);
   }
   res/=samples;
   return res;
}

Please help me.

Advance in thanks.

Here you can do download the datasheet:

ok thanks...but i am getting LPG and Smoke value in ppm respectively to the gas sensor my LPG value is in 0.01 ppm am getting....is it correct and what is the maximum value of LPG and Smoke.

Please help me...Advance in thanks

yamini_1:
ok thanks...but i am getting LPG and Smoke value in ppm respectively to the gas sensor my LPG value is in 0.01 ppm am getting....is it correct and what is the maximum value of LPG and Smoke.

Please help me...Advance in thanks

Did you calibrate the sensor as shown in the data sheet? Did you correct for temperature and humidity as in the data sheet?

Paul