Thursday, 22 December 2016

REFERENCE

Lecturer
  1. Syamsul Adlan Mahrim (SAM)

Journal
1.      John L, Kennedy. Oil and Gas pipeline fundamentals .pennWell Nontechnical serries. 1993.
2.      Robert S. Glass, Sam P. Perone, Dinor R. Ciarlo, James F. Kimmons. Electrochemical sensor/detector system and method .1994.
3.      Atzori, L.; Iera, A.; Morabito, G. The internet of things: A survey. Comput. Netw. 2010, 54, 2787–2805.
4.       Miorandi, D.; Sicari, S.; De Pellegrini, F.; Chlamtac, I. Internet of things: Vision, applications and research challenges. Ad Hoc Netw. 2012, 10, 1497–1516.
5.       Stoianov, I.; Nachman, L.; Madden, S.; Tokmouline, T.; Csail, M. PIPENET: A Wireless Sensor Network for Pipeline Monitoring. In Proceedings of IEEE the 6th International Symposium on Information Processing in Sensor Networks (IPSN 2007), Cambridge, MA, USA, 25–27 April
6.      Incorporated,  C.  T.,  Technologies,  C.,  &  Technologies,  C.  (2011).  Cytron
USB to UART Converter User ‟ s Manual, (June), 1-23.
7.      Health,  E.,  &  Elements,  L.  (2012).  Liquefied  Petroleum  Gas  (Canada)
8.      Section  1 :  Identification  of  the  substance  or  mixture  and  of  the  supplier
Section 2 : Hazard ( s ) Identification Section 3 : Composition / Information on Ingredients Section 4 : First Aid Measures, 1-8.
9.       Datasheet, Uno, T. A. Arduino Uno, 328.
1.  Datasheet MQ-2 Semiconductor Sensor for LPG, 2-4.





CONCLUSION


                As a conclusion, this project is a simulation and prototype of the real application in industry particularly in oil and gas ie Petronas. The prototype is an analogy of the real Carbon Dioxide gas molecule in the pipeline. 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.
Based on this project, the study scope is to create a counting system which combination of software and hardware development. Obviously this invention project within procedure involves the knowledge base approach. This sensor system will expand sensor capabilities in chemically with high-performance sensors of highly selective sensors can be detect carbon dioxide gases. The LPG sensor will senses the interrupted by something is entering its path of the pipeline oil and gas.

Wednesday, 21 December 2016

CHAPTER 4 -Testing

4. Testing


Figure 20
Circuit troubleshooting




Figure 21
·      After initialization, Then push red button to turn on the LCD monitor and will display "LPG GAS DETECTOR" with yellow LED HIGH. The portable will enter a normal state where it detects no gas. Green button is to reset the whole circuit. 




Figure 22
   The display shows "NO GAS DETECTED”. And the red LED HIGH.




Figure 23
Once lighter's gas is pointed at the sensor, green LED will be HIGH and will display "GAS DETECTED" to indicate the gas presence. LCD will display "NO GAS DETECTED" and red LED will be HIGH if no gas presence.

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.














2.2 Software Programming


2.2      Software programming

The software that we used to create this source code is Arduino Software


#include <Wire.h> // Provide within Arduino IDE
#include <LiquidCrystal_I2C.h> //LCD-I2C library

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  //LCD Port configuration
const int sensorPin= 0;

const int ledPin= 13;
const int ledPin2= 12;
int gas_level;

void setup() 
{
Serial.begin(9600);  // Serial baud rate configuration
lcd.begin(16,2);   //Intialization LCD
Serial.begin(115200); //sets the baud rate for data transfer in bits/second
pinMode(sensorPin, INPUT);//the gas sensor will be an input to the arduino
pinMode(ledPin, OUTPUT);//the LED serves an output in the circuit
pinMode(ledPin2, OUTPUT);//the LED serves an output in the circuit
lcd.begin(16, 2);
lcd.print("    LPG  GAS    ");
lcd.setCursor(0,1);
lcd.print("    DETECTOR    ");
delay(2000);
}



void loop()
{
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin2, LOW);
lcd.clear();
lcd.print("     GAS     ");
lcd.setCursor(0, 1);
lcd.print("   DETECTED  ");
delay(400);
digitalWrite(ledPin, LOW);
delay(500);
   

}
else{

digitalWrite(ledPin2, HIGH);
lcd.clear();
lcd.print("     NO GAS    ");
lcd.setCursor(0,1);
lcd.print("    DETECTED    ");
delay(1000);

}
}

2.1 Hardware Set up

2.1 Hardware set up


2.1.1 Schematic diagram 




Figure 4





2.1.2 Arduino microcontroller 


This  indicates  that  the  codes  written  for  the  microcontroller can  be  loaded  on  to  Arduino  Uno  using  USB  cables,  which are  easier  to  carry  and  deal  with.  As  seen  in  the  figure,  the Arduino Uno is powered using ATmega328P microcontroller. The circuit board has a convenient power management which allows  the  input  voltage  up  to  12V.  The  built-in  power regulatory  mechanism  then  permits  the  regulation  of  this voltage  into  5V  and  3.3V.  The  power  can  be  supplied  by connecting  an  adapter  to  the  external  power  supply  or  to computers  (or  other  devices)  using  a  USB  cable.  The  figure clearly represents the existence of 14 digital I/O pins as well as  6  analog  I/O  pins.  These  pins  are  the  circuit  board’s medium  of  communication  to  external  devices.  Apart  from these  features,  Arduino  Uno  accommodates  32KB  flash memory for the storage of programs.

Figure 5





The power pins are as follows:
· Vin. The input voltage to the Arduino/Genuino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
· 5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.
· 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
· GND. Ground pins.
· IOREF. This pin on the Arduino/Genuino board provides the voltage reference with which the microcontroller operates. A properly configured shield can read the IOREF pin voltage and select the appropriate power source or enable voltage translators on the outputs to work with the 5V or 3.3V.

Memory
The ATmega328 has 32 KB (with 0.5 KB occupied by the bootloader). It also has 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).

Input and Output
See the mapping between Arduino pins and ATmega328P ports. The mapping for the Atmega8, 168, and 328 is identical.
Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode()digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive 20 mA as recommended operating condition and has an internal pull-up resistor (disconnected by default) of 20-50k ohm. A maximum of 40mA is the value that must not be exceeded on any I/O pin to avoid permanent damage to the microcontroller.


In addition, some pins have specialized functions:
· Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
· External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
· PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
· SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the SPI library.
· LED: 13. There is a built-in LED driven by digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
· TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function.

There are a couple of other pins on the board:
· AREF. Reference voltage for the analog inputs. Used with analogReference().
· Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.








2.1.3 External circuit

Figure 6
LCD was placed at the center of the box




 Figure 7
Dot board with complete circuit is placed after LCD 



Figure 8
LED's and BUTTONS is attached to the circuit 



Figure 9
Arduino Uno



Figure 10
Arduino Uno with signed source code is being attached to the dot board




Figure 11
MQ2 gas sensor




Figure 12
MQ2 gas sensor is placed inside small box 




Figure 13
Complete MQ2 gas sensor




Figure 14
Complete prototype 








CHAPTER 2 - Prototype Development

2. Prototype development

What we do in developing the prototype is by doing it by phase, the project development started by doing the research onto this project. After that, we proceed to :
2.             2.1 Hardware set up
2.1.1  Schematic diagram
2.1.2  Arduino Microcontroller
2.1.3           External circuit


          2.2    Software Programming Arduino Source Code

CHAPTER 1 - Conceptual Design

1. Conceptual design

So how does it work?

As for real time product, it is quite similar to this prototype except for a few changes of material used. It is no longer PVC pipeline but metal pipeline that is harder and more expensive, the sensor that will be used must be very particular one so that the presence of carbon dioxide will be detect precisely with correct amount and send the data directly to the server. This carbon dioxide detector will be mounted two to three along the way in the pipeline after every filtration section just to make sure all co2 was filtrated and all the impurities gone because pure oil is the only that we needed. 






Circuits









Gantt Chart










Flowchart







Block Diagram






WBS Dictionary

WBS Dictionary


Work Breakdown Structure(WBS)

WORK BREAKDOWN STRUCTURE



Project Name:
DEVELOPMENT OF GAS DETECTOR  IN OIL AND GAS PIELINE USING ARDUINO
Project Manager:
Puteri Intan Solha binti Salim
Nur Shasha Qastina binti Mohd Zulkifli
Date:
[22/12/2016]










Problem Statement

Problem statement
Carbon dioxide system are one of the common environments in the pipeline steel and process equipment used in the extraction, production and transportation of oil and gas in the petroleum industry where corrosion occurs. There are many effects of pipeline, cracking and also may constitute serious hazards to the gas in the pipeline. Besides that as shown in figure 1.1, corrosion also may damage the pipeline and can cause the leakage that may hazards to the environment, assets and even humans. In this study, our team will develop gas detector using Arduino that is basically to detect the presence of co2 in the pipeline.


Figure 1

The oil industry transport and distribution of hydrocarbons is carried out by means of carbon steel pipelines, which are one of the most efficient, safe and economic methods. However metallic pipes are prone to failure under conditions of poor maintenance. Due to the acidity of the aqueous phase, one of the main risks in the operation of pipelines for the transport of hydrocarbons is the internal corrosion. To control internal corrosion, one of the main strategies is to inject corrosion inhibitors, figure 2.2-2.3. The presence of aqueous phase is almost unavoidable, since during the production of crude oil the formation water or injected water is also transported in a multiphase flow. We will develop a device that can detect the amount of carbon dioxide presence in the pipe that come along with the oil.


                                       
Figure 2


                                                              Figure 3

This project is actually an analogy of the real problem in Oil and Gas industry that we currently facing ever since. However, because of we are lack of time and material, we reduce the functionality of the project by using general gas sensor instead of using CO2 sensor. From what we observed based on research, CO2 gas has caused so much disadvantages towards industry and there’s nothing much to do to settle down this problem. The only thing we could offer now is to develop gas sensor that is to sense just how high the amount of co2 in the pipeline and directly transmit the data to the server so that they are aware and conduct a few filtration onto the crude oil before it goes to the next process.