logologo
Contact

HOMEABOUTSERVICESBLOGSBOOKSSHOPCONTACT

+977 9803661701support@nepatronix.orgLokanthali, Bhaktapur

© 2025 NepaTronix all rigths reserved

FIRE DETECTION THROUGH ESP32 MOBILE APP (IoT Project in Nepal)

  Back To Blogs

This project is designed to detect fire using an ESP32 microcontroller and a flame sensor. The system monitors the flame sensor's readings and sends data to a mobile app via the Blynk platform. Additionally, it displays the status on an LCD screen. If fire is detected, an alert message is displayed on both the mobile app and the LCD. This project demonstrates how IoT can be leveraged for fire detection and safety systems.

Project : 47


Introduction

This project is designed to detect fire using an ESP32 microcontroller and a flame sensor. The system monitors the flame sensor's readings and sends data to a mobile app via the Blynk platform. Additionally, it displays the status on an LCD screen. If fire is detected, an alert message is displayed on both the mobile app and the LCD. This project demonstrates how IoT can be leveraged for fire detection and safety systems.

Components Required

1.      ESP32 Microcontroller: The main control unit that processes sensor data and communicates with the Blynk app.

2.      Flame Sensor: Detects the presence of fire or flame.

3.      LiquidCrystal_I2C Display: For displaying the fire status locally.

4.      WiFi Network: For the ESP32 to connect and send data to the Blynk server.

5.      Connecting Wires: To connect the sensor and the LCD to the ESP32.

6.      Power Supply: To power the ESP32 and other components.

Pin Configuration

•        Flame Sensor Pin: Connected to GPIO 34 of the ESP32.

•        LCD Pins: Connected via I2C (SDA and SCL pins on ESP32).

Libraries Used

1.      BlynkSimpleEsp32: For communication with the Blynk app.

2.      Wire: For I2C communication.

3.      LiquidCrystal_I2C: For interfacing with the LCD display.

4.      WiFi: For connecting the ESP32 to a WiFi network.

 Code: 

//Copy the blynk credential from your acoount device and paset it here

 

#define BLYNK_TEMPLATE_ID "TMPL670BbO1Nl"

#define BLYNK_TEMPLATE_NAME "Data Monitoring"

#define BLYNK_AUTH_TOKEN "4Q5w-qYfY3jO82qXBaL3O0E3irLFfDwb"

 

#define BLYNK_PRINT Serial

#include <BlynkSimpleEsp32.h>

#include <Wire.h>

#include <WiFi.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

 

#define Sensor_PIN 34

 

char auth[] = BLYNK_AUTH_TOKEN; char ssid[] = "nepatronix_2.4";  //Enter your WIFI SSID name char pass[] = "CLB269DA03";      //Enter your WIFI password BlynkTimer timer;

void notify() {   int value = analogRead(Sensor_PIN);

  Serial.println(value);   Blynk.virtualWrite(V1, value);   display(14, 1, String(value));   if (value < 200) {

    display(1, 1, "No Fire                 ");

  }   else {     display(1, 1, "Fire Detected           ");

  }

  delay(100);

}

 

void setup() {

  Serial.begin(9600);   Wire.begin();

  lcd.init();   lcd.clear();   lcd.backlight();   lcd.setCursor(1, 0);

  lcd.print("**NEPATRONIX**");   delay(2000);

  lcd.clear();

  pinMode(Sensor_PIN, INPUT);

  display(1, 0, "Fire Status: ");

  Blynk.begin(auth, ssid, pass); //Connecting to Blynk Server with ssid and password   delay(500);

  Serial.println(WiFi.localIP());

 

  timer.setInterval(100L, notify);

 

}

 

void loop() {

  Blynk.run(); //run the blynk function in loop   timer.run();

}

 

void display(int col, int row, String msg) {

  lcd.clear();   lcd.setCursor(col, row);   lcd.print(msg);

}

Working

1.      Initialization:

o   The ESP32 initializes serial communication at 9600 baud rate. o The I2C communication is set up for the LCD, and an initial message is displayed. o             WiFi connection is established using the provided SSID and password.

o   The Blynk connection is initiated with the provided authentication token.

2.      Main Loop:

o   The main loop runs continuously, checking for sensor data and Blynk updates. o        The sensor value is read and displayed on the LCD and sent to the Blynk app.

o   If the sensor value indicates fire (value >= 200), a fire detected message is displayed; otherwise, a no fire message is shown.

3.      Notification Function:

o   Reads the flame sensor value.

o   Sends the sensor value to the Blynk app and updates the LCD.

o   Displays a fire detected message if the value exceeds a threshold (e.g., 200), otherwise, it displays no fire.

Testing

1.      Setup: Assemble all components as per the pin configuration.

2.      Power Up: Power the ESP32 and ensure all components are properly powered.

3.      WiFi Connection: Ensure the ESP32 is connected to the WiFi network and can communicate with the Blynk server.

4.      Sensor Testing: Place a flame near the sensor to test its response. The LCD and Blynk app should display a fire detected message when a flame is present and no fire when absent.

5.      Monitoring: Continuously monitor the sensor readings on the LCD and the Blynk app to ensure proper functioning.

Conclusion

The Fire Detection Through ESP32 Mobile App project successfully demonstrates how to use an ESP32 microcontroller for fire detection. By integrating a flame sensor with the ESP32 and utilizing the Blynk platform for mobile app notifications, the project provides a reliable and real-time fire monitoring system. The use of an LCD display ensures local visibility of the fire status, making it a comprehensive solution for fire safety applications.

 




Total likes : 4

Comments







Read More Blogs!

LED Intensity Controlled with Resistance(STEAM Education)

The aim of this project is to understand how resistance affects the flow of current in a circuit and to learn how to control the intensity of an LED by varying resistance.


1.7k04

Electromagnet with Compass(STEAM Education)

To understand the concept of electromagnetism and explore the direction of magnetic fields and poles.


1.7k05

Automatic Morning Alarm(STEAM Education)

The aim of this project is to create an automatic morning alarm system using simple electronic components.


1.8k03

TEMPERATURE HUMIDITY READER ON MOBILE APP (IoT Project)

The Temperature Humidity Reader project utilizes an ESP32 microcontroller in conjunction with a DHT11 sensor to monitor temperature and humidity levels. The collected data is displayed on an LCD and transmitted to a mobile application using the Blynk platform. This project provides an efficient way to remotely monitor environmental conditions in real time, making it useful for applications such as home automation, weather stations, and greenhouse monitoring.


1.9k02