logologo
Contact

HOMEABOUTSERVICESBLOGSBOOKSSHOPCONTACT

+977 9803661701support@nepatronix.orgLokanthali, Bhaktapur

© 2025 NepaTronix all rigths reserved

Fire and Gas Monitoring System(IoT Project)

  Back To Blogs

The Fire and Gas Monitoring System is designed to enhance safety in residential, commercial, and industrial environments. It continuously monitors for fire and gas leaks using a fire sensor and an MQ2 gas sensor. When a hazardous condition is detected, the system alerts the user via an LCD display and activates a buzzer. This system provides an effective way to quickly respond to fire outbreaks and gas leaks, potentially preventing damage and saving lives.

Project : 2

Fire and Gas Monitoring System

Description

The Fire and Gas Monitoring System is designed to enhance safety in residential, commercial, and industrial environments. It continuously monitors for fire and gas leaks using a fire sensor and an MQ2 gas sensor. When a hazardous condition is detected, the system alerts the user via an LCD display and activates a buzzer. This system provides an effective way to quickly respond to fire outbreaks and gas leaks, potentially preventing damage and saving lives.

Required Components

  1. Arduino Board: The central microcontroller to process sensor data and control the display and buzzer (e.g., Arduino Uno, Mega).
  2. Fire Sensor: A sensor to detect the presence of fire or high temperatures.
  3. MQ2 Gas Sensor: A sensor to detect smoke and various gases like LPG, CO, and methane.
  4. LCD Display with I2C Interface: A 16x2 LCD to display the status of fire and gas detection.
  5. Buzzer: An audible alert that sounds when a hazardous condition is detected.
  6. Connecting Wires: Wires to connect all components to the Arduino.
  7. Breadboard (Optional): For easier prototyping and connections.

Working Principle

  1. Initialization:
    • The Arduino initializes serial communication for debugging purposes.
    • The LCD is initialized and a welcome message is displayed.
    • Sensor pins and the buzzer pin are configured.
  2. Sensor Reading:
    • The fire sensor provides a digital output (HIGH or LOW) indicating the presence of fire.
    • The MQ2 gas sensor provides an analog output that corresponds to the concentration of detected gases.
  3. Data Processing:
    • The Arduino reads the digital output from the fire sensor.
    • It also reads the analog value from the MQ2 gas sensor, which is then compared to a predefined threshold to determine the presence of hazardous gas levels.
  4. Display and Alerts:
    • The sensor readings are displayed on the LCD, showing whether fire is detected and the gas concentration level.
    • If fire is detected or the gas concentration exceeds the threshold, the buzzer is activated to alert the user.
  5. Continuous Monitoring:
    • The system continuously monitors the environment by repeatedly reading sensor values and updating the display and buzzer status.

Code:

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

 

// Define the I2C address for the LCD

LiquidCrystal_I2C lcd(0x27, 16, 2); // Adjust the address 0x27 if needed

 

// Define sensor pins

const int fireSensorPin = 2;

const int mq2SensorPin = A0;

const int buzzerPin = 8;

 

void setup() {

  // Initialize the serial communication

  Serial.begin(9600);

 

  // Initialize the LCD

  lcd.begin();

  lcd.backlight();

  lcd.setCursor(0, 0);

  lcd.print("Initializing...");

 

  // Initialize sensor pins

  pinMode(fireSensorPin, INPUT);

  pinMode(mq2SensorPin, INPUT);

  pinMode(buzzerPin, OUTPUT);

 

  // Wait for a second to initialize

  delay(1000);

  lcd.clear();

}

 

void loop() {

  // Read the fire sensor value

  int fireSensorValue = digitalRead(fireSensorPin);

 

  // Read the MQ2 sensor value

  int mq2SensorValue = analogRead(mq2SensorPin);

 

  // Print the sensor values to the Serial Monitor

  Serial.print("Fire Sensor: ");

  Serial.print(fireSensorValue);

  Serial.print("  MQ2 Sensor: ");

  Serial.println(mq2SensorValue);

 

  // Display sensor values on the LCD

  lcd.setCursor(0, 0);

  lcd.print("Fire: ");

  lcd.print(fireSensorValue ? "No" : "Yes");

 

  lcd.setCursor(0, 1);

  lcd.print("Smoke: ");

  lcd.print(mq2SensorValue);

 

  // Check if fire or smoke is detected

  if (fireSensorValue == LOW || mq2SensorValue > 300) { // Adjust threshold as needed

    digitalWrite(buzzerPin, HIGH); // Turn on buzzer

  } else {

    digitalWrite(buzzerPin, LOW);  // Turn off buzzer

  }

 

  delay(500); // Wait for 0.5 second before next reading

}

Conclusion

The Fire and Gas Monitoring System is a reliable and efficient solution for detecting fire and gas leaks. It provides real-time monitoring and immediate alerts through an LCD display and buzzer, allowing for quick responses to potential hazards. This system can significantly enhance safety measures in various settings, reducing the risk of damage and harm caused by fire and gas leaks. The integration of sensors with an Arduino microcontroller and a user-friendly display makes it a versatile and valuable addition to any safety protocol.




Total likes : 3

Comments







Read More Blogs!

Top 10 IoT Projects Based on Arduino/ESP32/ESP8266

Here's a concise summary for your blog: Top 10 IoT Projects for Final Year Students Looking for innovative IoT projects for your final year? Explore our top 10 picks, ranging from smart energy meters to healthcare monitoring systems. These projects cover various sectors, including agriculture, healthcare, waste management, and home automation. Each project leverages IoT to solve real-world problems by using sensors, microcontrollers, and cloud computing. Whether you want to build a smart parking system or automate irrigation for farms, these ideas will help you develop skills in IoT technology and create impactful solutions. Dive in to learn more about these exciting projects!


28000

Obstacle Avoiding Robot(Robotics Project)

The Line Following Robot is a simple autonomous robot that follows a predefined path marked by a contrasting line on the ground. It utilizes infrared sensors to detect the line and adjust its movement accordingly. This project demonstrates the basic principles of robotics, including sensor integration, decision-making, and motor control.


1.7k04

Top 10 Robotics Projects for Final Year Students (iot projects based on arduino/esp32/esp8266)

Looking for engaging and innovative robotics projects for your final year? Explore these top 10 projects, ranging from autonomous line-following robots to sophisticated swarm robotics. These projects cover a wide range of applications, including industrial automation, healthcare, surveillance, and human-robot interaction. Whether you're interested in building a robotic arm or a self-balancing robot, each project offers a hands-on opportunity to develop essential skills in robotics, control systems, and programming. Dive in to discover the most exciting robotics ideas for your final year and take your robotics skills to the next level!


1.4k02

Laser Security System(STEAM Education)

To learn about laser security systems and how they work.


1.6k04