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

ESP32-Based Smart Fire and Gas Detection System with Wi-Fi Alerts

View and Edit Project In Cirkit DesignerImage of ESP32-Based Smart Fire and Gas Detection System with Wi-Fi Alerts

Circuit Documentation

Summary

This circuit is designed to interface an ESP32 microcontroller with various sensors and actuators. It reads temperature and humidity from a DHT11 sensor and displays the values on a 16x2 I2C LCD. It also monitors a flame sensor and an MQ-6 gas sensor. If a flame is detected, it displays a warning on the LCD, sends a message via Telegram, and activates a red LED, servo, buzzer, and fan. If LPG gas is detected, it displays a warning on the LCD, sends a message via Telegram, and activates the same actuators. If no gas is detected, it displays a safe message and activates a green LED.

Component List

ESP32 Devkit V1

LED: Two Pin (red)

LED: Two Pin (green)

Resistor

16x2 I2C LCD

Buzzer

Servo

Fan

Sensor SHT113 Flame

KY-015 DHT11

MB102 Breadboard Power Supply Module 3.3V/5V

MQ-6 SENSOR LPG GAS

L298N DC motor driver

Battery 12V

Wiring Details

ESP32 Devkit V1

LED: Two Pin (red)

LED: Two Pin (green)

Resistor

16x2 I2C LCD

Buzzer

Servo

Fan

Sensor SHT113 Flame

KY-015 DHT11

MB102 Breadboard Power Supply Module 3.3V/5V

MQ-6 SENSOR LPG GAS

L298N DC motor driver

Battery 12V

Code Documentation

/*
 * This Arduino sketch is designed for an ESP32 microcontroller to interface with
 * various sensors and actuators. It reads temperature and humidity from a DHT11
 * sensor and displays the values on a 16x2 I2C LCD. It also monitors a flame
 * sensor and an MQ-6 gas sensor. If a flame is detected, it displays a warning
 * on the LCD, sends a message via Telegram, and activates a red LED, servo,
 * buzzer, and fan. If LPG gas is detected, it displays a warning on the LCD,
 * sends a message via Telegram, and activates the same actuators. If no gas is
 * detected, it displays a safe message and activates a green LED.
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <DHT.h>
#include <WiFi.h>
#include <UniversalTelegramBot.h>
#include <Servo.h>

#define DHTPIN 14
#define DHTTYPE DHT11
#define FLAME_PIN 35
#define MQ6_PIN 34
#define RED_LED_PIN 32
#define GREEN_LED_PIN 27
#define BUZZER_PIN 26
#define SERVO_PIN 25
#define FAN_PIN1 4
#define FAN_PIN2 5

const char* ssid = "Airtel_8272878748";//"oplus_co_aqwuon"
const char* password = "air56101";//"ludw6620"
const char* telegramBotToken = "8155996349:AAHqXEu4mk0w2v5VDdPcPK2Ll9oU