Interfacing Gas Sensor With Arduino

Introduction: Interfacing Gas Sensor With Arduino

The MQ-2 smoke sensor is sensitive to smoke and to the following flammable gases:

LPG, Butane, Propane, Methane, Alcohol, Hydrogen. The resistance of the sensor is different depending on the type of gas. The smoke sensor has a built-in potentiometer that allows you to adjust the sensor sensitivity according to how accurate you want to detect gas.

Step 1: How Does It Work?

The voltage that the sensor outputs changes accordingly to the smoke/gas level that exists in the atmosphere. The sensor outputs a voltage that is proportional to the concentration of smoke/gas.

In other words, the relationship between voltage and gas concentration is the following:

  • The greater the gas concentration, the greater the output voltage
  • The lower the gas concentration, the lower the output voltage

Step 2: Components Required:

Components required are:

1. Arduino UNO

2. Breadboard

3. Gas Sensor

4. Buzzer

5. LED's

6. Resistors (220 ohms)

7. Jumper wires

Step 3: Circuit Diagram:

First make the connections of Gas sensor:

1. Connect B1, H2 & B2 to the 5v of the Arduino and H1 directly to the ground.

2. Connect a 220-ohm resistor to A2 and connect the other end to gnd.

3. Connect the A1 to the analogPin A0.

Now make the connections for led's and buzzer:

1. Connect the 220-ohm resistor to the negative leg of all the led's and another end of the resistors to the gnd.

2. Connect the positive legs to digitalPin of the Arduino i.e. 2, 3 & 4.

3. Connect the negative leg of the buzzer to gnd and positive leg to digitalPin 5.

Step 4: Code:

For credit, please follow my following accounts.


Connect with me on:

Youtube: Click here

Facebook page: Click here

Instagram: Click here

Be the First to Share


    • Make It Bridge

      Make It Bridge
    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • For the Home Contest

      For the Home Contest