Smart Smoke and Fire Alarm System Using Arduino />

Smart Smoke and Fire Alarm System Using Arduino

By Shail Pathak

Introduction:

In today's world, early detection of fire hazards is critical to ensure the safety of homes, offices, and industries. In this project, we will build a Smart Smoke and Fire Alarm System using an Arduino Uno, an MQ-2 Smoke Sensor, a Buzzer, and an LCD Display. This system will detect smoke or gas leaks and immediately alert you through sound and a visual message.

Why Build a Smoke and Fire Alarm?

Fire accidents can cause massive damage. A smoke and fire alarm system acts as the first line of defense, providing early warnings that help save lives and property. Building this system using Arduino is affordable, customizable, and educational.

Components Required:

Circuit Connections:

Component Pin (Arduino) Pin (Component)
MQ-2 Sensor 5V VCC
MQ-2 Sensor GND GND
MQ-2 Sensor D2 D0
MQ-2 Sensor (Optional Analog) A0 (optional) A0
Buzzer 5V VCC
Buzzer GND GND
Buzzer D3 SIG
LCD Display (I2C) A4 SDA
LCD Display (I2C) A5 SCL
LCD Display (I2C) 5V VCC
LCD Display (I2C) GND GND

 

Libraries Required:

You need to install the following Arduino library to work with the LCD via I2C:

  • LiquidCrystal_I2C Library

Steps to Install:

  1. Open Arduino IDE
  2. Go to Sketch → Include Library → Manage Libraries
  3. Search for "LiquidCrystal_I2C" by Frank de Brabander or similar
  4. Click Install

Alternatively, you can find it here: LiquidCrystal_I2C GitHub

Arduino Code:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#define smokeSensorPin 2
#define buzzerPin 3

LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  pinMode(smokeSensorPin, INPUT);
  pinMode(buzzerPin, OUTPUT);

  lcd.begin();
  lcd.backlight();

  Serial.begin(9600);
  lcd.setCursor(0, 0);
  lcd.print("MQ-2 Smoke Test");
  delay(2000);
  lcd.clear();
}

void loop() {
  int smokeStatus = digitalRead(smokeSensorPin);

  if (smokeStatus == LOW) {
    digitalWrite(buzzerPin, HIGH);
    lcd.setCursor(0, 0);
    lcd.print(" Smoke Detected ");
    Serial.println("Smoke Detected!");
  } else {
    digitalWrite(buzzerPin, LOW);
    lcd.setCursor(0, 0);
    lcd.print(" Air Clean ");
    Serial.println("Air Clean");
  }

  delay(500);
}

Working Principle:

  • The MQ-2 sensor continuously checks the surrounding air for smoke or gas.
  • When smoke is detected:
    • The sensor output becomes LOW.
    • Arduino reads the signal and turns ON the buzzer.
    • LCD shows "Smoke Detected".
    • A message "Smoke Detected!" is printed on the Serial Monitor.
  • When no smoke is detected:
    • The buzzer stays OFF.
    • LCD displays "Air Clean".

Applications:

  • Home Fire Alarm System
  • Kitchen Smoke Detection
  • Industrial Safety Monitoring
  • School or College Projects
  • Warehouse Monitoring

Final Thoughts:

This project offers a simple and effective way to enhance fire safety. You can upgrade it further with GSM, Wi-Fi modules, or automation systems. Building this system will enhance your knowledge of microcontrollers and real-world applications.

Back to blog

Leave a comment