mq 7 sensor

-How to generate pwm cycle for switching between 1.4 & 5v ?
-How to convert analog reading into parts per million ?
-Preheating is required once at start or every time i use it ?
-If i am using breakout kit(http://thesis.jmsaavedra.com/prototypes/technology/mq-7-carbon-monoxide-sensor-breakout/) then what will be the code?
-Problem with this code :Citizen-Sensor/CS_MQ7.pde at master · jmsaavedra/Citizen-Sensor · GitHub
showing currentstate() not member of class mq 7

thank you

If you would control the heater with a mosfet, you can use pwm.
Output pin pwm value 255 means 100% on: heater at 5V.
Output pin pwm 1.4/5.0 * 255 = pwm value 74 : heater gets the same power as at 1.4V.

For parts per milion, you need a known concentration of gas to calibrate the sensor.

Preheating is done only once. The sensor is electro-chemical, and its value changes a lot when it is new. After preheating, the output is stable from then on.
http://playground.arduino.cc/Main/MQGasSensors

You might have to do some (a lot) testing with the sensor. After the heater is set to 5V or 1.4V I think you have to wait a few minutes before reading the analog value.

Did you take a look at the source of the library ?

I think it waits 90 secondes at 1.4V and 60 seconds at 5V. That seems a little too fast for me.
I would not use that library. It is not hard to write the delay and pwm output yourself.

thanks alot
but how to use mosfet with mq7

If i am using breakout kit(http://thesis.jmsaavedra.com/prototypes/technology/mq-7-carbon-monoxide-sensor-breakout/) then what will be the code?

Then you don't need to use PWM for the 1.4V but you just toggle between the two provided voltages on the board with the TOGG pin.

How to convert analog reading into parts per million ?

Have you seen the graph on the page linked above? You don't even get a linear value at a given concentration, so you have to average the reading over the 60s you're heating at 5V and without calibration you just get relative values not absolute ones.

dhiru:
but how to use mosfet with mq7

Take a look at the ABC guide, http://www.pighixxx.com/abc-arduino-basic-connections/
Card 5 on the left shows how a mosfet is used with a motor.
Click on "Set 2 (Card 4,5,6)" to open the pdf file.
The 100 ohm is to protect the Arduino output pin.
The 10k is optional, it keeps the heater off during power-on.
The 1uF and the diode are only for the motor, you don't need them for the heater.
The motor in the ABC guide is the 'load', that is where your heater (inside the sensor) will be.

The minimal circuit will be the 100 ohm to protect the Arduino, and the mosfet.