Liquid volume monitoring based on ultrasonic sensor and Arduino microcontroller

Incident of oil leakage and theft in oil tank often happens. To prevent it, the liquid volume insides the tank needs to be monitored continuously. Aim of the study is to calculate the liquid volume inside oil tank on any road condition and send the volume data and location data to the user. This research use some ultrasonic sensors (to monitor the fluid height), Bluetooth modules (to sent data from the sensors to the Arduino microcontroller), Arduino Microcontroller (to calculate the liquid volume), and also GPS/GPRS/GSM Shield module (to get location of vehicle and sent the data to the Server). The experimental results show that the accuracy rate of monitoring liquid volume inside tanker while the vehicle is in the flat road is 99.33% and the one while the vehicle is in the road with elevation angle is 84%. Thus, this system can be used to monitor the tanker position and the liquid volume in any road position continuously via web application to prevent illegal theft.


Introduction
Oil theft by taking small amount of the liquid inside the tank often happen, the latest case happened in Riau. The incident causes loss about IDR 1.3 trillion. The oil theft is done by creating small hole in the tank so the fluid can leak and distributed to the other party. This illegal act caused loss to the company (Pertamina) and also Indonesia [1].
To overcome this problem, Pertamina uses ATG (Automatic Tanks Gauge) but it only calculates the liquid volume in the gas station not in the oil tank [1]. To calculate the liquid volume inside tank, fluid velocity sensor which is embedded in the oil tap can be used. This method can be implemented if the leakage comes from the oil tap [1]. But, if it comes from the other hole, this method won't success.
The other method is using fuel level sensor inside the oil tanker and GPS sensor to monitor the oil tanker [2] [3]. The monitoring result is already well presented by using maps, but, the fuel sensor will fail if the oil tanker is on the tilted road. To overcome the disadvantage, fuel level sensor mounted on the fuel tanker with arm on floater can be used [4]. But this approach can have less accuracy since it only has 1 sensor. It also only send the OK data in a plain teks so it's hard for the user to monitor the location and the fuel volume.
Aim of this study is to calculate the liquid volume inside oil tank on any road condition and send the volume data and location data to the user. This research contribution is the system can calculate the fuel volume even in a tilted road with more accurate than previous study. The advantage of this system is user doesn't have to request the data. The system will send the data regularly to the server, save it on the database, and displayed the record in the user's browser in a visual way.
This system uses ultrasonic sensors to monitor the fluid height, Bluetooth modules to sent data from the sensors to the Arduino microcontroller, Arduino microcontroller to calculate the liquid volume, GPS / GPRS / GSM Shield module to get location of vehicle and sent it to the Server. From the server, the data will be processed and the output is displayed in a web browser. It will display a map and show the location of the oil tank and the liquid volume.

Literature Study
The literature study explains the object used for this research.

2.1.
Ultrasonic Sensor Ultrasonic sensor is electronic device that change the electrical energy into mechanical energy in the form of ultrasonic sound waves. Ultrasonic sensors are most commonly used due to its simplicity and low cost. The sensor consists of a series of ultrasonic transmitter and receiver. The accuracy of the measured distance is dependent on the separation between the ultrasonic transmitter and receiver [5].
Example of ultrasonic usage is distance measurement of an object in the path of a person, equipment, or a vehicle, stationary or moving is used in a large number of applications such as robotic movement control, vehicle control, blind man's walking stick, medical applications, binary gas mixture fraction, etc [6][7] [8].
This tool is used to measure the ultrasonic waves. Ultrasonic waves are mechanical waves which have the characteristic longitudinal and typically have a frequency above 20 kHz. Ultrasonic waves can propagate through the solid, liquid or gas. Ultrasonic waves are waves of energy propagation and mechanical momentum that propagate through the third element as the interaction with the molecule and the nature of the medium inertia path [9].

2.2.
Arduino The Arduino integrated development environment (IDE) is a cross-platform application written in Java. Arduino programs are written in C or C++ [10]. The Arduino Uno Boards are uploaded with specific programs that enable them to perform their required operation [11]. Arduino is flexible (offers a variety of inputs, interface, and output), inexpensive, and can communicate with software running on your computer [12].

2.3.
GPS GPS (Global Positioning System) is a radio-based navigation system that provides information about the coordinates of the position, velocity, and time to users worldwide. The use of GPS satellites service is not charged. Users only need a GPS receiver to determine the coordinates of the location. The accuracy of location coordinates depending on the type of GPS receiver. GPS consists of three parts: satellites orbiting the Earth (The GPS satellites orbit the earth twice a day), control and monitoring stations on Earth, and the GPS receiver [13]. Example of GPS implementations are: land vehicle navigation [14], human activity [15], and tracking system [16] [17].
GPS output data format is defined by the NMEA (National Marine Electronics Association).    [25]. Bluetooth is a great protocol for wireless communication because it's capable of transmitting data at nearly 1MB/s, while consuming 1/100th of the power of Wi-Fi [26].
HC 05 and HC 06 is a Bluetooth module that is compatible with Arduino microcontroller. This module serves as a plug in on Arduino. It act as the media data recipient or sender through the air (wireless). Both modules use the AT command. Examples of AT commands which used in this system can be seen in Table 3 [27].

Methodology
This research creates a monitoring system of liquid volume inside the fuel tank by combining some components: Ultrasonic sensors, Arduino microcontroller, Bluetooth module and GSM/GPRS/GPS Shield v3.0. These components are designed to form a simple wireless network for obtaining liquid volume data in the tank and get the location of the tank. The system sends the data to the server, processed by the server, and displayed via web-based application.
To monitor an oil tank, the vehicle, capacity, the route, and the liquid volume should be registered before it leaves the base. As long as the vehicle has not reached the destination, the components which are embedded in the vehicle will continuously send liquid volume data and vehicle location data every 10 seconds. In the web application, the vehicle icon will continuously move according the coordinates of the monitored vehicle. The vehicle icons contained information on the percentage of the volume of the tank on the monitored vehicle. This system uses leaflet.js API for drawing the map and the vehicle in the browser.

3.1.
Workflow Process There are 3 workflow processes that occur in the system, the first is the process flow of the child node (figure 1), the second is the process flow of the centre node (figure 2), and the third is a process flow of the monitoring application (figure 3).

3.2.
System Architecture The ultrasonic sensor used to capture the depth of the liquid in the tank. To increase the data validity, this system uses two ultrasonic sensors. Create integration system between those sensors is necessary, so we set up a small network wireless using Bluetooth module as a medium of communication between nodes. An additional GPS/GSM/GPRS Shield module is needed to capture location data and send it to the server. The system architecture in figure 4 shows that there are two child nodes to capture liquid level data in the tank. While the centre node assigned to receive sensor data from child node, receives location data from the GPS, and transmits the data to a server. Users can monitor the liquid volume via web-based application, so it can be viewed anywhere and anytime. Overview of the monitoring process can be seen in figure 5.

Implementation
Child node consists of Ultrasonic sensor, Bluetooth module (HC 05), and Arduino microcontroller. Centre node consists of Bluetooth module (HC 06), GPS/GSM/GPRS Shield module, and Arduino microcontroller. Implementation of components child node and centre node can be seen in Figure 6 and Figure

Experimental Result
To determine the accuracy level of sensor components when detecting liquid volume in the tank, we create three test scenarios. Those tests are performed on a prototype tank contains water. The last scenario is to check the web based application.

5.1.
First Scenario The first testing scenario is to check the component accuracy under normal circumstances. The components and the tank prototype can be seen in figure 8. This scenario is performed for 70 seconds, and managed to send 5 data to the server. Graph accuracy rate sensor in the first scenario can be seen in figure 9. The blue line shows real volume of the liquid while the red one shows the detected volume. The accuracy rate of the system in normal circumstances is 99.33%. It is almost the same with previous study [2] [3].

5.2.
Second Scenario The second testing scenario is to check the component accuracy when the tank is tilted 10 0 . The components and the tank prototype can be seen in figure 10. This scenario is performed for 75 seconds, and managed to send 5 data to the server. Graph accuracy rate sensor in the second scenario can be seen in figure 11. The blue line shows real volume of the liquid while the red one shows the detected volume. The accuracy rate of the system in tilted circumstances is 84%.

Third Scenario
The third testing scenario is to check the component accuracy when the tank leakage happens in a flat road. The components and the tank prototype can be seen in figure 12. This scenario is managed to send 10 data to the server. Graph of the leakage in the third scenario can be seen in figure 13. The blue line shows the liquid height. When the liquid height decreases gradually over a certain period in different locations, it can be suspected as leakage or illegal theft.

5.4.
Fourth Scenario The fourth testing scenario is to check the registration process and output of monitoring system in a web based application. The result can be seen in figure 14 and figure 15. The interface for monitoring fuel inside is better than just text based [4] and give more details than the other research [2] [3].

Conclusion
From the experimental result, we can draw conclusions as follows: 1. This system that consists of ultrasonic sensors, Arduino microcontroller, GSM/GPRS/GPS Shield modules and Bluetooth module can monitor the liquid volume inside tank and detect the leakage via web based application continuously. 2. The road condition (flat or tilt) is affecting the accuracy rate of the sensor. In the normal road the accuracy rate is 99.33% while in tilted road the accuracy rate drop until 84%. This system can be implemented in any road condition.