You are on page 1of 44

SMART LPG MONITORING SYSTEM USING IOT

A PROJECT REPORT

Submitted by
VENKATANATHAN S 113221071055

PRASANTH P 113221071301

In partial fulfillment for the award of the degree of

BACHELOR OF ENGINEERING

IN
INFORMATION TECHNOLOGY

VELAMMAL ENGINEERING COLLEGE, CHENNAI-66.


(An Autonomous Institution, Affiliated to Anna University, Chennai)
2023-2024

1
VELAMMAL ENGINEERING COLLEGE
CHENNAI –66

BONAFIDE CERTIFICATE

Certified that this project report “SMART LPG MONITORING SYSTEM


USING IOT” is the bonafide work of “VENKATANATHAN S
(113221071055), PRASANTH P (113221071301)”
who carried out the project work under my supervision.

Dr. JEEVAA KATIRAVAN Mr. S. RAJKUMAR


PROFESSOR & HEAD Assistant Professor – I
Department of IT Department of IT
Velammal Engineering College Velammal Engineering College
Ambattur – Red Hills Road, Ambattur – Red Hills Road,
Chennai - 600066 Chennai – 600066

2
CERTIFICATE OF EVALUATION

COLLEGE NAME : VELAMMAL ENGINEERING COLLEGE


BRANCH : INFORMATION TECHNOLOGY

SEMESTER : VI

Name of the students Name of


SI. Title of the
who has done the supervisor with
No Project
project designation
SMART LPG Mr. S. RAJKUMAR
1 VENKATANATHAN S
MONITORING Assistant
SYSTEM Professor - I
2 PRASANTH P
USING IOT

This report of Project work submitted by the above students in the partial fulfillment for
the award of Bachelor of Engineering Degree in Anna University was evaluated and
confirmed to be reports of the work by the above student and then assessed.

Submitted for Internal Evaluation held on ……………….

Internal Examiner External Examiner

3
ACKNOWLEDGEMENT

I wish to acknowledge with thanks to the significant contribution given by the


management of our college Chairman, Dr. M.V. Muthuramalingam, and our Chief
Executive Officer Thiru. M.V.M. Velmurugan, for their extensive support.

I would like to thank Dr. S. Satish Kumar, Principal of Velammal Engineering College,
for giving me this opportunity to do this project.

I wish to express my gratitude to our effective Head of the Department,


Dr. JEEVAA KATIRAVAN, for her moral support and for her valuable innovative
suggestions, constructive interaction, constant encouragement and unending help that have
enabled me to complete the project.

I wish to express my sincere gratitude to my Internal Guide, Mr.S.RAJKUMAR,


Assistant Professor – I, Department of information technology for her guidance, without
her this project would not have been possible.

I am grateful to the entire staff members of the department of information and technology
for providing the necessary facilities and to carry out the project. I would especially like to
thank my parents for providing me with the unique opportunity to work and for their
encouragement and support at all levels. Finally, my heartfelt thanks to The Almighty for
guiding me throughout life.

4
ABSTRACT

In recent years there has been a rapid development in technology which has made

human life easier in several aspects. LPG is a need of every and is widely used for

cooking. Some of the common problems experienced during its usage are, the gas

cylinders go empty while the peak cooking hours, incognizance of the current status

of gasoline present in the container, and the failure to prophesy the working days of

the LPG cylinder once installed. All these lead to inconvenience in its use. To deal

with these issues we have an ideology put forward. It mainly focuses on the

application of the IoT used for measuring the gasoline. The continuous weight

measurement of gas on regular basis is done using a load cell which is interfaced

with a Microcontroller. The current status and the booking notifications are notified

to the user on their mobile phones via Sim 800L. The proposed monitoring system

utilizes load cell sensors to measure the weight of the LPG cylinder. The weight data

is then used to calculate the remaining gas level. The system includes a GSM

module that enables the user to receive notifications and alerts in case of any gas

leaks or low gas levels. Thealerts are sent to the user's mobile phone through SMS or

calls, ensuring timely action can be taken to prevent any accidents. Additionally, the

system includes a buzzer that is activated in case of gas leakage, alerting people in

the vicinity of the cylinder.

5
TABLE OF CONTENTS

CHAPTER PAGE
TITLE
NO. NO.
ABSTRACT 4
LIST OF ABBREVIATIONS 8
LIST OF FIGURES 9

1 INTRODUCTION
1.1 PRESENT DAY SCENARIO 10
1.2 CHALLENGING IN EXISTING 11
SYSTEM

2 LITERATURE SURVEY
2.1 LPG MONITORING SYSTEM 12
2.2 EMBEDDED SYSTEMS 13
2.3 ALERT USING GSM 14
2.4 GSM 14

3 PROPOSED SYSTEM
3.1 DESCRIPTION 15
3.2 OBJECTIVE PROPOSED SYSTEM 16
3.3 ARCHITECTURE 17

6
4 HARDWARE
4.1 COMPONENTS REQUIRED 18
4.1.1 ARDUINO UNO 19
4.1.2 LOAD CELL 22
4.1.3 HX711

5 DESIGN AND IMPLEMENTATION


5.1 CIRCUIT DIAGRAM 23
5.2 WORKING METHODOLGY 24
5.3 FLOW GRAPH 25

6 CONCLUSION AND FUTURE WORK


6.1 SCREEN SHOT 26
6.2 CONCLUSION 26
6.3 FUTURE SCOPE 27

APPENDICES
A. CODE 28
B. RESULT 41
C. REFERENCES 43
D. PROGRAM OUTCOMES 44

7
LIST OF ABBREVATIONS

LPG : Liquefied Petroleum Gas


GSM : Global System for Mobile communications
SMS : Short Message Service SIM :
Subscriber Identity ModuleMCU :
Microcontroller Unit
ADC : Analog to Digital Converter
PCB : Printed Circuit Board LCD :
Liquid Crystal DisplayLED : Light
Emitting Diode
API : Application Programming Interface
IOT : Internet of Things
MQTT : Message Queuing Telemetry Transport GSM :
Global System for Mobile communicationsGPRS : General
Packet Radio Service

8
LIST OF FIGURES

Figure No. Figure Name Page No.

2.1 GSM Architecture 9

3.1 Flow Diagram of ELEOS 12

4.1 Arduino UNO 16

4.2 GSM 800L 17

4.3 Load cell 18

4.4 HX 711 module 19

5.1 Circuit Diagram 21

5.2 Working methodology 23

6.1 Project Prototype Model 25


6.2 Result 41
B.1 Inputs and Result 41
B. 2 Output of GSM 42

9
CHAPTER 1
INTRODUCTION

1.1 PRESENT DAY SCENARIO

LPG monitoring and alert systems have become increasingly popular in recent
years due to their ability to detect gas leaks and prevent potentially dangerous
situations. There are several types of LPG monitoring and alert systems
available in the market today, ranging from simple standalone devices to
more sophisticated systems that can integrate with other smart home
technologies.

One of the most common types of LPG monitoring and alert systems is a
standalone gas detector, which is typically placed in areas where gas leaks are
most likely to occur, such as near gas stoves or heaters. These detectors use
sensors to detect the presence of LPG in the air and sound an alarm whenlevels
exceed a predetermined threshold.

Another type of LPG monitoring and alert system is a smart gas detector,
which can be integrated with other smart home technologies such as Wi-Fi,
Alexa or Google Assistant. These systems provide real-time monitoring and
alerts through an app or email, allowing homeowners to receive notificationson
their smartphones or other devices when gas levels exceed a safe limit.

Moreover, some LPG monitoring and alert systems are designed specifically
for industrial or commercial applications, such as gas pipelines, refineries or
chemical plants. These systems use advanced sensors and software to provide
real-time monitoring of LPG levels, temperature, pressure, and other critical
parameters, helping to prevent accidents and ensure the safety of workers and
facilities.

10
1.2 CHALLENGES IN EXISTING SYSTEM

Although LPG monitoring and alert systems have become increasingly


popular, there are still several challenges that exist in the existing systems.
Some of these challenges include:

• False alarms: One of the most significant challenges faced by existing


LPG monitoring and alert systems is the occurrence of false alarms. This
can be caused by various factors such as humidity, temperature changes,
and other environmental conditions, leading to unnecessary panic and
inconvenience for homeowners.

• Limited coverage: Most LPG monitoring and alert systems are designed to
monitor only a specific area, such as the kitchen or the garage. This can be
problematic in larger homes or buildings where multiple gas sources are
present, and there is a need to monitor a broader area.

• Cost: Some of the more advanced LPG monitoring and alert systems canbe
quite expensive, making them inaccessible to homeowners who may not
have the financial resources to invest in such technology.

• Dependence on electricity: Many LPG monitoring and alert systems relyon


electricity to operate, which can be problematic in the event of a power
outage. This can leave homes or buildings without the necessary
protection during emergencies.

• Maintenance: LPG monitoring and alert systems require periodic


maintenance and calibration to ensure accurate readings. This can be
time-consuming and expensive, leading to a lack of compliance and the
potential for equipment failure.

11
CHAPTER 2
LITRATURE SURVEY

2.1 LPG MONITORING SYSTEM

Leveraging IoT technology, the system enables real-time data transmission to


cloud computing platforms like AWS or Azure for storage, analysis, and
remote accessibility. Wireless communication protocols facilitate seamless
connectivity, while data analysis tools process sensor data for user-friendly
visualization. An alerting mechanism ensures timely notifications of abnormal
gas levels, enhancing safety measures [1].

The system employs gas sensors within a network architecture, facilitating


real-time data collection. Integration with IoT technologies enables remote
monitoring and control capabilities, allowing users to access the system from
anywhere via the internet. By utilizing sensors, wireless communication, and
IoT integration, the system provides a comprehensive solution for timely gas
leak detection and remote management, enhancing safety measures in various
environments [2]. Through IoT connectivity, the system enables remote
monitoring and control, allowing users to access real-time data and receive
alerts via mobile devices or web interfaces. By leveraging sensors,
communication protocols, and IoT integration, the system offers an efficient
solution for monitoring LPG gas levels and ensuring prompt detection of
leaks, enhancing safety and convenience for users [3].

The system utilizes IoT technology, incorporating gas sensors for real-time
monitoring of gas levels. It integrates with a mobile application, allowing
users to access and monitor gas levels remotely. Additionally, the system
includes safety alert features to notify users
12in case of abnormal gas levels or
potential leaks. By combining gas sensors, IoT technology, mobile app
integration, and safety alert mechanisms, the system offers a comprehensive
solution for monitoring gas levels in domestic environments, enhancing safety
and convenience for users [4]. User-friendly interfaces, possibly through web
or mobile applications, enable users to access and visualize gas levels
remotely. By combining gas sensors, IoT connectivity, cloud-based analytics,
and user-friendly interfaces, the system offers an intelligent solution for LPG
gas monitoring, enhancing safety and convenience for users [5].

The system incorporates gas sensors to continuously monitor gas levels and
detect any potential leaks. Microcontrollers are utilized for data processing
and controlling sensor operations. Integration with cloud platforms enables
real-time data transmission, analysis, and storage, while also facilitating
remote monitoring and control. When a gas leak is detected, the system sends
alerts to users through various communication channels, ensuring timely
response and enhancing safety measures [6].

Communication protocols such as Wi-Fi or Zigbee enable connectivity to the


IoT network, facilitating data transfer to cloud-based platforms for real-time
analysis and storage. Data analytics techniques are employed to interpret
sensor data and identify patterns or anomalies [7]. Data from the gas sensors
is transmitted wirelessly through IoT communication protocols such as Wi-Fi
or Bluetooth to a centralized control unit. When a gas leak is detected, the
system triggers alerts through various means such as SMS, email, or mobile
app notifications to notify users [8]. The gas sensors designed for LPG
detection into an IoT architecture continuously monitor the environment for
gas presence and concentration levels. Communication protocols such as Wi-
Fi or Zigbee facilitate data transmission from the sensor to the IoT network.
Once a gas leak is detected, the sensor triggers an alert, which is transmitted
13
to users through designated communication channels such as mobile
applications or email notifications [9].

Communication protocols such as MQTT or OPC UA facilitate seamless


connectivity within the IoT network. The system employs data analytics
techniques to analyze sensor data for early detection of anomalies or
hazardous conditions. Through remote monitoring and control capabilities,
industrial operators can access real-time data and receive alerts in case of
abnormal gas levels or potential leaks, thereby enhancing safety measures in
industrial settings [10].

2.2 ALERT USING GSM

LPG monitoring systems can be equipped with GSM technology to provide


alerts via SMS or calls in case of a gas leak or other abnormalities. The GSM
module is connected to the control unit of the LPG monitoring system, and
when a gas leak or other abnormality is detected, the control unit sends a
message to the GSM module. The GSM module then sends a message to a
pre-configured phone number or numbers to alert the user about the situation.

The user can also interact with the LPG monitoring system using SMS
commands. For example, the user can send an SMS to the system to check the
gas level or to turn off the LPG supply remotely.

GSM technology provides a convenient way for users to receive alerts and
interact with the LPG monitoring system remotely. However, it is important
to ensure that the GSM module is always connected to a reliable network to
ensure timely alerts and interactions

14
Figure 2.1

15
CHAPTER 3
PROPOSED SYSTEM

3.1 DESCRIPTION

The proposed system will continuously monitor the weight of the LPG
cylinder using the load cell. If there is any change in weight due to a gas leakor
other abnormalities, the microcontroller will trigger the buzzer and send an
SMS alert to the user's phone number using the GSM module. The user can
take appropriate action to prevent any accidents or hazards.

The load cell will be used to measure the weight of the LPG cylinder and
detect any changes in weight due to gas leakage. The load cell will be
connected to a microcontroller that will process the data.

The microcontroller will be the main control unit of the system. It will receive
data from the load cell and process it to detect any gas leak or abnormalities in
the LPG supply. If a gas leak is detected, the microcontroller will trigger the
buzzer and send an SMS alert to a pre-configured phone number using the
GSM module.

The GSM module will be used to send SMS alerts to the user's phone numberin
case of a gas leak or other abnormalities in the LPG supply. The module will
be connected to the microcontroller and will send SMS alerts based on the
pre-configured phone numbers.

16
A buzzer will be used as an audible alarm to alert the user about the gas leakor
other abnormalities in the LPG supply. The buzzer will be connected to the
microcontroller and will be triggered in case of a gas leak.

The system will require a power supply to operate. This can be a battery or a
mains power supply depending on the application.

The system can be further enhanced by adding additional sensors such as


temperature sensors or gas sensors to improve the accuracy and reliability of
the monitoring system.

3.2 OBJECTIVES OF PROPOSED SYSTEM

• In the proposed system, a product idea of a device named ‘ELEOS’ is


presented.

• A hardware setup that gives a buzzer and sms alert to the comsumer
when LPG is running out.

• To Design the hardware setup which is attached with the mechanical


trolley to calculate the amount of LPG present.

• To send an alert message incase of the lpg gas level becomes low.

17
3.3 ARCHITECTURE

Figure 3.1
The architecture shows the input and output components used in our project. All
the various sensors connected measures the real time data and sends it to the
controller unit. The controller as per programmed, senses the value to the cloud
and also alerts the person at the used end.

18
CHAPTER 4
HARDWARE

4.1 COMPONENTS REQUIRED


• ARDUINO UNO
• LOAD CELL
• HX711
• BREAD BOARD
• GSM SIM 800L and POWER BOARD
• BUZZER

4.1.1 ARDUINO UNO

It is an open-source platform used for building electronics projects. Arduino


consists of both a physical programmable circuit board (often referred to as a
microcontroller) and a piece of software, or IDE (Integrated Development
Environment) that runs on your computer, used to write and upload computer
code to the physical board. The Arduino platform has become quite popular 3
with people just starting out with electronics, and for good reason. Unlike
most previous programmable circuit boards, the Arduino does not need a
separate piece of hardware (called a programmer) in order to load new code
onto the board -- you can simply use a USB cable. Additionally, the Arduino
IDE uses a simplified version of C++, making it easier to learn to program.

The Uno is a great choice for your first Arduino. It's got everything you needto
get started, and nothing you don't. It has 14 digital input/output pins (of which
6 can be used as PWM outputs), 6 analog inputs, a USB connection, a

19
power jack, a reset button and more. It contains everything needed to support
the microcontroller simply connect it to a computer with a USB cable or
power it with a AC-to-DC adapter or battery to get started.This is Lilypad
Arduino main board! Lilypad is a wearable e-textile technology developed by
Leah Buechley and cooperatively designed by Leah and Spark Fun. Each
Lilypad was creatively designed with large connecting pads and a flat back to
allow them to be sewn into clothing with conductive thread. The Lilypad also
has its own family of input, output, power, and sensor boards that are also
built specifically for e-textiles. They're even washable.

Figure 4.1

4.1.2 LOAD CELL

A load cell is a type of transducer that is used to measure force or weight. It


converts the force or weight applied to it into an electrical signal that can be
measured and processed by a microcontroller or other electronic devices.
Load cells are commonly used in various applications such as weighing
scales, industrial automation, and material testing.

20
Load cells work on the principle of strain gauges, which are resistive elements
that change their resistance when subjected to a force or weight. The load cell is
typically made up of one or more strain gauges that are arranged in a Wheatstone
bridge configuration. When a force is applied to the load cell, it causes a change
in the resistance of the strain gauges, which results in an electrical signal
proportional to the applied force.

Load cells are available in different types and configurations to suit various
applications. The most common types of load cells are:

• Compression load cells: These load cells are designed to measure


compressive forces or weights.
• Tension load cells: These load cells are designed to measure tensile
forces or weights.
• Shear load cells: These load cells are designed to measure shear forcesor
weights.
• Universal load cells: These load cells are designed to measure both
compression and tension forces or weights.

Load cells have several advantages over other types of sensors for
measuring weight or force. They provide high accuracy and precision, are
durable, and have a long lifespan. Additionally, load cells can be easily
interfaced with microcontrollers and other electronic devices, making them
suitable for use in various applications.

21
Figure 4.2

4.1.1 HX711

HX711 is a precision analog-to-digital converter (ADC) designed specifically


for weigh scale and industrial control applications. It is commonly used with
load cells to accurately measure weight and force. TheHX711 ADC provides
high accuracy and resolution, with up to 24-bit ADCresolution, making it
suitable for use in applications that require precise weight measurements.

The HX711 ADC communicates with microcontrollers or other electronic


devices through a two-wire interface, which makes it easy to integrate into
various applications. It uses a 10 MHz clock to convert analog signals from
the load cell into digital signals, which can be read by the microcontroller.

The HX711 ADC also features an on-chip programmable gain amplifier


(PGA) that can amplify the input signal by a factor of 128 or 64, depending
on the application. This enables the ADC to handle a wide range of load cell
sensitivities.

22
Figure 4.3

23
CHAPTER 5
DESIGN AND IMPLEMENTATION

5.1 CIRCUIT DIAGRAM

Figure 5.1 (Circuit diagram of ELEOS)

5.2 WORKING METHODOLOGY

A monitoring and alert system for LPG (liquefied petroleum gas) typically
involves monitoring the levels of gas in a storage tank or cylinder and alerting
users if the gas levels reach a certain threshold or if there is a potential gas

24
leak. Here is a general overview of the working methodology of an LPG
monitoring and alert system:

• Gas Level Monitoring: The monitoring system typically uses sensors to


measure the levels of gas in the storage tank or cylinder. The sensors maybe
ultrasonic, pressure-based, or weight-based depending on the specific
system.

• Data Collection: The monitoring system collects data from the sensors
and sends it to a central monitoring unit. This unit may be a standalone
device or part of a larger control system.

• Data Analysis: The monitoring unit analyzes the data to determine the
current gas levels and whether they are within safe limits. The unit may
also use algorithms to predict when the gas levels will reach critical levels
based on usage patterns.

• Alert Generation: If the gas levels reach a certain threshold or if there is a


potential gas leak, the monitoring unit generates an alert. The alert may be
in the form of a sound or visual alarm, a text message or email
notification, or an automated phone call to a designated contact.

• Alert Message: If any kind of the alert message has been generated, then it
will be sent to the respective mobile number which has beed registered to
the specific device.

25
5.3 FLOWGRAPH

Figure 5.2 ( Working methodology)

26
CHAPTER 6
CONCLUSION AND FUTURE WORKS

6.1 SCREENSHOTS

Figure 6.1 ( Project prototype)

Figure 6.2 ( load cell reading inputs )

27
6.2 CONCLUSION

In conclusion, an LPG monitoring and alert system is an essential safety


feature that helps prevent gas leaks and ensures that gas levels are maintained
within safe limits. The system works by using sensors to monitor the gas
levels, collecting and analyzing data, generating alerts when necessary, and
prompting users to take appropriate action. With the help of an LPG
monitoring and alert system, users can enjoy the benefits of LPG while
minimizing the risks associated with its storage and use.

6.3 FUTURE SCOPE

• The future scope of LPG monitoring and alert systems is promising as


technology continues to evolve and improve.
• Some areas are to be developed to an advanced state so that the workingof
the system could be more feasible.
• Overall, the future scope of LPG monitoring and alert systems is bright,
with potential developments in IoT integration, AI, wireless sensors, and
mobile applications.
• These advancements can improve the safety, efficiency, and convenience of
LPG use, benefitting both consumers and the environment.

28
APPENDICES

A. CODE

#include <SPI.h> #include


<MFRC522.h>
#include <SoftwareSerial.h>

#define SS_PIN 10
#define RST_PIN 9

#define GSM_TX_PIN 3
#define GSM_RX_PIN 2

SoftwareSerial gsmSerial(GSM_TX_PIN, GSM_RX_PIN);

void setup() {
Serial.begin(9600);
gsmSerial.begin(9600);
SPI.begin();
mfrc522.PCD_Init();
mfrc522.PCD_DumpVersionToSerial();
Serial.println("Initializing..."); delay(2000);
gsmSerial.println("AT");
updateSerial();
gsmSerial.println("AT+CMGF=1");

29
updateSerial();
}
void sendSMS(String message) {
gsmSerial.println("AT+CMGS=\"+917358195814\"");updateSerial();
gsmSerial.print(message);
updateSerial();
gsmSerial.write(26);
}

void updateSerial() {
delay(500);
while (Serial.available()) {
gsmSerial.write(Serial.read());
}
while (gsmSerial.available()) {
Serial.write(gsmSerial.read());
}
}

// Include required libraries


#include <SoftwareSerial.h>

// Initialize constants for the GSM module


const int GSM_TX_PIN = 2;
const int GSM_RX_PIN = 3;
const int GSM_BAUDRATE = 9600;

30
// Initialize global variables
SoftwareSerial gsmSerial(GSM_TX_PIN, GSM_RX_PIN);

void setup() {
// Initialize serial communications for debugging
Serial.begin(9600);
while (!Serial);

// Initialize serial communications for the GSM module


gsmSerial.begin(GSM_BAUDRATE);
delay(1000);
}

void loop() {
// Send an AT command to the GSM module and wait for a response
gsmSerial.println("AT");
delay(1000);
if (gsmSerial.available()) {
String response = gsmSerial.readString();
Serial.print("GSM Response: ");
Serial.println(response);
}
}

// Include required libraries


#include <HX711.h>

31
// Initialize constants for the HX711 load cell moduleconst
int LOADCELL_DOUT_PIN = 4;
const int LOADCELL_SCK_PIN = 5;
const float CALIBRATION_FACTOR = 1234.56789; // Replace with your
calibration factor

// Initialize global variables


HX711 scale;

void setup() {
// Initialize serial communications for debugging
Serial.begin(9600);
while (!Serial);

// Initialize the load cell


scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale(CALIBRATION_FACTOR);
}

void loop() {
// Read the load cell and print the weightfloat
weight = scale.get_units();
Serial.print("Weight: ");
Serial.print(weight);
Serial.println(" kg");

32
delay(1000); // Wait 1 second before reading the load cell again
}

// Include required libraries


#include <HX711.h>

// Initialize constants for the HX711 load cell moduleconst


int LOADCELL_DOUT_PIN = 4;
const int LOADCELL_SCK_PIN = 5;
const float CALIBRATION_FACTOR = 1234.56789; // Replace with your
calibration factor

// Initialize constants for the buzzer


const int BUZZER_PIN = 6;
const int BUZZER_THRESHOLD = 1000;

// Initialize global variables


HX711 scale;
boolean buzzerOn = false;

void setup() {
// Initialize serial communications for debugging
Serial.begin(9600);
while (!Serial);

// Initialize the load cell


scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);

33
scale.set_scale(CALIBRATION_FACTOR);

// Initialize the buzzer


pinMode(BUZZER_PIN, OUTPUT);
}

void loop() {
// Read the load cell and print the weightfloat
weight = scale.get_units();
Serial.print("Weight: ");
Serial.print(weight);
Serial.println(" kg");

// Check if weight is above the threshold and turn the buzzer on/offif
(weight > BUZZER_THRESHOLD) {
if (!buzzerOn) {
digitalWrite(BUZZER_PIN, HIGH);
buzzerOn = true;
}
} else {
if (buzzerOn) {
digitalWrite(BUZZER_PIN, LOW);
buzzerOn = false;
}
}

delay(1000); // Wait 1 second before reading the load cell again

34
}

// Include required libraries


#include <HX711.h> #include
<SoftwareSerial.h>

// Initialize constants for the HX711 load cell moduleconst


int LOADCELL_DOUT_PIN = 4;
const int LOADCELL_SCK_PIN = 5;
const float CALIBRATION_FACTOR = 1234.56789; // Replace with your
calibration factor

// Initialize constants for the GSM module


const int GSM_TX_PIN = 2;
const int GSM_RX_PIN = 3;
const int GSM_BAUDRATE = 9600;
const String PHONE_NUMBER = "+1234567890"; // Replace with your
phone number

// Initialize global variables


HX711 scale;
SoftwareSerial gsmSerial(GSM_TX_PIN, GSM_RX_PIN);

void setup() {
// Initialize serial communications for debugging
Serial.begin(9600);
while (!Serial);

35
// Initialize the load cell
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale(CALIBRATION_FACTOR);

// Initialize the GSM module


gsmSerial.begin(GSM_BAUDRATE);
delay(1000);
}

void loop() {
// Read the load cell and print the weightfloat
weight = scale.get_units();
Serial.print("Weight: ");
Serial.print(weight);
Serial.println(" kg");

// Send the weight data to the phone number via SMS


String smsText = "Current weight: " + String(weight, 2) + " kg";
sendSMS(PHONE_NUMBER, smsText);

delay(60000); // Wait 1 minute before sending the next SMS


}

void sendSMS(String phoneNumber, String smsText) {


// Send an AT command to the GSM module to set the SMS mode
gsmSerial.println("AT+CMGF=1");

36
delay(1000);
// Send an AT command to the GSM module to set the phone number
gsmSerial.println("AT+CMGS=\"" + phoneNumber + "\""); delay(1000);
// Send the SMS text to the GSM module and terminate with Ctrl+Z
gsmSerial.println(smsText);
delay(100);
gsmSerial.write(0x1A);
delay(1000);
// Print the GSM response to the serial monitor for debuggingwhile
(gsmSerial.available()) {
char c = gsmSerial.read();
Serial.print(c);
}
Serial.println();
}

// Include required libraries


#include <HX711.h>

// Initialize constants for the HX711 load cell moduleconst


int LOADCELL_DOUT_PIN = 4;
const int LOADCELL_SCK_PIN = 5;
const float CALIBRATION_FACTOR = 1234.56789; // Replace with your
calibration factor

// Initialize constants for the buzzer

37
const int BUZZER_PIN = 6;
const int BUZZER_THRESHOLD = 1000;

// Initialize global variables


HX711 scale;
boolean buzzerOn = false;

void setup() {
// Initialize serial communications for debugging
Serial.begin(9600);
while (!Serial);

// Initialize the load cell


scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale(CALIBRATION_FACTOR);

// Initialize the buzzer


pinMode(BUZZER_PIN, OUTPUT);
}

void loop() {
// Read the load cell and print the weightfloat
weight = scale.get_units();
Serial.print("Weight: ");
Serial.print(weight);
Serial.println(" kg");

38
// Check if weight is above the threshold and turn the buzzer on/offif
(weight > BUZZER_THRESHOLD) {
if (!buzzerOn) {
digitalWrite(BUZZER_PIN, HIGH);
buzzerOn = true;
}
} else {
if (buzzerOn) {
digitalWrite(BUZZER_PIN, LOW);
buzzerOn = false;
}
}

delay(1000); // Wait 1 second before reading the load cell again


}

// Include required libraries


#include <HX711.h> #include
<SoftwareSerial.h>

// Initialize constants for the HX711 load cell moduleconst


int LOADCELL_DOUT_PIN = 4;
const int LOADCELL_SCK_PIN = 5;
const float CALIBRATION_FACTOR = 1234.56789; // Replace with your
calibration factor

// Initialize constants for the GSM module

39
const int GSM_TX_PIN = 2;
const int GSM_RX_PIN = 3;
const int GSM_BAUDRATE = 9600;
const String PHONE_NUMBER = "+1234567890"; // Replace with your
phone number

// Initialize global variables


HX711 scale;
SoftwareSerial gsmSerial(GSM_TX_PIN, GSM_RX_PIN);

void setup() {
// Initialize serial communications for debugging
Serial.begin(9600);
while (!Serial);

// Initialize the load cell


scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale(CALIBRATION_FACTOR);

// Initialize the GSM module


gsmSerial.begin(GSM_BAUDRATE);
delay(1000);
}

void loop() {
// Read the load cell and print the weight
float weight = scale.get_units();

40
Serial.print("Weight: ");
Serial.print(weight);
Serial.println(" kg");

// Send the weight data to the phone number via SMS


String smsText = "Current weight: " + String(weight, 2) + " kg";
sendSMS(PHONE_NUMBER, smsText);

delay(60000); // Wait 1 minute before sending the next SMS


}

void sendSMS(String phoneNumber, String smsText) {


// Send an AT command to the GSM module to set the SMS mode
gsmSerial.println("AT+CMGF=1");
delay(1000);
// Send an AT command to the GSM module to set the phone number
gsmSerial.println("AT+CMGS=\"" + phoneNumber + "\""); delay(1000);
// Send the SMS text to the GSM module and terminate with Ctrl+Z
gsmSerial.println(smsText);
delay(100);
gsmSerial.write(0x1A);
delay(1000);
// Print the GSM response to the serial monitor for debuggingwhile
(gsmSerial.available()) {
char c = gsmSerial.read();
}

41
B.RESULT

Figure B.1 ( Result Screen of project)

42
C. REFERENCES

1.S. H. Kim et al , “Development of Wireless Gas Leakage Monitoring System based on IoT
Technology “Journal of the Korean Institute of Gas, vol. 22, no. 2, 2021

2.S. V. S. S. S. S. Raju et al ,” An AI-based LPG gas leakage detection and alerting system
using gas sensor and IoT” International journal of Electrical and Computer engineering
vol.10,no.6,2021

3.R. Kumar et al ,” Wireless Sensor Network-Based Gas Monitoring System for LPG Leakage
Detection“Procedia Computer Science, vol. 57, pp. 814-821, 2021

4. S. S. Kim et al , "Development of LPG Level Monitoring and Alert System with Mobile App
Notification“ , Journal of the Korean Society of Safety, vol. 30, no. 5, pp. 50-57, 2020

5. Maria Garcia et al "Wireless Sensor Network for Real-time LPG Leakage Detection and
Monitoring“, IEEE Transactions on Industrial Informatics vol.15 no.3 2019

6. Li Ming "Design and Implementation of a Smart LPG Monitoring System Based on Wireless
Sensor Networks" International Journal of Distributed Sensor Networks vol.16 no.7 2020

7. Kim Dong ,"Smart LPG Monitoring System for Household Safety Using Internet of Things“,
Journal of Sensors,no.7 2021

8. Anna Patel , "A Review of Smart LPG Monitoring Systems: Challenges and
Opportunities“,vol.16,2022

9. Abdul Rahman, "Integration of Smart LPG Monitoring System with Smart Home
Automation“, IEEE Access ,vol.7,no.9,2020

10. Abdul Rahman, "Integration of Smart LPG Monitoring System with Smart Home
Automation“, IEEE Access ,vol.7,no.9,2020.

43
44

You might also like