Fuzzy System of Irrigation Applied to the Growth of Habanero Pepper (Capsicum chinense Jacq.) under Protected Conditions in Yucatan, Mexico

Agriculture is the largest user of water worldwide by using about 70 percent of total consumption. The world food production depends on the availability of water, considering factors such as demographic and climate change, so the use of efficient irrigation is necessary to apply the correct amount of water to crops. The traditional irrigation systems generally program their scheme based on measurements made at Class A evaporimeter pan. In this paper an irrigation scheme defined by an algorithm that automates the amount of water supplied is presented, it considers the consumption of habanero pepper crop, and a fuzzy system evaluates the necessary duration of irrigation. The climatic variables considered are temperature, relative humidity, and soil moisture. The algorithm was programmed in a microcontroller Atmel 328p included in Arduino platform, with the addition of a ZigBee wireless system that allows for monitoring through a PC. The climatic variables were inserted into the fuzzy system by sets of trapezoidal and triangular form and a Mamdani type inference mechanism in which the knowledge of an expert is registered through the fuzzy rules. The system was applied to a habanero pepper crop at Conkal Institute of Technology in Yucatan, Mexico.


Introduction
Mexico ranks second in volume production of chili peppers and third in area harvested with 2379736 tons and 136132 ha, respectively, engaged with the 7.1% area and 7.6% ton of world production [1]. The fruits of this plant are of great economic importance because there is a wide variety of applications; there is an excellent source of natural dyes, minerals, and vitamins A, C, and E; the mainly substance that is extracted from this crop is capsaicin whose concentration is very high in the variety known as habanero. There are several regions in Mexico who grow habanero pepper [2]; however, more than 50% of production for domestic and export markets comes from the Yucatan Peninsula, which has provided support for obtaining distinctive "appellation of origin" published in the Official Gazette of the Mexican Federation on June 4, 2010. For production even outside station protected cultivation techniques are used, and the most commonly used structures in protected agriculture are greenhouses, shade mesh, high, and low tunnels. The shadow mesh structure mentioned above is a simple and inexpensive alternative, although very low technology [3].
Environmental variables have, by nature, a complex and nonlinear dynamic. Therefore the information processing 2 International Journal of Distributed Sensor Networks solutions are required, based on advanced techniques and technologies, to provide a better result in the production of food [4]. In this context, the use of soft computing techniques (such as neural networks, genetic algorithms, and fuzzy logic) has been considered as real solutions to problems related to the effective management of agricultural resources [5]. One such resource is hydric, characterized by irrigation systems and affecting plant growth and hence production. Due to the above, there are proposals that enable automation and control to carry out this process in the best way [6,7]. These methods adjust the amount of water supplied according to crop water requirements, the amount of water available in the channel and system components. In systems that use drip irrigation such information has not been considered, because the amount of water is controlled in a certain manner [8]. However, the frequency of irrigation drip systems still depends on climatic factors, soil type, and crop type, so that the control and close monitoring remains necessary in these systems [9][10][11]. The application of soft computing techniques has been observed in work processes involving environmental control [4,5], weed control, pest and biological processes [12], and greenhouse climate control [9,13].
The work presented in [14] is a simulator that aims to provide a model of irrigation scheduling considering different times and different distributions of water in sensitive plant species lack thereof. Project development provides the biophysical modeling, technical and decision subsystems. Time schedule irrigation is carried out considering the water shortage, the amount of available soil water for lawn and plant composition. The limitation of this study is that it is a simulated process and not done in a real environment.
The work in [15] shows an irrigation system used for ornamental plants of different types calculating irrigation from soil type. This work uses: crop coefficient information, the type of soil cultivation, wind speed, solar radiation, temperature, relative humidity, and rainfall level, obtained from a weather station and other measuring devices purchased for that purpose. An important limitation is the use of expensive measuring instruments, applied to field crops, to which most farmers do not have an access.
The work in [16] integrates fuzzy logic and neural networks in a network of sensors in precision irrigation scheme. This is a work in software, which simulates the behavior of irrigation scheduling and is expected to have favorable results in manual application. One drawback is that it proposes the use of precision irrigation equipment (little affordable in most of the time for a producer) to obtain information in a real environment. Blurring the crop is also observed, although some environmental variables needed for irrigation control, such as humidity and temperature which are integrated variables and factors inherent at the crop, are ignored.
In this study, the development of a smart irrigation system based on microclimate variables such as temperature and relative humidity in a shadow mesh structure is proposed. This system is designed to improve irrigation scheme for habanero pepper (Capsicum chinense Jacq.) using the fewest number of variables and taking advantage of expert knowledge. A relevant aspect of this proposal is the possibility  of implementation in crops where farmers do not have sufficient financial resources and therefore less access to the technification.

Materials and Methods
This work was carried out in a metal covered roof infrastructure with milky white plastic with 50% and side walls, front and back with mesh antiaphids, in an area of 482. 4 [17], is the Awo ( ) ( ) type. In the shade house, when the seedlings had about 10 cm tall, they were transplanted in containers with compost.
For the growing crop, two irrigation schemes were employed, a traditional scheme and a fuzzy scheme ( Figure 1).
Traditional irrigation scheme was performed using the following criteria: (1) obtaining data through an Class A evaporation pan, (2) applying data crop coefficient ( ) for habanero pepper (Tables 1(a) and 1(b)),  On the other hand, fuzzy irrigation schema is proposed. The proposed system consists of four sections, first, measuring and estimating the volume of water lost, subsequently, measuring level categorization through measuring the relative humidity and temperature, further, the integration of the communication system, and finally, a fuzzy mechanism for the estimation of irrigation.

Measuring and Estimating the Volume of Water.
The soil used was characterized to obtain the parameters of Table 2, to identify the moisture levels percentage. With these properties field capacity is obtained, which is the volume of water that is capable of retaining the soil of 1.4 MLCM −2 . Once known field capacity, using traditional irrigation scheme, a volume between 70% and 80% range is chosen to make growing Habanero pepper develop properly.
The proposed system can be integrated into an algorithm ( Figure 2 and Algorithm 1).
To measure the volume the VH400-2M sensor is used. This element provides a signal from 0 to 3 V in accordance with soil moisture. It can be seen that the useful limits of the sensor are 50% ( Figure 3).
The interpolation of the measured data results in Equation (1) can be simplified for the range of interest, in order to reduce processing time, as indicated in the sensor data sheet, resulting in the linear relation (2). This equation is used to convert the voltage in a soil moisture value: In this way, with this sensor, the estimated lost soil moisture is obtained.

Measurement of Relative Humidity and Temperature.
The measurement of relative humidity and temperature is performed by a sensor DHT11. This sensor is characterized by the calibrated digital signal. It consists of two resistive sensors  (NTC and humidity) and a small 8-bit microcontroller. It can measure the humidity in the range 20%, approximately 95% and the temperature range between 0 ∘ C and 50 ∘ C. Protocol uses 1-wire communication, and the size is small and has low power consumption and the ability to transmit the signal up to 20 meters away.

Fuzzy Rules.
A model for the climate behavior is too complex and the uncertainty is always present so the use of the fuzzy system in order to program an irrigation scheme is proposed. The fuzzy system uses the expert knowledge in form of rules to control the aperture time of the valve and therefor the water supplied. The knowledge base from the expert provides the information necessary to perform the design of the irrigation program sequence, as well as the generation of the rules that are part of the fuzzy inference mechanism (see Table 3). The proposed model employs Mamdani fuzzy mechanism described with MISO type fuzzy rules shown on the system equation International Journal of Distributed Sensor Networks where , 2 , . . . , and for , represent the corresponding linguistic values [18]. The processing block consists of a hardware Arduino microcontroller which is the Atmel 328p, where the irrigation program established by the fuzzy rules is stored.

Fuzzy Sets.
The linguistic variables to form the fuzzy sets are as follows.
(i) Temperature. Due to the warm air in the shadow house infrastructure is retained, and an important consideration in the cultivation under protected conditions is the temperature factor, because it favors the evaporation of water and has an important impact in the crop. The low technification of this structure only can provide air movement through the roof doors or the antiaphid mesh around of him.
(ii) Relative Humidity. The humidity factor has great influence on the crop. Excess moisture in habanero pepper plants affects its development, so it should not be given water to the crop when the humidity is high; however, when the humidity decreases, it is necessary to supply water to the plant.
(iii) Stages of the Crop. Growth stages ( ) influence the development of the plant, especially considering that the habanero pepper is a plant that requires large amounts of water, which ultimately affects the quality of the fruit. This is an important factor for the habanero pepper because, to obtain designation of origin, you must have certain characteristics of the fruit at harvest.  part of the linguistic rang (5), and function, right part of the linguistic range (6): The membership function is created with expert knowledge and adopts a graphic form determined according to the type of value associated with the fuzzy set. The and Gamma functions correspond to the membership functions, which are used to calculate extreme fuzzy values. Therefore, the function is defined by The graphic form of the linguistic variables, defined by the last equations, is shown in Figures 4, 5, 6, and 7.

Inference Mechanism.
The inference mechanism has two basic tasks, determines the relevance and extent of each rule in relation to the current entries ( ), and generates the corresponding conclusions. The combination of the sets of rules with inputs can be calculated as follows: . . .
( ) = ( ) * ̂fuz ( ) . 6 International Journal of Distributed Sensor Networks The result is a set with the "fired" rules. To obtain a crisp value that can be applied to the valve, it will be necessary to calculate the center of the graph, and this can be done by

Data Acquisition
System. The proposed communication system includes a basic structure that can be used in agricultural environments, and this proposal aims to organize the sections of a sensor network and facilitates the selection of technologies required to implement the ZigBee network. The communication system uses IEEE802.15.4 protocol (ZigBee), which was implemented on an Arduino board with XBee Pro module of Maxtream, configured with a PAN ID 3332, a rate of 9600 baud, 8 data bits, and no parity (see Figure 8). The structure presented is divided into two sections, an internal, for data collection (sensor network), and an external, that can send information to central computers to store and/or process information. The internal section is composed of elements that collect information from the agricultural parameters of interest, such as temperature, relative humidity, and soil moisture (sensors), the data collected will be sent to devices for processing through the ZigBee protocol, which  is used for transmission (end devices). The internal section can be implemented through Arduino boards with Xbee modules. In the transmission of information, the router node will receive the information of the end devices and will be transmitted to the coordinator for central processing, in order to be able to connect to a larger network. The external section is composed of central processing devices sending data to remote nodes via Ethernet, WiFi, mobile devices, or other means that can send information to other locations as shown in Figure 9.
The data acquisition is made with a Duemilanova Arduino, and this platform is programed for a sampling rate of 5 minutes. Each value from the corresponding sensor has an header for identification, as shown in Algorithm 2. These data are linked with the Xbee devices for the transmission to the other Xbee configured like a coordinator.
To get data from the serial port that the Xbee Shield (Coordinator) is sending, we program methods as can be seen in Algorithm 3, and the header of each data frame is defined so that it recognizes and takes the indicated action for storage at the database every time that receives data (Algorithm 4).

Results and Discussion
The behavior of   the results of calculations performed for the water loss by evapotranspiration reference (Eto), as shown in the work of Pérez-Gutiérrez et al. [19]. The comparison between fuzzy systems of irrigation and traditional irrigation was performed to validate the data obtained. The Etc shows values that are in an interval of 3 mm⋅day −1 (Figure 10). This range is stable for all the harvest period, if variations of the Etc were more spacious and then should take into account a greater number of variables therefore; by maintaining a controlled environment with the use of the shadow house, we can use a small number of sensors, and in this proposal the use of three of them is enough to estimate the irrigation.
The system showed a deviation of +0.11% in March, −0.39% in April, and +0.51% in May (Figures 11, 12, and  13). The supplied volume by the fuzzy system is compared with the calculated volume, resulting in a small deviation; therefore, we can establish the reliability of the system. With the fuzzy system validated, the analysis of the data for each month can be made. As part of the validation sample March 20 is shown. In Figure 14, the frequency of irrigation during the day is graphed.
According to the data obtained with respect to the frequency of irrigation, Figure 14 shows that the frequency of irrigation is higher in the time period between 10:30 and 13:00; in this period, we can observe an increase trend in the temperature ( Figure 15) and a low relative humidity (Figure 16), indicating a water accumulation in the soil; therefore, a balance between evapotranspiration and the water applied to the crop is generated.   These results establish the reliability of the proposed system to provide adequate water and maintain optimum moisture level with low relative humidity, to obtain the desirable quality of hbanero pepper production.
In the work of Ortiz et al. [20], the percentage of optimum soil moisture for growing good quality fruits is 60%; the fuzzy system employs the percentage of 70% indicated by the expert so that it is possible to also set the reliability in the final quality of the fruit. The work presented by Pérez-Gutiérrez et al. [19] mentioned that the volume of water applied to 80% of potential evapotranspiration generates the amount of water in the soil to favor a constant process of transpiration, fruit yield, and improvement of water use; this requires a water volume 2223 m 3 ha −1 ; however, the fuzzy system only requires 449.95 m 3 ha −1 , which represents a saving of 79.8% water.
The proposed system is a better form to schedule irrigation; unlike Yao et al. [16], the objective is to give to the poor communities a form to harvest a high demand product like habanero pepper (with designation of origin) with enough technologic structure. The work of Yao et al. [16] is using a neural network to refine the sprinkle time based on a pattern that is not described in the paper; in a real environment especially in Yucatan, Mexico, the humidity and temperature variables have to be considered, to obtain a quality product   and, unlike the work of Yao et al. [16], in this work are taken into account in the fuzzy model and in the expert knowledge. The use of a neural network is not a significant contribution for managing the time of irrigation on a shadow house because there are no other important variables included, and in the Yao et al. [16] proposal only the soil moisture and the error are considered to set the irrigation time.

Conclusions
This paper has presented a fuzzy system that manages a wireless irrigation scheme through an algorithm that takes into account the conditions of microclimate of a shadow house used for growing habanero pepper with designation of origin in the state of Yucatan. The water volume consumed, float h = dht.readHumidity( ); float t = dht.readTemperature(); // revisa si retorna un valor valido, de lo //contrario hay un error if (isnan (t) || isnan (h)) ( Serial.println ("Failed to read from DHT"); ) else ( String hume = "Humedad: "; Serial.println (hume + h + "% de Humedad"); String tempe = "Temperatura: "; Serial.println (tempe + t +" Grados Centrigrados "); ) Algorithm 2: Section of the Arduino code. according to the graphic that shows the comparison between the volume of water from the system and the manual or traditional volume, gives us a difference of 79.8% over the best result shown in Pérez-Gutiérrez et al. [19], which shows that the system can efficiently manage water and that incorporation of the expert knowledge in fuzzy rules allows irrigation scheme without using the pan evaporation or calculating the volume associated with irrigation, as they can be automatically supplied without the crop being adversely affected in its development. Saving water is about 152482.3 m 3 for a crop of 1000 plants in an 85-day cycle, causing transplantation at the 30th day. The microclimate conditions generated by the infrastructure of shadow house are not exploited by the lack of modernization, that is, a producer who does not have the ability to use technology to irrigate their crops, generally only considered during the morning or afternoon, which does not guarantee the product quality, since plants could fall in either water stress or excess moisture. However, the proposed system allows for irrigation supply data from three common sensors (temperature, relative humidity, and soil moisture), allowing similarly for reducing infrastructure costs.