LoRaWAN Technology in Irrigation Channels in Batu Indonesia

Received November 17, 2021 Revised January 15, 2022 Accepted February 01, 2022 Currently, agricultural technology or Farming development is increasingly sophisticated by applying LoRaWAN-based IoT technology, ignoring quality agricultural products. LoRaWAN used in this research uses Long-Range Frequency 915 MHz and 920 MHz. The case study in this research is a case of river water quality that enters agricultural land or irrigation in Temas, Batu City, where the river water has been contaminated by household waste. The prototype installed on this farm uses an Arduino and Dragino LoRa 915 MHz microcontroller as transceivers and input and output devices consisting of ultrasonic sensors and water pH sensors, and outputs such as Solenoid valves mounted on tub one and tub 2. In contrast, tub 3 is a unique tub for distributing water to agricultural land with normal water pH quality. In this research, realtime monitoring, especially on the conditions of water turbidity, water pH, and water level.


INTRODUCTION
Modern farming works not only on agricultural land with large areas such as rice fields or gardens but also on hydroponics type crops or small land farming with the help of water. In this study, two things become the focus of research or research, i.e., regulating the pH of water in agricultural irrigation channels and plants with a hydroponics pattern. Both will be discussed in this research. In the two types of agriculture above, both use water pH control, so water pH will be a topic that needs to be discussed in detail in this research. Normal water pH is 6.5-7.5, equal to the soil pH value. There are two types of water pH, namely alkaline pH (>7.5) and acidic pH (<6.5). Moreover, this water pH value is entered into a computer program on the Arduino IDE Microcontroller, which is combined into one of the output determinants, e.g., the Solenoid Valve.
Furthermore, the agricultural land used is in the Batu area, East Java, located in a mountainous area, with a large intake of mountain water and springs that are clear and free from pollution, unlike urban areas. However, the pH of the water is still influenced by the flow of water before entering the agricultural area, namely the flow of river water that passes through the residential areas there. The Solenoid valve is used as a water regulator that can flow or close at the output. Here, the Solenoid valve is one of the output devices from the microcontroller with pH water and ultrasonic sensor input.
Moreover, all outputs that are displayed in real-time must pass through an Application Programming Interface (API) process found on the Application Server. Furthermore, the Application Server used uses the Thingspeak App from MathWorks.inc., and TTN (The Things Network), devices that can connect to IoT [6].
The contribution of this research is to assist farmers in producing higher quality outputs or harvests, such as the size of shallots, garlic, and leaf width of pakcoy, which affect the quality of sales, consumers, and higher prices. This can be realized from watering arrangements monitoring the quality of water pH, soil pH, and soil moisture which are monitored automatically using devices based on microcontrollers and the Internet of Things (IoT). The next contribution is to provide LoRaWAN analysis results that are specific to Agricultural. Accordingly, the ability of LoRaWAN as a transceiver is low Bit Rate (bps) with a long-range, with an obstacle (3 km) and Line of Sight (LoS) reaching 15 km to get LoRa Gateway and this analysis is used by Lora analyzer to measure LoRa signal strength more specifically. Fig. 1 is Communication between LoRa End Node LoRa Gateway [7], MQTT Server, and an IoT-based LoRa [8] [9][10] [11] [12][13] [14]. The device in question is the End node or Easy LoRa Node, which then communicates with the LoRa Gateway using a specific LoRa Radio Frequency (RF) module [15][16] [17][18] [19], e.g., 915 MHz or 920 MHz which the author has tested. While the Gateway used is the Dragino LG01-P Gateway. The function of LG01-P is to receive all data sent by the LoRa End-node [18], which will be continued to the Network Server or users using 3G/4G/Ethernet/Wi-Fi included in the Network Server Application Server as a viewer of Real-time data. Accordingly, LoRa sends a minimal Bit Rate, which is 125 kbps. It is not possible to send photos or videos.

METHOD 2.1. LoRa Architecture Concept and Method
Moreover, no less important is the MQTT (Message Queuing Telemetry Transport) Server, which is a simple method of transmitting data when communicating with IoT devices and Application Servers or Internet Servers. The terms used are Uplink and Downlink. Uplink is a method used to upload to the internet data read in real-time. In contrast, Downlink is used to request back server data that can be displayed on the computer in real-time before. Moreover, MQTT or MQTT Broker works in the Publish, Subscribe process. The Publish process is carried out if MQTT Broker moves the sensor output from the end-node in this case, using the example of a thermometer. After MQTT Broker gets real-time data from end-nodes, this step continues on MQTT Publish, and devices used when sending end-node data to Computers or Mobile Devices as end-users; moreover, subscriptions is a reciprocal process from end-users to MQTT Broker. In some research, IoT is also referred to as ACK (Acknowledge) in communication between end-devices and MQTT Brokers and End Users. Fig. 2(a) and Fig. 2(b) are the agricultural irrigation methods that farmers currently make; this irrigation is still conventional from year to year; indeed, this method continues to provide stable yields of shallots and garlic until now. When the dry season arrives, the curvature of the soil on irrigation can still store water well and make a simple fish pond. The water reservoir under the mound provides nutrients to the soil, and the plants are grown on it. But in today's era, many modern methods are offered for agriculture that doesn't take up space, such as using Hydroponics. Hydroponics is a type of agriculture that uses narrow land and does not use soil, only water. And in Hydroponic, a good nutrient is needed to grow healthy plants. Hydroponics can grow water, spinach, Pakcoy, spinach, and plants living in the water.

Irrigation, Agriculture Design and ADR Method
Several connected devices are used in automatic irrigation or irrigation, including Arduino microcontroller, LoRa 915 MHz shield, pH water, turbidity sensor, Soil pH, soil Moisture, ultrasonic sensor, and Solar Cell, and Solenoid valve, as well as other supporting devices. These components are integrated to get an automatic system based on a microcontroller with LoRa telecommunication tools. LoRa 915 MHz, which is compatible with Arduino boards, will facilitate connectivity and data transmission with a small bit rate (125 kbps maximum data) to the LoRa Gateway; the rest will be sent to the Thingspeak or TTN Application Server. Ultimately can be seen in Fig. 3    Soil pH and Soil moisture are two crucial input system components, and their function is to provide specific data on soil conditions and water conditions flowing into agricultural land. Suppose the soil moisture data shows dry soil. In that case, it can automatically provide feedback to the solenoid valve to open and drain water to the ground, similarly to the pH water sensor. It will provide feedback in the form of opening an acidic pH and alkaline pH tub that is ready to provide nutrients to the water so that the water returns to its normal pH position (6.5-7), which will provide good nutrition to plants in full can be seen in Fig. 5.
Furthermore, regarding the Algorithm or mechanism, it is essential for sending sensor data. This is because not only one sensor point placed, but many points, at least 10 points, will be sent to provide specific data at each point. So the right mechanism is the Adaptive Data Rate (ADR) mechanism; ADR is used to reduce packet loss and increase or stabilize throughput. Fig. 6 is a collection of tools integrated into automatic irrigation; this is one of the modern techniques, by combining energy harvesting from the sun, namely solar cells, converted to energy with smaller currents, namely 9-12 volt DC batteries. Which then provides power to each microcontroller without any electrical assistance at all. Then provide information from LoRa transceiver to internet without AC electricity connection. This is due to the location or location of the rice fields, which are far from electrical installations.

Fig. 6. Design of Automatic Irrigation
Meanwhile, the water in the irrigation basin is taken from a flowing river but is also equipped with a sensor that provides feedback to the solenoid valve to open and close the water valve from distance sensor data or ultrasonic sensor. The task of the ultrasonic sensor here is to provide information that the water is full and please close the solenoid valve automatically to let the water flow again, so the principle of taking water is based on ultrasonic sensor data regarding the volume of water that has reached the limit of the tub. Fig. 7  . This design is made like a pole with a height of 1-2 meters, with an Omni antenna type that can transmit data or beams in all directions; LoRa's ability to transmit electromagnetic signals is as far as 1 km -15 km. with a note, that there are no obstacles. Obstacles that exist include trees, buildings, bad weather (heavy rain, fog). Attenuation due to bad weather is shown in the results and analysis chapter.   Fig. 8 shows the LoRa Master-Slave method, this type of method has a drawback, namely MIMO does not work well, which only has Multiple outputs, but for Multiple inputs, this does not happen. Multiple inputs in question are the number of receivers available to serve the number of transmitters that send data at once at a certain time. Therefore, the development of ADR can be seen in Fig. 9. Fig. 9 shows the minimized MIMO concept that occurs. However, the number of receivers is still not as many as transmitters. This is called the Adaptive Data Rate (ADR) strategy because having at least 2 or 3 receivers is better than just one receiver, which causes a data bottleneck that causes a significant packet loss.   Table 1 is the specification of LoRa, which is essential which determine LoRa's ability to transmit data. The spreading Factor in LoRa is 7-12 with a bandwidth of 125 kHz. And only 1 uses a bandwidth (BW) of 250 kHz, with a spreading factor of 7 and a bit rate of 11 kbps. Spreading Factor talks about the distance from Transmitter (Tx) to Receiver (Rx). The faster the transmitting distance of radio waves from Tx to Rx, the throughput is greater than the farther Tx and Rx. This is due to attenuation, we can see in table 1 with Spreading Factor 7 with 250 kHz BW with Bit Rate 11 kbps and Spreading Factor ( ) 12 with BW 250 bps, this is a significant difference. While Fig. 10 is one of the basics of and the energy expended, when viewed from the Bitrate, the farther the distance, the Bitrate decreases, and energy or Time on Air ( ) increases.  (14) is an important formula used by LoRa to determine LoRa's Quality of Service (QoS) when the testbed is real in the field or simulated. Many LoRa simulations currently use OMNET++ with fLORA and MatLab with CSS (Chrips Spread Spectrum) analysis. However, the equations (1)- (14) are needed for the analysis needs, e.g., in determining ToA, SNR (-dB), CR, SF, Rs, Rc, and RSSI (-dBm).  Fig. 12 shows the Connectivity of the Solenoid valve, Arduino Mega, six-channel relay, and DC motor. In Fig. 11, the Turbidity sensor is used to detect the level of water turbidity. In the system being built, if the level of turbidity of the water is high, then the water cannot flow to the next tub. Therefore, it can be added to absorb water turbidity factors such as rocks and alum. Furthermore, in Fig. 12, the solenoid valve opens and closes the water faucet that will flow into the next tub. This solenoid valve provides acid and base if the water conditions are classified as acidic or alkaline. Fig. 13. is Automatic control of watering on plants.

RESULTS AND DISCUSSION
ADC Sensor and output voltage are sensor outputs from sensors that show changes in the volume of water, specifically shown in Fig. 14, Fig. 15, and Fig. 16. The higher the ADC Sensor, the higher the output voltage (volt DC). Another instrumentation is shown in Fig. 15, where the scale decreases as the ADC Sensor 1000 increases, and the scale decreases to 2 from a scale range of 2-10. Next, in Fig. 16, the ADC sensor decreases with increasing water volume (ml); e.g., the ADC sensor shows a decrease from ADC 1000 to 200.  Fig. 18 are a comparison between the DHT11 sensor and the thermometer at midday and night; it can be seen that there is no significant difference between the DHT11 and the thermometer. But in general, the temperature at night is cooler than the temperature during the day. Therefore, the temperature during the day ranges from 30-35 degrees Celsius, and the temperature at night ranges from 22-23 degrees Celsius. Fig. 17. Comparison of DHT11 sensor and Thermometer at midday Fig. 19, Fig. 20, and Fig. 21 are the output of the Thingspeak Application Server of all sensors used in this research. Sensors include pH sensors, temperature (DHT11) sensors, Humidity sensors, and other sensors connected to this system or analysis. Furthermore, Fig. 22 is a Real-time Temperature Indicator, Humidity Indicator, and pH [25] Indicator in the form of a temperature indicator using color, so it can be seen that if the color shows red, it means high temperature; otherwise, if it is green, it means low temperature.
Furthermore, Fig. 23 is the analyzer result if there is LoRa data transmitting, then the signal shows an oscillation or increase in amplitude at the centerline analyzer in Fig. 23 (c); otherwise, if there is no LoRa data transmitting, then there is no signal like Fig. 23(b), while Fig. 23(a) and Fig. 23(c) are the same because both LoRa signals are detected. The greater the ToA or, the greater the SF or, the greater the energy or, the farther the distance between Tx and Rx, the weaker the signal will mean (-dB the greater the value).    (c) Fig. 23. (a, b, c) Realtime monitoring from LoRa signal analyzer Furthermore, Fig. 24 is the LoRa Receive Signal Strength Indicator (-dBm) at a certain distance, represented in 1 meter. It can experience attenuation if the distance is added. In Fig. 24, the best value is shown in the RSSI on analyzer 2, which is -34 dBm to -36 dBm; this is a good result meaning it has excellent signal strength, which may also decrease if the distance of the transceivers moves away from each other; furthermore, Fig. 25 is an example of a decrease in the Receive Signal Ratio (%) if the distance increases, the signal-noise ratio (%) decreases, at a distance of 1 km. Without obstacles reached 93.945%.   Fig. 26. It is the Attenuation LoRa signal on the heavy rain. LoRa signal decreased to -140 dBm. It was initially around -65 dBm to -70 dBm at a distance of 1 m to 100 meters. And at a distance of 1 km, it reaches -140 dBm in heavy rain conditions, while drizzle and normal conditions are not too significant at a distance of 1 km is -120 dBm.

CONCLUSION
All sensors work well; for example, the temperature sensor with temperature test equipment has been functioning and compared well with minimal errors. The test shows the temperature during the day ranges from 30-35 degrees Celsius, and the temperature at night ranges from 22-23 degrees Celsius. Next, sensor testing by looking at ADC Sensor values has shown specific changes. In addition, in LoRa signal testing, it can be seen that the resulting signal can be analyzed explicitly using Textronix's LoRa Signal Analyzer and shows a decrease in the Receive Signal Ratio (%). If the distance increases, the signal-noise ratio (%) decreases at a distance of 1 km. Without obstacles reached 93.945%-the Attenuation LoRa signal on the heavy rain. LoRa signal dropped to -140 dBm. It was initially around -65 dBm to -70 dBm at a distance of 1 m to 100 meters. And at a distance of 1 km, it reaches -140 dBm in heavy rain conditions, while drizzle and normal conditions