Development of an electronic controller for lettuce production in greenhouses

The objective of this study was to develop an electronic controller for microclimate control in greenhouses, as well as to verify if the automated control system affects the productivity of two varieties of lettuce “Lactuca sativa”. The control system was developed based on the Atmega 2560 and compatible transducers. An experimental field analysis was carried out over a production cycle for two lettuce varieties. The experimental results showed that the designed equipment worked according to the implemented programming algorithm. However, the ventilation, nebulization and shading actuators did not control environmental variables, due to under sizing. The irrigation process was correctly controlled throughout the experimental period. The electronic controller promoted increase in the productivity of lettuce varieties. There was increase of 28% in total fresh weight; 10% in stem diameter; 7 and 8% in height gain and average diameter, respectively.


Introduction
The main advantage of producing in greenhouses is the possibility of growing plants in adverse climates, offering ideal environmental conditions for crops (Vatari et al., 2016). Ishikava and Figueiredo (2011) stated that the lack of skilled labor is a problem for production in greenhouses, limiting the expansion of production. Thus, prototyping platforms are a low-cost alternative for automation of agricultural production processes.
The increasing demand for efficient and accessible electronic systems has motivated research using prototyping platforms (Bajer and Krejkar, 2015;Mekki et al., 2015;Wishkerman and Wishkerman, 2017). Studies have used the Arduino platform to create agricultural control systems. The main motivation of such projects is versatility of applications and their low cost. Fuentes et al. (2014) confirmed the feasibility of using free software and hardware platforms to obtain field data and monitor photovoltaic systems. Nugroho et al. (2016) reported the application of development platforms to monitoring and controlling systems in rural areas, highlighting the potential of applying them horticulture.
To facilitate and improve the process, Vatari et al. (2016) evaluated the operation of two greenhouse control systems. The authors reported innovations in data acquisition using sensors and storage of values in clouds, basing the study on the concept of internet of things (IoT). The authors proved that electronic technology has been fostering precision agriculture (Wishkerman and Wishkerman, 2017;Santos et al., 2018;Mazon-Olivo et al., 2018;Zhou et al., 2018).
This work developed an electronic controller for monitoring and the microclimate control in greenhouses, and also for verifying if the automatic control system affects the productivity of two varieties of lettuce "Lactuca sativa".

Material and Methods
The electronic control environmental system followed the methodology proposed by Rozenfeld et al. (2015). A prototype was assembled. It consisted of an Arduino ATmega2560 control board (Arduino, 2018) fixed to a metal case with eight push-down buttons and an LCD display (20x4, twenty characters and four lines) ( Figure 1a). The controller was equipped with a Real Time Clock (RTC) system, a Secure Digital (SD) cardholder, and a board with eight 250V/10A output relays. The inputs of the system were electronic transducers ( Figure 1b) compatible with the controller. The transducers were three DHT-22 thermo-hygrometers containing three FC-28 soil moisture sensors and three LDR (Light Dependent Resistor) global radiance sensors arranged in three 40-mm PVC supports (Polyvinyl Chloride) (Figure 1c).
The estimation of soil moisture performed by the FC-28 sensor and global radiation performed by the LDR sensor (in percentage) was a low investment strategy, although results obtained by Abdel-Ghany (2011) have demonstrated the importance of converting radiation into latent and sensitive heat and its relationship with plant respiratory rates. However, radiation sensors are expensive and secondary for small and medium-scale cultivation. Figure 2 shows the circuit diagram of the system.
The controller setting was carried out in Processing/C++. Information on ideal environmental conditions for lettuce crops at each stage of development was consulted from the literature. From 0 to 20 days after daytime transplanting, the values programmed were ideal temperature (20-25.7°C), ideal relative air humidity (76.5-93.5%), and ideal soil moisture (62-85%) (Cermeño, 1990). The operating chart of the controller is described in Figure 3.
The evaluation of performance of the electronic controller was performed by a controlled environment experiment in Biguaçu/SC, Brazil (27°46'42" S, 48°72'42" W). The soil was classified as a red yellow Argisol with a loamy texture, according to Santos et al. (2013). Soil analysis and correction were performed according to the values for lettuce cultivation recommended by Yuri et al. (2016).
The experiment was performed in two protected environments (A1 and A2) using a high arch tunnel model with a height of 2.75 m and a total area of 50 m 2 each (5x10 m). PVC cover with 150 micrometers was used, in full coverage, without side openings and without artificial shading.
In the A1 greenhouse, ventilation, irrigation, misting and shading actuators were installed. In the A2 environment, only the irrigation system with manual operation was installed. One irrigation was performed early in the morning and two irrigations were performed in early and late afternoon. Manual irrigation is the standard procedure adopted by the non-automated production model.
For the ventilation actuator, a dwt220R fan was used. It has 80W of power, 0.6 m of propeller diameter, and average airflow of 0.98 m 3 s −1 . For the activation of irrigation and misting systems, electro valves with a nominal diameter of 12.5 mm were used; the maximum flow rate was 20 L.min −1 and the power was 5W. The irrigation model used in the A1 and A2 environments was direct sprinkler. It is composed of two central branches, ten meters long each, in a micro-perforated hose ( Figure  4a). Weed control was performed using traditional methods of weeding and manual removal at 10, 15 and 20 days after transplanting (DAT).
A meteorological shelter (MS) was installed in front of the greenhouse to protect the electronic control system and data acquisition systems. The meteorological shelter was built using Pinus sp. wood and painted with a white acrylic paint. It has 1.10 m of frontal width, 0.80 m of height, and 0.30 m of depth. The cover of the shelter was built using 4-mm fiber cement roof tiles with a slope of 50% (Figure 4b).
In the field experiment, the biometric characteristics of two lettuce varieties, cv. Lucy Brown and cv. Vanda, were evaluated in environments with and without automation, respectively (Figure 4c). To evaluate the productivity of lettuce crops, the following biometric data were measured: total plant diameter (PD), total plant height (PHe), stem diameter cut 1 cm from the soil (SD), and total fresh mass (TFM).   Inside A1 and A2, three identical plant beds were built (1×10 m long, 0.2 m high). The seedlings were produced in expanded polyethylene trays containing 128 cells using commercial substrate, maintaining only one seedling per cell in a nursery for 19 days.
The system operation was monitored through data stored on a SD card attached to the controller. Information on activation of actuators and sensors was obtained in real time, as well as the date and time of each event; thus constructing an auxiliary database for future decision-making.
The harvest was performed 21 DAT. Eight plants were removed from the central range of plant beds per experimental plot in each evaluation, excluding the plants of the extremities because of border effects.
The biometric variables PD and PHe were measured still in the field using a metallic graduated ruler. Afterwards, plants were harvested 1 cm from the soil using cutting shears. The SD was measured using a pachymeter, and the TFM was measured using a digital precision scale.
The intervals lasted 24 hours and the measurements were performed hourly. The experiment was completely randomized in a 2×2 factorial design with six replications. The first factor comprised the cultivation environments A1 and A2 and the second factor comprised the cultivars V1 and V2. The response variables were submitted to analysis of variance and, when necessary, a Tukey test was applied at a 5% significance level. All statistical analyses were performed using the software R (2018).

Results and Discussion
The controller presented satisfactory response throughout the experimental period. It performed the monitoring and activation of actuators according to the programming proposed. Data were stored on a SD card and later processed using the appropriate software. Nugroho et al. (2016) made use of a SD card for data storage for data acquisition and monitoring systems and obtained positive results in a region with poor internet quality.
During the first days of operation, the environmental parameters of temperature, relative humidity and radiation were not in the comfort range for the crop for a few hours, even when the actuators were activated. The radiation exceeded this parameter in some days during a first and second phase, and this event was correctly detected by the control system (Figure 8). On the first day of data collection, there was great variation in the values of temperature and relative air humidity ( Figure 5 and 6), which triggered the activation of ventilation and misting actuators for a total of six and nine hours, respectively. Our ventilation actuators have been undersized for the greenhouse.
On the second day, the relative humidity remained below the programmed value, even with the nebulizer actuator turned on for 15 hours. This fact clearly demonstrates that the nebulization system was incompatible for the constructive characteristics of the greenhouse. In the third and fourth days of the experiment, temperature, and radiation ( Figure 5 and 8) were within the programmed value, with the activation of only three hours of misting in a 48-hour interval.
The main behavior is the ineffectiveness of the ventilation and misting systems for controlling the process, even when the controller performed the appropriate activation according to schedule. The functioning of the control system was successful. However, the actuators were not efficient. In some moments, critical levels of humidity and temperature were reached, as on 13-16 DAT peaks of temperature and relative humidity were well below expectations. Even though it did not completely control the process, the control system adjusted the temperature and relative humidity of the air discreetly, with better values for A1.
The best controlled process was irrigation. Figure 7 shows the soil moisture at A1 permanently within the ideal range. In A2 we found significant variations in soil moisture, which was decisive in the final productivity results. Our findings allow us to state that the greatest advantage found in the experiment was the correct control of water availability for the roots. The sprinkled water also affected the air temperature and humidity in A1.
The luminosity obtained with low-cost sensors of the LDR type, does not allow to obtain reliable information, but provides an approximation of the real parameter for shading control (Figure 8). Hassanien and Ming (2017), working with translucent photovoltaic panels, stated that a moderate shading has little influence on lettuce productivity and can be an alternative to generate electrical energy for the system.
The means of total fresh mass, plant diameter, plant height, stem diameter, and total productivity are shown in Table 1. For all variables, the interaction between factors was not significant (p>0.05). Plant diameter differed between environments. A1 plants had larger diameters, indicating a greater vegetative development possibly provided by adequate water supply and environmental conditions close to ideal. Yuri et al. (2016) stated that lettuce is a fast-cycle crop. It is very demanding in nutrients at its final development phase (after approximately 20 to 30 days of planting). The authors emphasized the importance of nutrition during this period and adequate water availability for correct absorption of minerals.     The biometric variables plant height and stem diameter did not differ between environments possibly because these characteristics were not responsive to stimuli. This also occurred for plant diameter, plant height and stem diameter for both lettuce varieties (Table  1). In a study on fertilization and light levels, Gonçalves et al. (2017) reported plant height and stem diameter as mostly affected. Total mass and height were affected by the etiolation process.
The variable total fresh mass presented significant differences between varieties and between environments. The statistical difference between the varieties was possibly due to different vegetative conformations. However, the difference between environments is interesting; it is possibly related to the automation in A1.
For Marenco and Lopes (2013), stress due to lack of water in the soil stimulates the closure of stomata, which hinders the absorption of carbon dioxide and affects the growth of plant tissues. Thus, plants under water stress have lower growth rates at some point in their cycle compared to plants under adequate water availability at all development stages. Yuri et al. (2016) stated that adequate nutrition of lettuce increases total productivity and guarantees a greater income for the producer.
Data of total fresh mass allow concluding that productivity per area is higher for the protected crop with automation than for the protected crop with manual operation (Table 1). In percentage terms, the mean of total fresh mass of the two varieties, in the A1 environment was 28% higher than in the A2 environment. These data are similar to Santos et al. (2018), who obtained gains of 17.9% in leaf development and 14.29% in arugula cultivation by using an electronic monitoring system.
Researchers have successfully developed new systems of wireless communication between sensors and control systems (Mazon-Olivo et al., 2018;Oliveira Junior et al., 2018). Therefore, a future improvement of the system developed in this study could be the addition of a wireless network card to the PVC supports. It would facilitate the installation process and reduce the risk of damage to the system. Zhou et al. (2018), studying response of soybeans to saline stress, used image analysis to correlate this response with plant physiology, and obtained good correlation results. González-Esquiva et al. (2017) used low-cost cameras for environmental monitoring and obtained promising results. This opens the way to new research on environmental monitoring based on pictures.

Conclusions
The control system developed increased the lettuce productivity in greenhouses. We found 28% increase in fresh mass, 10% in stem diameter, 7% in plant height and 8% in average plant diameter.