Automatic Gas Stove System

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 23

AUTOMATIC GAS STOVE SYSTEM

Pankaj Mishra , Ruchi Priya,

ABSTRACT

LPG is found naturally in combination with other hydrocarbons, typically crude oil and natural gas. Though nowadays
it has become renewable but still we need to save it for the future generation. In todays cooking system, most of the
lpg get wasted due to the larger diameter of flame as compared to the diameter of the vessel. And they are also not
rich with the advanced safety controls like automatic turn on and off of the knob when the vessel is placed over it.
Push notifications at every change in state. Automatic gas booking, leakage detection, food overflow and emergency
alarm. All these has been implemented in this proposed Smart gas stove system and all the real time notifications
and changes can be seen in an mobile app developed for it.

INTRODUCTION:

Liquefied Petroleum Gas or LPG is the most commonly used source of the energy for cooking in urban areas as well
as in some remote areas. Users of LPG gas is increasing at a enormous rate. Still nothing has been done much to to
ameliorate cooking standards. Lack of safety measures end up taking several innocent lives every year. One of the
biggest problem is Leakage of gas in cooking system. Not only this most of the energy get wasted when flame is
greater than the vessel diameter. We need to reduce the number of deaths and make the gas stove system enhaced
with notification alerts, automatic on-off, leakage control and energy efficient.

In this project, we have worked on the Smart Gas Stove which can solve many problems related to kitchen.

1) Gas Sensor ->

placed near Gas stove -> if level of gas/LPG smell more than threshold limit

Actions taken:

(SMS + call to owner) through API +

Buzzer ON + Gas Valve OFF (by rotating the servo motor).


2) LOAD CELL -> Placed below the cylinder.

If level of gas in the cylinder less than 30 %


: Actions taken : Notify User.

If level of gas in the cylinder less than 15 % :

Actions Taken : Notify User + Automatic Booking From the DATABASE + show current weight on LCD.

3) LOAD CELL -> Placed below the knob.

If any vessel is not on the knob and still the GAS is ON :

Actions taken : Gas OFF(by rotating servo motor) + notify user by SMS.

4) HUMIDITY SENSOR -> Portable and will be placed on the top of the
vessel. If the water content of the food reaches the threshold height of the vessel:

Actions taken : Gas OFF + Buzzer ON.

Our proposed model of Smart Gas System aims to perform all the above tasks with accuracy. The smart
gas system which provides home safety, detects the leakage of the LPG and alerts the consumer about the
leak by a notification(SMS + Call) through by API and through a buzzer and consumer can turn off the gas
valve

.The additional advantage of the system is that it continuously monitors the level of the LPG present in the
cylinder using load sensor and if the gas level reaches below the threshold limit of gas so that the user can
replace the old cylinder with new in time and books the cylinder automatically from the database we have
created. An added feature is that if the users accidently forget to turn off the gas burner, the system will
inform by activating an alarm. So the problem of wastage of the energy is solved. Even if the water
content of food crosses the threshold height of the container and is about to fall the alert will be sent and
the Gas Valve will be turned OFF.

Servo Motor here is equivalent to the GAS VALVE.


1.1 Objective :

The main Objective is to propose the design and construction of an SMS based SMART GAS
STOVE SYSTEM.
It alerts the user using Buzzer whenever any un-wanted situation is about to happen. The smart gas system
which provides home safety, detects the leakage of the LPG and alerts the consumer about the leak by a
notification(SMS + Call) through by API and through a buzzer and consumer can turn off the gas valve
.The additional advantage of the system is that it continuously monitors the level of the LPG present in the
cylinder using load sensor and if the gas level reaches below the threshold limit of gas so that the user can
replace the old cylinder with new in time and books the cylinder automatically from the database we have
created.

1.2 COMPONENTS REQUIRED:

• Raspberry-pi 3B

• Gas Sensor (MQ5)

• Load Cell (3 Kg) – 2

• LCD

• HX711 load cell module (ADC)

• Humidity Sensor (SY_HS_220)

• Servo motor

• Buzzers

• Jumper Wires

• Bread-board

2.) METHODOLOGY

2.1 PROBLEM DEFINITION:


The main Objective is to propose the design and construction of an SMS based SMART GAS
STOVE SYSTEM.

First of all the basic description about the components are:

Gas Sensor (MQ2):

A gas sensor is a device which detects the presence of gas in an area. This sensor interacts with a gas
to measure its concentration. Each gas has a unique breakdown voltage i.e. the electric field at which it
is ionized. Sensor identifies gases by measuring these voltages.

Load Cell (3 kg):

Load cell is a transducer that is used to create an electrical signal whose magnitude is directly proportional
to the force being measured. The various load cell types include hydraulic, pneumatic, and strain gauge.

Humidity Sensor:

Soil moisture sensors measure the volumetric water content in soil. Since the direct gravimetric measurement
of free soil moisture requires removing, drying, and weighting of a sample, soil moisture sensors measure
the volumetric water content indirectly by using some other property of the soil, such as electrical resistance,
dielectric constant, or interaction with neutrons, as a proxy for the moisture content.

HX711 ADC:

HX711 is a precision 24-bit analog to-digital converter (ADC) designed for weigh scales and industrial
control applications to interface directly with a bridge sensor. The input multiplexer selects either Channel
A or B differential input to the low-noise programmable gain amplifier (PGA). Channel A can be
programmed with a gain of 128 or 64, corresponding to a full-scale differential input voltage of ±20mV or
±40mV respectively, when a 5V supply is connected to AVDD analog power supply pin. Channel B has a
fixed gain of 32.

2.2 PLANNING AND APPROACH:

In this project, the main aim is to reduce the risks in Kitchen using Internet of Things. The main aim

is to propose the design and construction of an SMS based “Smart gas stove System” along with
which we can check the weight of the LPG present in the cylinder. Gas sensor is used to detect gas

leakages in a kitchen. An alarm will turn ON whenever the sensor doesn’t detect any vessel over the

burner beyond a particular time period and also any overflow is detected and alerts the user . Also,

SMS and call are through the API to alert the users.

2.3 METHODOLOY :

Code:

For Gas Sensor:

from twilio.rest import Client


import RPi.GPIO as GPIO
import time
channel = 35
GPIO.setmode(GPIO.BOARD)

GPIO.setup(channel, GPIO.IN)

from time import sleep # lets us have a delay


GPIO.setmode(GPIO.BOARD)
GPIO.setup(37, GPIO.OUT) # choose BCM or BOARD
GPIO.setup(12, GPIO.OUT)
# set GPIO24 as an output

p = GPIO.PWM(12, 50)

p.start(7.5)
account_sid = "ACe024845db21e3829b6299c28febf0257"
auth_token = "babf2940e2c7b3ad8816caa19010a73a"

client = Client(account_sid, auth_token)

def callback(channel):

if GPIO.input(channel):

print "Gas Leakage Detected!"

#message = client.messages.create(

to="+917550250062",

from_="+17047416442",

body="Kindly check, something bad is going on.")

print(message.sid)

GPIO.output(37, 1)

p.ChangeDutyCycle(2.5) # turn towards 90 degree


time.sleep(1) # sleep 1 second

'''p.ChangeDutyCycle(2.5) # turn towards 0 degree


time.sleep(1) # sleep 1 second'''

else:

print "No Leakage Detected!"

GPIO.add_event_detect(channel, GPIO.BOTH, bouncetime=300) # let us know when the


pin goes HIGH or LOW

GPIO.add_event_callback(channel, callback) # assign function to GPIO PIN, Run


function on

# infinite loop
while True:
time.sleep(1)
GPIO.output(37, 0)

For Humidity Sensor:

from twilio.rest import Client

import RPi.GPIO as GPIO

import time

channel = 40

GPIO.setmode(GPIO.BOARD)

GPIO.setup(channel, GPIO.IN)

from time import sleep # lets us have a delay


GPIO.setmode(GPIO.BOARD)
GPIO.setup(37, GPIO.OUT) # choose BCM or BOARD
GPIO.setup(12, GPIO.OUT)
p = GPIO.PWM(12, 50)
# set GPIO24 as an output

p.start(7.5)
account_sid = "ACe024845db21e3829b6299c28febf0257"
auth_token = "babf2940e2c7b3ad8816caa19010a73a" client
= Client(account_sid, auth_token)

def callback(channel):

if GPIO.input(channel):

print "Water Detected!"

message = client.messages.create(

to="+917550250062",
from_="+17047416442",

body="Your food is ready and Knob has been turned off")

print(message.sid)

GPIO.output(37, 1)

p.ChangeDutyCycle(2.5) # turn towards 90 degree


time.sleep(1) # sleep 1 second

'''p.ChangeDutyCycle(2.5) # turn towards 0 degree


time.sleep(1) # sleep 1 second'''

else:

print "No Water Detected!"

GPIO.add_event_detect(channel, GPIO.BOTH, bouncetime=300) # let us know when the


pin goes HIGH or LOW

GPIO.add_event_callback(channel, callback) # assign function to GPIO PIN, Run


function on

# infinite loop
while True:
time.sleep(1)
GPIO.output(37, 0)

For Load Cell and LCD:

import RPi.GPIO as GPIO

import time

import sys

import numpy # sudo apt-get python-numpy

GPIO.setwarnings(False)

class HX711:

def __init__(self, dout, pd_sck, gain=32):

self.PD_SCK = pd_sck

self.DOUT = dout

GPIO.setmode(GPIO.BCM)

GPIO.setup(self.PD_SCK, GPIO.OUT)

GPIO.setup(self.DOUT, GPIO.IN)

self.GAIN = 0

self.REFERENCE_UNIT = 1 # The value returned by the hx711 that corresponds


to your reference unit AFTER dividing by the SCALE.

self.OFFSET = 1
self.lastVal = 0

self.LSByte = [2, -1, -1]

self.MSByte = [0, 3, 1]

self.MSBit = [0, 8, 1]

self.LSBit = [7, -1, -1]

self.byte_range_values = self.LSByte

self.bit_range_values = self.MSBit

self.set_gain(gain)

time.sleep(1)

def is_ready(self):
return GPIO.input(self.DOUT) == 0

def set_gain(self, gain):

if gain is 128:

self.GAIN = 1

elif gain is 64:

self.GAIN = 3

elif gain is 32:

self.GAIN = 2

GPIO.output(self.PD_SCK, False)

self.read()

def createBoolList(self, size=8):


ret = []

for i in range(8):

ret.append(False)

return ret

def read(self):

while not self.is_ready():

#print("WAITING")

pass

dataBits = [self.createBoolList(), self.createBoolList(),


self.createBoolList()]

dataBytes = [0x0] * 4

for j in range(self.byte_range_values[0], self.byte_range_values[1],


self.byte_range_values[2]):

for i in range(self.bit_range_values[0], self.bit_range_values[1],


self.bit_range_values[2]):

GPIO.output(self.PD_SCK, True)

dataBits[j][i] = GPIO.input(self.DOUT)

GPIO.output(self.PD_SCK, False)

dataBytes[j] = numpy.packbits(numpy.uint8(dataBits[j]))

#set channel and gain factor for next reading for


i in range(self.GAIN):

GPIO.output(self.PD_SCK, True)

GPIO.output(self.PD_SCK, False)
#check for all 1

#if all(item is True for item in dataBits[0]):

# return long(self.lastVal)

dataBytes[2] ^= 0x80

return dataBytes

def get_binary_string(self):

binary_format = "{0:b}"

np_arr8 = self.read_np_arr8()

binary_string = ""

for i in range(4):

binary_segment = binary_format.format(np_arr8[i]) binary_segment = format(np_arr8[i],


'#010b') binary_string += binary_segment + " "

return binary_string

def get_np_arr8_string(self):

np_arr8 = self.read_np_arr8()

np_arr8_string = "[";

comma = ", "

for i in range(4):

if i is 3:

comma = ""
np_arr8_string += str(np_arr8[i]) + comma
np_arr8_string += "]";

return np_arr8_string

def read_np_arr8(self):

dataBytes = self.read()

np_arr8 = numpy.uint8(dataBytes)

return np_arr8

def read_long(self):

np_arr8 = self.read_np_arr8()

np_arr32 = np_arr8.view('uint32')

self.lastVal = np_arr32

return self.lastVal

def read_average(self, times=3):

values = 0

for i in range(times):

values += self.read_long()

return values / times

def get_value(self, times=3):

return self.read_average(times) - self.OFFSET


def get_weight(self, times=3):

value = self.get_value(times)

value = value / self.REFERENCE_UNIT

return value

def tare(self, times=15):

# Backup REFERENCE_UNIT value reference_unit =


self.REFERENCE_UNIT self.set_reference_unit(1)

value = self.read_average(times)

self.set_offset(value)

self.set_reference_unit(reference_unit)

def set_reading_format(self, byte_format="LSB", bit_format="MSB"):

if byte_format == "LSB":

self.byte_range_values = self.LSByte elif


byte_format == "MSB":

self.byte_range_values = self.MSByte

self.bit_range_values = self.LSBit

elif bit_format == "MSB":

self.bit_range_values = self.MSBit

def set_offset(self, offset):

self.OFFSET = offset
def set_reference_unit(self, reference_unit):

self.REFERENCE_UNIT = reference_unit

# HX711 datasheet states that setting the PDA_CLOCK pin on high for a more
than 60 microseconds would power off the chip.

# I used 100 microseconds, just in case.

# I've found it is good practice to reset the hx711 if it wasn't used for more
than a few seconds.

def power_down(self):

GPIO.output(self.PD_SCK, False)

GPIO.output(self.PD_SCK, True)

time.sleep(0.0001)

def power_up(self):

GPIO.output(self.PD_SCK, False)

time.sleep(0.0001)

def reset(self):

self.power_down()

self.power_up()

2.4 WORKING:
Gas Sensor placed near Gas stove detects the level of gas/LPG. If it crosses the threshold limit.

, it sends an alert (SMS + call to owner) through API and the Buzzer turns ON and Gas Valve is turned OFF
(by rotating the servo motor).

One LOAD CELL placed below the cylinder detects the level of gas inside the cylinder. If it is less than 30
%, Then it notifies the user.

If the level of gas in the cylinder less than 15 %, then it notifies the user, does Automatic Booking from the
DATABASE and also shows current weight on LCD.

Another LOAD CELL is placed below the stove. If no vessel is on the stove and the GAS supply is still ON,
then the Gas will be turned OFF (by rotating servo motor) + notify user by SMS.

HUMIDITY SENSOR is Portable and can be placed on the top of the vessel. If the water content of the
food reaches the threshold height of the vessel and starts overflowing, Gas will be turned OFF along with
the Buzzer ON.
3. CIRCUIT:

Complete Circuit
OUTPUT SCREEN (R-pi)
SMS alert on PHONE
4. APPLICATIONS:

1. Monitoring the sensors and its value for safety detection in case of gas leakage.

2. Monitoring the sensors and its value for safety detection in case if the gas is ON and no object is
present on the gas, or the liquid food is about to fall from the container.

3. Automatic Booking for gas refill.

4. Stores the data related to the system like daily usage booking dates etc.

5. Shows the current value of LPG present in the cylinder.

6. Sending alert through API (Call + SMS) + Buzzer.

5. DISADVANTAGES:

1. Now, we have our own database with few sample data through which the booking takes place.

That’s not the real case.

2. In place of the gas cylinder, an object is considered to be the equivalent of gas cylinder. When
dealing with the actual gas cylinder, the weight of the body will also come in the picture.

3. The sensors can sometimes not give the desired result and it can cause damage around.
7. FUTURE SCOPES:

In future, the database can be expanded and a new database can be formed which
contains the data of all the people from the locality and actual bookings can be
done.

The model can be expanded to the usage with real gas and cylinders.

The probability of error can be minimized to 0% so that the model can be


reliable and trustworthy and people actually start buying and using such
models.

8. RESULTS & CONCLUSION:

As a result of the large amount of accidents occurring in the kitchen, the damages
caused by the leakage of gas is increasing day by day. So as to eradicate these
problems we have introduced a highly advanced system known as Internet Of Things
(IOT). It is used in wide range of applications in present day society and introducing a
vast scope to the future. Our proposed system is more effective and eco-friendly due
to the reason of detecting the leakage of gas and controlling the gas valve. So, it is
mainly designed for the safety of people and property and their convenience. Using
IOT, it also allows us to book the gas from the gas agency, when the weight of the gas
cylinder reduces below a threshold value. Thus, it saves people’s time and people
could easily use their time effectively. It also uses to alert the consumers about the
wastage of gas while removing the utensils from the burner or whenever the food is
about to fall from the container.

9. REFERENCES:

http://www.iosrjournals.org/iosr-jeee/Papers/Conf.17017/Volume-
3/13.%2082-87.pdf http://www.ijrat.org/downloads/ncpci2016/ncpci-
43.pdf https://www.instructables.com/id/Soil-Moisture-Sensor-
Raspberry-Pi/ https://circuitdigest.com/microcontroller-
projects/raspberry-pi-weight-sensing-automatic-gate
https://github.com/tutRPi/Raspberry-Pi-Gas-Sensor-MQ

THANK-YOU

You might also like