Interface Gas Sensor With PIC


A Gas detector is a device that detects the presence of gases in an area.

  • Gas sensors spontaneously react to the gas present.
  • These sensors usually employ an audible alarm to alert people when a dangerous gas has been detected.
  • Different  types of gas sensor available in the market like
    MQ2, MQ3, MQ4, MQ5, MQ6, MQ7, MQ8, MQ9.
  • Each type has unique characteristics to detect the gas.
  • Sensitive material of Gas sensor is SnO2, which has lower conductivity in clean air.
  • When the target flammable gas exists, the sensor’s conductivity gets higher along with the gas concentration rising.
  • Gas sensor can detect different kinds of flammable gases, especially has high sensitivity to LPG (propane).


  • Domestic gas leakage alarm.
  • Industrial flammable gas alarm.
  • Portable gas detector.

Hardware Required

  • Gas Sensor.
  • Pic16f877a MicroController.

Pin Diagram

  • VCC:+5v.
  • A0: Analog Output.
  • GND: GND.