The problem
A gas leakage detector with alarm and SMS alert using an MQ-2 sensor is a safety device that continuously watches the air in a kitchen, laboratory or hostel room for leaking LPG or propane and warns people before it becomes dangerous. LPG is heavier than air, so it pools near the floor and around the cylinder, and a leak is often noticed only by smell — when a spark can ignite it. Most homes rely on that smell alone, and nobody is warned when the house is empty or the occupants are asleep. This project closes that gap with a small Arduino-based prototype: an MQ-2 sensor measures the gas level, a buzzer sounds and a 16x2 LCD shows the warning the moment a threshold is crossed, and a SIM800L GSM module sends an SMS to the owner's phone, so the alert reaches someone even when nobody is in the room. An optional relay can also cut the gas supply automatically.
| How a leak is noticed | Local warning | Remote warning |
|---|---|---|
| Smell alone | None | None |
| Standalone gas alarm | Buzzer | None |
| This MQ-2 detector | Buzzer and LCD | SMS to the owner |
Tin-dioxide layer whose resistance falls as LPG or propane reaches it.
Follow the working sequence
How it works
The gas leakage detector works as a continuous sense-decide-alert loop. The MQ-2 sensor's tin-dioxide (SnO2) layer sits on a small heated ceramic tube; in clean air the layer conducts poorly, and when LPG, propane or smoke reaches its surface the gas reacts with adsorbed oxygen, the layer's resistance falls, and the module's voltage divider turns that fall into a rising voltage on its analogue output. The Arduino Uno reads that voltage on pin A0 with its 10-bit ADC, converts it to a value from 0 to 1023, and compares it with a threshold set in the firmware. Below the threshold the LCD shows GAS SAFE and the system keeps sampling; above it the buzzer sounds, the red LED lights, the LCD shows GAS LEAK, and the SIM800L GSM module sends an SMS warning to a stored phone number, while the optional relay switches off the gas supply.
- The MQ-2 sensor is powered from a stable 5 V supply and its heater warms the tin-dioxide layer; the build waits a few minutes after power-on for the reading to settle.
- The sensor's analogue output is read on Arduino pin A0, where the 10-bit ADC converts the 0–5 V signal into a value from 0 to 1023 (approximately 4.88 mV per step).
- The firmware compares each reading with the threshold set during calibration; clean-air readings sit well below it and gas pushes the reading up.
- Below the threshold the LCD shows GAS SAFE and the system keeps sampling roughly once per second.
- Above the threshold the buzzer sounds, the red LED lights, and the LCD switches to GAS LEAK with the current reading.
- The Arduino sends AT commands to the SIM800L GSM module, which transmits an SMS warning to the stored phone number over the 2G network.
- If the optional relay is fitted, the Arduino energises it to cut the gas supply, and the alarm keeps sounding until the reading falls back below the threshold.
Tech stack:
- Arduino Uno (ATmega328P)
- MQ-2 gas sensor module
- SIM800L GSM module
- 16x2 LCD display
- Arduino IDE
- Buzzer and relay module
- 5 V power supply
- Jumper wires and breadboard
| Parameter | Value |
|---|---|
| Controller | Arduino Uno with ATmega328P at 16 MHz (datasheet value) |
| Sensor | MQ-2 tin-dioxide gas sensor module (datasheet value) |
| Gases detected | LPG · propane · butane · methane · hydrogen · alcohol vapour · smoke (datasheet value) |
| Detection range | 300–10,000 ppm, gas-dependent (datasheet value) |
| Sensor heater | 5 V supply · approximately 150 mA heater current (datasheet value) |
| ADC resolution | 10-bit · 0–1023 · approximately 4.88 mV per step (datasheet value) |
| GSM module | SIM800L quad-band 850/900/1800/1900 MHz · 2G only (datasheet value) |
| GSM supply | 3.4–4.4 V · 4.0 V recommended · peak current approximately 2 A during transmission (datasheet value) |
| Display | 16x2 character LCD |
| Alarm | Buzzer plus red LED · optional relay for gas-supply cutoff |
| Sampling | Approximately once per second (design target) |
| Power | 5 V DC supply for the controller and sensor · separate regulated 4.0 V supply for the SIM800L (design target) |
Project features
The strongest parts of this build are its three-layer warning, its remote SMS alert, and its honest, calibratable sensing. The buzzer and red LED warn anyone in the room the instant gas crosses the threshold, the 16x2 LCD shows the live status in plain words, and the SIM800L GSM module sends an SMS to the owner's phone so the warning also reaches someone who is away. The fourth strength is the sensing itself: the MQ-2 is a tin-dioxide sensor whose resistance falls as gas concentration rises, and the threshold is set in the firmware after a warm-up and clean-air calibration, so the student can explain exactly what the system measures and where its limits lie. The build also teaches the power problem honestly: the sensor heater and the GSM module's transmission bursts each need their own proper supply, which is why the wiring keeps them separate.
- [MQ-2 gas sensing] The MQ-2 sensor detects LPG, propane, butane, methane, hydrogen, alcohol vapour and smoke, and reports the level as an analogue voltage the Arduino reads on pin A0.
- [Buzzer and LED alarm] A buzzer sounds and a red LED lights the moment the reading crosses the set threshold, giving an immediate local warning that needs no phone or network.
- [SMS alert via SIM800L] The SIM800L GSM module sends an SMS with the gas warning to a stored phone number, so the alert reaches the owner even when nobody is in the room.
- [16x2 LCD status display] The LCD shows the live status in plain words — GAS SAFE in clean air and GAS LEAK with the reading during an alarm — so the state is visible at a glance.
- [Configurable alarm threshold] The gas threshold is set in the firmware and tuned during calibration, so the alarm point can be matched to the room and the sensor's clean-air reading.
- [Optional gas-supply cutoff relay] A relay module can switch off the gas supply automatically when a leak is detected; it is an optional add-on, not part of the base build.
- [Warm-up and calibration guide] The build includes a step-by-step calibration procedure — warm-up, clean-air baseline, threshold setting — so the student can repeat it during the demonstration.
What is included
- Working gas leakage detector prototype (Arduino Uno, MQ-2 sensor, SIM800L, 16x2 LCD, buzzer, LED)
- Complete firmware source code (Arduino sketch with threshold, SMS and relay logic)
- Circuit and wiring diagram with pin connections
- Calibration guide (warm-up, clean-air baseline, threshold setting)
- Component list with exact part numbers
- Project report PDF (background, sensor theory, methodology, results)
- PPT presentation for final review
- Viva Q&A preparation document (MQ-2 sensing, ADC conversion, GSM AT commands, limitations)
Limitations & prerequisites
- The MQ-2 is a broadband sensor: it responds to LPG, propane, smoke and alcohol vapour together and cannot identify which gas triggered the alarm.
- Readings are relative, not calibrated ppm values — the report states the ADC reading and the threshold, never a claimed gas concentration.
- The sensor needs a warm-up of a few minutes after power-on, and a long preheat of over 24 hours on first use (datasheet guidance) before readings fully stabilise.
- The SIM800L works on 2G networks only, so the SMS alert needs a 2G SIM card and coverage; it cannot use 3G or 4G.
- The SIM800L must be fed 3.4–4.4 V with a supply that can deliver approximately 2 A peaks — powering it from the Arduino 5 V pin or a weak supply causes resets.
- The MQ-2 heater draws approximately 150 mA continuously, so the prototype is not suited to long battery operation.
- This is an academic prototype, not a certified gas detector; it is not a replacement for a certified domestic gas alarm.
Delivery timeline
- The prototype is built to order; the expected build and testing time is approximately 7–10 working days from order confirmation, depending on component availability.
- The report, PPT and viva Q&A are prepared alongside the build and shared with the prototype.
Support & explanation
- The build includes a live demonstration walkthrough over a video call, covering power-on, warm-up, calibration and a safe gas-response test.
- Doubts about the wiring, firmware, calibration or viva questions are answered on WhatsApp for approximately 30 days after delivery.
Frequently Asked Questions
Which gases can the MQ-2 sensor detect?
The MQ-2 detects LPG, propane, butane, methane, hydrogen, alcohol vapour and smoke, with the strongest response to LPG and propane. It is a broadband sensor, so it cannot tell which gas triggered the alarm — it reports that combustible gas or smoke is present above the threshold, and the report states this limit honestly.
How does the SMS alert work?
The SIM800L GSM module sends a text message to a phone number stored in the firmware when the gas reading crosses the threshold. It uses AT commands over a serial connection and works on 2G networks, so it needs a 2G SIM card with an active plan and network coverage at the installation site.
Does the detector work without internet or Wi-Fi?
Yes — the detector needs no internet and no Wi-Fi at all. Sensing, the buzzer, the LCD and the relay all run locally on the Arduino, and the SMS alert travels over the GSM mobile network, so the system works anywhere a 2G mobile signal reaches.
Why does the sensor need a warm-up before use?
The MQ-2's tin-dioxide layer only responds correctly once its internal heater brings it to working temperature, so a cold sensor reads high and drifts for the first few minutes. The firmware waits for the reading to settle, and the calibration guide records a clean-air baseline before the threshold is set.
Can the relay cut off the gas supply automatically?
Yes, as an optional add-on — a relay module wired to the gas solenoid valve switches the supply off when a leak is detected. It is not part of the base build, it is quoted separately, and it must be fitted by someone competent with mains and gas fittings.
Is this project suitable for a final-year project?
Yes — for Electronics, Electrical and IoT & Embedded programs, because it demonstrates sensor physics, analogue-to-digital conversion, threshold logic, GSM communication with AT commands, and a real safety application with honest, calibratable limits. Students can show the sensing, the decision, the local alarm and the remote SMS alert in one working prototype, and the calibration procedure gives the guide a clear demonstration to examine.
Components & software requirements
- Arduino Uno (ATmega328P)
- MQ-2 gas sensor module
- SIM800L GSM module
- 16x2 LCD display
- Arduino IDE
- Buzzer and relay module
- 5 V power supply
- Jumper wires and breadboard
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.