Design of Laboratory Scale Fluid Level Measurement Device Based on Arduino

Measuring the height of a liquid using analog is very difficult, and its accuracy is very low. It is more accurate to measure liquid level using digital technology. Measurements of the correct fuel level are needed to measure fuel purchases at fuel stations or fuel retailers. The study aimed to design laboratory-level fuel level measurements based on the Arduino Uno microcontroller. The method used was a direct comparison between the measuring instrument and a ruler as a measuring standard. This device used a gas gauging sensor on the vehicle and an Arduino Uno microcontroller to process data and display data on the LCD and LabView. The results of the fluid level measurement could be used to determine the height of fuel surface. The error rate of the measuring instrument was ± 3% in a calm and bumpy state. The results showed that the device is suitable for use in measurement. Keywords— Fluid Level, Gasoline Gauge, Arduino


INTRODUCTION
Metrology is a science related to measurement. Metrology originates from the Greek word metro, which means measurement, and logos, which means science. Metrology is divided into three parts, namely scientific, legal, and industrial. It covers all aspects of practical and theoretical measurement, including uncertainty and application. It is believed that human never escapes the need and knowledge to measure and weigh in everyday life. Legal metrology is very important in measurement, particularly in the field of commercial transactions.
Today's life of society requires knowledge of measurements and of measuring and weighing the level of accuracy as needed. It can be seen from the current industrial technology that requires accurate measuring devices and techniques. Likewise, daily consumption activities such as food and beverages, lighting, telephone, and fuel require a precise and accurate measuring device. Research on measuring the fluid level has been studied by earlier researchers. Madrid researched Real-Time Water Quality Monitoring System for Tilapia. In his study, he measured the water level, temperature, pH, and DO levels using the Arduino microcontroller [1]. Sachio studied IoT Water Levels Control System using the Blynk IoT service integrated with PHP web programming to provide water level monitoring and control [2]. A Novel approach to improve Telemetry-based Intelligent Real-Time Irrigation Systems was developed by Kaushik. The system automatically monitored the natural parameters of plants such as temperature, humidity, humidity, etc [3]. Sado studied and designed a PV-powered DC water pump system for irrigation. New methods for measuring water content in the soil and the level of sufficient moisture required for normal plant growth were presented to design a timer for the system to reduce the amount of water wasted [4]. Machado investigated the level and temperature control and multivariate design via Arduino through loop control decoupling. It aimed to study and develop a multivariate temperature and level control systems consisting of three tanks, one for mixing and the other two for hot and cold-water supply [5].
Taru used Arduino with LabView the water for a monitoring system. The system was designed to develop, implement, monitor, and control several water parameters such as pH, temperature, and turbidity [6]. Fathur Rahman an ultrasonic pipe in an open channel to monitor water levels control. The device consisted of a combination of JSN-SR04 T ultrasonic sensors, and an iron pipe developed using the microcontroller system ATMEGA328 [7]. Jeswin studied indicators and ultrasonic water level controllers using AVR microcontrollers. In this project, HC-SR04 was used to measure water levels in tanks, and AVR Microcontrollers to control overflow [8]. Mantoro used ultrasonic sensors and Fuzzy logic to detect water levels in smart home bathtubs. The study proposed the development of water-saving devices using automatic water-opening and water-closing-devices to reduce water wastage [9]. Sharma investigated remote monitoring and control of liquid fertilizer and water irrigation. He proposed an Android-based agricultural support system, an automatic irrigation system, that adjusted the amount of water-based on sensor data [10].
Shruthi examined the real-time smart sprinkler irrigation control system. The study focused on water storage monitoring systems for pharmaceutical plants with pH sensors [11]. The research supported sustainable agriculture using environmentally friendly and energy-saving sensor technology. The quality and quantity of these natural resources have declined over the years due to various Journal of Robotics and Control (JRC) ISSN: 2715-5072 146 Nur Fitri Apsari, Design of Laboratory Scale Fluid Level Measurement Device Based on Arduino economic problems associated with rising input costs, decreasing agricultural income, declining land, labor, energy resources, and also environmental problems such as land, water pollution, and soil erosion [12]. Kabilan used a Wireless Sensor Network and a Wi-Fi module to supervise and control cloud irrigation systems. He set up a database to develop automated techniques for analyzing water needed by factories at a given time. The database contained training samples related to soil type, water content, temperature, plant leaf condition and humidity level, and the amount of water flow required for the next set of features [13]. Smart water leak detection and measurement tools have been investigated by Sithole. Smart devices have changed almost every aspect of our home, and this paper presents a practical low-cost Smart Water Meter that can determine the probability of leakage in customer property and report the current level of household water consumption in real-time [14]. A multisensor system for monitoring environmental quality (air and water) remotely was investigated by Simic. The system is designed for use in remote environmental monitoring by collecting information on air temperature (T) and relative humidity (RH), the presence of volatile organic compounds (VOCs) as well as water temperature and pH [15].

Faroqi used Arduino Uno-based light-dependent resistors for the Automatic Water Filtration Monitoring and Clarity
System. The water clarity monitoring system in the aquarium was designed to detect the level of water clarity/turbidity at a certain level using Arduino Uno Microcontroller as the central controller and LDR (Light Dependent Resistor) as the-sensor [16]. Jain investigated the irrigation management system with the application of a micro-controller. The optimized irrigation scheme used automatic water control to perform plant-specific irrigation activities [17]. Rahman studied and designed a monitoring system for automatic household water supply. In this project, the automated switching and water level sensors used Arduino Mega 2560 and were completed with dual relays. A water flow sensor was used to detect the level and quantity of water [18]. Srilikhitha used a soil moisture sensor and a temperature sensor with microcontroller AT89S52 to investigate an automatic irrigation system. It consisted of two sensors with ambient temperature and soil moisture value [19]. Putung used a microcontroller for the Automatic Dry Control System. The system consisted of a light sensor (photodiode), rain sensor, microcontroller ATmega8535, servo motor, an LCD (Liquid Crystal Display), a series of relays, and limit switches [20].
One metrology application studied in this research is fuel measurement related to the fuel purchase in retail, which requires an accurate measurement device. The research aimed to design a laboratory-scale fuel level measurement device based on Arduino, which will be used to measure fuel height and displayed in a digital form. In the research, the author compared the measurement of the fuel level both in calm and wave states to determine the characteristics of the fuel sensor.

II. METHOD
The Arduino-based fuel measuring system equipped with a buoy sensor placed in the fuel tank and the Arduino Uno R3 worked as the control system of the sensor [6], [9], [16], [21], and 22]. The results would be displayed on a 16x2 LCD and the graphical results on the LabView. Figure 1 illustrates the system block diagram.  Figure 2 shows the flow chart for the entire system. The buoy sensor in the gas tank worked as a sensor that measured fuel surface height values ranging from 1 to 10 cm [21], [23] - [26]. The Arduino Uno R3 served as a circuit controller for the system using the Atmega 328 microcontroller. A 16x2 LCD was used to display the measurement result in a nominal or numeric form, and the Lab-view to display the results in a graphic form. The buoy sensor was installed in the fuel tank. After the buoy sensor was active, it would read the water level. When the sensor did not properly detect the water level, it had to be re-conditioned. When it detected correctly, the reading results would be managed by the Arduino, and then the data processing outcomes would be displayed on an LCD and LabView.

A. Hardware design
Designing the device started with the device's working system design. The buoy sensor was used as an input and later Journal of Robotics and Control (JRC) ISSN: 2715-5072 147 Nur Fitri Apsari, Design of Laboratory Scale Fluid Level Measurement Device Based on Arduino processed by the Arduino. The Arduino was either the brain or the control system. The output was in the form of a voltage which was an analog signal, which entered the A0 pin on the Arduino. Pin A0 was an ADC pin or pin used to convert analog signals to binary numbers. The binary numbers would be reprocessed into voltages by the Arduino. The results would be displayed on an LCD, which would afterward be compared to standard rulers for an equation to convert the voltage. The equations would be entered in the Arduino program. The data shown on the LCD were fuel surface levels in cm units, while on the LabView were the measurement graphs.

B. Buoy sensor design
The buoy sensor was a sensor used to measure the height and volume of the surface in the fuel tank. It was directly connected to the analog pin on the Arduino Uno board [27] - [30]. The Arduino received the output of the buoy sensor, which would then be processed by the program in it. The buoy sensor in the scheme was replaced by a potentiometer because it had the same working principle.

C. Firmware design
Software design of a system is very necessary to ensure that the system works properly. The software design for this research consisted of programs found on the computer in Arduino and LabView. The Arduino IDE software was used to convert the analog signal on the buoy sensor to a water level, and the results would be displayed on a 16x2 LCD. An array stored the ADC which was read ten times to find the average. The average reading of the ADC was then converted to voltage and displayed on the LCD and serial monitor. The process was completed.

D. Labview interface design
The Labview was designed to display the measurement data in graphical form to facilitate readings.

III. IMPLEMENTATION
This chapter explains the implementation and testing of the hardware (hardware) and software (software) of the system design that has been made. Figure 3 illustrates the implementation of the system. The software implementation was divided into the implementation of the Arduino Uno program and the LabView interface. There were two programs compiled in the implementation of the Arduino program. The first was a program to test the buoy sensor. The sensor was tested and compared to the standard measurement. The test was performed to find an equation on the buoy sensor that would afterward be used to convert the output of the buoy sensor to the altitude in centimeters. The second was the program to run the whole system. The equation results at the test stage were added to the Arduino program so that the results displayed were the voltage from the buoy sensor output and the reading of the water level detected by the buoy sensor.
The output of buoy sensor was an analog signal that entered the pin (A0). The output on the sensor was defined as int val. It is due to the reading of the ADC signal that was in integers. The average of the ADC sensor output was defined as the voltage float because the results of the average processing were enumerator numbers. The results were then processed into voltage with a conversion formula and defined as float sensors, which were then compared to the standard to find the equation.
In the LabView Interface Implementation, the measurement results of the entire system were shown in a graphical form and tank indicator. Figure 4 shows the front panel and the LabView schematic diagram.  Figure 5 shows the Labview interface block diagram in which the objects in this window are shown when the user is running the program. The data displayed in the Waveform Chart were real-time data. The tank showed the height level of fuel surface. Nur Fitri Apsari, Design of Laboratory Scale Fluid Level Measurement Device Based on Arduino A block diagram was used to design the systems and make the programs. It wouldn't be seen by the user when the program was running. A loop served to run the program in the block repeatedly as long as the conditional input terminal obtained a false value, otherwise, the loop would stop. Visa Configure Serial Port was used to set the serial communication settings at the beginning of the communication. Visa Configure Serial Port was used to set the serial communication settings at the beginning of the communication, including the channel used (Visa resource name), communication data speed (baud rate), and others. Visa Read was used to read several bytes of data from the device or hardware interface specified by the Visa resource name. Byte count 200 indicated reading of 200 bytes before the timeout. Scan from the String served to scan the input string and change the number data to the format entered. The Strings were ASCII characters and the Timer for data retrieval was Wait (ms). The Bundle served to arrange several pieces of data entered into a Cluster, Visa Clear to remove the I/O buffer, and Visa Close to close communication with the device specified by the Visa resource name. The Waveform Chart was a viewer of the sensor measurement data shown in real-time. The tank showed the height of the fuel level.

IV. SYSTEM TEST
The buoy sensor was compared to the standard ruler after being tested. Table 1 presents the results of a comparison between the sensor-reading tests and the standards. The table shows that the error of the float sensor test equipment measured with the standard ruler is 0.028 percent. The error value does not exceed 5 percent of the BKD (Allowable Error Limits) so that the float sensor test equipment can be used to retrieve data. Figure 6 shows the comparison chart between the tested device (cm) and the standard ruler (cm). A linear graph was obtained from the comparison chart between the tested device and the standard ruler. The standard ruler was shown in the red line, and the equation was y = x. The test result on the device was shown in the blue line and equation y = 1,0005x + 0.0446 with a regression value of R2 = 0.996, showing that the measurement results were good. The regression value or R2 was the value of the regression equation. Fig. 6. comparison chart between the tested device (cm) and the standard ruler (cm) V.

RESULT AND DISCUSSION
The designed measuring device used a buoy sensor with the same operating principle as a rotary potentiometer. The output of the buoy sensor was a voltage. The output voltage on the buoy sensor was an analog signal so that the outputs of the buoy sensor went into the Arduino ADC pin.
The Arduino in the constructed device was used as a microcontroller to control the operation of the system. It was programmed and used to turn on the sensors and the LCD. The measurement data entered in the Arduino was analog so that it had to be re-converted to voltage. The results of the conversion were compared to the standard ruler.
The measurement data taken were processed and used to find equations. The equation was then entered into the Arduino program to obtain the final results in centimeters. The device was later tested with a standard ruler that had been calibrated to make the measurement results more accurate. The test data obtained from the device should have a small error and should not exceed the allowable error limit of the data retrieval standard. A re-test was held when the error value was still large.
The graph resulting from the comparison test showed a linear line. It did not show too large deviations from the standard. The graph's suitability was 0.99 on average. The graph in the Lab-view showed that the motions of the chart based on the motions of the buoy sensors and the indicator tank. The device was equipped with digital readings to make readings easier.

VI. CONCLUSION
The error value of the laboratory-scale fuel height measurement instrument based on Arduino Uno is ±0,030 percent both in calm or wave conditions. The device has the resolution to measure the fuel height from 1 to 10 cm. The measurement results are digitally displayed on a 16x2 LCD in voltage and height. The LabView interface was used to display graphs and fuel level indicators.