Engorio.in
Home › Projects › CSE › GasShield MQ-2 Gas Leak Guardian

GasShield MQ-2 Gas Leak Guardian

CSE Advanced ESP32 Arduino C++
GasShield MQ-2 Gas Leak Guardian project banner

About this project

GasShield turns a ₹80 MQ-2 gas sensor into a cloud-connected leak detection system that sends an instant Telegram message with gas concentration and temperature the moment LPG, methane, or smoke exceeds a danger threshold — then logs every reading to Firebase Realtime Database for historical analysis on a live web dashboard served directly from the ESP32. The MQ-2 contains a tin oxide (SnO₂) sensing element heated to 200–300°C by an internal coil; in the presence of reducing gases, chemisorption lowers the SnO₂ surface resistance, raising the AOUT voltage on the module. The ESP32's 12-bit ADC converts this 0–3.3V output to 0–4095 counts. A DHT11 sensor provides temperature and humidity for context in alerts. Three status levels are tracked: SAFE (below 1500 ADC), WARNING (1500–2500), and ALARM (above 2500) — the ALARM state fires the local piezo buzzer, lights the red LED, and sends a Telegram Bot API POST request with the gas reading and a timestamp. All readings are written to Firebase at /gasshield/latest using HTTP PUT, enabling a JavaScript fetch() chart page to auto-update every 2 seconds. The ESP32 also runs an HTTP web server on port 80 — connect any browser on the same WiFi network to the ESP32's IP address to see a live dashboard with colour-coded status indicator. This project teaches Telegram Bot API integration (BotFather setup, sendMessage endpoint, JSON body construction), Firebase REST API (PUT to RTDB, database secret authentication), ESP32 dual-core HTTP server while also running sensor polling, ArduinoJson document serialisation, and gas sensor chemisorption physics. Build time: 3.5 hours.

What you get

  • Complete, commented source code
  • Full components list with quantities
  • Pin-by-pin wiring guide and connection table
  • Step-by-step upload and testing guide
  • Project report (.docx, IEEE style)
  • Presentation slides (.pptx)

More CSE projects

ByteBlast Binary Visualizer

Beginner₹109

CampusGuard Proximity Sentinel

Beginner₹109

CardCrypt RFID Access Sentinel

Beginner₹109

CipherForge — Servo PIN Security Vault

Beginner₹109

ClassCount Dual-Ultrasonic Occupancy Counter

Beginner₹109

GuardShelf — Reed-Switch Library Door Intrusion Alarm with Event Log

Beginner₹109