Learning Arduino as a Simple River Water Level Detection System Based on Ultrasonic Sensors

Current technological advancements are rapidly and impact daily life. Developing technology can be applied in many programs, one of which is as a tool for education. As shown in this study, technology as a mode of learning can be implemented in daily life. This study examined Arduino programming to create a river water level detection system using an ultrasonic sensor. This research is expected to be used as a learning tool for using Arduino as a microcontroller and can be applied in daily life. Additionally, by developing this river water level detection system, it will be possible to mitigate flood disasters.


I. Introduction
The term "technology" derives from the Latin "texere," which meaning to compile or construct.
Technology can be defined as a design, design, or method that shows efficiency in every human activity [7]. Today, science and technology develop rapidly and play an important role in realizing a better human life. Many infrastructure facilities are built automatically to help human activities during the technology developments [4]. Technology enables and facilitates the collection of information by people. In general, technology is widely employed in a variety of disciplines, including government and education [6]. Technology is frequently used to facilitate learning. As previously said, the use of technology in learning has many advantages, as knowledge may be discovered and studied directly 27 JODLI Vol. 3(1)_Bertha Anggita Purwandani with technology [5]. Here, technology is used as a learning tool to develop a simple river water level detection system using Arduino UNO and based on Ultrasonic Sensors.
A river, whether large or small, is one variable that contributes to floods caused by river water overflowing. Almost every large city in Indonesia experiences floods because of heavy rainfall, which increases river water levels and even causes rivers to overflow. As a result, many people will be unaware of when the flood will strike, as there will be no flood warning, which frequently results in casualties and other losses. Thus, this study aims to examine Arduino programming to develop a simple river water level detection system using ultrasonic sensors and LEDs as outputs. This research is expected to serve as a primer on how to use Arduino as a microcontroller and can be applied in daily life. Additionally, as this river water level detection system develops, it will be capable of being used to mitigate flood disasters.

a. Arduino UNO
The Arduino microcontroller is based on the ATmega 328. Additionally, Arduino can be referred to as a user-friendly open-source electronic platform [8]. Arduino is a microcontroller that is about the size of an ATM card. The Arduino UNO features 14 digital pins, 6 analog pins, a 16 MHz crystal oscillator, a USB connection, a voltage supply connector, an ICSP header, and a reset button [1]. The term Arduino is sometimes used to refer to a programming language or software, namely the Arduino IDE (Integrated Development Environment) [4]. An ultrasonic sensor is a device that converts physical quantities, specifically sound, to electrical quantities or vice versa. Ultrasonic sensors interpret the distance to an object with a specific frequency using the principle of sound wave reflection [2]. This sensor is comprised of a set of ultrasonic transmitter circuits, referred to as transmitters, and ultrasonic receiver circuits, referred to as receivers [4].

Figure 2. HC-SR04 Ultrasonic Sensor
In ultrasonic sensors, ultrasonic waves are generated by a piezoelectric, which generates ultrasonic waves with a frequency of approximately 40kHz. The ultrasonic sensor works by projecting ultrasonic waves toward a specific area or target. When the wave hits the area's surface, the area reflects the wave back to the sensor, which then calculates the difference between the time of transmitting the wave and the time of receiving the reflected wave [3].

c. LED
When a voltage is provided to an LED, or Light Emitting Diode, it generates monochromatic light [9]. LEDs are frequently referred to as the Diode family of semiconductor materials; in general, LEDs produce light in didff colors depending on the semiconductor material used. Typically, LEDs are found on remote controls, televisions, cellphones, and other electronic devices [4].

II. Method
This river water level monitoring system is composed of different components, including an Arduino microcontroller, an ultrasonic sensor, and an LED output. Figure 3 illustrates the design chart for the river water level monitoring system. The ultrasonic sensor of type HC-SR04 will collect data, which will then be processed by Arduino UNO. Once the data has been processed, the results or output, in this case the LED, will display. In this study, 4 LEDs were used: a blue LED to show that the river water level is completely safe, a green LED to show that the river water level is safe, a yellow LED to show that the river water level is alert, and a red LED to show that the river water level is dangerous. Figure 4 shows the design of system mechanism. The design of a river water level monitoring system using fritzing is carried out using the system design chart and system flow diagram in Figure 3 and 4. The river water level monitoring system is designed in the manner shown in Figure 5. The Ultraviolet Sensor data will then be processed using the Arduino programming language, namely the Arduino IDE. The following is the source code for the Arduino IDE that used in this study.

III. Results and Discussion
Based on the design of the tool and data processing by the river water level monitoring system, when the system was tested, the results were as shown in the table below. The data above is obtained from the readings of the river level monitoring system that has been tested with a ruler as a comparison. The experiment was carried out in a small aquarium with a maximum height of 35 cm. The results show that when the ruler shows a water level of 30 cm, the LED flashes blue, so the water conditions are completely safe. Similarly, when the ruler shows a water level of 28 cm, the LED lights up blue so the water is completely safe. In this condition, the ultrasonic sensor can read at a height of more than equal to 30 cm. For further testing, the ruler shows the water level is 24 cm and 21cm, so it shows a green LED which means it is completely safe. This shows that the ultrasonic sensor can read a water level of less than 25 cm. The following data shown by the ruler is water as high as 18 cm and 16 cm, the LED lights up yellow which means alert or careful because the water is rising, also it shows that the ultrasonic sensor can read water levels less than 20 cm. And the last data obtained is the water level shown by the ruler is 8 cm, the LED lights up red which shows it is dangerous, in this latest data the ultrasonic sensor can also read water levels less than 10 cm.
These results show that the simple river water level monitoring system proposed in this study can function properly, using both ultrasonic sensors and Arduino microcontrollers and LEDs as outputs.
Thus, the Arduino mechanism or operating system can be considered as a microcontroller that is combined with an ultrasonic sensor to read the river's water level. This means that Arduino may be used not only as a river water level monitoring system but also with programs or other technologies that are beneficial in daily life.

IV. Conclusion
The results show that the design of a simple river water level monitoring system using an Arduino microcontroller and an ultrasonic sensor was successful. This is determined by the sensor's accuracy when reading the river water level, as evidenced by the program run on the Arduino IDE, in which the river water level reading is compared to a ruler. Additionally, the working mechanism of Arduino as a microcontroller is combined with an ultrasonic sensor to read river water levels, implying that Arduino can be applied to a variety of programs or systems, as well as other technologies that are beneficial in human daily life.