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.

Arduino UnoMini or Major projectECE, EEE, EIE, Diploma
UNOMQ1056 rpmFeatured
Parts
₹3,140
Build
10 weeks
Board
Arduino Uno
Objectives
6
Test only with a lighter's unlit gas for a second at a time, outdoors or near an open window, with no flame nearby. This is a student prototype, not a certified gas alarm.

Block diagram

Inputs
  • MQ
    MQ-2 gas sensorDetects LPG and smoke
Controller
  • UNO
    Arduino UnoCompares the reading with the threshold
Power
  • 12
    12 V supplyFan, alarm and board
Outputs
  • AlarmWarns people nearby
  • Relay and exhaust fanClears the gas
  • 23.4°CLCD
    LCDShows the gas level and state
  • 4G
    4G modemSends SMS alerts and calls over the mobile network+
  • CLOUD
    Cloud dashboardStores readings, plots trends and sends alerts+

Objectives

  1. To detect LPG with an MQ-2 sensor after a 24-hour burn-in and a 20-second warm-up at each start.
  2. To raise an alarm above a threshold set from clean-air calibration (Rs/R0).
  3. To switch on an exhaust fan automatically and keep it on until the level stays low for two minutes.
  4. To measure the response time from leak to alarm.
  5. To send SMS alerts through a 4G modem where no Wi-Fi is available.
  6. To publish readings over MQTT and show them on a live dashboard with threshold alerts.

Parts and specifications

Total about ₹3,140 at typical online prices. Tap a part for its pinout and datasheet notes.

Design calculations

Sensor resistance Rs

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Ω.

Clean-air reference R0

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Ω.

Gas concentration

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.

Alarm level

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

SignalPin or connection
MQ-2 AOA0
LCD SDA / SCLA4 / A5
Relay 1 (fan)D7
Relay 2 (alarm)D8
Status LEDD13
MQ-2 heater5 V, 150 mA from the board's 5 V rail

Firmware outline

  1. At power-on show 'Warming up' for 20 s and do not alarm.
  2. Read A0 every 200 ms, average 10 samples, convert to Rs/R0 and ppm.
  3. If ppm > alarm level for 2 s, turn on the alarm and fan relays.
  4. Keep the fan on until ppm stays below the level for 2 minutes.
  5. Show ppm and state on the LCD; blink the LED while the sensor warms up.
  6. Store R0 in EEPROM after a clean-air calibration button press.

Test plan

TestExpected result
Clean air after warm-upRs/R0 close to 9.8, no alarm
Lighter gas released 10 cm away for 1 sAlarm within 5 s
Gas clearedFan stays on 2 minutes, then off
Power-onNo alarm during the 20 s warm-up
Ten trialsMean 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.

1. How does an MQ-2 sensor work?
2. Why does the sensor need a warm-up and a burn-in?
3. Why measure Rs/R0 and not raw voltage?
4. Why not shut the cylinder valve with a motor?
5. What else can set off the MQ-2?
6. Why should the fan motor be brushless or outside?

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.