A real-time, multi-functional safety monitoring system powered by the ESP32 microcontroller.
This project, affectionately titled "In-Heat Earthquickie Detector", integrates four distinct detection capabilities—Earthquake, Fire, Gas, and Intrusion—into a single compact device. It utilizes the Blynk IoT platform for data visualization and the Telegram Bot API for instant remote alert notifications.
Project Status: Complete [December 2025]
Institution: Technological University of the Philippines - Manila
Course: CPET11L-M (Microprocessor and Microcontroller Systems)
The system continuously monitors environmental data and triggers alerts based on specific thresholds:
- 🌍 Earthquake Detection: Uses an MPU6050 accelerometer to detect seismic vibrations. It calculates magnitude intensity and classifies alerts (Minor, Mild, Harmful).
- 🔥 Fire & Heat Detection: Uses a DHT11 sensor to monitor temperature spikes. Triggers an alarm if the temperature exceeds 33°C (configurable).
- 💨 Gas & Smoke Detection: Uses an MQ-137/MQ-2 gas sensor to detect hazardous gases (LPG, Propane) and smoke density.
- 🏃 Motion/Intrusion Detection: Uses a PIR Sensor to detect human movement and send security alerts.
- 📱 Smart Notifications: Sends real-time alerts to your smartphone via Telegram and visualizes data on the Blynk app.
- Microcontroller: ESP32 Development Board (DOIT DEVKIT V1)
- Sensors:
- MPU6050 (Accelerometer/Gyroscope)
- DHT11 (Temperature & Humidity)
- MQ-137 or MQ-2 (Gas/Smoke Sensor)
- PIR Motion Sensor (HC-SR501)
- Display: LCD 20x4 with I2C Interface
- Power: 5V Power Supply (via USB or external source)
- Miscellaneous: Breadboard, Jumper Wires, 220Ω Resistors.
| Component | ESP32 GPIO Pin | Description |
|---|---|---|
| MPU6050 (SDA) | GPIO 21 |
I2C Data |
| MPU6050 (SCL) | GPIO 22 |
I2C Clock |
| LCD (SDA) | GPIO 21 |
I2C Data |
| LCD (SCL) | GPIO 22 |
I2C Clock |
| MQ Gas Sensor | GPIO 34 |
Analog Input (A0) |
| PIR Sensor | GPIO 33 |
Digital Input |
| DHT11 Sensor | GPIO 4 |
Digital Signal |
| Onboard LED | GPIO 2 |
Status Indicator |
This project is built using the Arduino IDE. You will need to install the following libraries via the Library Manager:
WiFi.h&WiFiClientSecure.h(Built-in)UniversalTelegramBotby Brian LoughArduinoJsonby Benoit BlanchonLiquidCrystal_I2Cby Frank de BrabanderDHT sensor libraryby AdafruitMPU6050by Electronic CatsBlynkby Blynk Inc.
Assemble the circuit according to the pinout table above. Ensure the I2C devices (LCD and MPU6050) share the same SDA/SCL lines.
The source code contains placeholders for your personal credentials. You must edit these lines in multiHazardDetectorSystem_SourceCode.ino before uploading:
// ==========================================
// IMPORTANT: CONFIGURATION REQUIRED
// ==========================================
// 1. BLYNK SETTINGS (Found in your Blynk Console)
#define BLYNK_TEMPLATE_ID "Your_Template_ID"
#define BLYNK_TEMPLATE_NAME "Your_Template_Name"
#define BLYNK_AUTH_TOKEN "Your_Blynk_Auth_Token"
// 2. WIFI CREDENTIALS
#define WIFI_SSID "Your_WiFi_Name"
#define WIFI_PASS "Your_WiFi_Password"
// 3. TELEGRAM BOT SETTINGS (Get these from @BotFather and @IDBot)
#define BOT_TOKEN "Your_Telegram_Bot_Token"
#define CHAT_ID "Your_Telegram_Chat_ID"-
Open Telegram and search for @BotFather.
-
Send the command /newbot.
-
Follow the instructions to name your bot. BotFather will provide you with a HTTP API Token (this is your BOT_TOKEN).
-
Search for @IDBot (or similar user ID bots) and send /getid to retrieve your personal Chat ID (this is your CHAT_ID).
-
Paste both the Token and Chat ID into the code variables mentioned above.
-
Connect your ESP32 to the computer via USB.
-
Open the project in Arduino IDE.
-
Go to Tools > Board and select DOIT ESP32 DEVKIT V1.
-
Go to Tools > Port and select the correct COM port.
-
Click the Upload button (Right Arrow icon).
-
Once uploaded, open the Serial Monitor (set baud rate to 115200) to verify connection status.
- Joseph C. Arenas
- Adriene Cyruz Estrada
- Geo Kentzer Gutierrez
- Lian Gil B. Pacis
- Jordan Recaña