The problem
Gas leaks cause some of the most preventable household accidents in India. This gas leakage detector project using ESP32 continuously monitors LPG concentration with an MQ-2 sensor and responds automatically: a local buzzer raises an alarm, a relay switches on an exhaust fan to ventilate the area, and an instant Telegram message reaches your phone wherever you are. Built on the ESP32's built-in Wi-Fi, it needs no extra GSM module and works with any home router. A compact, low-cost, high-safety-relevance build — ideal as a final year project for ECE, EEE, and electronics diploma students, with complete report, source code, and viva support included.
How it works
- The MQ-2 sensor's tin-dioxide sensing element changes resistance in the presence of combustible gases (LPG, methane, propane, smoke).
- The ESP32 samples the sensor's analog output every few seconds, smooths the readings, and maps them to a gas-concentration value.
- When the value crosses the danger threshold: the buzzer sounds, the relay energizes the exhaust fan, and the ESP32 sends a pre-formatted alert to your Telegram bot.
- Once gas levels fall back below the threshold, the system sends an "all clear" message and returns the fan and buzzer to standby.
Project features
- MQ-2 semiconductor gas sensor calibrated for LPG detection with adjustable sensitivity via onboard potentiometer
- ESP32 reads analog gas levels continuously and compares against a configurable danger threshold
- Loud local buzzer alarm triggers the moment the threshold is crossed
- Relay automatically switches on an exhaust fan (or ventilation system) to disperse leaked gas
- Instant Telegram alert messages sent to your phone via Telegram Bot API on leak detection and on all-clear
- Status LED indication for normal, warning, and leak conditions
- Calibration mode with serial monitor readout to set the right baseline for your room
- Low component cost — total hardware under typical academic project budgets
What is included
- Assembled hardware unit (sensor wired and tested)
- Complete firmware source code (Arduino IDE) with configurable thresholds and Wi-Fi/Telegram credentials
- Wiring diagram and circuit explanation
- Report PDF: abstract, block diagram, methodology, results, conclusion
- PPT presentation for project review
- Viva Q&A document with expected questions and answers
Limitations & prerequisites
- Requires a working Wi-Fi connection for Telegram alerts; local buzzer and fan work without internet
- MQ-2 detects gas presence, not exact concentration — readings are indicative, and the sensor needs ~1–2 minutes of warm-up after power-on
- The sensor should be mounted near floor level, since LPG is heavier than air — mounting height affects sensitivity
- This is an academic safety demonstration, not a certified commercial gas-safety product
Components & software requirements
- ESP32 development board (built-in Wi-Fi)
- MQ-2 gas sensor module
- Active buzzer (5V)
- Single-channel relay module
- Exhaust fan (12V DC) or equivalent load
- LEDs and current-limiting resistors
- Breadboard / PCB, jumper wires, 5V power supply