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 Security & Surveillance

Smoke and Fire Alarm: MQ2 Sensor and Buzzer Arduino Build

Smoke and Fire Alarm: MQ2 Sensor and Buzzer Arduino Build

March 11, 2026 /Posted byJayesh Jain / 0

Table of Contents

  • MQ2 Sensor Overview
  • Circuit Wiring
  • Arduino Code with Calibration
  • Placement in Indian Homes
  • Indian Fire Safety
  • FAQ

MQ2 Sensor Overview

The MQ2 sensor detects smoke, LPG, propane, methane, alcohol, hydrogen, and carbon monoxide. The most popular gas/smoke sensor in Indian maker projects (Rs 40-100) due to wide sensitivity range and low cost. It has two outputs: digital D0 (triggers at threshold set by onboard potentiometer) and analog A0 (continuous voltage proportional to gas concentration). Critical: preheat for 20-48 hours before calibration in clean air. Fresh sensors show inaccurate readings until the heating element stabilises the sensing film. The sensor body becomes hot to the touch during operation – this is normal.

Recommended: Tiny RTC Real Time Clock DS1307 I2C IIC Module for Arduino – DS1307 RTC Module – add timestamped alarm logging to your smoke detector for fire incident reports required by Indian insurance companies.

Circuit Wiring

  • MQ2 VCC to 5V (from Arduino 5V pin, not USB-limited 5V), GND to GND
  • MQ2 A0 to Arduino A0 (analog reading)
  • MQ2 D0 to Arduino D2 (digital interrupt for instant alert)
  • Piezo buzzer + 100 ohm resistor to Arduino D8
  • Red LED (220 ohm) to Arduino D9
  • Optional: SIM800L to D3/D4 (SoftwareSerial) for SMS alerts

Arduino Code with Calibration

#define MQ2_AO A0
#define BUZZER 8
int baseline=0, threshold=0;
void setup(){
  Serial.begin(9600);
  Serial.println("Warming up 20s...");
  delay(20000);
  long sum=0;
  for(int i=0;i<100;i++){ sum+=analogRead(MQ2_AO); delay(10); }
  baseline=sum/100;
  threshold=baseline*1.5; // 50% above clean air
  Serial.print("Baseline: "); Serial.print(baseline);
  Serial.print(" Threshold: "); Serial.println(threshold);
}
void loop(){
  int reading=analogRead(MQ2_AO);
  if(reading > threshold){
    tone(BUZZER,2200);
    Serial.print("ALARM: "); Serial.println(reading);
  } else { noTone(BUZZER); }
  delay(100);
}

Placement in Indian Homes

  • Kitchen: Ceiling 30-60cm from cooking area. Not directly above stove (steam causes false alarms). For LPG leak detection, mount at 30cm above floor near the cylinder connection (LPG is heavier than air).
  • Bedroom: Ceiling centre. Smoke rises and collects at ceiling first.
  • Living room: Near the electrical distribution board for electrical fire detection.
  • False alarm reduction: Add 15-second sustained-reading filter – alarm only if threshold exceeded continuously for 15+ seconds. This rejects brief cooking smoke while maintaining sensitivity to real fires.

Indian Fire Safety

Bureau of Indian Standards IS 2189 governs fire alarm systems. Commercial premises require certified detection per National Building Code (NBC) 2016. DIY MQ2 systems are suitable for personal awareness but not a substitute for IS 11360 certified smoke detectors required for commercial compliance. Certified photoelectric detectors (better at distinguishing cooking aerosol from fire smoke): Rs 500-800 from Ravel, Honeywell, and Siemens at Indian electrical wholesalers.

Frequently Asked Questions

Does MQ2 detect cooking smoke vs real fire?

MQ2 detects both but cannot distinguish them. Indian high-heat cooking (tadka, deep frying) frequently triggers basic threshold alarms. Add a 15-second sustained-reading filter and use a higher threshold (2x clean air baseline instead of 1.5x) for kitchen installations. A photoelectric smoke detector is better at distinguishing cooking aerosol from real fire smoke.

Can MQ2 replace a certified smoke detector for building compliance?

For personal awareness – yes. For building compliance, insurance, or safety-critical applications – no. IS 11360 certified detectors use ionisation or photoelectric methods calibrated specifically to fire particle sizes.

MQ2 reads high values in clean air – is it defective?

New MQ2 sensors read 400-800 analog in clean air for the first few hours. Leave powered for 24-48 hours and re-measure baseline. If still high after 48h, test outdoors to rule out background gas levels. Kitchen vapour exposure over extended periods degrades the sensing film.

How do I send SMS alarm with SIM800L?

Connect to Arduino SoftwareSerial. In alarm code: send AT+CMGF=1, AT+CMGS=”+91XXXXXXXXXX”, message text, then 0x1A (chr 26). Use Jio or Airtel prepaid SIM. Note: SIM800L requires 4.1V supply – use AMS1117-4.0 regulator or dedicated LiPo, not Arduino 5V directly.

Shop Security & Surveillance at Zbotic

Tags: fire alarm circuit DIY, LPG gas alarm India, MQ2 sensor smoke, smoke detector Arduino project, smoke fire alarm Arduino
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Robotics Competition India 202...
blog robotics competition india 2026 wro abu and nrc guide 599614
blog seed germination chamber humidity and heat control build 599620
Seed Germination Chamber: Humi...

Related posts

Svg%3E
Read more

Trail Camera: Wildlife and Property Monitoring India

April 1, 2026 0
Table of Contents Trail Cameras for Indian Wildlife PIR-Triggered Camera Design ESP32-CAM Configuration for Trail Use Night Vision with IR... Continue reading
Svg%3E
Read more

Solar Powered Security Camera: Off-Grid Surveillance

April 1, 2026 0
Table of Contents Off-Grid Surveillance Needs in India Solar Panel and Battery Sizing Power Management Circuit ESP32-CAM Low Power Optimisation... Continue reading
Svg%3E
Read more

Remote Viewing Setup: Access Cameras from Anywhere

April 1, 2026 0
Table of Contents Remote Viewing Options P2P Cloud vs Port Forwarding Dynamic DNS Setup VPN for Secure Access Mobile App... Continue reading
Svg%3E
Read more

Motion Detection Zones: Reduce False Alarms

April 1, 2026 0
Table of Contents The False Alarm Problem How Motion Detection Works in Cameras Setting Detection Zones Sensitivity Adjustment Object Size... Continue reading
Svg%3E
Read more

Security Camera Placement: Best Positions for Coverage

April 1, 2026 0
Table of Contents Camera Placement Principles Height and Angle Guidelines Coverage Overlap Strategy Indian Home Layouts Commercial Property Placement Avoiding... Continue reading

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