AUTOMATIC NOZZLE CONTROL SYSTEM WITH ULTRASONIC SENSOR FOR ORCHARD SPRAYERS

Spraying fruit trees with orchard sprayers cause some limitations, as well as problems such as wasting the drugs by spraying spaces among the trees, especially in some cases where the distance among the trees are high. Accordingly, overmuch drugs are used, and harmful substances are added to the soil. Moreover, pesticide ruins that pass from the soil cause health problems. Consequently, production costs increase and correspondingly, efficiency decreases. In this experimental study, ultrasonic sensors are placed on the right and left surfaces of the machine facing the tree. The pesticides are sprayed as long as an object is detected within a certain distance with the help of these sensors. Spraying is automatically stopped when the object is not detected. The developed system consists of an electronic control unit, solenoid valves and ultrasonic sensors, controlled by a microcontroller. High rates of savings are achieved in pesticide consumption and the addition of harmful substances to the soil is prevented thanks to this automatic control system. Solid structure enables practical mounting on existing manually controlled sprayers.

internet applications, efficiency has increased while costs have been reduced [3]. Furthermore, low cost automatic control systems, tracking systems, and management systems have become more common.
Spraying is used as a common solution in order to increase yields and obtain higher quality products in nurseries and gardens. Also, it has an important effect on fruit disease and pest control, is an essential part of orchard applications [4]. Tree shapes and sizes differ significantly by time and region. These differences require that the amount, speed, and direction of the pesticide sprayed be adjusted specifically for each zone. As a result of these adjustments not being made specifically to the region, they caused serious pollution in the environment and excessive pesticide residue threatening the safety of agricultural products [5,6].
To increase efficiency in spraying, it is necessary to identify the tree using sensor technologies, and then apply the appropriate amount of material [7,8]. Ultrasonic sensors are widely used in automatic spray systems due to their economical convenience and ease of use [9]. In the literature; He et al. developed a system that converts a continuous spraying system into an automatic sprayer using infrared sensing technology. In apple orchards, this system can save range of 50% -75% pesticides [10]. Esau et al. using four cameras, designed a variable spraying system through image processing, detecting diseases in blueberry leaves. Solanelles et al. using ultrasonic sensors and proportional solenoid valves, he designed an electronic control system prototype for a variable rate sprayer based on tree width [11,12]. Zhai et al. to detect the tree profile in real-time, installed a platform using an ultrasonic sensor. The experiments carried out showed 92.8% measurement accuracy for normal tree canopy and 90.0% for cherry tree canopy [13]. Jeon et al. developed a real-time, variable speed sprayer that automatically adjusts spray outputs according to the canopy size using ultrasonic sensors at 20 Hz detection frequency and the proportional solenoid valve [8,14]. Zaman and Salyani measured the canopy of trees using ultrasonic sensors. It was observed that there was 82.63% -128.71% difference between the measurements made with the developed system and manual measurements [15]. Gil et al. developed an orchard sprayer supplemented with airflow using ultrasonic sensors [16,17]. Moltó et al. used three ultrasonic sensors to determine geometric properties in citrus fruit trees. This application allowed the spraying to be applied at three different flow rates according to a canopy width measurement with an ultrasonic sensor [18]. Llorens et al. by applying the variable rate method, they has achieved 58% savings in pesticide consumption and obtained better spraying efficiency in leaves compared to air blower orchard sprayer [19]. Tumbo et al. used ultrasonic sensors to estimate the most necessary geometrical parameters of trees and compared these with manual measurements [20]. It is observed that many different types of sensors have been preferred, especially infrared (IR) sensors, Light Detection and Ranging (LIDAR) sensors and ultrasonic sensors from the previous studies. However, a couple of limitations were found, such as the need for a computer to run a LIDAR sensor and poor performance of IR sensors [21].
In this study, it is aimed to prevent health problems and financial losses that occur when orchard sprayers continuously spray. An economical and versatile electronic control system that provides automatic control of the orchard sprayers has been developed to prevent pesticide residues from falling into the soil. Thanks to this control system, the cost of spraying decreases, efficiency, and quality increases. Ultrasonic sensors are used to detect the trees to be sprayed in the developed system. These sensors and the rest of the system are managed with a microcontroller. Thus, it provides a great economic advantage with a reasonable price, and also overcome the issues caused by the hardware crowd.

Orchard Sprayers
Many different sizes of garden sprayers with various features are produced. The primary purpose of these machines is to spray the pesticide stored in a tank into the trees [22].

Figure 1. Orchard sprayer components
System components of orchard sprayers are shown in Figure 1. The pesticide is filled into a tank. Afterward, the filled pesticide is transferred to the filter. Then, residues and foreign substances in the pesticide are filtered in the filter. After passing through the filter, the pesticide is transferred to the pump, which is powered by the tail shaft and provides the necessary pressure for the spraying process. A pressure regulator is then used to control the pressure in the system. This regulator lowers the high pressure by sending some of the pesticides back to the tank, and thus it can control the pressure. A pressure gauge is installed at the outlet of the pressure regulator so that the operator can monitor the system pressure. The pesticide coming out of the pressure regulator comes to the unit where the control valves are located. The valves are opened and closed to deliver the pesticide to the desired nozzles. Reaching the nozzles with high pressure, the pesticide is sprayed homogeneously. A high-power fan is installed behind the nozzles. It is ensured that the sprayed pesticide is delivered to more distant places thanks to airflow caused by the fan. Eventually, pesticide loss that falls to the soil before it reaches the tree is prevented.

Automatic Nozzle Control System
In orchard spraying machines, the spraying process continues without interruption since the operator starts spraying. This situation causes extra pesticide consumption in the gardens where there is a large space between trees. To prevent this, the automatic nozzle control system has been developed. The system can control four zones as right down and up or left down and up. The developed system consists of four ultrasonic sensors, four 3-ways solenoid valves, and a motherboard. It can be attached to newly produced spray machines, or it can be easily integrated into the sprayers that are already in use.  The pesticide, whose pressure is increased with the pump, should be discharged to the tank when it is not transferred to the nozzles, that is when the spraying is stopped. Otherwise, system pressure will increase excessively and will cause damage to some parts, especially the pump. Therefore, a 3-way valve was used to control the spraying. The pesticide entering the valve will either be transferred to the nozzles or discharged back to the tank. However, the use of 3-way solenoid valves is not common and healthy. Alternatively, a "T" connection was designed as shown in Figure 4 using two solenoid valves, one normally open and the other normally closed.

Ultrasonic Sensor
There are two basic criteria that make it reasonable to prefer ultrasonic sensors among the other options. The first criteria is the sensing distance; an ultrasonic sensor is expected to accurately measure the distance from the object in front of it. The second criteria is the view angle; ultrasonic sensors have a cone-shaped sensing area as they send sound waves and follow the rotating sound signals. Sensors with a wide view angle cannot detect small objects because they will scan a wide area. This condition may create a major problem for users. Therefore, a good ultrasonic sensor is expected to have a narrow viewing angle [23].
There is no such thing as the distance determination of the ultrasonic sensors that are intended to be used for orchard sprayers. It is sufficient to detect whether there is a tree within a certain distance. Since the objects to be perceived are trees, there is no need for a narrow view angle. Any industrial grade ultrasonic sensor with an IP68 certificate can be used in orchard sprayers. This provides a significant advantage in terms of cost.
Ultrasonic sensor with the code "JSN-SR04T" is preferred in the developed system [24].  The probe and board of the ultrasonic sensor are housed in a box with mounting stand with IP68 certification. In this way, it is ensured that the sensor is protected from external factors, and it is possible to position it anywhere on the machine regardless of the motherboard.

Mainboard
The PCB is prepared in a laboratory environment. PIC18F45K80 microcontroller produced by Microchip, which is capable of reading four ultrasonic sensors simultaneously [25]. This microcontroller has four external interrupts. This makes it possible to read the echo signals from each sensor.
N-channel MOSFET is used to drive solenoid valves. These MOSFETs can be driven with logic level. In this way, there is no need for any driver IC. It also has a maximum operating voltage of 100V and a continuous drain current of 42A.
A dip switch is preferred to use it manually when necessary. Thus, the nozzles can be opened and closed independently of the sensors with this switch.

Results and Conclusions
In this study, a management system has been developed for automatic control of nozzles in orchard sprayers. It is aimed to spray agricultural pesticides only on trees using an ultrasonic sensorbased system. The main purpose of this system is not to determine the distance to the target, but to determine if there is any object within a certain distance. The practical use of sensors does not require any external computer as in image processing applications. It is an effective solution in terms of detection performance with a low-cost mechanism. Information from the sensors is interpreted in the PIC18F45K80 microcontroller. Thus, the solenoid valves are driven via logic level MOSFETs. In addition, as the drug consumption will decrease with the developed system, the environment and human health will be protected.
The developed pesticide spraying system is tested and investigated the success of the system in laboratory conditions. While there is an object in its range, the spraying system successfully ejects liquid on it. As soon as the object removes from its range, the spraying system stops immediately ejecting liquid. It has been observed that the developed system detects objects within 5 m distance with high stability. In future studies, the developed system will be installed on a sprayer. In order to determine the decrease in the use of pesticides, the precision spraying system is going to test in practical usage.