Gas Leakage Detection System using 8051

In this Tutorial we are going to see Gas Leakage Detection System using 8051.

Gas Leakage Detection System using 8051


Gas leakage tragedies and accidents have led to heavy losses over the years. So it is very important to detect any gas leakage and prevent any accidents. So here we propose a system to detect LPG gas leakage scenarios and provide a security alert to intended users.

SMS based LPG gas leakage detection system using GSM has application in various areas like home, industries, hotels, hospitals. This project has a gas leakage detector implemented by using an LPG Gas sensor. The user can get remote indication through SMS sent from the project. This SMS is sent from GSM modem which is connected to the microcontroller. A buzzer is turned on after LPG gas leakage so it acts as a gas leakage alarm.

Components Required

  • 8051 Development board
  • LCD Module
  • GSM Module
  • Gas Sensor
  • Buzzer
  • ADC0804
  • Relay

Software Required

  • Keil IDE


Before see the code, first you can see the basic interfacing tutorials of these components.

Block Diagram

Gas Leakage Detection System using 8051


  • Gas sensor is used to detect the Gas, which is connected to 8051 micro controller through ADC0804.
  • LCD is used to Display the Gas level and Relay status.
  • GSM is used to send the message when it detects the Gas in room or home.
  • Buzzer also make sound when controller detects any Gas.
  • Relay also connected to Micro Controller. The house’s electricity power will go through this relay. When it detects gas leakage, the relay goes off. So house electricity will be off. It will prevent the other damages by electricity.

Circuit Diagram


  • RS – P3.7
  • RW – GND
  • EN – P3.6
  • Data lines – P1

Gas Sensor:

  • Output – ADC’s Vin (6th Pin)


  • RD – P0.7
  • WR – P0.6
  • INTR – P0.5
  • CS – GND
  • Data Lines – P2


  • GSM RX – P3.1
  • GSM TX – P3.0

Buzzer: P0.1

Relay: P0.0


Here I’ve added only the main code. Header files are not here. You can download the full code Here.


  • Gas sensor detects the gas leakage in home. This value is analog. So we need to connect ADC to convert Digital.
  • If Gas level is high, micro controller turns OFF the Relay to cut electricity. The ON the buzzer. Finally it sends the message to house owner about gas leakage using GSM.
5 1 vote
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newest Most Voted
Inline Feedbacks
View all comments
Sanjeev Parmar
Sanjeev Parmar
February 17, 2019 1:33 AM

RESpack 8 or 7 what is it and it available in market ?

EmbeTronicx India
EmbeTronicx India
Reply to  Sanjeev Parmar
March 6, 2019 2:34 PM

Yes it is available. That is pullup resistor

Would love your thoughts, please comment.x
%d bloggers like this: