An intelligent humidity control system for mushroom growing house by using beam-switching antennas with artificial neural networks

An automatic humidity control system for mushroom growing house based on the free-space technique is presented. The novelty of this work is the modified free-space technique by measuring the amplitude only of transmission coefficient | S 21 | that reflected from mushroom by using beam-switching antenna with artificial neural networks (ANNs) as a humidity sensor to control quantity and time of water misting nozzle. In the proposed system, the antenna is designed to act as the transmitting antenna at the frequency of 2.45 GHz. Its radiation patterns can be switched to 4 directions covering all corners of mushroom growing house. The measured | S 21 | from each direction are converted to direct current (DC) voltage by a radio frequency (RF) detector; then are trained with ANNs in the humidity range of 60-85%. The optimized ANNs structure consists of 4 input nodes, two layers of 5 hidden nodes, and 3 output nodes. To verify the proposed system, experiments were set up in controlled humidity mushroom growing house at the humidity level of 75-80% for 120 hours. The results showed that there was slightly average standard deviation (S.D.) of humidity level 1.36. Consequently, the performance of sensor system assures that it is able to apply for humidity control in large growing house.


INTRODUCTION
Mushroom is one of the most interesting agricultural products that have been consumed as food or medical usage due to its nutrition guaranteed by many published research [1] such as Diabetes relief [2], Alzheimer's disease and cardiovascular diseases [3], high antioxidants [4]. The worldwide market value of fresh mushroom reached higher 38 billion dollars in 2018 [5]. It is commercially classified into 3 categories: wild mushroom 8%, medicinal mushrooms 38%, and cultivated edible mushroom 54%. The average consumption per person increased from 1 kg in 1997 to 4.7 kg in 2013 and was predicted that the growing rate has been increasing every year [6]. Thus, the productivity to supply the higher demand of mushroom becomes challenging issue. Since the growth is affected by many factors, i.e., humidity, temperature, CO2 [7]. Pleurotus Sajor Caju growth is best suitable in the environment of 25-30 o C and relative humidity of 70 to 80% [8]. In Thailand, there is a long period summer which maximum temperature is 36.2 o C and minimum relative humidity is about 63% [9]. Thus, the humidity control is essential and has much been paid attention. Many previous works in humidity control system in growing house concerning the use of humidity sensor module. However, the system was complex, expensive, and the accuracy was affected by humidity outside growing house. For example, humidity detection and control in a greenhouse using only one point of sensor was proposed in [10], [11] which was limited for small greenhouse. However, humidity detection throughout the large greenhouse has to install sensors at multiple points resulting in the complex wireless sensor network (WSN) system [12], [13]. Thus, the real-time humidity control system with low complexity design for a large greenhouse is essentially required. One of the most promising candidates is using electromagnetic wave in microwave frequency band related to the change of the dielectric properties. Many techniques have been reported such as resonance technique [14], [15] and transmission coefficient technique [16]. These techniques detect the air humidity change that results in the shifted of operating frequency or the change of reflection coefficient and transmission coefficient [17]. For the resonance technique, it is prefer using in laboratory to implementing in field test. The humidity detection using a radio frequency identification (RFID) technique in ultra-high frequency (UHF) frequency band was proposed in [18]- [21]. These techniques are based on the shift of resonant frequency related to the change of humidity. The major limitation is short range operation that is unsuitable for large growing house application. In addition, a freespace technique using phase changing of transmitting electromagnetic wave to correlate the humidity change with the dielectric properties was presented in [22] but this work operates at high frequency that is not suitable for large greenhouse due to high attenuation. Switched-polarized antenna with amplitude only of free-space technique was used to determine moisture constant of paddy [23]. This technique is much interesting since its system setup is not complex and suitable for large space applications. Moreover, the dielectric properties of dry and humid environments cause the change of electromagnetic wave amplitude distinctly different.
Dielectric property is the specific inherent of each material that indicates the electrical property. The dielectric properties are described as (1).
The humidity concerns the amount of water which the dielectric constant of dry air medium and water medium are respectively equal to 1 and around 78 at the frequency of 2.45 GHz [24]. For insulator medium, the propagation constant is the function of attenuation constant (α) and phase constant (β) that is described as (2) [25].
When electromagnetic wave propagates in any medium, its amplitude decreases depending on the dielectric constant and the dielectric loss factor of medium. Due to this concept, humidity in growing house is able to be detected. Consequently, this paper presents an automatic humidity control system for a large mushroom growing house by using the free-space technique. The novelties of this work are the application of switchable 4-beam antenna to cover all growing house area with artificial neural networks (ANNs). ANNs is applied for the decision and control humidity part since it is suitable for non-linear system and has great performance to process multi inputs [26], [27]. The amplitudes of propagated wave in growing house related to the humidity change were measured; then the measured data were used to train with ANNs to optimize the structure of ANNs and weight function. In section 2, the detail of optimized antenna, the antenna system design and experiment set up to collect the measured data were described. Designing the ANNs and the automatic humidity system was set up and installed at the growing house for 120 hours to verify the presented system was described in section 3. Finally, this work was concluded in section 4.

RESEARCH METHOD 2.1. Automatic humidity control system design concept
According to conventional free-space technique, the material under test (MUT) is placed between transmitting and receiving antenna to measure amplitude and phase of reflected electromagnetic wave from MUT and transmitted through MUT. This proposed technique modifies the conventional free-space technique due to the configuration of practical growing house depicted in Figure 1. There are mushroom shelves containing tons of mushrooms that are placed on the opposite side while a walkway is at the center along the length of growing house. The modification concept is to measure only amplitude of reflected electromagnetic wave from mushroom by placing the transmitting and receiving antennas opposite each other along walkway at the distance of 6 meters. The distance causes the incident angle equal the reflect angle. To

Switchable 4-beam antenna design
The transmitting antenna plays an important role in this system since its radiation pattern must be able to cover most areas of mushroom in growing house. However, it is inefficient to use conventional omnidirectional antennas due to theirs low gain and high noise interference. Thus, the antenna with switched radiation pattern capability to specific direction is needed. There have been many previous works concerning pattern reconfiguration or switched radiation pattern published. A pattern reconfiguration dual band Yagi patch antenna was developed on low complex structure and able to switch in multi directions [28]. In addition, a pattern reconfigurable microstrip parasitic array was studied on rectangular microstrip which employed parasitic elements to switch radiation patterns based on Yagi-Uda antenna [29]. However, it was only able to switch radiation patterns between +y and -y directions in horizontal plane. A pattern reconfigurable antenna between omnidirectional and directional patterns was developed on the same FR-4 substrate that it switched to monopole mode when omnidirectional pattern was required while it changed to monopole with reflector mode for directional pattern [30]. However, there was slightly frequency deviation between mode switching. In 2011, a microstrip patch antenna with U-shaped slot was proposed on fabric substrate that it was able to steer beam in yz-plane only 3 directions: 0, 30, and 331 degrees [31]. An interesting one called multi-size pixel antenna was published in 2012 that it could reconfigure both frequency and patterns. It could steer beam cover 180°, but there was some limitations in efficiency, complexity, cost and reconfiguration time due to a large amount of switches [32]. Consequently, this work requires an antenna with beam switching capable and low complexity also.
A modified microstrip patch antenna consisted of four slanted rectangular elements and a square element with cross slit on the same substrate is presented. The rectangular elements are slanted in four directions: +45 o , -45 o , +135 o , and -135 o that act as the radiators. Each element has its own feeding port while the square element with cross slit acts like the beam shaper. The radiated element is initially designed by calculating the width (w) dimension from where, c, fr, and εr are respectively the speed of light in free-space, the operating frequency, and the relative dielectric constant of substrate [33].
The frequency operation is 2.45 GHz and the dielectric constant of FR-4 substrate equals 4.1. Then, the calculated dimension is modeled in a commercial electromagnetic simulation CST Microwave Studio which the simulated antenna configuration is depicted in Figure 2(a). The width of radiating element is tuned and shown in Figure 2(b). It can be seen that the resonant frequency shifts to the lower frequency as the width increases. The optimum width of radiating element equals 30.2 cm. All optimized dimension of parameters of the design antenna are tabulated in Table 1. In addition, the radiation patterns are considered since the antenna consists of four radiator elements with individual excitation ports. All elements: element 1, element 2, element 3, and element 4 are aligned in counterclockwise direction that the first element is slanted  Table 2. For example, when port 1 is excited and other ports are terminated, it can be seen that the surface current on element 1 radiator is coupled to the square patch and other radiated elements to shape the beam in opposite direction (+45 o ). Like the concept of element 1 excitation, the beam steers to +135 o , -135 o , and -45 o when the radiated elements are respectively excited at port 2, 3, and 4. For the receiving antenna part, a conventional square microstrip patch antenna is employed due to its compact size. The dimension of antenna is 68×68 mm. The gain of the proposed antenna is about 4.36 dBi for each element of 1, 2, 3 and 4 excitations, respectively.  The designed transmitting antenna was fabricated on FR-4 substrate to verify the performance. The fabricated antenna was illustrated in Figure 3. It was connected to Rohde and Schwarz FPC1500 network analyzer to carry out |S11|. The measured result was compared with the simulated one as shown in Figure 4. It was found that the resonant frequency was 2.45 GHz which |S11| was lower than -25 dB. For the receiving antenna, it was also fabricated on FR-4 substrate that was measured and compared with simulated result. The results showed that the resonant frequency was 2.45 GHz and |S11| was lower than -17 dB.

System integration
The humidity control system consists of two parts: transmitting and receiving parts that operate at the frequency of 2.45 GHz. The transmitting part is consisted of frequency synthesizer, antenna and complex programmable logic device (CPLD). For the humidity measurement process, each beam-switched element independently connected with frequency synthesizer module that is controlled by CPLD to automatically select the transmitter by order. The receiving part is consisted of microstrip antenna connected to power detector, instrument amplifier and analog to digital convertor. Each reflected electromagnetic waves is received; then is transferred to direct current (DC) voltage level by an RF detector. The voltage results are in small levels so they must be proceeded in a signal conditioning stage by an instrument amplifier prior to converting to the digital signals for input data of field programmable gate array (FPGA). For the automatic humidity control process, FPGA decides to ON/OFF the misting nozzle valve depending on the decision based on trained measured humidity. The diagram of humidity measurement system is shown in Figure 5.
For the frequency synthesizer part, the ADF4351 module is chosen. It operates by controlling CLK-, DATA-, LE-and CE pins via MAX II EPM570 CPLD to generate a signal at 2.45 GHz with power of +5 dBm which is switched to transmit via element 1, 2, 3, and 4 of antenna by controlling with MAX II EPM570 CPLD as shown in Figure 6(a). For signal detection in the receiving part, the detected signal is converted to DC voltage by MAX4003 power detector that the output voltage is in the range 0.4 to 0.6 volt. The DC voltage is then double amplified by MAX4475 instrumentation amplifier and converted to 12-bit digital data by ADS8506 before sending to FPGA, Cyclone IV EP4CE22F17C6N, to analyze and process. The receiving part is shown in Figure 6(b).

Humidity data measurement for ANNs
ANNs were designed and trained by using the design humidity measurement system in previous section to collect humidity of mushroom data. The humidity measurement was setup to find the threshold power of transmitting electromagnetic wave at each humidity level inside growing house whose dimensions were 6×8×3 m enclosed with shading net 80% [34]. The relative humidity of mushroom was achieved by recording the voltage of transmitted electromagnetic wave from switched 4-beams antenna by order. Initially, the measured voltages were related to the relative humidity level in growing house which were measured by a standard sensor (DHT22) inside the growing house. The highest relative humidity level was set at 85% then was decreased to 60% with the step of 1%. The measurements were repeatedly done for 5 times at each relative humidity level prior to averaging the measured data. For beam switching to element 1, the electromagnetic wave was transmitted to the upper side of left mushroom shelves.
The measured voltages are in the range of 1.58-1.52 V for humidity range of 60%-72% and they decreased from 1.55-1.46 V for humidity range of to 73%-75%. They still decreased from 1.53-1.47 V when humidity level increased from 77% to 85% as shown in Figure 7(a). To measure the humidity of upper side of right mushroom shelves, element 2 of the switched-beam antenna was selected that the average measured voltages decreased in the range of 1.83-1.7 V as the humidity increased from 60%-85% as shown in Figure 7(b). In the case of element 3 switching, the humidity of lower side of right mushroom shelves was measured that the average measured voltages slightly fluctuated in the range of 1.23-1.16 V as the humidity increased from 60%-71%. When humidity increased from 71%-75%, the average measured voltages relatively decreased from 1.16-1.1 V. For the increasing of humidity from 75%-85%, the average measured voltages fluctuated around 1.12 V as shown in Figure 7(c). The last beam switching was the case element 4

ANNs training
To obtain the weight training of ANNs for humidity control decision, the measured voltage data in previous subsection are used as the input of ANNs training. In ANNs training process, a model with C language programming was used. Firstly, the target of training was set by optimizing time consuming in misting nozzle at each humidity in the range of 75%-80%. To enhance the ANNs decision and decrease the training complexity, the mapping function of output was assigned with 3-bit output for six levels of humidity as listed in Table 3. Table 3. Relation between relative humidity level and mapping function outputs A hundred of input data were randomly divided into two groups of 50 data for testing and 50 data for ANNs training. In data training, it was randomly selected data into three sets: 20% of input data set (20 training data), 33% of input data set (33 training data) and 50% of input data set (all training data). The hidden node was fixed for two layers (h1, h2) which each level had a number of nodes as 4-4, 5-5, 6-6, and 7-7. The training initially run with a set of 50% of input data which the epoch was assumed in the range of 8.84×10 4 to 3.72×10 7 that provided the accuracy in the range of 80.75% to 88.26%. Then, the case of using 33% of input data with the epoch in the range of 8.04×10 4 to 2.54×10 6 was trained that provided the accuracy in the range of 70.89% to 85.45%. Finally, the case of 20% of input data with the epoch was in the range of 8.45×10 4 to 3.65×10 6 that provided the accuracy in the range of 77.93% to 85.92%. The detail of ANN trainings are listed in Table 4. Note that the ANNs with low complexity which provides the best accuracy at is 87.32% from the case of 50% of input data with the epoch of 5.83×10 6 . The optimized structure of ANNs consists of four input nodes, five nodes of each hidden layers, and three output nodes as shown in Figure 8. Four input nodes in the input layer are the measured DC voltages from four antenna elements: element1, element2, element3, and element4, respectively. The DC voltages are then converted to binary digital number in two's compliment form. The converted data are twelve bits which consist of one bit of a sign, five bits of integer, and six bits of floating point. Each input node multiplies with the weight in each layer by coefficient distribution method to reduce complexity and control resources [35]. Data processing and sensor system control are implemented on FPGA version Cyclone IV E EP4CE22F17C6 with VHDL language by Quartus II version 10.1 program. There are 1,361 logic elements and 747 registers used as resources.

Experimental result and discussion
The proposed system was validated by installing in the mushroom cultivation growing house at Thailand Chanthaburi Banraikao community enterprise in which two thousand mushroom bottles were contained. The growing house configuration consisted of two shelves along both sides of the wall, metal sheet roof to ventilate heat, and sand floor. There were six water misting nozzles installed under the center beam along the growing house that was five meters high from the ground. The spacing between each misting nozzle was equal to cover the entire growing house. In addition, there were three misting nozzles behind the shelves. The system installation is depicted in Figure 9. Humidity in the growing house was determined by measuring the transmitted electromagnetic wave from the four elements transmitting antenna to receiving antenna that each element was done five times per measurement; then they were averaged prior to sending to the input of ANNs. The system was set to spray all misting nozzle for 5, 3, 2, 1 and 0.5 minutes when the humidity level reached 60%, 65%, 70%, 75% and 80%, respectively. When the humidity level was in the range of 75%-80%, the system was set to recheck every fifteen minutes. Figure 9. System installation in mushroom cultivation growing house In the experiment, the system continuously operated for 120 hours from 19 to 23 November 2020. The temperature and humidity data were recorded in the data logger. The measured data in 00:00 am to 11:59 am showed that the range of humidity in each day were respectively 80.4%-76.1%, 81.2%-77.1%, 81.5%-76.17%, 81.3%-77.3% and 80.7%-76%. For the measured data in 12:00 am to 3:00 pm, the humidity level rapidly decreased and slightly varied as the temperature changed, however the average humidity level for five days was in the range of 75%-80% as shown in Figure 10(a). The measured temperature for five days was in the range 25.8-33.2 °C as shown in Figure 10 Note that the system performance in controlling humidity was quite efficient since the humidity level during day time was over 75% while it was slightly over 80% during night time. In addition, the humidity obviously decreased related to the temperature increased during 08:00 to 12:00 am, especially the temperature was higher than 30 o C. Thus, the system controlled the misting nozzles to spray water every fifteen minutes. The average humidity level and temperature level of each day were tabulated in Table 5. According to Table 5, there were deviations of humidity inside the growing house since the growing house was incompletely closed-system. The effect of humidity and temperature outside the growing house resulted in the deviation of humidity level. Normally, the temperature inside growing house below 28 o C caused the humidity level around 80%. However, the temperatures below 28 o C during the night time, the humidity level got higher than 80%. In the other hand, the temperature higher 28 o C during the daytime, the humidity outside growing house affected the inside humidity to decrease rapidly. The effect of temperature caused the interference in system by thermal noise on the hardware components especially RF components and printed circuit board (PCB). However, the decision process in ANNs helped the system compensating the deviation and efficient maintaining the average humidity level in the range 75-80%.

CONCLUSION
An automatic humidity control system for a large mushroom growing house by using the free-space measurement technique with ANNs was presented. In the measurement technique part, the magnitude only of transmission coefficients was utilized to monitor the humidity level. A new switchable 4-beam antenna to act as the transmitting antenna at 2.45 GHz was designed and fabricated. The advantage of this antenna is able to cover all growing house. For the decision of system control part, the designed antenna was integrated with RF components to collect the correlation between magnitude of transmission coefficients and humidity level. Then, the collected data was used to design the structure and train ANNs. The optimized structure of ANNs consisted of 4 input nodes, 2 layers of 5 hidden nodes, and 3 output nodes was implemented on FPGA that provided the maximum efficiency at 87.32%. To validate the proposed system, it was installed to control the humidity level inside a mushroom growing house. The humidity level was set in the range 75%-80% and monitored continuously for 5 days. The results showed that there was slightly average standard deviation (S.D.) of humidity level 1.36. Thus, this proposed system is suitable for applying for a large mushroom growing house.