กลับไปหน้ารวมไฟล์
lpg-leakage-detector-and-email-sender-759024-en.md

Smart Gas Safety: IoT-Enabled LPG Leakage Detection

Liquefied Petroleum Gas (LPG) is a critical fuel source but poses significant risks if not monitored. This project creates a proactive safety system using the NodeMCU ESP8266 and the MQ2 Gas Sensor, capable of detecting flammable gas leaks and sending instant email notifications to the user—no matter where they are.

Chemical Sensing Physics: The MQ2 Module

The MQ2 is a metal-oxide semiconductor (MOS) gas sensor designed for high sensitivity to LPG, Propane, and Hydrogen.

  1. Heating Element: The sensor contains an internal heater that brings the sensitive layer to a specific temperature required for chemical reaction.
  2. Conductivity Shift: In clear air, the sensor has high resistance. When flammable gas molecules come into contact with the heated Tin Dioxide (SnO2) layer, the resistance drops.
  3. Signal Conditioning: The Arduino reads this change as an analog voltage (0V to 3.3V on the NodeMCU). The code polls the sensor 500 times per cycle, calculating a sliding average to filter out atmospheric noise and prevent false alarms.

Cloud Integration: Email Alerts via ESP8266

Unlike a basic alarm that only sounds locally, this project utilizes the WiFi capabilities of the ESP8266 to provide remote monitoring:

  • WiFi Connection: The NodeMCU connects to your home network, maintaining a persistent link to the cloud.
  • Trigger Logic: Once the average sensor value exceeds a pre-defined threshold, the device initiates an HTTP request.
  • SMTP/Notification Service: The request is processed by a secondary service (like IFTTT or a custom SMTP script) to dispatch an urgent email to the user's primary account, ensuring they are alerted even when away from the kitchen or industrial site.

Deployment and Calibration

To ensure the system remains reliable, it features a calibration step upon startup. This baseline ensures the sensor adapts to the ambient air quality of the specific room. By integrating this IoT logic into your kitchen, you add a critical layer of automated protection, turning a standard gas detector into a "Smart Home" safety appliance.

Need For LPG Detector:

Liquefied petroleum gas or liquid petroleum gas LPG, is a flammable mixture of hydrocarbon gases used as fuel in heating appliances, cooking equipment, and vehicles. LPG is a odorless gas but to make it odor, additives are added.

Our gas sensor which is MQ-4 Gas Monitors the LPG sensor output 500 times and takes the average of the sampling to reduce reading noise, and if the value is greater than the threshold value, it sends email to the recipient.

Connection Diagram:

  • Start by placing the NodeMCU on a breadboard as shown below:
  • Place the MQ-2 Gas sensor on the breadboard as shown below:
  • Make the breadboard connections with resistors as shown below:
470Ω with A0 and 10KΩ with GND
  • Make the connections on breadboard with wires as shown below:

After this upload the code and the project is finally complete!

Detailed tutorial:

Tutorial

Visit my website for more details. GitHub

Download the code GitHub

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Arduino IDE"
  - "1x Visual Studio Code Extension for Arduino"
author: "rahuladitya303"
category: ""
components:
  - "1x Jumper wires (generic)"
  - "1x Resistor 10k ohm"
  - "1x NodeMCU ESP8266 Breakout Board"
  - "1x MQ2 gas sensor"
  - "1x Through Hole Resistor, 470 ohm"
description: "This project uses ESP8266 along with MQ2 LPG gas sensor to work and send you email in case of increase in the concentration of methane."
difficulty: "Easy"
documentationLinks: []
downloadableFiles:
  - "https://projects.arduinocontent.cc/95df32ed-6ceb-403b-b908-d406c28a28c4.md"
  - "https://projects.arduinocontent.cc/991ef080-7e77-4180-872f-b29439b52770.ino"
  - "https://projects.arduinocontent.cc/3654a7d8-44d8-4641-90f0-a9fc047a650e.cpp"
  - "https://projects.arduinocontent.cc/0870cc11-01b9-470f-89dc-fe9a212307ed.h"
encryptedPayload: "U2FsdGVkX18xG27BuFSIZZz/tR6dWNfPJxE+mkAX4ANAgWC5y4eLE+gxHD3oc+93qGPR1pt0KpVv3LUm+9mXHKgt+AGIWz8B4iCB2T2vgsdP180fr6LmnYGyXlCKgmFTpV9esSVVuP12ed/F1Jv9eFSnhdHSB5g52yaqwQO5f2U="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/lpg-leakage-detector-and-email-sender-759024_cover.jpg"
lang: "en"
likes: 1
passwordHash: "b5baa9c387a153ab6d2a2d82bbf433e42d51feb0f872382def29b06ac9b28f57"
price: 2450
seoDescription: "ESP8266 and MQ2 Sensor project to detect LPG Leakage and send automated Email alerts for methane detection."
tags:
  - "nodemcu"
  - "esp8266"
  - "lpgdetector"
title: "LPG Leakage Detector and Email Sender"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/iCy8qLanQdc"
views: 4934