Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-Based Fire Alert System with LCD Display and Buzzer

View and Edit Project In Cirkit DesignerImage of ESP32-Based Fire Alert System with LCD Display and Buzzer

Fire Alert System Circuit Documentation

Summary

The circuit is designed to create a fire alert system using an ESP32 microcontroller, a flame sensor (Sensor SHT113 Flame), an LCD Display (20x4 I2C), and a buzzer. The ESP32 reads the flame sensor's digital output and displays the status on the LCD screen. If a flame is detected, the system activates the buzzer as an alert.

Component List

ESP32 (30 pin)

Sensor SHT113 Flame

LCD Display 20x4 I2C

Buzzer

Wiring Details

ESP32 (30 pin)

Sensor SHT113 Flame

LCD Display 20x4 I2C

Buzzer

Documented Code

#include <LiquidCrystal_I2C.h> 
#define FS 25
#define BUZ 4
LiquidCrystal_I2C lcd(0x27, 20, 4); 

void setup() { 
  Serial.begin(115200);
  pinMode(FS, INPUT);
  pinMode(BUZ, OUTPUT);
  lcd.init(); 
  lcd.backlight();
  lcd.setCursor(1, 0);    //c,r
  lcd.print("Fire Alert System"); 
  digitalWrite(BUZ, HIGH);
  delay(1000);
}

void loop() { 
  int Flame = digitalRead(FS);
  Serial.print("Data :");
  Serial.println(Flame);
  myflame(Flame);
  mymsg(Flame);
  delay(500);
  lcd.clear();
}

void myflame(int f) {
  lcd.setCursor(1, 0);    //c,r
  lcd.print("Fire Alert System"); 
  lcd.setCursor(1, 2); 
  lcd.print("Flame Status:");
  lcd.print(f); 
  delay(500);
}

void mymsg(int f) {
  lcd.setCursor(1, 3); 
  lcd.print("Message:"); 
  if(f == 0){
    lcd.print("Fire Alert"); 
    digitalWrite(BUZ, LOW);
  }
  else{
    lcd.print("Safe"); 
    digitalWrite(BUZ, HIGH);
  }
  delay(500);
}

Filename: sketch.ino

Description: This code initializes the ESP32 microcontroller, the LCD display, and sets up the pins for the flame sensor and buzzer. In the main loop, it reads the flame sensor's digital output and updates the LCD display with the flame status and a message. If a flame is detected, the buzzer is turned on to alert the user.