Gas Alert System Using Arduino UNO – Step by Step Tutorial (MQ-2 Gas Sensor)

 Gas alert system using arduino

Introduction

The Gas Alert System using Arduino UNO is a safety-based electronics project that detects harmful gases such as LPG, methane, and smoke. When gas leakage is detected, the system activates a buzzer and LED to alert users immediately.

This project is designed and simulated using Arduino Uno in Tinkercad, making it ideal for students, beginners, and robotics enthusiasts.

Gas leakage detection systems are widely used in homes, laboratories, kitchens, and industries to prevent fire accidents and health hazards.


 Objective of the Project

  • Detect harmful gases like LPG, methane, and smoke

  • Trigger an alarm system (buzzer + LED)

  • Create a simple and low-cost gas leak detection system

  • Learn how to interface the MQ-2 gas sensor with Arduino


 Components Required

  • Arduino Uno

  • MQ-2 Gas Sensor

  • Buzzer

  • Red LED

  • 220Ω Resistor

  • Breadboard

  • Jumper Wires


 Working Principle of Gas Detection System

The MQ-2 Gas Sensor detects gas concentration in the air.

How It Works:

  1. The MQ-2 sensor senses gases like LPG, methane, and smoke.

  2. If the gas concentration exceeds a predefined threshold:

    • The sensor outputs a HIGH signal.

  3. The Arduino reads this signal.

  4. When gas is detected:

    • The buzzer turns ON (audible alert).

    • The LED glows (visual alert).

  5. If no gas is detected:

    • Buzzer and LED remain OFF.

This creates a simple yet effective gas leak warning system.


 Step-by-Step Circuit Connections

Step 1: Connect MQ-2 Gas Sensor

  • VCC → 5V (Arduino)

  • GND → GND (Arduino)

  • A0 → Analog Pin A0 (Arduino)

Step 2: Connect LED

  • Long leg (Anode) → Digital Pin 7 (via 220Ω resistor)

  • Short leg (Cathode) → GND

Step 3: Connect Buzzer

  • Positive → Digital Pin 8

  • Negative → GND


 Arduino Code for Gas Alert System

int gasSensor = A0;
int led = 7;
int buzzer = 8;
int threshold = 300;

void setup() {
pinMode(led, OUTPUT);
pinMode(buzzer, OUTPUT);
Serial.begin(9600);
}

void loop() {
int gasValue = analogRead(gasSensor);
Serial.println(gasValue);

if (gasValue > threshold) {
digitalWrite(led, HIGH);
digitalWrite(buzzer, HIGH);
} else {
digitalWrite(led, LOW);
digitalWrite(buzzer, LOW);
}

delay(500);
}

You can adjust the threshold value based on gas sensitivity.


How to Simulate Gas Alert System in Tinkercad

  1. Open Tinkercad

  2. Click Circuits → Create New Circuit

  3. Add:

    • Arduino UNO

    • MQ-2 Gas Sensor

    • LED

    • Buzzer

  4. Complete wiring as shown above

  5. Paste the Arduino code

  6. Click Start Simulation

  7. Adjust the gas sensor level to test detection


Applications of Arduino Gas Leak Detection System

  • Home kitchen gas monitoring

  • Industrial safety systems

  • Laboratory safety

  • Smart home automation

  • IoT-based gas monitoring systems


Advantages of This Project

  • Low cost

  • Easy to build

  • Beginner friendly

  • Real-world safety application

  • Can be upgraded to send SMS alerts using GSM module


Conclusion

The Gas Alert System using Arduino UNO is an essential safety project that demonstrates how sensors and microcontrollers can be used to detect hazardous gas leaks. By integrating the MQ-2 gas sensor with Arduino, this system provides an immediate warning using both sound and visual indicators.

This project is highly recommended for beginners learning Arduino, IoT, and embedded systems.



Try this using tinker cad:

BEGINNER PROJECTS (Foundation Skills)

  1. Ultrasonic Distance Measurement
  2. Traffic Light Simulation with 7-Segment Display
  3. 7-Segment Display Counter
  4. Kids Piano Circuit (8-Key Version)
  5. 16×2 LCD Display with Text Output
  6. LCD I2C to Arduino UNO
  7. Temperature Measurement using Arduino UNO
  8. LDR Controlled Street Light

INTERMEDIATE PROJECTS (Build Your Skills)

  1. Servo Motor Control Using Potentiometer
  2. DC Motor Speed Control
  3. Temperature Controlled Fan
  4. PIR Based Theft Alert System
  5. LPG Gas Leakage Detection System
  6. Automatic Door Locking System
  7. Soil Moisture Based Automatic Watering System
  8. Simple Digital Clock using Arduino UNO
  9. Automatic Voting Machine (EVM)
  10. Joystick Control using Arduino Uno
  11. RGB Lamp Control using Arduino Uno

    ADVANCED PROJECTS (Master Level)

    1. Home Automation Using Arduino UNO
    2. Bluetooth RC Car using Arduino Uno
    3. Obstacle Avoiding Robot
    4. Line Follower Robot
    5. Radar System Using Arduino UNO
    6. Automatic Parking System
    7. Bi-Directional People Counter using Arduino Uno 
    8. Automatic Plant Watering System
    9. NeoPixel LED Ring Control using Arduino Uno
    10. Smart Gloves for Bedridden People

      ROBOTICS & MOTION PROJECTS

      1. RC Car Using L293D Motor Driver
      2. Robot Arm and Leg Control Using Servo
      3. Smart Irrigation System using Arduino Uno

      Comments