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

Authors: Martha Rocio Ceballos; Juan Luis Gorricho; Oscar Palma Gamboa; Mónica Karel Huerta; David Rivas; Mayra Erazo Rodas
Journal: International Journal of Distributed Sensor Networks
 (2015)

---

## Abstract

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.


---

## Body

## 1. 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 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–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.


## 2. 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 m2 (13.4 m × 36 m) in Technological Institute of Conkal, Yucatan, located at Km 16.3 of the Merida-Motul road. Geographical coordinates are 21° 36′ north latitude, 19° 32′ south; 87° 32′ east, 90° 25′ west longitude, at an altitude of 9 meters, according to INEGI Geostatistical Framework (2010). The climate at the experimental site, according to the classification of Köppen modified by Garcia [17], is the Awo (x′) (i′) g 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 (Figure1).Figure 1
Irrigation schemes.Traditional irrigation scheme was performed using the following criteria:(1)
obtaining data through an Class A evaporation pan,(2)
applying data crop coefficient (Kc) for habanero pepper (Tables 1(a) and 1(b)),(3)
calculating crop evapotranspiration (ET),(4)
calculating irrigation depth,(5)
calculating the volume of water to be applied to replace the water lost by evapotranspiration,(6)
calculating irrigation time.Table 1
(a) Crop coefficient for habanero pepper (60%). (b) Crop coefficient for habanero pepper (100%).
(a)
Crop growth (%)
Days after transplanting
K
c
25
30–36
0.80
30
37–42
0.90
35
43–48
0.93
40
49–54
0.95
45
55–60
1.03
50
61–66
1.05
55
67–72
1.05
60
73–78
1.05
(b)
Crop growth (%)
Days after transplanting
K
c
65
79–84
1.03
70
85–90
1.00
75
91–96
0.97
80
97–102
0.90
85
103–108
0.85
90
109–114
0.80
95
115–120
0.70
100
121
0.60ETo calculation (reference evapotranspiration) can be estimated from the Class A evaporation pan. The crop coefficient (Kc) was determined by relating the measured crop evapotranspiration (ETc) with ETo calculated. ET is evapotranspiration (combined loss of water to plant transpiration and soil evaporation). The irrigation depth is calculated to determine the amount of water that must be applied to the soil to satisfy the needs of the crop. The calculation of the volume of water is obtained for estimating evapotranspiration losses and irrigation time is determined by considering the method of irrigation and type of crop.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.


### 2.1. Measuring and Estimating the Volume of Water

The soil used was characterized to obtain the parameters of Table2, 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.Table 2
Soil properties.
Physical properties
Unit
Apparent density
0.93 g·cm−3
Wilting point
17.3%
Field capacity
55.8%
Chemical properties
Unit
Ph
5.88
C.E.
3.85 dSm−1The proposed system can be integrated into an algorithm (Figure2 and Algorithm 1).Algorithm 1:Fuzzy irrigation process pseudocode.
Initial Value for soilMoisture
REPEAT
WHILE soilMoisture > 70%
READ Analog Port Soil Moisture Sensor Value
CALCULATE soilMoisture based on VH400 eq
WAIT 10 minutes
endWHILE
CALL Fuzzy Irrigation Time for Habanero pepper (INPUT: RelativeHumidity, Temperature; OUTPUT: IrrigationTime)
WHILE IrrigationTime > 0
WRITE Digital Value for pump activation
CALCULATE IrrigationTime countdown
endWHILE
WRITE Digital Value for pump deactivate
UNTIL (true)Figure 2
Algorithm that incorporated the fuzzy irrigation process.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% (Figure3).Figure 3
Humidity sensor characterization.The interpolation of the measured data results in(1)V=4.2×10-5HS3-0.0038HS2+0.1265HS+0.0888.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:(2)HS%=26.32V-7.89.In this way, with this sensor, the estimated lost soil moisture is obtained.


### 2.2. 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.


### 2.3. Fuzzy System

#### 2.3.1. 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 Table3).Table 3
Rules of the fuzzy system in the growth stage of the crop.
Temperature
Very few
Few
Medium
High
Very high
Humidity
Very few
Medium
Medium
Long
Long
Very long
Few
Medium
Medium
Medium
Medium
Long
Medium
Short
Short
Short
Short
Medium
High
Very short
Very short
Very short
Very short
Very short
Very high
Very short
Very short
Very short
Very short
Very shortThe proposed model employs Mamdani fuzzy mechanism described with MISO type fuzzy rules shown on the system equation(3)R1:Ifu1isA1j,u2isA2k,…,unisAnltheny1isB1r,Rj:Ifu1isA1j,u2isA2k,…,unisAnlthenyjisBjr,Rm:Ifu1isA1j,u2isA2k,…,unisAnlthenymisBmt,where Aij,A2k,…,Anl and Bjs for Rj, 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.


#### 2.3.2. 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 (Kc) 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.(iv) Irrigation Time. The output of the fuzzy system is the irrigation time and represents the run time in minutes. The frequency of watering time keeps the amount of water needed to avoid crop water stress.In order to convert the linguistic variables on fuzzy numbers, this paper proposes the calculation of intermediate values of the linguistic range through the triangular function (4), while outliers are modeled by the Gamma function, left part of the linguistic rang (5), and L function, right part of the linguistic range (6): (4)μx;a,m,b=max⁡min⁡x-am-a-1,b-xb-m-1,0,(5)μx=0x≤ax-am-a-1x∈a,m1x≥m.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 L and Gamma functions correspond to the membership functions, which are used to calculate extreme fuzzy values. Therefore, the L function is defined by(6)L=1-Gamma.The graphic form of the linguistic variables, defined by the last equations, is shown in Figures 4, 5, 6, and 7.Figure 4
Input sets for the variable stage of development.Figure 5
Input sets for the variable relative humidity.Figure 6
Input sets for the variable temperature.Figure 7
Output sets for the variable irrigation time.


#### 2.3.3. Inference Mechanism

The inference mechanism has two basic tasks, determines the relevance and extent of each rule in relation to the current entries (ui), and generates the corresponding conclusions. The combination of the sets of rules with inputs can be calculated as follows: (7)μA^1ju1=μA1ju1∗μA^1fuzu1μA^2ku2=μA2ku2∗μA^2fuzu2⋮μA^nlun=μAnlun∗μA^nfuzun.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(8)y=∫yμyydy∫yμyydy.


### 2.4. 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 Figure8).Figure 8
Sensor network.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 Figure9.Figure 9
Internal and external sections.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 Algorithm2. These data are linked with the Xbee devices for the transmission to the other Xbee configured like a coordinator.Algorithm 2:Section of the Arduino code.
f
loat
h
=
dht.
readHumidity(
);
float
t
=
dht.
readTemperature();
//revisasiretornaunvalorvalido,delo  //contrariohayunerror
if
(isnan
(t)
∣
∣
isnan
(h))
(
Serial.println("FailedtoreadfromDHT");
)else(
Stringhume="Humedad:";
Serial.println(hume+h+"%deHumedad");
Stringtempe="Temperatura:";
Serial.println(tempe+t+"GradosCentrigrados");
)To get data from the serial port that the Xbee Shield (Coordinator) is sending, we program methods as can be seen in Algorithm3, 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).Algorithm 3:Application connection.
S
erialPort conectar = new SerialPort (
"
COM4
"
, 9600)
;
conectar.Open
( )
;
while (
!_shouldStop)
if (conectar.BytesToRead>0)
string t = conectar.ReadLine( );
string h = conectar.ReadLine( );
string m = conectar.ReadLine( );
string texto;
t = t.Replace("∖r","");
resp_text.Text = t;
hume_text.Text = h;
mov_text.Text = m;
if (t.StartWith("Temperatura:"))
Texto = t;
t = t.Replace("Temperatura:","");
else resp_text.Text ="";
if (h.StartWith("Humedad:"))
texto = h;
h = h.Replace("Humedad:","");
else hume_text.Text ="";Algorithm 4:Database connection.
p
ublic void bd_tempe
( )
SqlConnection con=new SqlConnection();
con.ConnectionString=@"Data Source=DAVIDSERVER∖SQLEXPRESS;
Initial Catalog=ARDUINO;Integrated Security=True";
try
con.Open( );
catch (SqlException ex)
MessageBox.Show(ex.Message);
throw;
string tiempo=DateTime.Now.ToString( );
SqlCommand instruccion=con.CreateCommand( );
instruccion.CommandText="insert into tempe(hora,temperatura)
values (＇"+tiempo+"＇,＇"+txt_tempe.Text+"＇)";
instruccion.ExecuteNonQuery( );
con.Close( );


## 2.1. Measuring and Estimating the Volume of Water

The soil used was characterized to obtain the parameters of Table2, 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.Table 2
Soil properties.
Physical properties
Unit
Apparent density
0.93 g·cm−3
Wilting point
17.3%
Field capacity
55.8%
Chemical properties
Unit
Ph
5.88
C.E.
3.85 dSm−1The proposed system can be integrated into an algorithm (Figure2 and Algorithm 1).Algorithm 1:Fuzzy irrigation process pseudocode.
Initial Value for soilMoisture
REPEAT
WHILE soilMoisture > 70%
READ Analog Port Soil Moisture Sensor Value
CALCULATE soilMoisture based on VH400 eq
WAIT 10 minutes
endWHILE
CALL Fuzzy Irrigation Time for Habanero pepper (INPUT: RelativeHumidity, Temperature; OUTPUT: IrrigationTime)
WHILE IrrigationTime > 0
WRITE Digital Value for pump activation
CALCULATE IrrigationTime countdown
endWHILE
WRITE Digital Value for pump deactivate
UNTIL (true)Figure 2
Algorithm that incorporated the fuzzy irrigation process.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% (Figure3).Figure 3
Humidity sensor characterization.The interpolation of the measured data results in(1)V=4.2×10-5HS3-0.0038HS2+0.1265HS+0.0888.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:(2)HS%=26.32V-7.89.In this way, with this sensor, the estimated lost soil moisture is obtained.


## 2.2. 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.


## 2.3. Fuzzy System

### 2.3.1. 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 Table3).Table 3
Rules of the fuzzy system in the growth stage of the crop.
Temperature
Very few
Few
Medium
High
Very high
Humidity
Very few
Medium
Medium
Long
Long
Very long
Few
Medium
Medium
Medium
Medium
Long
Medium
Short
Short
Short
Short
Medium
High
Very short
Very short
Very short
Very short
Very short
Very high
Very short
Very short
Very short
Very short
Very shortThe proposed model employs Mamdani fuzzy mechanism described with MISO type fuzzy rules shown on the system equation(3)R1:Ifu1isA1j,u2isA2k,…,unisAnltheny1isB1r,Rj:Ifu1isA1j,u2isA2k,…,unisAnlthenyjisBjr,Rm:Ifu1isA1j,u2isA2k,…,unisAnlthenymisBmt,where Aij,A2k,…,Anl and Bjs for Rj, 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.


### 2.3.2. 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 (Kc) 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.(iv) Irrigation Time. The output of the fuzzy system is the irrigation time and represents the run time in minutes. The frequency of watering time keeps the amount of water needed to avoid crop water stress.In order to convert the linguistic variables on fuzzy numbers, this paper proposes the calculation of intermediate values of the linguistic range through the triangular function (4), while outliers are modeled by the Gamma function, left part of the linguistic rang (5), and L function, right part of the linguistic range (6): (4)μx;a,m,b=max⁡min⁡x-am-a-1,b-xb-m-1,0,(5)μx=0x≤ax-am-a-1x∈a,m1x≥m.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 L and Gamma functions correspond to the membership functions, which are used to calculate extreme fuzzy values. Therefore, the L function is defined by(6)L=1-Gamma.The graphic form of the linguistic variables, defined by the last equations, is shown in Figures 4, 5, 6, and 7.Figure 4
Input sets for the variable stage of development.Figure 5
Input sets for the variable relative humidity.Figure 6
Input sets for the variable temperature.Figure 7
Output sets for the variable irrigation time.


### 2.3.3. Inference Mechanism

The inference mechanism has two basic tasks, determines the relevance and extent of each rule in relation to the current entries (ui), and generates the corresponding conclusions. The combination of the sets of rules with inputs can be calculated as follows: (7)μA^1ju1=μA1ju1∗μA^1fuzu1μA^2ku2=μA2ku2∗μA^2fuzu2⋮μA^nlun=μAnlun∗μA^nfuzun.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(8)y=∫yμyydy∫yμyydy.


## 2.3.1. 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 Table3).Table 3
Rules of the fuzzy system in the growth stage of the crop.
Temperature
Very few
Few
Medium
High
Very high
Humidity
Very few
Medium
Medium
Long
Long
Very long
Few
Medium
Medium
Medium
Medium
Long
Medium
Short
Short
Short
Short
Medium
High
Very short
Very short
Very short
Very short
Very short
Very high
Very short
Very short
Very short
Very short
Very shortThe proposed model employs Mamdani fuzzy mechanism described with MISO type fuzzy rules shown on the system equation(3)R1:Ifu1isA1j,u2isA2k,…,unisAnltheny1isB1r,Rj:Ifu1isA1j,u2isA2k,…,unisAnlthenyjisBjr,Rm:Ifu1isA1j,u2isA2k,…,unisAnlthenymisBmt,where Aij,A2k,…,Anl and Bjs for Rj, 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.


## 2.3.2. 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 (Kc) 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.(iv) Irrigation Time. The output of the fuzzy system is the irrigation time and represents the run time in minutes. The frequency of watering time keeps the amount of water needed to avoid crop water stress.In order to convert the linguistic variables on fuzzy numbers, this paper proposes the calculation of intermediate values of the linguistic range through the triangular function (4), while outliers are modeled by the Gamma function, left part of the linguistic rang (5), and L function, right part of the linguistic range (6): (4)μx;a,m,b=max⁡min⁡x-am-a-1,b-xb-m-1,0,(5)μx=0x≤ax-am-a-1x∈a,m1x≥m.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 L and Gamma functions correspond to the membership functions, which are used to calculate extreme fuzzy values. Therefore, the L function is defined by(6)L=1-Gamma.The graphic form of the linguistic variables, defined by the last equations, is shown in Figures 4, 5, 6, and 7.Figure 4
Input sets for the variable stage of development.Figure 5
Input sets for the variable relative humidity.Figure 6
Input sets for the variable temperature.Figure 7
Output sets for the variable irrigation time.


## 2.3.3. Inference Mechanism

The inference mechanism has two basic tasks, determines the relevance and extent of each rule in relation to the current entries (ui), and generates the corresponding conclusions. The combination of the sets of rules with inputs can be calculated as follows: (7)μA^1ju1=μA1ju1∗μA^1fuzu1μA^2ku2=μA2ku2∗μA^2fuzu2⋮μA^nlun=μAnlun∗μA^nfuzun.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(8)y=∫yμyydy∫yμyydy.


## 2.4. 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 Figure8).Figure 8
Sensor network.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 Figure9.Figure 9
Internal and external sections.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 Algorithm2. These data are linked with the Xbee devices for the transmission to the other Xbee configured like a coordinator.Algorithm 2:Section of the Arduino code.
f
loat
h
=
dht.
readHumidity(
);
float
t
=
dht.
readTemperature();
//revisasiretornaunvalorvalido,delo  //contrariohayunerror
if
(isnan
(t)
∣
∣
isnan
(h))
(
Serial.println("FailedtoreadfromDHT");
)else(
Stringhume="Humedad:";
Serial.println(hume+h+"%deHumedad");
Stringtempe="Temperatura:";
Serial.println(tempe+t+"GradosCentrigrados");
)To get data from the serial port that the Xbee Shield (Coordinator) is sending, we program methods as can be seen in Algorithm3, 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).Algorithm 3:Application connection.
S
erialPort conectar = new SerialPort (
"
COM4
"
, 9600)
;
conectar.Open
( )
;
while (
!_shouldStop)
if (conectar.BytesToRead>0)
string t = conectar.ReadLine( );
string h = conectar.ReadLine( );
string m = conectar.ReadLine( );
string texto;
t = t.Replace("∖r","");
resp_text.Text = t;
hume_text.Text = h;
mov_text.Text = m;
if (t.StartWith("Temperatura:"))
Texto = t;
t = t.Replace("Temperatura:","");
else resp_text.Text ="";
if (h.StartWith("Humedad:"))
texto = h;
h = h.Replace("Humedad:","");
else hume_text.Text ="";Algorithm 4:Database connection.
p
ublic void bd_tempe
( )
SqlConnection con=new SqlConnection();
con.ConnectionString=@"Data Source=DAVIDSERVER∖SQLEXPRESS;
Initial Catalog=ARDUINO;Integrated Security=True";
try
con.Open( );
catch (SqlException ex)
MessageBox.Show(ex.Message);
throw;
string tiempo=DateTime.Now.ToString( );
SqlCommand instruccion=con.CreateCommand( );
instruccion.CommandText="insert into tempe(hora,temperatura)
values (＇"+tiempo+"＇,＇"+txt_tempe.Text+"＇)";
instruccion.ExecuteNonQuery( );
con.Close( );


## 3. Results and Discussion

The behavior of the proposed system was supervised from March to May 2013; this corresponds to all cycle of crop. Tables4(a), 4(b), and 4(c) show the average values acquired from the system. The results obtained are compared with 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.Table 4
(a) Data from the month of March for the cycle of crop.  (b) Data from the month of April for the cycle of crop.  (c) Data from the month of May for the cycle of crop.
(a)
March
Day
Etc (mm·día−1)
Fuzzy IrrigTime  (min·día−1)
SuppliedVol Fuzzy  (l·día−1)
SuppliedVolTrad (l·día−1)
Day
Etc   (mm·día−1)
Fuzzy    IrrigTime  (min·día−1)
SuppliedVol Fuzzy (l·día−1)
SuppliedVolTrad  (l·día−1)
2
2.58425473
13.413409
223.5568182
202.9668918
17
3.57783512
16.811918
280.1986364
281.0025131
3
2.57725364
10.913627
181.8937879
202.4170272
18
3.07273124
14.404782
240.079697
241.3317471
4
3.70449566
15.902236
265.0372727
290.9504086
19
3.73218858
17.796109
296.6018182
293.1254056
5
3.84566297
18.2036
303.3933333
302.0376637
20
3.96009363
18.436127
307.2687879
311.0250267
6
3.33154632
14.9705
249.5083333
261.659036
21
3.4154618
15.833791
263.8965152
268.2497426
7
3.07303393
14.569518
247.2201515
241.3555204
22
4.4459937
22.096245
368.2707576
349.1875286
8
3.70648946
17.890227
298.1704545
291.1070015
23
4.50743937
21.169736
352.8289394
354.0134599
9
3.62726428
17.962364
299.3727273
284.8846704
24
4.67591342
21.811636
363.5272727
367.2453809
10
3.83003911
18.524945
317.4921212
300.8105683
25
1.3804632
5.6689909
94.48318182
108.4213265
11
2.65560684
11.413364
190.2227273
208.5708733
26
0.96752606
4.5595818
75.9930303
75.98931903
12
2.47468837
11.749273
199.9775758
194.3615697
27
3.66104898
17.867809
297.7968182
287.5381141
13
2.31084615
11.122518
185.375303
181.4934321
28
3.46753609
15.760455
262.6742424
272.3396476
14
2.42255034
10.806673
180.1112121
190.2666591
29
4.60879854
22.293755
371.5625758
361.9741905
15
3.49001336
16.748164
279.1360606
274.1050084
30
4.62318448
21.561836
359.3639394
363.1040596
16
3.69959684
17.351655
289.1942424
290.5656565
31
4.88327963
22.941936
382.3656061
383.5318856
(b)
April
Day
Etc   (mm·día−1)
Fuzzy IrrigTime  (min·día−1)
SuppliedVol Fuzzy  (l·día−1)
SuppliedVolTrad  (l·día−1)
Day
Etc   (mm·día−1)
Fuzzy    IrrigTime  (min·día−1)
SuppliedVol Fuzzy  (l·día−1)
SuppliedVol Trad  (l·día−1)
1
3.961718653
18.771482
312.8580303
311.1526554
16
3.99938767
17.371336
289.5222727
314.111173
2
4.169559209
25.227564
420.4593939
327.4764145
17
4.09686903
19.2428
320.7133333
321.7673412
3
4.048530602
18.909436
315.1572727
317.9708499
18
4.71907325
21.807836
363.4639394
370.6351464
4
3.418113126
15.290055
254.8342424
268.4579772
19
5.057651274
22.931773
382.1962121
397.2270022
5
4.344343997
20.729182
345.4863636
341.2039796
20
3.687610895
14.040036
234.0006061
289.6242824
6
5.216459781
24.479782
407.9963636
409.6997931
21
4.583233577
21.846064
364.1010606
359.9663234
7
5.021289634
23.754855
395.9142424
394.3711656
22
3.708343758
17.238536
287.3089394
291.2526377
8
4.818401971
25.410745
423.5124242
378.4364058
23
5.197175777
24.6604
411.0066667
408.185231
9
4.929600332
23.378527
389.6421212
387.1699047
24
5.013674745
23.637727
393.9621212
393.7730937
10
4.425304818
20.769664
346.1610606
347.5626276
25
4.604622494
21.392809
356.5468182
361.646205
11
4.304687447
20.112073
335.2012121
338.0893615
26
4.715697984
22.946236
382.4372727
370.3700535
12
3.030269642
14.473727
241.2287879
237.9968211
27
4.767017231
22.359845
372.6640909
374.4006578
13
4.228506725
19.813964
330.2327273
332.1061416
28
4.9999503
23.134864
385.5810606
392.6951783
14
4.199469641
21.049973
350.8328788
329.8255743
29
4.685183652
22.165509
369.4251515
367.9734635
15
4.13400889
18.688127
311.4687879
324.6842989
30
3.708190798
17.870818
297.8469697
291.2406242
(c)
May
Day
Etc   (mm·día−1)
Fuzzy IrrigTime  (min·día−1)
SuppliedVol Fuzzy  (l·día−1)
SuppliedVolTrad (l·día−1)
Day
Etc   (mm·día−1)
Fuzzy    IrrigTime  (min·día−1)
SuppliedVol Fuzzy  (l·día−1)
SuppliedVolTrad  (l·día−1)
1
3.48400241
16.046282
267.43803
273.632909
14
2.81323798
12.056146
200.935758
220.951194
2
4.28945109
19.954027
332.567121
336.892701
15
3.45795001
15.992027
266.533788
271.586759
3
3.64868417
17.514855
291.914242
286.566985
16
3.76349121
17.962409
299.373485
295.583908
4
4.00339841
19.0312
317.186667
314.426176
17
3.41760316
16.101982
268.366364
268.417925
5
2.70640388
12.413646
206.894091
212.560464
18
3.43767282
15.971582
266.19303
269.994192
6
3.51451778
16.295346
271.589091
276.029581
19
3.13612887
15.119536
251.992273
243.822456
7
3.29792176
16.091009
268.183485
259.01817
20
2.93326251
14.367546
239.459091
246.310986
8
3.35111737
15.496273
258.271212
263.196142
21
3.05215788
13.911227
231.853788
230.377899
9
3.58129742
16.387591
273.126515
281.274442
22
3.04887854
14.010273
233.504545
239.715919
10
3.65825019
17.664609
294.410152
287.318298
23
2.52884747
15.035646
250.594091
239.458361
11
3.77619727
17.437236
290.620606
296.58184
24
2.52884747
11.3733
189.555
198.615216
12
3.73897867
17.908982
298.48303
293.658698
25
3.20855932
15.548046
259.134091
251.999659
13
2.83378267
13.126791
218.779848
222.564771The 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.Figure 10
Evapotranspiration values for the crop cycle.The system showed a deviation of +0.11% in March, −0.39% in April, and +0.51% in May (Figures11, 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.Figure 11
Comparison between traditional irrigation and the fuzzy system (March, 2013).Figure 12
Comparison between traditional irrigation and the fuzzy system (April 2013).Figure 13
Comparison between traditional irrigation and the fuzzy system (May 2013).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 Figure14, the frequency of irrigation during the day is graphed.Figure 14
Irrigation frequency using the fuzzy system (sample of 20 March 2013).According to the data obtained with respect to the frequency of irrigation, Figure14 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.Figure 15
Temperature measurement (sample of 20 March 2013).Figure 16
Measurement of relative humidity (sample of 20 March 2013).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 m3 ha−1; however, the fuzzy system only requires 449.95 m3 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.


## 4. 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, 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 m3 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.



---

*Source: 123543-2015-06-16.xml*