Skip to content

deep-chatterjee/Fire-Alarm-System-using-Arduino

Repository files navigation

🔥 Fire Alarm System

An Arduino-based fire detection alarm that uses an MQ-2 gas/smoke sensor to monitor air quality in real time, displays status on a 16x2 I2C LCD, and triggers a buzzer and LED alert on smoke detection.

Arduino C++ LCD Sensor


📖 Overview

The Fire Alarm System is a smoke and fire detection project built on an Arduino UNO. An MQ-2 gas sensor continuously reads analog smoke levels and classifies them into three severity tiers — LOW, MEDIUM, and HIGH. The system displays the current status on a 16x2 I2C LCD screen and activates a buzzer and LED indicator when dangerous smoke levels are detected.


✨ Features

  • 🌫️ Three-tier detection — classifies smoke levels as LOW, MEDIUM, or HIGH based on configurable thresholds
  • 📺 Real-time LCD display — 16x2 I2C LCD shows live status and smoke level
  • 🔔 Buzzer alert — audible alarm triggers only at HIGH smoke level
  • 💡 LED indicator — lights up at MEDIUM and HIGH levels as a visual warning
  • 🖥️ Serial monitoring — raw sensor values streamed via Serial Monitor (9600 baud) for calibration and debugging

🛠️ Hardware Components

Component Quantity
Arduino UNO 1
MQ-2 Gas / Smoke Sensor 1
16x2 I2C LCD Display 1
Piezo Buzzer 1
LED (Blue) 1
Resistor (220Ω) 1
Breadboard 1
Jumper Wires As needed

🔌 Pin Connections

Component Pin Arduino Pin
MQ-2 Sensor VCC 5V
MQ-2 Sensor GND GND
MQ-2 Sensor AOUT A0
LCD (I2C) VCC 5V
LCD (I2C) GND GND
LCD (I2C) SDA A4
LCD (I2C) SCL A5
Buzzer Signal Digital 8
LED (+ 220Ω resistor) Anode Digital 9

🔌 Circuit Diagram

Built and simulated in Tinkercad

Breadboard View:

Breadboard Diagram

Schematic View:

Schematic Diagram


🚀 Getting Started

Prerequisites

  • Arduino IDE (1.8.x or 2.x)
  • LiquidCrystal_I2C library

Install the library via Arduino IDE Library Manager:

Sketch → Include Library → Manage Libraries → Search "LiquidCrystal I2C" → Install

Installation

  1. Clone the repository
git clone https://github.com/deep-chatterjee/Fire-Alarm-System.git
cd Fire-Alarm-System
  1. Open the sketch

    • Open Fire_Alarm_System.ino in the Arduino IDE
    • Select your board: Arduino UNO
    • Select the correct COM port
  2. Upload to your board

    • Click Upload
    • Open Serial Monitor (baud rate: 9600) to view live sensor readings

💻 How It Works

MQ-2 sensor reads analog smoke level (0–1023)
               ↓
     Compare against thresholds
    ┌──────────┬───────────┬──────────┐
    │  < 300   │  300–449  │  ≥ 450   │
    │   LOW    │  MEDIUM   │   HIGH   │
    └──────────┴───────────┴──────────┘
         ↓            ↓           ↓
    LCD: SAFE    LCD: Warning  LCD: FIRE ALERT!!!
    Buzzer: OFF  Buzzer: OFF   Buzzer: ON
    LED: OFF     LED: ON       LED: ON

⚙️ Threshold Configuration

Thresholds can be adjusted in the sketch to suit your environment and sensor:

int lowThreshold    = 300;   // Below this → SAFE
int mediumThreshold = 450;   // Between low & medium → WARNING
                             // Above medium → FIRE ALERT

📁 Project Structure

Fire-Alarm-System/
├── Fire_Alarm_System.ino              # Arduino sketch
├── Fire_Alarm_System_Circuit.png      # Tinkercad breadboard view
├── Fire_Alarm_System_Schematic.png    # Tinkercad schematic view
└── README.md

🧠 What I Learned

  • Reading and interpreting analog sensor output from an MQ-2 gas sensor
  • I2C communication protocol for driving an LCD display with only two signal wires
  • Multi-threshold classification logic for graduated alert levels
  • Coordinating multiple output peripherals (LCD, buzzer, LED) based on sensor state

🔮 Future Improvements

  • Add a temperature sensor (DHT11/DHT22) for combined fire and heat detection
  • Implement PWM buzzer tones that escalate with smoke severity
  • Send SMS or push notifications via GSM module (SIM800L) or Wi-Fi (ESP8266)
  • Log sensor data to an SD card for historical analysis
  • Add a manual reset button to silence the alarm

👤 Author

Deep Chatterjee
GitHub


📄 License

This project is licensed under the MIT License — see LICENSE for details.

About

Arduino-based fire detection alarm using an MQ-2 smoke sensor with three alert tiers - displays real-time status on a 16x2 I2C LCD and triggers a buzzer and LED on smoke detection.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages