Arduino Projects

Gas Leakage Detector With SMS Alert

Gas Leakage Detector

Introduction

Gas leaks can pose significant risks in various environments, from homes to industrial facilities. To ensure safety and prevent accidents, it’s crucial to detect gas leaks promptly. In this article, we will guide you through the process of building a gas leakage detector using an Arduino Nano, an MQ135 gas sensor, an I2C 16×2 LCD display, red and green LEDs, and a SIM800 GSM module. This DIY project will help you create a reliable gas detection system with real-time alerts.

Components Needed

  1. Arduino Nano
  2. MQ-135 Sensor
  3. 16×2 LCD Display with I2C
  4. GSM sim800l Module
  5. LED
  6. Buzzer
  7. Wire
  8. Zero PCB
  9. 9V power supply

Circuit Diagram

circuit diagram 19

  • Connect the VCC pin of the MQ135 sensor to the 5V pin of the Arduino Nano.
  • Connect the GND pin of the MQ135 sensor to the GND pin of the Arduino Nano.
  • Connect the AOUT pin of the MQ135 sensor to the A0 analog input pin of the Arduino Nano.
  • Connect the SDA pin of the LCD display to the A4 pin (SDA) of the Arduino Nano.
  • Connect the SCL pin of the LCD display to the A5 pin (SCL) of the Arduino Nano.
  • Connect the positive leg of the red LED to pin 4 of the Arduino Nano.
  • Connect the positive leg of the green LED to pin 5 of the Arduino Nano.
  • Connect the cathode (negative leg) of both LEDs to the GND pin of the Arduino Nano.
  • Connect the SIM800 GSM module Tx to 2 and RX to 3 Pin of the Arduino Nano.

Arduino Uno-Based GAS Detector

Source Code

Setup() Function

    • The randomSeed() the function is used to initialize the random number generator with an analog input value.
    • Serial communication is initialized with a baud rate of 9600.
    • The LCD display is initialized and the backlight is turned on.
    • Pin modes for gasValue, Red, and Green are set to INPUT and OUTPUT, respectively.
    • The setup routine displays some welcome messages on the LCD screen for a few seconds.

Loop() Function

    • Analog reading from the gas sensor is performed using, and the value is stored in the data variable.
    • Gas level information is printed to the Serial monitor and displayed on the LCD.
    • If the gas level exceeds a threshold value (80 in this case), the SendMessage() function is called to send an SMS alert.
    • The LCD display is updated accordingly and the red LED is turned on while the green LED is turned off.
    • If the gas level is below the threshold, the LCD display and LEDs are updated to indicate normal gas levels.

SendMessage() Function

    • This function is responsible for sending an SMS alert using the SIM800 GSM module.
    • AT commands are sent via the mySerial software serial connection to configure the GSM module and send the SMS.
    • The destination phone number, message content, and control characters are sent sequentially.
    • A delay is added to allow time for the SMS to be sent.

Video

Conclusion

By following this guide, you have successfully built a gas leakage detector using an Arduino Nano, MQ135 sensor, I2C 16×2 LCD display, red and green LEDs, and a SIM800 GSM module. This project offers a cost-effective solution for gas leak detection with real-time alerts, ensuring safety in various environments. Experiment with different gases, improve the system’s accuracy and extend its functionality to meet your specific requirements. Always prioritize safety and take necessary precautions when dealing with gas-related projects.

Arduino Based Projects

Prateek

Hi, Prateek Here I’m interested in Electronics That's why I Make Soo Many Projects, I’m currently Pursuing M Tech.. if you Relay Like To My Blog Plz Comment Below...Thanks To All Electronics Lover...❤️

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker