Unik Systems Logo
Unik Systems
IoT · Electronics · Branding
DashboardShop
Builder
PC Forge
Visual AI planner with live benchmarks
Build Wizard
Quick questionnaire → preset build
3D PrintBrandingQuoteTutorials
Sign in
Your cart
0 items
🛒
Your cart is empty

Add Arduino boards, sensors, kits, or anything from our 170+ product catalog.

Browse products
HomeKnowledge BaseHome Safety Alert: MQ-2 Gas & Smoke Detector with Buzzer & Arduino
Back to knowledge base
guides

Home Safety Alert: MQ-2 Gas & Smoke Detector with Buzzer & Arduino

Build a critical life-safety detector that sounds a high-decibel audible alarm and warning LED when LPG, methane, propane, or smoke is detected.

Kunal (Founder & Owner) 1 min read8 Oct 2026
Home Safety Alert: MQ-2 Gas & Smoke Detector with Buzzer & Arduino

Home Safety Alert: MQ-2 Gas & Smoke Detector with Buzzer & Arduino

Liquefied petroleum gas (LPG) and combustible gas leaks in home kitchens or 3D printer enclosures pose severe safety hazards. The MQ-2 electrochemical gas sensor utilizes a tin-dioxide (SnO2) sensitive layer whose electrical conductivity increases in the presence of combustible hydrocarbons and smoke particles.


1. Pin Connections

  • MQ-2 VCC → Arduino 5V
  • MQ-2 GND → Arduino GND
  • MQ-2 AOUT → Arduino Analog A0
  • Buzzer (+) → Arduino Digital Pin 8
  • LED Anode → Arduino Digital Pin 9 (via 220Ω resistor)

2. Arduino Code

cpp
const int GAS_PIN = A0; const int BUZZER_PIN = 8; const int LED_PIN = 9; const int ALARM_THRESHOLD = 300; void setup() { Serial.begin(9600); pinMode(BUZZER_PIN, OUTPUT); pinMode(LED_PIN, OUTPUT); Serial.println("MQ-2 Preheating (approx 20 seconds)..."); } void loop() { int gasLevel = analogRead(GAS_PIN); Serial.print("Current Gas Level: "); Serial.println(gasLevel); if (gasLevel > ALARM_THRESHOLD) { digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, 1000); // 1KHz alarm tone } else { digitalWrite(LED_PIN, LOW); noTone(BUZZER_PIN); } delay(300); }

Parts used in this tutorial

Buy them in one click — ships from Pune across India.

3 ITEMS
  • Arduino Nano
    Microcontrollers
    ₹235.23
    + GST
  • MQ-2 Smoke Sensor
    Sensors
    ₹106.23
    + GST
  • Solderless 800-pin Breadboard
    Connectors & Wires
    ₹59.19
    + GST
Approx. total ₹400.65 (before GST)Add all to cart
#safety#gas-sensor#arduino#diy
Found this useful? Tell us what you'd like to read next via our RFQ form.

Free Shipping.

Starting from ₹899 across India

Customer Support

Hardware engineers ready to help

Online Payment.

100% Secure & Shop with Confidence

Fast Delivery.

24-48h Dispatch via BlueDart & Delhivery

7 Days Return

Doorstep replacement for defects

About

  • About Us
  • Contact Us
  • Our Presence (Karol Bagh)
  • Careers

Information

  • PC Components & Hardware
  • Electronics & Robotics
  • Offer Zone & Deals
  • Maker Tutorials & Guides
  • FAQ & Knowledge Base

Account

  • My Account
  • Order History
  • Track Order
  • Wishlist
  • Compare Products

Policy

  • Privacy Policy
  • Refund & Return Policy
  • Shipping Policy
  • Terms & Conditions

Contact Us:

EmailUnik.systems98@gmail.com
WhatsApp+91 9311349121
Phone No+91 9311349121
Address

Karol Bagh, New Delhi 110005, India

Shipped By:
Delhivery
BlueDart
DTDC Express
Porter
Ecom Express
Trackon
Payment System:
NetBanking
UPIUPI (GPay/PhonePe)
VISA
RuPay
MasterCard
PaytmPaytm
Unik Systems Pvt. Ltd © 2012 - 2026. All Rights Reserved.
Our Social Links: