LPG leak detector with alarm and exhaust fan
LPG cylinders are in most Indian kitchens and hostel messes, and leaks cause fires every year. A detector that sounds an alarm and starts an exhaust fan as soon as gas builds up can buy critical minutes.
- Parts
- ₹3,140
- Build
- 10 weeks
- Board
- Arduino Uno
- Objectives
- 6
Block diagram
- MQ-2 gas sensorDetects LPG and smoke
- Arduino UnoCompares the reading with the threshold
- 12 V supplyFan, alarm and board
- AlarmWarns people nearby
- Relay and exhaust fanClears the gas
- LCDShows the gas level and state
- 4G modemSends SMS alerts and calls over the mobile network+
- Cloud dashboardStores readings, plots trends and sends alerts+
Objectives
- To detect LPG with an MQ-2 sensor after a 24-hour burn-in and a 20-second warm-up at each start.
- To raise an alarm above a threshold set from clean-air calibration (Rs/R0).
- To switch on an exhaust fan automatically and keep it on until the level stays low for two minutes.
- To measure the response time from leak to alarm.
- To send SMS alerts through a 4G modem where no Wi-Fi is available.
- To publish readings over MQTT and show them on a live dashboard with threshold alerts.
Parts and specifications
- Arduino Uno R3 (CH340 clone)ATmega328P 16 MHz, 32 KB flash, 2 KB SRAM, 5 V logic, 6 analog inputs (10-bit), 6 PWM pins₹450Buy
- MQ-2 gas and smoke sensorLPG, smoke, H₂ 200 to 10,000 ppm, heater 5 V 150 mA, 24 h burn-in, 20 s warm-up₹120Buy
- 16×2 LCD with I²C backpackHD44780, PCF8574 at 0x27 or 0x3F, 5 V, contrast trimmer on the back₹220Buy
- Wires and box₹150
- A7670C 4G LTE module4G Cat-1 with 2G fallback, SMS, calls and data, works with any Indian SIM including Jio; 3.4 to 4.2 V, 2 A peaks₹1,500Buy
- LM2596 buck converter (set to 4.0 V for the modem)4 to 40 V in, 1.25 to 37 V out, up to 2 A continuous (3 A peak), about 85% efficient₹90Buy
Total about ₹3,140 at typical online prices. Tap a part for its pinout and datasheet notes.
Design calculations
Rs = RL × (Vc − Vout) / Vout. The module's load RL is 1 kΩ on most boards (check yours). At Vout = 1.0 V and Vc = 5 V, Rs = 1 × 4 / 1 = 4 kΩ.
In clean air Rs/R0 is about 9.8 on the MQ-2 curve. If Rs in clean air is 9.8 kΩ, R0 = 1 kΩ.
From the log-log curve for LPG: ppm ≈ 10^((log10(Rs/R0) − 1.25) / −0.47), fitted from two datasheet points. Rs/R0 = 1.6 gives roughly 1000 ppm.
The lower explosive limit of LPG is about 1.8% (18,000 ppm). Alarm at 1000 ppm, about 5% of LEL, gives early warning.
Pin map
| Signal | Pin or connection |
|---|---|
| MQ-2 AO | A0 |
| LCD SDA / SCL | A4 / A5 |
| Relay 1 (fan) | D7 |
| Relay 2 (alarm) | D8 |
| Status LED | D13 |
| MQ-2 heater | 5 V, 150 mA from the board's 5 V rail |
Firmware outline
- At power-on show 'Warming up' for 20 s and do not alarm.
- Read A0 every 200 ms, average 10 samples, convert to Rs/R0 and ppm.
- If ppm > alarm level for 2 s, turn on the alarm and fan relays.
- Keep the fan on until ppm stays below the level for 2 minutes.
- Show ppm and state on the LCD; blink the LED while the sensor warms up.
- Store R0 in EEPROM after a clean-air calibration button press.
Test plan
| Test | Expected result |
|---|---|
| Clean air after warm-up | Rs/R0 close to 9.8, no alarm |
| Lighter gas released 10 cm away for 1 s | Alarm within 5 s |
| Gas cleared | Fan stays on 2 minutes, then off |
| Power-on | No alarm during the 20 s warm-up |
| Ten trials | Mean and spread of response time |
These rows start your results table when you plan the project.
Viva practice
Say your answer out loud first, then check. The first 2 answers are free; Maker opens all 6.
Make it yours
One or two upgrades for a mini project, two to four for a major one.
Build these first
Datasheets and sources to cite
- Hanwei MQ-2 datasheet
- Microchip ATmega328P datasheet
- IS 15100 (domestic gas leak detectors)
About this project
How much does the lpg leak detector with alarm and exhaust fan project cost?
About ₹1,550 for the parts in the base list: Arduino Uno R3 (CH340 clone), MQ-2 gas and smoke sensor, 12 V piezo alarm, 5 V relay module (2 channel), 12 V DC fan 80 mm, 16×2 LCD with I²C backpack, 12 V 2 A DC adapter, Breadboard 830 points, Wires and box.
How long does it take?
About 6 weeks for the base project, built on an Arduino Uno. Each upgrade adds time.
Which branches is it suitable for?
Electronics and Communication, Electrical and Electronics, Instrumentation, Diploma (any electronics branch), as a mini or major project.
Which pins and design calculations does it use?
MQ-2 AO on A0; LCD SDA / SCL on A4 / A5; Relay 1 (fan) on D7. Worked calculations on this page: sensor resistance rs, clean-air reference r0, gas concentration, alarm level.
How do I test it?
Clean air after warm-up: Rs/R0 close to 9.8, no alarm. Lighter gas released 10 cm away for 1 s: Alarm within 5 s. Gas cleared: Fan stays on 2 minutes, then off. Power-on: No alarm during the 20 s warm-up. Ten trials: Mean and spread of response time.
What are the objectives?
To detect LPG with an MQ-2 sensor after a 24-hour burn-in and a 20-second warm-up at each start. To raise an alarm above a threshold set from clean-air calibration (Rs/R0). To switch on an exhaust fan automatically and keep it on until the level stays low for two minutes. To measure the response time from leak to alarm.
