Wednesday, 21 December 2016

CHAPTER 3 - Hardware Integration

3. Hardware Integration 



We used LPG(LIQUEFIED PETROLEUM GAS) sensor that is MQ2 that is SnO2 based gas sensor for this prototype, the circuit indicates LPG level in the pipeline.

Figure 15



The resistance of the sensor is different depending on the type of the gas. The MQ2 sensor gas a built in potentiometer that allows to adjust the sensor sensitivity according to how accurate what want to detect gas.



Implementation
Sensor Selection
When determining the distance between two objects, there are a variety of sensors to choose from. The voltage that the sensor outputs changes accordingly to the gas level that enter in the pipeline. The sensor outputs a voltage that is proportional to the concentration of gas. In other words, the relationship between voltage and gas concentration is the greater the gas concentration, the greater the output voltage and the lower the gas concentration, the lower the output voltage.  In this case however, the gas  which can be implemented by using an LPG sensor. In this instance, the microcontroller being used is an Arduino UNO.
The output can be analog signal (A0) that can be read with an analog input of the Arduino or a digital output (DO) that can be read with a digital input of the Arduino Uno.

Figure 16






Technical Specifications
this flammable gas sensor detects the concentrations of combustible gas in the pipeline and outputs its reading as an analog voltage. The sensor can measure concentration of flammable gas of 300 to 10,000 ppm. The sensor can operate at level gas and consumes less than 150mA at 5V.

Figure 17




Installation
There are two different ways to connect a MQ2 LPG sensor to an Arduino UNO microcontroller. Both will work for all applications, it is up to the user to decide which one to use depending on how the sensors and other devices will be used together. 
Mode1
The first way is known as Mode 1, and the connection pins are shown below in Figure , and should be connected to the Arduino Uno microcontroller accordingly. In this mode, the trigger and echo pins are separate, and will take up 2 I/O pins on the Arduino Uno microcontroller. This is correct, but availability issues may arise when the sensors are used together. In this mode, the sensors could be implemented on the Arduino Uno micontroller. When the sensor is connected correctly, a red LED will flash to indicate that the wire connections are correct.

Figure 18

Mode 2
Mode 2 is different from Mode 1 in that it combines the trigger and echo pins. The LPG gas detector that turns on an LED when flammable concentration exceed a certain level. Along with a sensitivity resistor and a 3 pin header. The carrier board pins are VCC(+5V), GND, and out, which connects to A0 on an Arduino Uno microcontroller. Then, connect  a LED to Pin 13 and Gnd as indication of  LPG detected.  
Figure 19




Programming
Programming the Arduino Uno microcontroller is the most important aspect of this process. Without the correct code, the sensors will not work. The Arduino Programming language is based on C/C++. The first step is to download the Arduino software that will allow for communication between the computer and microcontroller. The MQ2 LPG sensor is considered to be a flammable sensor, and the Arduino software actually has a demo program that can be altered to implement multiple sensors.