GAS LEAKAGE DETECTOR
Gas leakages have become one of the important concerns in our day to day lives. It is necessary to make some system that helps us to identify gas leakages so that necessary action can be taken. Gas leakages have taken a toll on the number of deaths, injuries losses and so on. Thus this project gives a basic idea on have to implement a gas sensor using one of the most commonly used micr microc ocont ontro roll llers ers,, the the Ardu Arduin ino o alon along g with with the help help of labV labVI! I!.. "abview is one of the most commonly used virtual instrument platform that has seen a growing demand and is of particular instruments to scientists and engineers of the present era. This project will show how to implement a gas sensor with the help of Arduino and labVI!. !e use the G programming of the labVI! along with necessary packages to link the Arduino and labVI!. #irst irst a brie brieff intr introd oduc ucti tion on about about Ardu Arduin ino o is given given and how how the Arduino was linked with the labVI!. $e%t we discuss about the the G code and the components that have been used. #inally we discuss about how the entire circuit works&
THE ARDUINO Arduino is an open'source prototyping platform based on easy'to' use us e hard hardwa ware re and and sof softwar tware. e. Ardu Arduino ino boar boards ds are are able able to read ead inpu inputs ts ' ligh lightt on a sens sensor or,, a (nge (ngerr on a butto utton, n, or a Twitt witter er message ' and turn it into an output ' activating a motor, turning on an "), publishing something online. *ou can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Ard Arduino uino pro programm gramming ing language +based on !iring !iring, and the Ar Ardu duin ino o -o -oft ftwar ware e +I +I) ),, based on rocessing rocessing.. /ver /ver the the yea years Ardu Arduiino has has been been the the brai brain n of thou thousa sand nds s of projects, from everyday objects to comple% scienti(c instruments. A worldwide community of makers ' students, hobbyists, artists, programmers, and professionals ' has gathered around this open' sour ource pl plat atfo forrm, thei theirr contr ontrib ibut utiions ons have have added dded up to an
incredible amount of accessible knowledge that can be of great help to novices and e%perts alike. Arduino was born at the Ivrea Interaction )esign Institute as an easy tool for fast prototyping, aimed at students without a background in electronics and programming. As soon as it reached a wider community, the Arduino board started changing to adapt to new needs and challenges, di0erentiating its o0er from simple 1'bit boards to products for IoT applications, wearable, 2) printing, and embedded environments. All Arduino boards are completely open'source, empowering users to build them independently and eventually adapt them to their particular needs. The software, too, is open'source, and it is growing through the contributions of users worldwide.
Why Arduino? Thanks to its simple and accessible user e%perience, Arduino has been used in thousands of di0erent projects and applications. The Arduino software is easy'to'use for beginners, yet 3e%ible enough for advanced users. It runs on 4ac, !indows, and "inu%. Teachers and students use it to build low cost scienti(c instruments, to prove chemistry and physics principles, or to get started with programming and robotics. )esigners and architects build interactive prototypes, musicians and artists use it for installations and to e%periment with new musical instruments. 4akers, of course, use it to build many of the projects e%hibited at the 4aker #aire, for e%ample. Arduino is a key tool to learn new things. Anyone ' children, hobbyists, artists, programmers ' can start tinkering just following the step by step instructions of a kit, or sharing ideas online with other members of the Arduino community. There are many other microcontrollers and microcontroller platforms available for physical computing. aralla% 5asic -tamp, $etmedia6s 57'89, hidgets, 4IT6s :andyboard, and many others o0er similar functionality. All of these tools take the messy details of microcontroller programming and wrap it up in an easy'to'use
package. Arduino also simpli(es the process of working with microcontrollers, but it o0ers some advantage for teachers, students, and interested amateurs over other systems; •
•
•
•
•
Ine%pensive ' Arduino boards are relatively ine%pensive compared to other microcontroller platforms. The least e%pensive version of the Arduino module can be assembled by hand, and even the pre'assembled Arduino modules cost less than <=> ?ross'platform ' The Arduino -oftware +I) runs on !indows, 4acintosh /-7, and "inu% operating systems. 4ost microcontroller systems are limited to !indows. -imple, clear programming environment ' The Arduino -oftware +I) is easy'to'use for beginners, yet 3e%ible enough for advanced users to take advantage of as well. #or teachers, it6s conveniently based on the rocessing programming environment, so students learning to program in that environment will be familiar with how the Arduino I) works. /pen source and e%tensible software ' The Arduino software is published as open source tools, available for e%tension by e%perienced programmers. The language can be e%panded through ?@@ libraries, and people wanting to understand the technical details can make the leap from Arduino to the AV ? programming language on which it6s based. -imilarly, you can add AV'? code directly into your Arduino programs if you want to. /pen source and e%tensible hardware ' The plans of the Arduino boards are published under a ?reative ?ommons license, so e%perienced circuit designers can make their own version of the module, e%tending it and improving it. ven relatively ine%perienced users can build the breadboard version of the module in order to understand how it works and save money. :ere in particular we have
used the Arduino 4GA 8=B>.!e have discussed a few details about the Arduino 4GA 8=B>.
Arduino MEGA 2560 The 4GA 8=B> is designed for more comple% projects. !ith =9 digital IC/ pins, DB analog inputs and a larger space for your sketch it is the recommended board for 2) printers and robotics projects. This gives your projects plenty of room and opportunity.
ach of the =9 digital pins on the 4ega can be used as an input or output, using pin4ode+, digital!rite+, and digitalead+ functions. They operate at = volts. ach pin can provide or receive a ma%imum of 9> mA and has an internal pull'up resistor +disconnected by default of 8>'=> k/hms. In addition, some pins have specialiEed functions;
Sri!"# > +7 and D +T7F -erial D; D +7 and D1 +T7F -erial 8; DH +7 and DB +T7F -erial 2; D= +7 and D9 +T7. sed to receive +7 and transmit +T7 TT" serial data. ins > and D are also connected to the corresponding pins of the ATmega18 -5'to' TT" -erial chip . E$%rn!" In%rru&%'# 8 +interrupt >, 2 +interrupt D, D1 +interrupt =, D +interrupt 9, 8> +interrupt 2, and 8D +interrupt 8. These pins can be con(gured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. -ee the attachInterrupt+ function for details.
(WM# > to D2. rovide 1'bit !4 output with the analog!rite+ function. S(I# => +4I-/, =D +4/-I, =8 +-?J, =2 +--. These pins support -I communication, which, although provided by the underlying hardware, is not currently included in the Arduino language. The -I pins are also broken out on the I?- header, which is physically compatible with the )uemilanove and )iecimila.
LED# D2. There is a built'in ") connected to digital pin D2. !hen the pin is :IG: value, the ") is on, when the pin is "/!, it6s o0. I8?; 8> +-)A and 8D +-?". -upport I8? +T!I communication using the !ire library +documentation on the !iring website. $ote that these pins are not in the same location as the I8? pins on the )uemilanove. The 4ega8=B> has DB analog inputs, each of which provide D> bits of resolution +i.e. D>89 di0erent values. 5y default they measure from ground to = volts, though is it possible to change the upper end of their range using the A# pin and analogeference+ function.There are a couple of other pins on the board; ARE)# eference voltage for the analog inputs. sed with analogeference+. R'%# 5ring this line "/! to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board. The Arduino 4ega8=B> has a number of facilities for communicating with a computer, another Arduino, or other microcontrollers. The ATmega8=B> provides four hardware ATs for TT" +=V serial communication. An ATmega18 on the board channels one of these over -5 and provides a virtual com port to software on the computer +!indows machines will need a .inf (le, but /-7 and "inu% machines will recogniEe the board as a ?/4 port automatically. The Arduino software includes a serial monitor which allows simple te%tual data to be sent to and from the board. The 7 and T7 ")s on the board will 3ash when data is being transmitted via the ATmega18 chip and -5 connection to the
computer +but not for serial communication on pins > and D. A -oftware-erial library allows for serial communication on any of the 4ega6s digital pins. The ATmega8=B> also supports I8? +T!I and -I communication. The Arduino software includes a !ire library to simplify use of the I8? busF see the documentation on the !iring website for details. To use the -I communication, please see the ATmega8=B> datasheet.
Ho* %o in%r+!, Arduino *i%h LA-.IEW?? The Arduino can be interfaced with the labVI! using $I'VI-A and "I$7. The $I'VI-A and "I$7 packages and drivers have to be downloaded and installed to interface the Arduino with labVI!. The Arduino can be programmed using the Arduino cc software as per the reKuirement with the help of Arduino codes. $I'VI-A The Virtual Instrument -oftware Architecture +VI-A is a standard for con(guring, programming, and troubleshooting instrumentation systems comprising GI5, V7I, 7I, -erial, thernet, andCor -5 interfaces. VI-A provides the programming interface between the hardware and development environments such as "abVI!, "ab!indowsC?VI, and 4easurement -tudio for 4icrosoft Visual -tudio. $I'VI-A is the $ational Instruments implementation of the VI-A IC/ standard. $I'VI-A includes software libraries, interactive utilities such as $I IC/ Trace and the VI-A Interactive ?ontrol, and con(guration programs through 4easurement L Automation %plorer for all your development needs. $I'VI-A is standard across the $ational Instruments product line. !ith $I'VI-A, you can feel con(dent that your software development will not become obsolete as your instrumentation interface hardware needs evolve into the future.
A typical VI-A application would go through the following steps. D. /pen a -ession to a given esource. 8. )o any con(guration on the given resource +setting baud rates, termination character, etc.... 2. erform writes and reads to the device.
9. ?lose the -ession to the esource. =. :andle any errors that may have occurred. The following is a "abVI! application that opens a session to a GI5 Instrument, performs a write of MNI)$OPnM and then Kueries the device for its response.
This e%act same format would be used in a te%t based language like ?@@ or 5asic. *ou would also follow this e%act same format if the instrument was -erial, -5, thernet, I'D29, or any of the other buses VI-A supports. All you would have to change is the Instrument )escriptor connected to the VI-A /pen. This code would run on any operating system that supports "abVI! and $I' VI-A.
LIN/ y L!.IEW M!1rHu The "I$7 by "abVI! 4aker:ub makes it easy to interface with common embedded platforms such as chipJIT, Arduino, and $I myI/ as well as common sensors including accelerometers, temperature sensors, and ultrasonic distance sensors. !ith this toolkit and $I "abVI! software, you can control or acKuire data from common embedded platforms. /nce the information is in "abVI!, you can analyEe it using the hundreds of built'in "abVI! libraries, develop algorithms to control supported hardware, and present your (ndings on a polished I. "I$7 provides (rmware for common embedded platforms that acts as an IC/ engine and interfaces with "abVI! VIs through a serial, -5, wireless, or thernet connection. This helps you Kuickly move information from an embedded device such as a chipJIT to "abVI! without adjusting the communication, synchroniEation, or even a single line of ? code. sing the
common /pen, eadC!rite, ?lose convention in "abVI!, you can access the digital, analog, !4, I8?, and -I signals of many common embedded platforms or use higher level VIs to directly control sensors and actuators. "I$7 is open source so you can dig in and see how "I$7 works, or even contribute to the "I$7 project. -o we have seen how the Arduino can be linked with "abVI!.$e%t we will move onto the G code that has been used to implement the gas sensor.5efore that a brief introduction about the 4Q'B gas sensor is given&
THE M36 GAS SENSOR 4Q'B gas sensor modules are used in gas leakage detecting eKuipments in family and industry, are suitable for detecting of "G, iso'butane, propane, "$G, avoid the noise of alcohol and cooking fumes and cigarette smoke.
)!%ur' # :igh sensitivity to ?:9 $atural gas -mall sensitivity to alcohol, smoke #ast response -table and long life -imple drive circuit •
,
• • • •
The 4Q'B sensor is shown below along with its con(guration.
Ho* %o ,onn,% %h Arduino *i%h 4!' 'n'or???? The circuit connection for connecting the Arduino with the gas sensor is shown below.The analog input pin of the gas sensor can be connected to any one of the analog pins of the Arduino.?orrespondingly the Arduino code has to be changed for using di0erent analog pins of the Arduino.
Th G ,od u'd The G code that has been used here is shown below.#irst the front panel is shown below. "ater the block diagram is shown.
THE )RONT (ANEL
The front panel consists of input and output controls and indicators.This front panel consists of features like -erial ort, Interface, latform and Analog ?hannel to interface with the Arduino. •
•
•
• •
-erial port is the port of the computer to which Arduino is connected . latform tells us which software we are using to connect the Arduino to labview. The pin from which we are getting analog values is determined by the analog channel. "ed indicates whether there is "G gas leakage or not. The waveform graph gives the voltage across the mK B gas sensor at various instant of time.
THE -LOCK DIAGRAM
5lock diagram is the place where actual processing of data takes place. !e have used 4akerhub "in% driver to interface with the Arduino 4ega 8=B>. sing "in%, certain parameters are initialiEed. They include setting up of -erial port, latform of the software and the interface. Analog values from the gas sensor are read from the Analog pin of the Arduino 4ega. To set this up, RAnalog eadS function is used and the analog pin number of the Arduino is initialiEed. -ince, Analog values from the gas sensor are to be read, Analog ead function is inserted inside R#orS loop running RnS times. The Analog values are compared with the threshold voltage reKuired for the "ed and beep to trigger. If the condition is RTrueS, "ed and 5eep starts working until the condition becomes R#alseS. !aveform Graph is used to plot the voltage change with respect to time. The code is terminated by the "in% tool.
Ho* %o ,o&"% %h ,ir,ui% ? The circuit can be completed by connecting the Arduino to the gas sensor as shown above and connecting the Arduino to the -5 port of the ? or the laptop. The above shown could be run and the gas sensor senses any gas leakages and if a gas leakage
is detected, then the ") glows and a beep tone is produced alerting the user of a gas leakage.
A&&"i,!%ion'# D. rotection from any gas leakage in cars. 8. #or safety from gas leakage in heating gas (red appliances like boilers, domestic water heaters 2. #or safety from gas leakage in ?ooking gas (red appliances like ovens, stoves etc 9. "arge industries which uses gas as their production. =. They are used in gas leakage detecting eKuipments in family, ?ar and industry, are suitable for detecting of "G, iso'butane, propane, "$G, avoid the noise of alcohol and cooking fumes and cigarette smoke.
Ad!n%!4'# D. #ast response 8. !ide detection range 2. -table performance and long life 9. -imple drive circuit =. The sensor has e%cellent sensitivity combined with a Kuick response time.
Di'!d!n%!4'# D. If this system is used in a place where there is smoke, then the sensor is not that much e0ective. 8. Its sensitivity depends on :umidity and temperature.
CONCLUSION# The gas sensor was successfully designed with the help of the "abVI! software and the Arduino. It is found to be a more ecient system. The program that was used here is indeed simple and hence such systems can be used where such need is reKuired. The use of Arduino has also indeed made the software made much more simpler. The gas sensor used here that is the 4Q'B, is also cheap and also stable and can be used in the gas detection system. It is able to work signi(cantly well in di0erent conditions and is also stable. The use of such systems can signi(cantly reduce accidents due to gas leakages and alert the user of gas leakages so that he can necessary action.