← Back to blog
Student Projects

Smart fire protection system for buildings

About This Project

The Smart Fire Protection System is designed to enhance safety in tall buildings like the Burj Khalifa. When fire is detected by a gas sensor, the system triggers multiple safety responses: a piezo buzzer sounds an alert, red lights activate, sprinkler systems engage to suppress flames, and exhaust motors activate to remove smoke. A green neopixel LED strip at exits illuminates to guide occupants safely out, as green remains visible through heavy smoke.

How It Works

Upon fire detection, the system simultaneously:

  • Activates the piezo buzzer and red warning lights
  • Engages sprinkler motors for flame suppression
  • Turns on exhaust motors to remove smoke
  • Illuminates green LED strips marking exit routes
  • Displays fire alert messages on an LCD display

Components Required

  • Arduino UNO
  • Gas Detection Sensor, Hydrogen
  • Breadboard
  • Buzzer, Piezo
  • Jumper Wires
  • Alphanumeric LCD 16 x 2
  • DC Motor
  • RGB Diffused Common Diode
  • Resistor 220 ohm
  • Through Hole Resistor 10K ohm
  • LED Strip, Neopixel Digital RGB

Code

#include <Adafruit_NeoPixel.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd(8, 9, 10, 11, 12, 13);

const int dinPin = 3;
const int numOfLeds = 16;

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(numOfLeds, dinPin, NEO_GRB + NEO_KHZ800);

int Gas_Sensor_Value = 0;
int Gas_sensor = A0;
int Piezo = 7;
int RGB_red = 6;
int RGB_green = 5;
int exhaust_motor = 4;
int sprinkler_motor = 2;

void setup() {
  pixels.begin();
  pixels.setBrightness(80);
  lcd.begin(16, 2);

  pinMode(Gas_sensor, INPUT);
  pinMode(Piezo, OUTPUT);
  pinMode(RGB_red, OUTPUT);
  pinMode(RGB_green, OUTPUT);
  pinMode(exhaust_motor, OUTPUT);
  pinMode(sprinkler_motor, OUTPUT);
}

void loop() {
  lcd.clear();
  Gas_Sensor_Value = analogRead(A0);

  if (Gas_Sensor_Value >= 700) {
    for (int i = 0; i < numOfLeds; i++) {
      pixels.setPixelColor(i, pixels.Color(0, 255, 0));
      pixels.show();
    }

    digitalWrite(sprinkler_motor, HIGH);
    digitalWrite(Piezo, HIGH);
    digitalWrite(exhaust_motor, HIGH);
    digitalWrite(RGB_red, HIGH);
    digitalWrite(RGB_green, LOW);

    lcd.print("Burj Khalifa is");
    lcd.setCursor(0, 1);
    lcd.print("on fire!");
    delay(1000);
  } else {
    digitalWrite(exhaust_motor, LOW);
    digitalWrite(sprinkler_motor, LOW);
    digitalWrite(Piezo, LOW);
    digitalWrite(RGB_red, LOW);
    digitalWrite(RGB_green, HIGH);

    lcd.print("Burj Khalifa");
    lcd.setCursor(0, 1);
    lcd.print("is Safe");
    delay(1000);
  }
}
More stories
Book free trial
Buy a kit Become partner Talk to us