BAI hardware showcase

Automatic Fire Detector and Controller

A smart safety project by BAI that detects flame, gives an alert, and activates a water pump automatically. The model combines sensors, ESP8266 control, a relay module, and an audio warning system to create a practical fire response prototype.

BAI automatic fire detector prototype

Project overview

This page documents the main build idea, real model photos, component requirements, wiring plan, and core code.

Detection

Flame sensors continuously monitor for fire and send the signal to the ESP8266 controller.

Response

The relay activates the motor pump while the ISD1820 module triggers an audio warning.

Notification

The project logic is structured to support Blynk alerts so remote fire notifications can be sent.

ESP8266 code

Replace the template values with your Blynk credentials, then connect your Wi-Fi details before uploading the code.

#define BLYNK_TEMPLATE_ID "Enter Your Template ID"
#define BLYNK_TEMPLATE_NAME "Enter Your Template Name"
#define BLYNK_AUTH_TOKEN "Enter Your Blynk Auth Token"
#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char ssid[] = "Your WiFi Name";
char pass[] = "Your WiFi Password";

#define FLAME_PIN D5
#define RELAY_PIN D1
#define ISD_PLAY  D2
#define LIGHT_PIN D6

bool fireNotified = false;
unsigned long lastBlinkTime = 0;
bool lightState = false;

void setup() {
  Serial.begin(9600);
  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);

  pinMode(FLAME_PIN, INPUT);
  pinMode(RELAY_PIN, OUTPUT);
  pinMode(ISD_PLAY, OUTPUT);
  pinMode(LIGHT_PIN, OUTPUT);

  digitalWrite(RELAY_PIN, LOW);
  digitalWrite(ISD_PLAY, LOW);
  digitalWrite(LIGHT_PIN, LOW);
}

void loop() {
  Blynk.run();

  int flameState = digitalRead(FLAME_PIN);
  unsigned long currentTime = millis();

  if (flameState == LOW) {
    digitalWrite(RELAY_PIN, HIGH);
    digitalWrite(ISD_PLAY, HIGH);

    if (currentTime - lastBlinkTime >= 250) {
      lastBlinkTime = currentTime;
      lightState = !lightState;
      digitalWrite(LIGHT_PIN, lightState);
    }

    if (!fireNotified) {
      Blynk.logEvent("fire_alert", "Fire Alert! Fire Detected!");
      fireNotified = true;
    }
  } else {
    digitalWrite(RELAY_PIN, LOW);
    digitalWrite(ISD_PLAY, LOW);
    digitalWrite(LIGHT_PIN, LOW);
    fireNotified = false;
  }
}

Inside the prototype

The internal setup includes the controller board, relay, speaker, flame sensor modules, pump, and tubing arranged inside a hand-built enclosure. This makes the project both presentable and functional.

Founders

Debnarayan Dhara

Vaskar Das