Professional Documents
Culture Documents
Titled
Submitted by :
Supervised by :
All the praises and thanks go to ALLAH our creator and our master, who keeps
giving us the strength and patience to carry on during these long years of study.
We would like to Thank our supervisor, Mr. Rebhi Mohemmed, for providing us
with guidance in this work. Thanks also to our teachers of the electronics
our work. And finally, we would also love to thank our beloved mothers
especially and our families secondly who have always been there for us, and kept
ALHAMDULILLAH.
TABLE OF CONTENTS Page
Acknnowledgments………………………………………………………….II
Table of contents……………………………………………………………..III
List of figures………………………………………...………………………IV
General Introduction…………………………………………………………5
CHAPTER I:The Motivation for an embedded fire and gas detection system
(FGDS)
I.a) Carbon monoxide asphyxia in Algeria…………………………………...7
I.a.1) Introduction………………………………………………………….....7
I.a.2) The effect of concentration of CO gas on the person…………………..8
I.b) Fires in Algeria…………………………………………………………...9
I.c) Embedded systems……………………………………………………….9
I.c.1) Introduction…………………………………………………………….9
I.c.2) Definition of an Embedde system……………………………………...9
I.c.3) Characteristics of an Embedded System……………………………….10
I.d) Summary………………………………………………………………….12
CHAPTER II-Organs Implemented.
II.a) Control circuit: Arduino………………………………………………….14
II.a.1) Introduction…………………………………………………………….14
II.a.2) General presentation of Arduino……………………………………….14
II.a.3) What's on the board…………………………………………………….15
II.a.3.1) Power (USB / Barrel Jack)…………………………………………...15
II.a.3.2) Pins…………………………………………………………………...16
II.a.3.3) Reset Button………………………………………………………….16
II.a.3.4) Power LED Indicator………………………………………………...16
II.a.3.5) TX RX LEDs………………………………………………………...16
II.a.3.6) Main IC……………………………………………………………....16
II.a.3.7) Voltage Regulator……………………………….……………………17
II.b) Measuring circuit: Gas and smoke sensor (MQ2)……………………… 17
II.b.1) General presentation…………………………………………………...17
MQ-2 Specifications…………………………………………………………..18
MQ-2 Features…………………………………… …………………………18
II.c) summary………………………………………………………………….18
CHAPTER II-Organs Implemented.
III.a) Connecting MQ2 Gas Sensor Module to Arduino UNO……………..…20
III.b) Initializing Programme……… …………………………………….…..21
III.c)-CONCLUSION……………… ………………………………….....….21
EPILOGUE 23
Final Abstract……………………………………………………..……..….…24
REFERENCES……………………………………………………….…...…...25
List of Figures
List of Tables
General Introduction :
- Security measure are essential for Human safety and play an important role in
today's world and it is necessary that effective security systems are installed in
domestic environments, industrial and educational establishments. they aim to
eliminate and reduce of hazards to the health of the people and tampering of equipment
and the environment.
In the first chapter: a general description of the embedded systems and some statistics
on carbon monoxide asphyxia in Algeria will be exposed.
The second chapter: will be devoted to an in-depth study on the main organs used for
the implementation of the studied application. For the control-command part, the
Arduino microcontroller boards will be studied where a basic model which is Arduino
UNO will be detailed: its construction, its programming environment and its principle
of fonctioning, to simplify its use. Also the study of the MQ2 sensor for the acquisition
part with presentation of the technical characteristics relating to the measurement
ranges
The third chapter: will represent the connection of the MQ2 Gas sensor to the Arduino
Uno and we will present the initializing programme of the application.
Finally, we will end with a general conclusion which will summarize the interest of our
study, and various remarks and results obtained.
Page | 5
CHAPTER I
The Motivation for an embedded
fire and gas detection system
(FGDS)
Page | 6
Chapter I The Motivation for an embedded
FGDS
There are two types of poisoning. One is weak, called "chronic", manifested through
headache, nausea, mental confusion, fatigue. It is slow and its symptoms may not appear
immediately. The other is sharp, fast and causes dizziness, loss of consciousness, muscle
impotence, behavior disorders and even coma or death.
We can also add to the risk of carbon monoxide CO, the risk linked to gas leaks natural,
methane CH4 which powers our domestic installations. The leak of this gas and its
flammable in nature, presents a major danger to people and buildings, where several
Page | 7
Chapter I The Motivation for an embedded
FGDS
explosions recorded following a spark after the lighting was switched on presence of a
significant methane leak with a lack of ventilation. From all of the above, we draw the
interest of a low cost embedded system for detection, measuring and warning of these
dangerous gases in advance, and before the disaster strikes happen.
The usual CO level in ambient air is around 0.2 ppm (particle per million).
The World Health Organization has defined, for the whole population, including
pregnant women and the elderly with heart or respiratory conditions (known or not),
reference values considered as harmless according to the duration of the exhibition:
10 mg / m3
(10 ppm) for 8 hours.
30 mg / m3
(25ppm) for 1 hour.
60 mg / m3
(50ppm) for 30 min.
100 mg / m3
(90ppm) for 15 min.
The severity of poisoning is a function of the concentration of CO in the air and the
duration of the exhibition:
Tab
I.1 the
8 | Page
Chapter I The Motivation for an embedded
FGDS
Over the four year period from 2016 to 2017 as a whole, Power blast and meters
explosion were the leading cause of indoor fires and indoor fire injuries, also
cooking was one of the leading causes of home fires.
I. c) Embedded systems:
I. c.1) Introduction:
You just have to look around you every day to realize it. We withdraw money from
ATMs, it’s an embedded system. You drive a car, the speed regulator, the electric
power steering, the trajectory control system they are all embedded systems. The
autopilot in an airplane is an embedded system, and the examples do not end.
In various fields, in recent years, technological progress has made many functions
that are performed manually, mechanically and hydraulically all dematerialized in
favor of electronics and embedded computing. A considerable comfort that’s
becoming more and more difficult to give up. Electronic systems became necessary
in our day and age they are more and more present in our everyday life. Computers
and microcomputers are well-known electronic systems. But electronics are now
found in many common objects: telephones, electronic diaries, cars.
It is these electronic systems that are buried in in the devices and objects we use
daily that are called embedded systems. Embedded systems to function involve
different technologies, in addition to including a software part and a hardware part.
9 | Page
Chapter I The Motivation for an embedded
FGDS
10 | P a g e
Chapter I The Motivation for an embedded
FGDS
Single-functioned
− An embedded system usually performs a specialized operation and does the same
repeatedly. For example: A pager always functions as a pager.
Tightly constrained
P a g e | 11
Chapter I The Motivation for an embedded
FGDS
of a size to fit on a single chip, must perform fast enough to process data in real
time and consume minimum power to extend battery life.
Ready-Made Boards
P a g e | 12
Chapter I The Motivation for an embedded
FGDS
But now, there are different embedded boards are available from simple to
advanced level. According to the application need and complexity, we may use
these board and reduce the development time. boards like:
Arduino Board
Raspberry Pie
Banana Pi
Intel Galileo
Beaglebone
Memory
− It must have a memory, as its software usually embeds in ROM. It does not need
any secondary memories in the computer
Connected
13 | P a g e
HW-SW systems
− Software is used for more features and flexibility. Hardware is used for
performance and security.
I. d) Summary:
CHAPTER II
-Organs Implemented
Description.
CHAPTER II -Organs Implemented
Description.
II.a) Control circuit: Arduino
II.a.1) Introduction
The Arduino platform has become quite popular 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. Finally, Arduino provides a standard form factor that
breaks out the functions of the micro-controller into a more accessible package.
The Arduino hardware and software was designed for artists, designers,
hobbyists and anyone interested in creating interactive objects or environments.
Arduino can interact with buttons, LEDs, motors, speakers, GPS units, cameras,
the internet, and smart-phones or TVs. This flexibility combined with the fact that
the Arduino software is free, the hardware boards are pretty cheap, and both the
software and hardware are easy to learn has led to a large community of users who
have contributed code and released instructions for a huge variety of Arduino-
based projects.
For everything from robots and a heating pad hand warming blanket to honest
fortune-telling machines, and even a Dungeons and Dragons dice-throwing
gauntlet, the Arduino can be used as the brains behind almost any electronics
project.
There are many varieties of Arduino boards that can be used for different
purposes. Some boards look a bit different from the one below, but most Arduinos
have the majority of these components in common:
USB (1): UNO can be powered from a USB cable coming from your computer. The
USB connection is also how you will load code onto your Arduino board.
II.a.3.2) Pins
GND (3): Short for ‘Ground’, can be used to ground your circuit.
5V (4) & 3.3V (5): The 5V pin supplies 5 volts of power, and the 3.3V pin
supplies 3.3 volts of power.
Analog (6): These pins can read the signal from an analog sensor and convert it
into a digital value that we can read.
Digital (7): These pins can be used for both digital input (like telling if a button is
pushed) and digital output (like powering an LED).
PWM (8): These pins act as normal digital pins, but can also be used for
something called Pulse-Width Modulation (PWM).
AREF (9): Stands for Analog Reference. It is sometimes used to set an external
reference voltage (between 0 and 5 Volts) as the upper limit for the analog input
pins.
II.a.3.3) Reset Button
The Arduino has a reset button (10). Pushing it will temporarily connect the reset
pin to ground and restart any code that is loaded on the Arduino.
This LED should light up whenever you plug your Arduino into a power source,
there’s a tiny LED next to the word ‘ON’ (11).
II.a.3.5) TX RX LEDs
TX is short for transmit, RX is short for receive. These LEDs will give us some
nice visual indications whenever our Arduino is receiving or transmitting data.
TX and RX indicator LEDs (12).
II.a.3.6) Main IC
The voltage regulator (14), it controls the amount of voltage that is let into the
Arduino board.
MQ2 is one of the commonly used gas sensors in MQ sensor series. It is a Metal
Oxide Semiconductor (MOS) type Gas Sensor also known as Chemiresistors as the
detection is based upon change of resistance of the sensing material when the Gas
comes in contact with the material. Using a simple voltage divider network,
concentrations of gas can be detected. MQ2 Gas sensor works on 5V DC and
draws around 800mW. It can detect LPG, Smoke, Alcohol, Propane, Hydrogen,
Methane and Carbon Monoxide concentrations anywhere from 200 to 10000ppm.
Figure II.4: The effect of smoke on the MQ-2 Sensor
MQ-2 Specifications
II.c) summary: we explained the main job of the Arduino Uno and its
characteristics, We explained Also the job of the Gas and smoke sensor (MQ2) and
how it works, and we have presented the characteristics of the MQ2 sensor that
detect several types of gasses.
CHAPTER III -Connecting the MQ2 gas sensor, and initialization
CHAPTER III
Connecting MQ2 Gas Sensor
Module to Arduino UNO, and
initializing.
CHAPTER III -Connecting the MQ2 gas sensor, and initialization
III.a) Connecting MQ2 Gas Sensor Module to Arduino UNO and initialzing
programme:
Connecting the MQ2 Gas sensor module to the Arduino is an easy task. We start by
placing the sensor on to our breadboard. Connect VCC pin to the 5V pin on the
Arduino and connect GND pin to the Ground pin on the Arduino.
We connect D0 output pin on the module to Digital pin#8 on the Arduino and A0
output pin own the module to Analog pin#0 on the Arduino.
A0 A0
5V VCC
GND GND
Tab II.1 Arduino Uno and MQ-2 Sensor Set-up
CHAPTER III -Connecting the MQ2 gas sensor, and initialization
III.b) Initializing Programme:
#include <MQ2.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
//I2C pins declaration
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
int Analog_Input = A0;
int lpg, co, smoke;
MQ2 mq2(Analog_Input);
void setup(){
Serial.begin(9600);
lcd.begin(16,2);//Defining 16 columns and 2 rows of lcd display
lcd.backlight();
mq2.begin();
}
void loop(){
float* values= mq2.read(true); //set it false if you don't want to print the values in
the Serial
//lpg = values[0];
lpg = mq2.readLPG();
//co = values[1];
co = mq2.readCO();
//smoke = values[2];
smoke = mq2.readSmoke();
lcd.setCursor(0,0);
lcd.print("LPG:");
lcd.print(lpg);
lcd.print(" CO:");
lcd.print(co);
lcd.setCursor(0,1);
lcd.print("SMOKE:");
CHAPTER III -Connecting the MQ2 gas sensor, and initialization
lcd.print(smoke);
lcd.print(" PPM");
delay(1000);
}
III.c)- CONCLUSION
- Firstly, we have presented in this chapter how the MQ2 gas sensor is
connected to the Arduino Uno and its Set-Up.
EPILOGUE
Epilogue
Epilogue:
-The gas sensors can be implemented for detecting various gases either in
domestic area such as places of educational institutions, residential and industrial
areas which avoids endangering of human lives. This system provides quick
response rate and the diffusion of the critical situation can be made faster than the
manual methods.
FINAL ABSTRACT
“Embedded system for Hazardous Gas detection and Alerting” by V.Ramya, B. Palaniappan
International Journal of Distributed and Parallel Systems (IJDPS) Vol.3, No.3, May 2012
Fire and gas asphyxiation statistics from Echourouk, Ennahar and EL Watan newspapers
2020,2019,2018,2017,2016,2015,2014,2013
Puran G., Bhausaheb S., and Sagar S. (2014) Review on Gas Leak Detection Techniques.
Allen Gold; Thomas B. Perera. “Asphyxiation And Other Gas And Fire Hazards”
Liu Z., Kim A.K. Review of Recent Developments in Fire Detection Technologies. J. Fire
Prot. Eng. 2003;13:129–151.
Zafer Ankara, Andreas Schütze. Low power virtual sensor systems based on a micromachined
gas sensor for security
Artim, N. (2014). An Introduction to Fire Detection, Alarm, and Automatic Fire Sprinklers.
Retrieved October 2016, from NorthEast Document Conservation Center
Selvapriya, Sathya Prabha, Abdulrahim , Aarthi K“LPG Leakage Monitoring and Multilevel
Alerting System”, ISSN: 2277-9655
- https://www.arduino.cc/
- https://maker.pro/
- http://www.protectioncivile.dz/
- https://www.ennaharonline.com/
- https://www.echoroukonline.com/
- https://www.elwatan.com/
- https://lastminuteengineers.com/
- https://www.instructables.com/
- http://www.theorycircuit.com/
- https://www.projectsof8051.com/
- https://projetsdiy.fr/
YOUTUBE Channels :
-Tech Maker
-Razib shahadat
-MR.Innovative
-Electronoobs
-Afrotechmods
-GreatScott !
-Easy Tech
-Science Buddies
-Farrouk
-Josh Arduino