Help with methane gas sensor MQ-4

Hi, I need your help. How can I transform the value analog output voltage (0 to 1023) to PPM (parts per million)?

You have to first "burn in" the sensor for 72 hours or more, as described in the MQ-4 data sheet, then calibrate it by exposing it to known concentrations of methane in dry air.

The sensor responds to other gases, which if present will make the calibration useless.

Thank you. But, how can I show, mathematically, the result (analog value) in PPM?

To convert analog readings to PPM, you use the scale factor and offset that you determine when you calibrate the sensor.

float ppm = scale*analogRead(pin)+offset;

Seems the sensor is not that linear (never used one).
With the graph from the datasheet you can try to convert to PPM with multiMap, before final calibration.
Leo..

The nonlinearity in response is the least of the sensor's problems.

I’d agree - these are really combustible gas sensors , they suffer with drift and don’t return to the same output after detecting gas ( esp high concentrations ) . I would only use to detect a rapid change where absolute values don’t matter .

Thanks!!