Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Electronics Basics

Smoke Detection using MQ-2 Gas Sensor

Smoke Detection using MQ-2 Gas Sensor

November 2, 2021 /Posted byshreyans001 / 1

Introduction:

This is a robust Gas sensor suitable for sensing LPG, Smoke, Alcohol, Propane, Hydrogen, Methane and Carbon Monoxide concentrations in the air. If you are planning on creating an indoor air quality monitoring system; breath checker or early fire detection system, MQ2 Gas Sensor Module is a great choice.

In this project, you will learn the sensor Analog output voltage and when the smoke reaches a certain level, it will make sound a buzzer and a red LED will turn on.

When the output voltage is below that level, a green LED will be on.

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
image 4
Smoke Detection using MQ-2 Gas Sensor 3

Component Required:

Arduino Uno
Uno Cable
MQ-2 Smoke Detection Sensor
Breadboard
Male-Female Jumper Wire
1 x 5mm LED Red
1 x 5mm LED Green
Buzzer
3 x Resistor 221ohm
9v Battery
Battery Snapper Connector

Circuit Diagram:

image 6
Smoke Detection using MQ-2 Gas Sensor 4

Connections:

Connect sensor A0 pin to Arduino A5 pin
Connect sensor GND pin to GND
Connect sensor Vcc pin to Vcc
Connect buzzer +ve to Arduino pin 10
Connect buzzer -Ve to GND through 221ohm resistor
Connect +ve pin of Red led to Arduino pin 12
Connect -ve pin of red led to GND through 221ohm resistor
Connect +ve pin of Green led to Arduino pin 11
Connect -ve pin of Green led to GND through 221ohm resistor

Code for Smoke Detection using MQ-2 Gas Sensor

int redLed = 12;
int greenLed = 11;
int buzzer = 10;
int smokeA0 = A5;
// Your threshold value
int sensorThres = 165;

void setup() {
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
Serial.begin(9600);
}

void loop() {
int analogSensor = analogRead(smokeA0);

Serial.print(“Pin A0: “);
Serial.println(analogSensor);
// Checks if it has reached the threshold value
if (analogSensor > sensorThres)
{
digitalWrite(redLed, HIGH);
digitalWrite(greenLed, LOW);
tone(buzzer, 1000, 200);
}
else
{
digitalWrite(redLed, LOW);
digitalWrite(greenLed, HIGH);
noTone(buzzer);
}
delay(100);
}

If you have any query please write us at [email protected]

YOU CAN BUY MQ-2 GAS DETECTION PROJECT KIT ON ZBOTIC

Please click below link

https://zbotic.in/product/smoke-detection-using-mq-2-gas-sensor-kit/

Hope you understand the project well and if you are facing any errors do inform us in the comments section below.

Tags: arduino uno, interfacing, microcontroller, Mini project, MQ2 Smoke Sensor
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Traffic Light Controller by Us...
diy0010.2
Aquaculture Monitoring System
IOT Based Aquaculture

Related posts

Svg%3E
Read more

Coffee Roaster: Temperature Profile Controller Build

April 1, 2026 0
Table of Contents Why Build a Coffee Roaster? Roasting Temperature Profiles Components for the Build Thermocouple Placement PID Profile Controller... Continue reading
Svg%3E
Read more

Sous Vide Cooker: Precision Temperature Water Bath

April 1, 2026 0
Table of Contents What Is Sous Vide Cooking? Precision Temperature Requirements Components for the Build PID Temperature Controller Water Circulation... Continue reading
Svg%3E
Read more

Kiln Controller: High-Temperature Pottery Automation

April 1, 2026 0
Table of Contents What Is a Kiln Controller? Temperature Requirements for Ceramics Components for High-Temperature Control K-Type Thermocouple and MAX6675... Continue reading
Svg%3E
Read more

Heat Gun Controller: Temperature and Airflow Regulation

April 1, 2026 0
Table of Contents What Is a Heat Gun Controller? Temperature and Airflow Regulation Components for the Build PID Temperature Control... Continue reading
Svg%3E
Read more

Soldering Iron Station: PID Temperature Controller Build

April 1, 2026 0
Table of Contents Why Build a Soldering Station? PID Temperature Control for Soldering Components Required Thermocouple Sensing at the Tip... Continue reading

One comment

  • Avatar of RK Menon

    RK Menon

    August 9, 2024 - 11:58 am

    will be grateful if you could let me knw the prices for all the components for both Gas leak project and Sanitizer projects. Once you let me know ,will take it forward. Let me know if you accept COD

    best wishes.

    Reply

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now