The application of pesticides and fertilizers in agricultural areas is of prime importance for crop yi elds. The use of aircraftsis becoming increasingly common in carrying out this task mainly because of its speed and effectiveness in the spraying operation. However, some factors may reduce the yield, oreven cause damage (e.g. crop areas not covered in the spraying process, overlapping spraying of crop areas, applying pesticide son the outer edge of the crop). Climatic condition,such as the intensity and direction of the wind while spraying add further complexity to the control problem.In this paper,we describe an architecture based on unmanned aerial vehicles(UAVs) which can be employed to implement a control loop for agricultural applications where UAVs are responsible for spraying chemicals on crops. The process of applying the chemicals is controlled by means of the feedback obtained from the wireless sensor network (WSN) deployed on the crop field.The aim of this solution is to support short delay sin the control loop so that the spraying UAV can process the information on from the sensors. We evaluate an algorithm to adjust the UAV route under changes in wind intensity and direction. Moreover, we evaluate the impact of the number of communication messages between the UAV and minimize the waste of pesticides.