Sei sulla pagina 1di 13

Smoke and Gas leakage detector with Smart GSM messaging

module using microcontroller.

E-mail: Freemail2bj@yahoo.com Phone No: +2347068514137.

Department of Mechanical Engineering, Osun State Polytechnic

ABSTRACT

This paper proposes smoke and gas leakage detector using GSM module to
send text to the user or owner of the house or company if any smoke or gas
leakage is detected.The topology behind this concept is the using of highly
efficient smoke detector which have the ability to calibrate different level of
smoke level or gas leakage at different level and an appropriate or equivalent
voltage level is been sent to the microcontroller by the analog to digital
converter ADC then the controller asses the level, compare the value with
the map value on the microcontroller if it is sufficient to initiate a
catastrophic disaster a text command is been trigger to the user about an
eminent problem that can arise.With this concept a lot of fire breakout can
be avoided.

1.
KEYWORDS: Microcontroller, smoke detector, ADC analog to digital
converter buzzer and GSM module.

1. INTRODUCTION:

Equations that govern fluid dynamics, heat transfer, and combustion have
been defined and improved upon for decades. However, the daunting task of
adequately modeling fire growth and behavior has been hampered by the
sheer mathematical complexity of the equations involved, the number of
variables that need to be taken into account, and maybe most importantly the
processing capabilities of computers. The technological revolution has
provided engineers with desktop personal computers that, for the first time,
may provide economically convenient methods of numerically modeling fire
phenomena. Recently, the emergence of computational fluid dynamics
(CFD) fire modeling codes based on the RANS (Reynolds Averaged Navier-
Stokes equations) has shown promising results when modeling fire induced
flow. Exponential growth in computational clock speed has allowed the
engineer with a desktop personal computer to define grids with hundreds of
thousands of cells that bring approximation of fire phenomena to higher
levels of accuracy.this research work this will bring a paradigm shift in the
area of Homeland security making it efficient and reliable to secure life and
property.

2.
HARDWARE AND SOFTWARE:

Fig 1.1: Smoke


Detector Hardware

In this project, we will go over how to build a smoke sensor circuit with an arduino board.

The smoke sensor we will use is the MQ-2. This is a sensor that is not only sensitive to smoke,
but also to flammable gas.

3.

The MQ-2 smoke sensor reports smoke by the voltage level that it outputs. The more smoke
there is, the greater the voltage that it outputs. Conversely, the less smoke that it is exposed to,
the less voltage it outputs.

The MQ-2 also has a built-in potentiometer to adjust the sensitivity to smoke. By adjusting the
potentiometer, you can change how sensitive it is to smoke, so it's a form of calibrating it to
adjust how much voltage it will put out in relation to the smoke it is exposed to.
We will wire the MQ-2 to an arduino so that the arduino can read the amount of voltage output
by the sensor and sound a buzzer if the sensor outputs a voltage above a certain threshold. This
way, we will know that the sensor is detecting smoke and we will sound a buzzer alerting a
person such as a homeowner to this fact.

Components Needed for Arduino Smoke Sensor Circuit

 MQ-2 Smoke Sensor


 Arduino board

 Buzzer

 GSM Module

 Registered SIM Card

4.

The MQ-2 can be obtained very cheaply, just a few bucks. Important, it is recommended that you
do not obtain the standalone sensor but the whole MQ-2 board. This is because if you buy the
standalone sensor, you will have to finish building the whole schematic before you can connect it
to the arduino. So that less work is required for integrating this with the arduino.

FIG 1.2 : Smoke detector


module
The 3 leads are Output, Vcc, and GND.

It's very basic.

5.

The gas sensor needs about 5 volts of power in order to operate. This is done

by connecting 5 volts to Vcc and GND. VCThe Output pin gives out the voltage reading, which is
proportional to the amount of smoke that the sensor is

exposed to. Again, a high voltage output means the sensor is exposed to a lot

of smoke. A low or 0 voltage output means the sensor is exposed to either little or no smoke.
6.

Arduino
Smoke
Sensor
with
buzzer

Fig
1.3:

Assembling of Smoke detector with Microcontroller


7.

Fig 1.4: Circuit Schematic

8.
So to power the smoke sensor, we connect pin 2 of the smoke sensor to the

5V terminal of the arduino and terminal 3 to the GND terminal of the arduino. This gives the
smoke sensor the 5 volts it needs to be powered.

The output of the sensor goes into analog pin A0 of the arduino. Through this connection, the
arduino can read the analog voltage output from the sensor. The arduino board has a built-in
analog-to-digital converter, so it is able to read analog values without any external ADC chip.

Depending on the value that the arduino reads determines the action that will occur with the
circuit. We will make it in our code that if the sensor outputs a voltage above a certain threshold,
the buzzer will go off, alerting a user that smoke has been detected.

These are all the physical connections in order for our circuit to work.

Code for the Arduino MQ-2 Smoke Sensor Circuit

Being that we've just gone over the circuit schematic for the smoke sensor circuit, all we need
know is the code necessary to upload to the arduino for this smoke alarm cicrcuit to work.

The code that we need to upload is shown below.

9.

/*Code for MQ-2 Smoke Sensor Circusit Built with an Arduino Board*/

Arduino Program:

int PIN = 7;// attach gas sensor to pin 7


int sensor = 0;
void setup()
{
pinMode (PIN,INPUT);
Serial.begin(9600); // gsm baud rate
delay(5000);
}
void loop()
{
sensor = digitalRead (PIN); // read whether gas is presented or not
if (sensor == HIGH){ // if gas is presented send a message
Serial.println("AT");
delay(1000);
Serial.println("AT+CMGF=1"); // send SMS in text mode
delay(1000);
Serial.println("AT+CMGS=\"+2349962\""); //CHANGE TO Number , you'd
like to receive message
delay(1000);
Serial.print("Gas Leakage at HOME (attention required)"); // content of the
message

10.

Serial.write(26); // ctrl+z ASCII code


delay(300000); // Wait for 5 minutes before next reading
}
}
The first block of code declares and initializes 3 variables. The sensorPin represents the smoke
sensor. It is initialized to 0, because it will be connected to analog pin A0 of the arduino board.
The next variable, buzzerPin, represents the pin that the anode of the buzzer will be connected
to; it is initialized to 12 because it will be connected to digital pin D12 of the arduino board. And
the variable, smoke_level, represents the amount of smoke that the smoke sensor picks up.

The next block of code defines the baud rate and the input and output of the circuit. The
sensorPin, which is the smoke sensor pin, serves as the input of

the circuit. This sensor is input into the arduino so that the arduino can read and process the
value. The buzzerPin serves as the output. If the smoke level is above a certain threshold, the
output of the circuit, the buzzer, will go off.

The next block of code uses the analogRead() function to read the value from the sensorPin (the
smoke sensor). This will be a numerical value from 0 to 1023. 0 represents no smoke, while 1023
represents smoke at the absolute maximum highest level. So the variable, smoke_level,
represents the smoke level that can range from 0 to 1023. We put a line to print this value just
for debugging purposes, so that you can see what values are being returned from this function.
In our code, we make it so that if the smoke

11.

level rises above 200, we will trigger the buzzer to sound by sending the digital pin D12 high. So
200 is our threshold level. If the smoke level is below this value, then the buzzer does not go off.

This last block of code was the loop() function. This is the part of code that repeats over and over
in an infinite loop. This means that our code is always checking to see what the smoke_level is,
so that it can know whether to trigger the buzzer or not.

And this is how a smoke sensor works with an MQ-2 and an arduino.
12.

References

A. W. Ahmad, N. Jan, S. Iqbal, and C. Lee, "Implementation of Zig Bee-


GSM based Home Security Monitoring and Remote Control system," in
Proc. 2011 IEEE 54th International Midwest Symposium on Circuits and
Systems (MWSCAS), Seoul, pp. 1-4.
Abstract| Full Text: PDF (980KB) | Full Text: HTML.

A. Rajabzadeh, A. R. Manashty and Z. F. Jahromi, "A generic model for


smart house remote control systems with software and hardware simulators",
IKT 2013 – 2013 5th Conference on Information and Knowledge
Technology, pp. 262-267, 2013 Programming hardware using Matlab
simulink

http://www.instructables.com/id/Ultrasonic-Mapmaker-Using-Arduino-and-MatLab/

How to use stepper motor driver with microcontroller.(2012, October


12).Retrieved from

http://www.instructables.com/tag/type-id/category-technology/channel-
arduino/

How to use stepper motor driver with microcontroller.(2012,


October12).Retrieved from
http://www.schmalzhaus.com/BigEasyDriver/index.html

Programming Code for micro-controller. (2014, September 13).

13.

Retrieved from http//:danthompsonsblog.blogspot.com.ng/2010/05/easydriver

Fat Cat Automated Arduino Pet Feeder.(2013, March 16). Retrieved from
http://www.instructables.com/id/Fat-Cat-Automated-Arduino-Pet-Feeder/

Using microcontroller with push on/off button (2015,October 17).

Retrieved from

http://danthompsonsblog.blogspot.com.ng/search/label/Arduino

Award winning innovative ideas with microcontroller. (2015,August 25).Retrieved from


https://www.google.com/url?q=http://www.nfiautomation.org/FREE_Download/Technical
%2520Documents/Arduino/20-Unbelievable-Arduino-
Projects.pdf&sa=U&ved=0ahUKEwig4enRr67MAhVqC8AKHbIwBvgQFggWMAg&client=internal-
uds-cse&usg=AFQjCNGoNd1k9xCbWE9VLbLZM-BfI801eg.
14.

(Oladeji Bolaji).

Potrebbero piacerti anche