Table of Contents
To program the gas sensor to operate with the microprocessor in the event of a gas leak
To utilize a stepper motor to turn off the gas source immediately as a leak is detected
To program the flame sensor to operate with the microprocessor in the event of a flame.
To program a buzzer to alert persons in the building of danger.
To program a fan to ventilate smoke from the building to reduce the casualties caused by choking.
To program an LCD to display the status of the system.
This project is based on preventing gas leakage and reducing/preventing casualties in the event of a fire. It does not take much doing for an accident to happen. How many times in daily life we might leave the gas cooker unattended just for a minute and sometimes a bad connection from the gas supply can cause leakage. This was the case when three people from Madurai, India 1 were injured from a fire that resulted due to a LPG cylinder leak according to an article by the Times of India the replacement gas cylinder was not installed properly which led to the fire. Another instance in a report by the Delhi times 2 thirteen people were injured when the cylinder burst due to gas leakage. These tragic accidents could have been prevented if the leakage was detected earlier.
The proposed project will use microprocessor technology to create a relatively inexpensive solution. The system is designed to read input signals from various sensors (gas/smoke and flame) connected to the microcontroller, process and send signals to various outputs (Fan, Stepper Motor LED,s etc..)
1 CITATION TNN16 l 1033 (TNN, 2016)2 CITATION Pre10 l 1033 (Press Trust of India, 2010)3 CITATION Vmo17 l 1033 (Vmoksha IoT Bootcamp, 2017)The Gas Sensor (MQ2)
The MQ-2 Gas Sensor module used in this project can detect gas leakage in home and industry. The MQ2 sensor is useful in detection of several gases such as LPG, Methane, Propane, Hydrogen, I-butane, Alcohol and Smoke 3. The electrochemical sensor contained in the MQ2 is what changes its resistance for different concentrations of the various gases. A variable resistor is connected in series with the sensor with to form a voltage divider circuit (Fig 1), and the variable resistor is used to change sensitivity. The sensor has a preheat duration of 20 seconds then when any one of the gases come into contact with the sensor after heating, the sensor’s resistance changes.
The resistance change varies the voltage across the sensor which can then be read by the microcontroller (Arduino Mega 2560) which will be introduced later. The voltage value can be used to find the resistance of the sensor by knowing the reference voltage and the other resistor’s resistance 3. The sensor has different sensitivity for different types of gases. The sensitivity characteristic curve (Fig 3) is shown shows the typical sensitivity characteristics of the MQ-2 for the different type of gases in particles per million (PPM).
438150271145Figure SEQ Figure * ARABIC 1: Voltage Divider Circuit
00Figure SEQ Figure * ARABIC 1: Voltage Divider Circuit
38671504445Figure 2 : MQ2 Pinout Diagram
00Figure 2 : MQ2 Pinout Diagram
176212572389Figure 3 : Sensitivity CharacteristicsCurve
00Figure 3 : Sensitivity CharacteristicsCurve
The following is a brief description of the pin functions of the Module
Features of the MQ2 according to data sheet :
Operating Voltage is +5V
Can be used to Measure or detect LPG, Alcohol, Propane, Hydrogen etc.
Analog output voltage: 0V to 5V
Digital Output Voltage: 0V or 5V (TTL Logic)
Preheat duration 20 seconds
Can be used as a Digital or analog sensor
The Sensitivity of Digital pin can be varied using the potentiometer
Some applications of the MQ2 include :
Detects or measure smoke or Gases like LPG, Alcohol, Propane, Hydrogen, CO and even methane
Air quality monitor
Gas leak alarm
Safety standard maintenance
Maintaining environment standards in hospitals
Note: The sensor becomes hot after preheating avoid touching it.
How to use MQ-2 Sensors to detect gas: use when explaining entire system.
Using an MQ sensor it detects a gas is very easy. You can either use the digital pin or the analog pin to accomplish this. Simply power the module with 5V and you should notice the power LED on the module to glow and when no gas it detected the output LED will remain turned off meaning the digital output pin will be 0V. Remember that these sensors have to be kept on for pre-heating time (mentioned in features above) before you can actually work with it. Now, introduce the sensor to the gas you want to detect and you should see the output LED to go high along with the digital pin, if not use the potentiometer until the output gets high. Now every time your sensor gets introduced to this gas at this particular concentration the digital pin will go high (5V) else will remain low (0V).
You can also use the analog pin to achieve the same thing. Read the analog values (0-5V) using a microcontroller, this value will be directly proportional to the concentration of the gas to which the sensor detects. You can experiment with this values and check how the sensor reacts to different concentration of gas and develop your program accordingly.
The Flame Sensor
A flame sensor detects the presence of fire or flames but to understand the flame sensor we need to know some of the characteristics that all flames have in common http://www.gobdc.com/basics-flame-sensors/ some of which are :
Production of heat
Expansion of gases
Production of by-product of combustion
Emission of light (infrared or ultraviolet)
Ionization of the atmosphere in and around the flame
Many flame detection devices designed for domestic heating systems use the thermal effect of the flame (heat) as the method of detection. In extremely hazardous environments such as a petrochemical processing plant, flame sensors work to reduce the risks associated with fire because failure to detect gas leaks, fires or explosions could prove fatal.
There are many different types of flame sensor – some will raise an alarm while others may activate a fire suppression system or deactivate a combustible fuel line. Our system hopes to achieve a combination of purposes. Optical flame sensors are divided into three groups including Visible light sensors, Infrared sensors and Ultraviolet sensors depending on which range of the total radiation band they are designed to detect. Infrared flame sensors and ultraviolet flame sensors being some of the most notable.
Infrared (IR) Detector
An IR detector is a pyroelectric sensor that is capable of detecting thermal radiation and is rather sensitive to variations of the received light signal. The detector is sensitive to a narrow band of radiation around the 4.4 micron range which is a predominant emission band for hydrocarbon fueled fires. Single frequency detectors use a pyroelectric sensor, which responds to changes in IR radiation intensity. In addition they incorporate a low frequency band pass filter, which limits their response to those frequencies that are characteristic of a flickering fire. In response to a fire signal from the sensor, electronic circuitry in the detector generates an output signal, before it is interpreted by the microprocessor.
Many flame detection devices designed for domestic heating systems use the thermal effect of the flame (heat) as the method of detection . Infrared sensors, can be used with either gas or oil flames. Since more than 90% of the flame’s total radiation is infrared, these detectors receive ample radiation of quite high intensity and will operate with either very weak or very hot flames .
Special application requirements for infrared detectors can be summarized as follows:
The cell must have a good view of the flame.
The cell must be protected from excessive hot refractory.
The cell must be protected from temperatures in excess of 125 0 F.
Correct wiring procedures must be used for the flame detector leads.
Shown below are the advantages and disadvantages of the flame sensor
Highly immune to optical contaminants like oil, dirt, and dust
High speed response under 30 milliseconds for some brands
Insensitive to solar, welding, lightning, X-rays, sparks, arcs and corona
Generally not suitable for non-carbon fires
Some brands will respond to modulated infra-red sources example signals from a tv remote which may overlap the signals which had to be detected and cause false alarms.
Rain, ice and water vapor on the detector lens will inhibit detection
Sensitive to aqueous environments like frost, fog, etcAccording to 4 In order to protect against this strong sensitivity and prevent false alarms, several sensors are now being used in a single device (Multi IR). The benefits of this are that they are more reliable and cheaper than a UV detector, this device has a longer lifetime before failure.
These are some of the applications of the flame sensor
Engine test facilities
Generator and Storage Tanks
The Microcontroller (Arduino Mega 2560)
http://www.mantech.co.za/datasheets/products/A000047.pdfThis project utilizes the Arduino Mega 2560 which is a microcontroller board based on the ATmega2560. It has 54 digital input/output pins shown below (of which 14 can be used as PWM outputs),16 analog inputs,4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection for connection to a computer via USB cable, a power jack for powering it with a AC-to-DC adapter or battery, an ICSP header, and a reset button simply everything needed to support the microcontroller. (Source Arduino manual)
Programming the Arduino
The Arduino Mega2560 can be programmed with the Arduino software (Arduino IDE). The programming language used is C/C++ and is stored in the microcontrollers’ 256 KB of flash memory, for storing code in the form of a “sketch” used by the Arduino IDE software. For components like the flame sensor , gas sensor , LCD Display and Stepper Motor, digital libraries can be added to simplify the process of coding and the code itself will be explained later on. The 54 digital pins on the Mega can be used as an input or output, using functions like pinMode (to define a pin as input or output), digitalWrite (To send a high or low signal to the pin), and digitalRead (to read the state of the pin) functions. They are each operated at 5 volts.
The LCD Display with Inter- Integrated Circuit Communications (I2C) Bus
For displaying system status a 16*2 LCD Display was used. Normally using the LCD display with the Liquid Crystal Digital library works fine however it uses several I/O connections the Arduino. So to reduce the number of connections to the LCD an I2C Bus is used freeing up some port for use elsewhere. It was first developed by Phillips Semiconductor in 1982 for communications between integrated circuits and televisions The I2C can be used not only to drive an LCD but connect multiple Microcontrollers and similar devices to each other. Shown below are the I2C adapter fig 6 and the connection of it to the LCD fig7.
The I2C adapter has four pins which is as follows :
Pin Name Description
VCC Power of 3.3V or 5V
SDA Stores Serial Data
SCL Serial Clock Signal
790575212090Figure 6 : I2C Adapter
00Figure 6 : I2C Adapter
1133475280035Figure 7 : I2C Adapter connected to LCD
00Figure 7 : I2C Adapter connected to LCD
The Stepper Motor
172402534925Fig 8 Stepper Motor + ULN2003 Driver Board
00Fig 8 Stepper Motor + ULN2003 Driver Board
Where to use 28-BYJ48 Stepper Motor
The stepper motor utilized in this project is the most commonly used 28-BYJ48 Stepper Motor . The motor has a 4 coil unipolar arrangement and each coil is rated for +5V and can be easily controlled with any basic microcontroller. You can find this (or similar) motors in your some basic everyday items such as those listed below
Stepper Motor Applications
•Precise control machines
•Car side mirror tilt
•Closing a valve for this project
This motor has a stride angle of 5.625°/64, this means that the motor will have to make 64 steps to complete one rotation and for every step it will cover a 5.625° hence the level of control is quite high. These motors run only on 5V so don’t expect very high torque, for a high torque application you should consider the Nema17 motors. Normally you would have seen servo motors being used to shut off valves in industrial applications . Now the stepper motor can do the same job with greater control in terms of flexibility and is cheaper, not taking anything away from the servo motor.
How to use 28-BYJ48 Stepper Motor
These stepper motors consume high current and hence a driver IC like the ULN2003 is mandatory. To understand how this motor rotates we look into the coil diagram fig 9 below.
There are four coils in the motor and one end of all the coil is tied to +5V (Red) and the other ends (Orange, Pink, Yellow and Blue) are taken out as wires. The Red wire is constantly provided with a +5V supply which will be across (energize) the coil only if the other end of the coil is grounded. The motor can be made to rotate only if the coils are energized in a logical sequence. This logical sequence is programmed using the microcontroller. The sequence in which each coil should be triggered is shown in the table below. Here “1” represent the coil is held at +5V, since both the ends of coil is at +5V (red and other end) the coil will not be energized. Similarly “0” represents the coil is held to ground, now one end will be +5V and the other one is grounded so the coil will be energized.
https://components101.com/motors/28byj-48-stepper-motorThe Ventilation Fan
A ventilation fan is used in this project for the purpose of extracting gases from the building. Fire ventilation can have several purposes, for example to reduce the effect of smoke which can cause choking and heat on trapped people and to improve working conditions for the fire fighting crew according to “Fire Ventilation by Stefan Svensson 5. The objective of fire ventilation is to release heat and fire gases into the open.
Mentioned in the article are some of the reasons we use fire ventilation as follows :
• Reducing the impact of fire gases and heat on trapped persons, and to facilitate their evacuation from the building.
• Facilitate the fire and rescue operation by reducing the thermal load, and to improve visibility in the building for the fire fighting crew.
• Prevent or contain the spread of fire or fire gases through a reduction of the impact of pressure and heat in the building.
• Enable or facilitate salvage and overhaul at an early stage of the fire and rescue operation.
Implementation of fire ventilation
Fire ventilation can be implemented in three different ways, among other things depending on the relative configuration of inlets (openings where fresh air flows in) and outlets (openings where fire gases flow out), both in terms of distance and height, and also depending on which other resources are used:
Horizontal fire ventilation
This is where the outlets are on the same level as the fire, so that the flow of fire gases takes place horizontally. This would be the case, for example, in apartment fires or in certain types of industrial buildings where it is difficult, or in fact impossible, to create openings in the roof and where there are no skylights or vents.
Vertical fire ventilation
This is where the outlets are above the fire, often as high as
possible in the building so that the flow of fire gases takes place vertically. The outlet is normally implemented by making an opening in the roof structure, or by using existing vents (windows/apertures or vents/shutters).
Mechanical fire ventilation
This can mainly be implemented as positive pressure ventilation or negative pressure ventilation. The mechanical ventilation must be combined with creating openings, so as to achieve horizontal or vertical ventilation.
Also mentioned were steps in designing a fire ventilation system
Identify the design fire size and fire characteristics, expected smoke yield(s) for the fuel material(s), heat(s) of combustion, fire dimensions etc.
Prepare a qualitative analysis of worst case fires (at least one fire per zone is normally required). Identify the location of fire brigade entry points to enclosed parking levels and where dry risers etc. are located. How are fire fighters going to enter the building? Can we protect them by operating the ventilation system in a certain way?
Decide how far smoke is permitted to spread before being controlled. Normally 10 metres upstream of the fire is recommended.
Create an initial fan layout and zone strategy according to guidelines recommended by the building codes and / or fan manufacturer.
Fire gas explosion
When unburnt gases from an under-ventilated fire flow through leakages into a closed space connected to the fire room, the gases there can mix very well with air to form a combustible gas mixture. If these gases are ignited, a fire gas explosion may occur.
Backdraft is the burning of heated gaseous products of combustion when oxygen is introduced into an environment that has a depleted supply of oxygen due to fire. This burning often occurs with explosive force.
The result of fire ventilation depends to a large extent on whether the fire is ventilation controlled or fuel controlled when the measure is implemented.
Mechanical ventilation systems
Mechanical ventilation systems can designed as follows:
• Supply air systems. Fans supply air through the ventilation ducts. The exhaust air is pressed out through gaps in the room or to adjoining rooms so the system creates positive pressure in the fire compartments.
• Exhaust air systems. Fans suck out air through the ventilation ducts. The supply air is drawn in through gaps in the room or from adjacent rooms and the system creates negative pressure in the fire compartments.
• Closed supply and exhaust air systems. Fans connected to the rooms, supply them with both supply air and exhaust air through ventilation ducts.
• Open supply and exhaust air systems. Fans connected to the rooms, supply them with both supply air and exhaust air through ducts. The exhaust air is also allowed to flow through gaps both to the surroundings and to adjoining rooms.
An example is shown in fig 11157162511747500
1885950243205Fig 11 Mechanical Ventilation System
00Fig 11 Mechanical Ventilation System
Main Objective : to reduce casualties in event of a fire .
Turn on lcd and display system monitoringRead gas sensor and flame sensor inputs
Case 1 lpg leak
If gas sensor value > 200ppm
Display gas detected on lcd ,
Turn on alarm
turn on led row 3 (alarm)
turn on stepper motor (close valve),
turn on fan while gas sensor value > 200ppm (to ventilate lpg or smoke)
turn on led row 1(gas sensor )
turn on led row 4 (fan)
else lcd display system monitoring
Case 2 electrical fire
If flame sensor = high
Display flame detected on lcd ,
Turn on alarm
turn on led row 3 (alarm)
turn on fan
turn on led row 4 (fan)
else lcd display system monitoring
The Complete System Operation