logologo

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!

Electromagnet with Compass(STEAM Education)

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


1.7k05

loRa(LOng Range)Alert System(IoT Projects Arduino)

The IoT Projects Arduino LoRa (Long Range) Alert System is a wireless communication system designed to facilitate long-distance, low-power data transmission. In this project, two LoRa modules are employed in distinct locations, with one module acting as a transmitter and the other as a receiver. The system is engineered to send alerts or messages across large distances with minimal power consumption, making it ideal for remote monitoring and alerting applications. This IoT Projects Arduino documentation provides a comprehensive overview of the system's use, importance, operational principles, components, pin configurations, libraries used, working mechanism, main loop, notification function, and testing procedures.


2.7k06

Combination of Resistance Parallel Connection(STEAM Education)

To understand the effect of resistance in parallel connection on circuit behavior, that we will observe from LED intensity.


1.8k03

Research on IoT based Attendace System

This IoT based research project is designed to create an RFID-based attendance system using an ESP32 microcontroller and an MFRC522 RFID reader. The system reads RFID card UIDs, compares them with predefined UIDs to identify users, and displays the results on a LiquidCrystal_I2C LCD screen. If the scanned card UID matches the predefined UID, a "Welcome" message is shown; IoT Projects Arduino otherwise, an "Access Denied" message is displayed. This project demonstrates the use of RFID technology for access control and attendance management.IoT Projects .


3.0k011