# Greenhouses Low-Cost Monitoring and Control System Carlos Eduardo Bastos ? , Miguel Grequi ? & Rafael Galli ? Abstract-The cultivation of fruits and vegetables is a fundamental activity for a nation's economic and food sectors. However, this practice exposes the farmer to the damage caused by weather conditions or severe weather changes in the region. Thus, we observe that, when cultivation occurs organically, without the addition of fertilizers or pesticides, there's an intensification of the impacts caused to production. Mitigating this issue is possible through several technologies found on the market for the control of agricultural greenhouses since the cultivation in greenhouses provides better development of production. Although, these devices are usually inaccessible to small rural producers, damaging the family farming sector. Based on these facts, the present study aims to build a low-cost autonomous gadget for controlling and monitoring agricultural greenhouses, making this system efficient and accessible to small rural producers and encouraging the practice of organic cultivation. The device acts independently that the user, from his personal computer or smartphone, selects the type of crop to be sown, and the system acts by simulating the best possible microclimate inside the greenhouse. This simulation is possible through an array of sensors that frequently gather climatic data both inside and outside the greenhouse. After reading the sensors, the software compares the values acquired and, if necessary, executing the electric actuators' activation dedicated to modifying specific climatic properties in the greenhouse. So, simulating the microclimate for the best development of production. The device also presents the farmer, based on his climate database, alerts for specific meteorological phenomena, such as dew. Allowing both the producer and the system to prepare themselves to deal with this fact in the best possible way. The equipment is still under development, and a bench-scale prototype will be implemented for analysis purposes and will later be implemented on a pilot scale to ensure its effectiveness. El equipo aún está en desarrollo y se implementará un prototipo a escala de banco con fines de análisis y luego se implementará a escala piloto para asegurar su efectividad. # Introduction griculture is a crucial sector of the Brazilian economy, fundamental to the country's growth. It is an activity highly dependent on climatic factors, whose changes can affect productivity and crop management, in addition to reaching social, economic, and political factors [1]. As reported in some media ways, agriculture is an activity that is subject to losses caused by weather variations. Thus, it may cause a drop in the quality of fresh produce and, consequently, an increase in these products' prices, harming the farmer and the entire consumer population. The potential adverse impact of climate change on Brazilian agriculture and its livelihoods is an issue on which researchers and producers have paid extraordinary attention. There is a growing concern about the hypothesis that the increase in climate variability negatively impacts agriculture, national economic growth, and related subsistences in Brazil [2]. There are climatic changes in each region, which causes immense impacts that make cultivation difficult. Any culture suffers due to these variations, especially with the distance between provinces and factors of climate instability that we find today [3]. Considering these facts and that "[...] the ability to control the internal environment of the greenhouse makes the results better than those obtained in the open field" [4]. We developed this project to provide a control and monitoring system for agricultural greenhouses to the small agricultural sector, ensuring a better development of production and consequent reduction in the probability of losses caused by weather conditions to the producer. The project aims to build a low-cost electronic system that will provide as much as possible the ideal climatic conditions for the cultivation of a given crop in an agricultural greenhouse, ensuring grander safety and quality of production. Through this, the user will be able to define in advance from his personal computer or smartphone the type of cultivation to be sown. Thus, the system will act by monitoring not only the internal environment of the greenhouse but also the external environment comparing the climatic properties of these environments and activating, when necessary, electric actuators inside the greenhouse to control such values. It is necessary to note the equipment's sustainable characteristics, such as the use of solar energy to recharge the batteries, in addition to saving water used in cultivation, since the plantation will receive only the necessary. Regarding the benefits for the user, the possibility of controlling and monitoring the greenhouse from a distance stands out, which provides the producer with continuous monitoring and a less exhaustive routine since it is not necessary to travel to the production site to be aware of the climatic conditions inside the greenhouse and the drives carried out by the system. # II. # Materials and Methods At first, research was carried out on the components employed in the system. These were chosen to aim at the efficiency and accessibility of the project. Simultaneously, we researched managing horticultural products in agricultural greenhouses and how an electronic system could assist in efficient cultivation. That said, we conclude that, initially, the most relevant climatic factors to obtain the best quality of production in an agricultural greenhouse are: luminosity, the relative soil moisture, relative air humidity, and temperature. Therefore, to carry out the analysis of these parameters, it was necessary to research how to collect data from sensors [5], implement response curves, and ascertain and improve their accuracy. # a) Component search and selection After choosing the array of sensors, we carried out an analysis of these devices. This phase took place by implementing and testing a circuit with the sensor connected to a microcontroller. This device can act sequentially or combinational, so the system operates by performing the sensor's acquisition, interpretation, and conversion of acquired data, mathematical calculation, storage, comparison, and, finally, if necessary, making a decision [6][7]. As mentioned, the electronic system, through the sensor response, performs mathematical functions to convert the sensor data into units of the sensors; that is, in analog sensors, it converts voltage levels to the corresponding sensor unit, as temperature. However, some sensors used do not have mathematical equations provided by the manufacturer. Therefore, it was necessary to carry out research and tests with these sensors in different environments and soils so that we can ensure that it is making a correct measurement. To perform such tests, we made use of a previously developed device. It is a portable electronic device that contains a programmable microcontroller to perform test steps with the sensors (Figure 1). Thus, facilitating the instrumentation process, since the device is compact, facilitates the test areas' movement. This system also saw implementation in the Substrate and Fertilizer Production from Tree Pruning project, which uses this device to carry out practical classes with students from the technical courses at IFSUL Campus Pelotas [8]. The realization of most of these studies was in conjunction with the Production of Substrates and Organic Fertilizers from Tree Pruning for Food and Vegetables Production, which constitutes a research center directly linked to this work. We also conducted studies on electric actuators, devices responsible for controlling each climate property analyzed. However, due to our academic environment's financial and physical limitations, we have completed the analysis stage; that is, the system is analyzing everything precisely. Electric actuators demand their power and cost, depending on the physical space available for installation. Therefore, it would be impracticable to install the system in a fullscale greenhouse for the first tests. # b) Sensors instrumentation Consultation of a wide theoretical basis took place to research climatic properties, establishing the reasons for the contemplated aspects of examination of similar works available through technical reports issued by renowned universities in the country. Thus, the project's theoretical framework has information on variations in weather, climate analysis, irrigation, light, air humidity, ventilation, and temperature. From the theoretical knowledge obtained, the sensors' research phase was initiated, carried out to select the best electronic components to be used in the project. Besides, concepts about the climate were studied, making their practical application in our institution's research laboratories. With the portable device used to perform tests, we started to examine the relative soil moisture sensor. Based on our research, we have not successfully found an affordable and efficient soil moisture sensor. Therefore, we innovated a conventional sensor that consists of a skewer to measure the soil's electrical conductivity, and that has no equation on the part of the manufacturer. Therefore, we researched the sensor's behavior in a chemistry laboratory in conjunction with the project Production of Substrates and Fertilizers from Tree Pruning. Tests were carried out with several types of organic substrates in conjunction with the sensor to discover its different voltage levels and collect as much information as possible to complete this device's mathematical function. For that way, we try to validate a conventional sensor and access to efficient gear for the system. Next, we examined the Light Dependent Resistor (LDR) brightness sensor. A plant's growth through artificial lighting shows the best result when it receives the correct incidence of a photoperiod [9]. Such phenomena demonstrate that a conventional luminosity sensor such as LDR is necessary due to its practicality of use and its low cost. Although the device has an equation corresponding to its response curve, we couldn't find information on lux analysis applications in the instructional text. The standardization of luminosity measurements is quite complicated due to the lack of a widely accepted measurement system [10]. Given this finding, we sought to develop an LDR device that would meet the minimum precision needs. The LDR has the response curve as a logarithm function (Figure 2); thus, by extracting the appropriate mathematical equations for each interval for calculating the sensor, we were able to analyze this graph. With the standardization of these measures, we tested the device with a certified professional luximeter. Our system presented a minimal deviation concerning the other device, which is very satisfactory considering that the relevant factor, as mentioned, is the photoperiod in which the plant is subject to, and not the amount of incident lux. The temperature sensor used was the LM35. This component comprises temperatures up to 150 ºC, with each variation of 1 ºC in its condition, causing a 10mV variation in its output (Figure 3). Also, it has meticulous behavior for the application of our system, making it unnecessary to carry out advanced examinations with the equipment. The sensor designed to acquire the relative humidity is the HIH4000. This sensor also has a desirable precision for the project and was tested based on our city's climatic comparisons. Where he presented a very satisfactory result, and his response curve, available in his datasheet, can be seen in figure 4. The relative soil moisture sensor has not yet shown satisfying behavior and is still under analysis. It is also estimated to carry out several long-term tests with different types of soil and cultivation to carry out the proper calibration of this apparatus. # c) Hardware and software development After the instrumentation of the sensors, the hardware and software design phase begins. A system was devised, predicting the construction of independent monitoring and control modules. Control of each module happens through an ESP32, which will analyze a small-scale greenhouse or its corresponding area in a large-scale greenhouse. Based on the data gathered and on previous instructions of a master personal computer or smartphone, the module will activate the electric actuators, if necessary, to control specific climatic properties mentioned elsewhere. Thus, the monitoring and control module consists of a compact and easy to implement device to allow easy installation in any structure of an agricultural greenhouse. This device contains all the prior sensors and will perform all the acquisition of climatic data inside the greenhouse. Specifically, an independent module will perform the climactic analysis of the external environment. Allowing the insertion of modules according to the producer's physical structure, that is, separate modules where each one will control a small greenhouse, or several modules, each being responsible for the analysis of a specific area of a large greenhouse. After carrying out each analysis cycle and executing the necessary activations, this information, both from the external environment module and from the greenhouses' interior, is sent to a central, where the farmer can view these data and know the internal state of the greenhouse. The plant is still in development. It is estimated, initially, to create a software to carry out wireless communication with the modules for both Windows and Android platforms; that is, the producer will be able to monitor the progress of his production using his personal computer or smartphone. The physical standard of communication is still under study, and as mentioned, there will be the implementation of wireless communication, where this could be Wifi, Bluetooth LE, or ZigBee. For the software development of the modules, we used the Arduino IDE, formulating specific functions for the various tasks implicit in the system. Initially, to perform the sensors' analysis, each directive is assigned to the sensors containing the entire procedure to deal with the physical pattern of the sensor, interpret, convert, and store the requested data according to the calibrations performed previously. Soon after, we developed procedures to compare the sensor data with the external environment and with the instructions coming from the control panel to activate the electric actuators when necessary [11]. For the system's central software, we conceived an interface where the farmer could start the cultivation, select the type of culture, visualize in real-time the data of the monitoring and control modules, and also receive alerts about specific climatic phenomena such as dew. # d) Prototype development Execution of the system's first tests will take place in a small greenhouse, where the necessary actuators are easily accessible. Thus, in this greenhouse, it will already be possible to ascertain the system's behavior and have a database of the first errors present. (Figure 5). At first, this prototype consists of a bench greenhouse, which contains a monitoring and control module with the appropriate electric actuators to perform the drives. Later, more greenhouses of the same scale, and more modules will be implemented to carry out wireless communication tests. The structure will initially have a group of electric actuators to control the climatic properties mentioned elsewhere. The system's ventilation system will be activated at each determined time interval to replace the greenhouse's indoor air. The heating system consists of an electric heater connected to a fan. With cooling activation done by a thermoelectric chip connected to a fan, and irrigation acting through the use of the sprinkling technique [12] composed of humidifying sponges linked to a fan. It is worth mentioning that an irrigation system that consumes little water and that acts efficiently is essential in production to generate benefits for the producer and the environment [13]. With the apparatus built, it is estimated to carry out long-term tests by sowing and cultivating different types of crops and analyzing the system's behavior in distinctive circumstances, such as rainy, humid, hot, and cold days. Simultaneously, we intend to produce the same crop in an open field and a greenhouse of the same scale without implementing the system, so at the end of the experiment, we will have a database of crops produced in the open field, in a conventional agricultural greenhouse, and an autonomously controlled greenhouse. # III. # Results and Discussions Because the project is still in the development stage, it has not yet been possible to test it in a real application. However, we already devised tests and selected the site. This space consists of a rural property in the family farming sector, where the producer has homemade greenhouses for the organic cultivation of fruit and vegetables. In this structure, certain fruits will be grown with different substrates, which were produced with compost in a partner project in the core of governmental, agricultural works. This way, it will be possible to evaluate the project's effectiveness in the field and on a real scale. However, the instrumentation phase of the sensors, hardware, and software development and the theoretical framework addressed to ensure an autonomous electronic system's efficiency for analyzing and controlling agricultural greenhouses. Logically, the smaller the area of a greenhouse for control and monitoring, the lower the cost of operating and installing the system. IV. # Conclusion The project is still under development, and many steps must be completed to, in fact, fully evaluate its efficiency in a real application. We should note that some improvements have already been observed, such as the implementation of more sensors and electric actuators to expand the system's monitoring and control capabilities. Simultaneously, it is estimated to carry out studies on other factors relevant to cultivation, such as soil pH. Following envisioning an efficient and sustainable apparatus, we plan on studying and developing an adjunct system for capturing solar energy and recharging a battery bank, making the system selfsustainable and accessible to rural properties where electrical connection isn't present to the structure of the agricultural greenhouse. The variety of expansion and application of the project is immense. The studies carried out in the current work ensure the central idea that a low-cost electronic system can autonomously monitor and control an agricultural greenhouse, guaranteeing a better development of production and a less exhaustive work routine for the farmer. It is possible to conclude that controlled cultivation in greenhouses solves weather conditions and provides the farmer and the population with a better quality product [14]. 1![Figure 1: Portable testing electronic device](image-2.png "FFigure 1 :") 2![Figure 2: Brightness vs. resistance graph](image-3.png "Figure 2 :") 3![Figure 3: Temperature vs. sensor output voltage graph (LM35)](image-4.png "Figure 3 :") 4![Figure 4: Relative humidity sensor response curve (HIH4000)](image-5.png "Figure 4 :") 5![Figure 5: Small testing greenhouse](image-6.png "Figure 5 :") © 2020 Global Journals ## Acknowledgments Given this project's realization, we would like to thank everyone who guided and supported us in making this work a reality. First of all, we thank our family members for always supporting us in all aspects and understanding our absences during the project development process. To IFSUL Campus Pelotas for making material conditions feasible and the servers and teachers of IFSUL Campus Pelotas for their support and affection, to all students and teachers who make up LAB 14 for their support, guidance, and tenderness. To professor Rafael Galli for his teachings and instructions. To professor Éder Coutinho for the aid, commitment, and dedication in scientific research and the team's recognition in the different areas. To the student and friend Thales Ferreira for his guidance and devotion in several moments of the anal. The student Manuela Carrazzoni for the support and dedication in the graphic and advertising issues of the project. To everyone mentioned and to the others who are somehow involved in the process of building this work, we have to leave our "Thank you very much.". * Mudanças climáticas globais e a agropecuária brasileira MALima OM RCabral JD GMiguez 2001 397 Jaguariúna, SP * Mudanças climáticas globais e a agricultura no Brasil QPellegrino EDAssad FRMarin Revista Multiciência 8 2007 * ClaudiaCamargo * LudmilaMachado * Estudo de tendências climáticas da temperatura do ar no estado de Santa Catarina Cristina;Pandolfo HugoBraga Eng. Agr., Centro de Ciências Agrárias 2009 Florianópolis, SC; Estudante, UFSC * Automação de Estufas Agrícolas Murguero Junior TRonaldo SILVA, Juarez Bento da * Anais do I Seminário de Pesquisa SimoneMeisterBilessimo Sommer Pós-Graduação e * Inovação CatarinaUniversidade Federal De Santa 2016 Araranguá, SC * Microcontroladores PIC: Programação em C. São Paulo: Érica FábioPereira 2003 * JamesW ;Bignell Donovan LRobert Eletrônica Digital -Lógica Combinacional. São Paulo: Makron Books 1 1995 * Eletrônica Digital -Lógica sequencial JamesW ;Bignell Donovan LRobert 1995 Makron Books São Paulo * Diana -dispositivo de análise e controle de estufas agrícolas CarlosE . ;Bastos Ferreira G;Thales RafaelGalli Online), v 24 2020 Tecno-lógica * Anderson;Bósio EvertonNascimento * Análise de crescimento de plantas de acordo com o espectro de luz e fotoperiodismo. UFBA, agosto de Gabriel;Santos Queiroz ;Gustavo GustavoCustódio 2011 * Light-emitting diodes in plant growth: Comparative growth test in greenhouse and evaluation of photosynthetic radiation Pinho T ET M E PRosvall LHalonen 2008 Helsinki University of Technology, Department of Electronics -Lighting Unit, Espoo, Tech. * Programando em C/C++. A Bíblia O melhor guia para programação em C/C++. São Paulo: Makron Books KrisPh DJamsa LarsKlander 1999 * GuilhermeABiscaro Sistemas de Irrigação por Aspersão Dourados, MS 2009 * Avaliação de sondas de TDR multi-haste segmentadas para estimativa da umidade do solo ClaudineiF ;Souza Matsura EEdson Revista Brasileira de Engenharia Agrícola e Ambiental 1 2002 * Cultivo protegido -Em busca de mais eficiência produtiva LarissaG ;Pagiuca AmandaRSilva BrunaASilva Ed. CAPA 2014 Piracicaba, SP