Recibido: 28 de junio de 2024; Revision Received: 9 de diciembre de 2024; Aceptado: 18 de diciembre de 2024
Monitoring of environmental variables in greenhouse crops through an IoT wireless sensor network
Monitoreo de variables ambientales en cultivos bajo invernadero mediante una red inalámbrica de sensores IoT
Abstract
Agricultural cultivation in the Amazon region is vital for local farmers. Monitoring environmental variables in greenhouses is crucial for the quantity and quality of the harvest. The objective was to propose a wireless sensor network with open-source hardware and software. The client nodes, based on ESP8266, acquire data in real time from various transducers and transmit them to the server node (ESP32) through WebSockets. A webpage embedded in the ESP32 displays the environmental variables. The data is transmitted to a broker using MQTT (Message Queuing Telemetry Transport), processed with Node-RED, stored in InfluxDB, and displayed on a Grafana dashboard. The results show that the use of open-source software and hardware for wireless sensor networks is efficient, reliable, economical, and applicable in various covered plantations.
Keywords:
grafana, interface, MQTT.Resumen
El cultivo agrícola en la región amazónica es vital para los agricultores locales. Monitorear las variables ambientales en invernaderos es crucial para la cantidad y calidad de la cosecha. El objetivo fue proponer una red de sensores inalámbricos con hardware y software de código abierto. Los nodos clientes, basados en ESP8266, adquieren datos en tiempo real de transductores diversos y los transmiten al nodo servidor (ESP32) a través de WebSockets. Una página web embebida en el ESP32 muestra las variables ambientales. Los datos se transmiten a un Broker mediante MQTT (Message Queuing Telemetry Transport), se procesan con Node-RED, se almacenan en InfluxDB y se visualizan en un dashboard de Grafana. La investigación demuestra que el uso de software y hardware de código abierto para redes de sensores inalámbricos es eficiente, confiable y económico, aplicable en diversas plantaciones bajo cubierta.
Palabras clave:
grafana, interface, MQTT.1. Introduction
Global agriculture is being affected by the impacts of climate change (rising temperatures, droughts, floods, and storms, among others). These events can cause crop losses and physical damage to fields, resulting in decreased productivity and crop quality [1].
The decrease in agricultural production as a result of climate effects has raised concerns about the possibility of ensuring food security [2], and it also leads to a reduction in farmers’ incomes [3]. As a response to this challenge, various alternatives to conventional crops have emerged as potential solutions.
One option is the implementation of greenhouses as a form of physical protection for crops, making them capable of isolating certain climatic factors while also enabling the creation of optimal environmental conditions for plant growth [4]. This is achieved through monitoring and controlling agroecological variables, such as soil moisture, relative humidity, ambient temperature, and sunlight [5].
One of the most important benefits of greenhouses is their ability to create a controlled environment for plants. This allows for the adjustment and control of factors such as temperature, humidity, light, soil quality, irrigation, and plant nutrition, which promote the optimal growth and development of crops [6]. Additionally, greenhouses provide protection against extreme weather conditions, including frost, hail, strong winds, and high temperatures, thereby reducing the risk of crop losses.
Another important advantage of greenhouses is the possibility of growing crops throughout the year, regardless of the season. This allows greater flexibility in agricultural production and the possibility of offering products out of season, which can have a positive impact on farm profitability [7]. Additionally, greenhouses can help reduce the use of pesticides and fertilizers since the controlled environment allows for more precise and efficient management of these inputs, which can have both economic and environmental benefits.
According to [8], in Ecuador, approximately 3,000 hectares are devoted to the cultivation of Solanum lycopersicum, with 2,000 hectares cultivated under greenhouses. This type of greenhouse cultivation is increasing due to the advantages it offers for plant development, as well as the reduction in maintenance costs due to the reduced use of agrochemicals. Authors such as [2] state that photosynthesis depends largely on humidity since if the plant loses large amounts of water, its stomata will close and this will stop the photosynthesis process. Meanwhile, when an excessive amount of water is supplied, plant growth is negatively affected, resulting in fewer flowers and fruits as well as poor growth in general [9].
Globally, efforts have been made to develop wireless technologies with smaller, more economical, and energy-efficient devices that allow the monitoring of various variables through sensors, making the data collection process more continuous and efficient, whether in greenhouses or open fields [10]. This facilitates decision-making to improve cultivation and harvesting processes.
[11] developed a network of low-cost wireless sensors for monitoring agroecological variables (temperature, soil humidity, and luminosity) in greenhouse crops. The information from the sensors was displayed locally on a screen, wirelessly from a cell phone via Bluetooth, and remotely through the ThingSpeak Internet of Things (IoT) platform.
The work of [12] mentions the implementation of a web system for monitoring and controlling a greenhouse. They used low-cost technologies that allow the remote monitoring of temperature and humidity (soil and air). The goal was that farmers would be able to more efficiently identify any threat that may affect their production and make a decision from wherever they are, avoiding production losses and saving time and travel costs.
At Finca Pozo located in the El Triunfo canton in Guayas province, a drip irrigation system with IoT technology was implemented for bell pepper greenhouses. This system is based on the ESP8266 device and uses FC-28 sensors to measure soil moisture and the DHT22 sensor to measure temperature and relative humidity in the environment. These data are used by solenoid valves to regulate water flow according to the specific needs of the crop. Through a web application, users can monitor in real time the values of these variables in the greenhouse [13].
Authors such as [14] propose applying IoT technology and Artificial Intelligence (AI) techniques in greenhouse control methodology. The network of sensors implemented allows temperature and soil humidity to be monitored. The data obtained were analyzed using Machine Learning algorithms, such as K-Means, with the aim of proposing an automatic control system for the greenhouse.
The mentioned cases serve as a reference for the development of similar projects in the Amazon region. This is because the Amazon is characterized by presenting humid-tropical and humid-rainy climatic conditions that are not suitable for the cultivation of certain types of legumes and vegetables endemic to a dry climate. Problems in the Amazon include low soil fertility and high exposure of crops to fertilizers and fungicides with negative health impacts. For these reasons, it has been suggested that new forms of production system management must be introduced [15].
By having a technological tool that allows automation in greenhouses and at the same time the acquisition, adaptation, and transmission of information on environmental variables, such as ambient temperature, relative humidity, and soil, to a base station, users will have access locally and through the cloud in order to visualize and analyze the information collected by the network. Furthermore, it will be possible to promote crop growth and production efficiency, which are challenges of precision agriculture since it has been shown that the use of wireless sensor networks contributes to this benefit [12].
The implementation of a greenhouse will allow for the use of the most appropriate techniques at each stage of the cultivation processes to supervise and optimize agricultural production methods and offer efficient and sustainable management of the necessary resources and inputs. Wireless sensor networks in precision agriculture are used to improve crop growth and production efficiency [16].
For all these reasons, the purpose of this research was to design a wireless monitoring system using embedded systems and the IoT to be implemented in greenhouses in the Amazon region.
2. Methodology
2.1. Network topology
Properly selecting the network topology that best fits specific requirements is crucial, as the choice of how network nodes are physically connected affects not only economic costs but also the overall performance of the network.
There are four basic topologies that can be used in wireless networks [17] and which can be combined to create more complex networks. The implemented sensor network is based on the star topology [18] since the communication between the main node and the secondary nodes is direct, which results in less time in data exchange.
2.2. Data transport medium between server and clients
The OSI (Open Systems Interconnection) model [19] is the conceptual reference used to describe and understand how data communication networks function. The physical layer of the OSI model establishes the electrical, mechanical, procedural, and functional standards necessary for the activation, maintenance, and deactivation of the physical connection between the end systems of the communication network.
Various media and technologies allow the transport of digital data. Due to the technical and mechanical characteristics of the greenhouses, Wi-Fi technology based on the IEEE 802.11 b/g/n [20] standard at 2.4GHz was chosen to implement the sensor network architecture in a star topology. Table 1 shows the technical characteristics of two modules that feature integrated Wi-Fi functionality.
Source: Authors’ own creation.
Table 1: Technical characteristics of the ESP8266 and ESP32 modules
Characteristics
ESP8266
ESP32
Processor
LX106 32-bit at 80MHz
LX6 32-bit at 160MHz
RAM Memory
80 KB (40 KB available) 520 KB
520 KB
Flash Memory
Up to 4MB
Up to 16MB
Power Supply
3.0v to 3.6v
2.2v to 3.6v
Temperature Range
-40°C to 125°C
-40°C to 125°C
Current Consumption
80 mA (average)
225 mA
Deep Sleep Consumption
20uA (RTC + RTC memory)
2.5uA (RTC + RTC memory)
Wi-Fi
802.11 b/g/n (up to +20dBm)
802.11 b/g/n (up to +20dBm)
Soft-AP Support
Yes
Yes
UART Ports
2 ports
3 ports
I2C Interfaces
1 interface
2 interfaces
GPIO Pins
32 pins
11 pins
2.3. Data communication protocol
The communication protocol defines the rules that establish how data should be transmitted, received, and processed between two or more entities in the wireless sensor network.
HTTP (Hypertext Transfer Protocol) allows the exchange of data between one or more clients and a server [21]. HTTP operates on a request and response model, where a client sends a request to the server, which responds with the requested information, and the communication is closed.
The WebSockets protocol [22] enables the establishment of a bidirectional and real-time communication session between the client and the server, implying the ability to transmit data from both the client to the server and vice versa at any time during the communication session.
The WebSockets protocol was used to implement the wireless sensor network because it is characterized by presenting more efficient and faster communication than HTTP. With WebSockets, the client sends simple data frames to the server, which processes the data and sends the response, making WebSockets more suitable for real-time applications compared to HTTP.
As shown in Fig. 1, the client initiates a WebSocket connection with the server through the Handshake binding process, which starts with an HTTP request/response. This allows servers to handle both HTTP and WebSocket connections on the same port. Once the connection is established, the client and server can exchange data in full-duplex mode via WebSocket. This also allows for periodically sending information to the web browser and constantly updating the data displayed on the web interface.
Figure 1: WebSockets Protocol, Client - Server.
2.4. Client node
Two types of client nodes can be connected to the sensor network architecture: those affiliated with the network and those not affiliated.
The client node affiliated with the network (NAN) is based on the ESP8266 module and is responsible for acquiring the variables of ambient temperature, soil humidity, relative humidity, luminosity, and UV radiation present in the greenhouse through sensors. The data is transmitted to the server (ESP32) via the WebSockets protocol.
The NAN stores a unique identification value (ID) in its memory, which is validated when WebSocket communication starts. The client sends a data frame that includes its ID, and the server verifies that the ID is registered in its memory. If the ID is validated, the server processes the data frame, backs up the information in the data logger, and updates the web interface. If the ID is not validated, the server discards the data frame.
For measuring ambient temperature and relative humidity (RH), the SHT71 sensor was used. According to Veldscholte & de Beer [23], the SHT71 sensor features I2C communication, an RH measurement range between 0 and 100%, a linear output, stable measurements over time, a small absolute deviation in its measurements, high repeatability, and an RMS dispersion around the fitting line of 2% RH. The SHT71 sensor has a temperature measurement range between -40 and 123.8ºC, linear output that responds accurately to temperature changes, greater thermal stability, and repeatability with a variation of 0.1ºC.
Soil humidity was measured using the HL-69 sensor [24], which uses water conductivity to determine the amount of liquid in a substrate (e.g., soil). This sensor features an electronic conditioning circuit that processes the signal from the sensor and transmits it to the ESP8266 module.
The ML8511 sensor [25] provides an analog signal that varies based on the amount of ultraviolet (UV radiation in the environment. This sensor can detect light with a wavelength of 280 to 390 nm (nanometers) and operates in environments with temperatures between -20 and 70ºC.
The intensity of light in the greenhouse was measured using the TSL2561 sensor [26], selected for its ability to measure visible and infrared light from 0.1-40,000 lux in real time, with an operating temperature range of between -30 and 80ºC.
Fig. 2 shows the connection of the different sensors used in the instrumentation system with the ESP8266 module affiliated with the network.
Figure 2: Sensor Connection to the Node Affiliated with the Network.
The node not affiliated with the network (NNAN) makes a WebSocket request to access information from the webpage embedded in the ESP32 server. Through a web browser, the user can visualize real-time data from various sensors. NNAN devices are typically smart devices (computers, smartphones, etc.). Unlike NANs, NNANs do not have a registered ID in the server’s memory.
2.5. Server node
The web server node is responsible for processing, visualizing, and storing the data emitted by the sensors, as well as responding to client requests. It also has the fundamental task of storing the files associated with the webpage, through which sensor data is visualized in real time. These files are accessed by users through a web browser.
For hardware, the ESP32 module was used to function as the server. It is part of the ESP (Espressif Systems Platform) microcontroller family, known for its low cost, low power consumption, up to 16MB of flash memory, and various communication ports.
The WLAN (Wireless Local Area Network) connection of the ESP32 server module is configured to work in two modes within the sensor network:
Station mode: The ESP32 web server connects to a Wi-Fi network provided by a router.
Access Point mode: If the ESP32 web server cannot connect to a Wi-Fi network, it acts as a router and generates a Wi-Fi network to which client devices will connect.
In both operation modes, the ESP32 server presents a static IP address.
The web server based on the ESP32 module performs the following functions: validating the connection of client nodes affiliated with the network (the web server only receives data frames from nodes with IDs registered in its memory); receiving the data frame with the sensor values from validated client nodes; establishing a connection with clients who need to access the webpage displaying sensor data through the TCP (Transmission Control Protocol) [27] data logger [28] of sensor data; managing the web page; and communicating with the IoT platform [29].
Fig. 3 shows the heuristic diagram of the operation of the web server in the wireless sensor network.
Figure 3: Heuristic Diagram of the Server Node.
2.6. Web interface
The web interface [30], also known as user interface or GUI (graphical user interface) [31], is the structure designed in a web application that allows users to access various contents of the server. The web interface of the sensor network uses visual components, such as numerical displays and gauge-type elements, to represent the information from each of the data provided by the sensors of the client nodes affiliated with the network.
Fig. 4 shows the web interface that allows the user to monitor [32] the ambient temperature, soil humidity, and ambient relative humidity at three different locations in the greenhouse. It also displays the light intensity and existing UV solar radiation inside the greenhouse. Depending on the area of the greenhouse or crop to be instrumented, a greater number of sensors can be added to the network with a greater diversity of functionalities.
Figure 4: Web Interface- Greenhouse Instrumentation System.
2.7. Data logger
The implemented data logger allows for the collection and recording of data from various sensors at regular time intervals or specific events.
The data logger [33] has the ability to locally store variables using a Micro SD memory card. The data is stored in a plain text file that does not have any formatting or markup code, making it ideal for storing information that only needs to be readable in its most basic form. Additionally, this type of file is compatible with various operating systems and applications, making it easy to exchange and share between different platforms [34].
The information provided in the data logger will be used for:
Data analysis and processing: The recorded data can be analyzed and processed to extract relevant information.
Monitoring and tracking: Monitoring and tracking the measured variables.
Decision-making: Supporting decision-making processes.
Research and study: The data can be used in studies to propose new research and generate digital controllers, among other uses.
2.8. Sensor Network Architecture
The sensor network consists of a server module, a gateway for internet access, three client NANs, and various client NNANs, which are distributed throughout the greenhouse as per Fig. 5.
The Gateway provides the sensor network with IoT connectivity, through which data is transmitted to a broker using the Message Queuing Telemetry Transport (MQTT protocol [35], processed using Node-RED [36], stored in the InfluxDB database [37], and visualized using Grafana [38].
The ESP32 server node’s hardware structure includes a 2.4GHz data transmission block with an average power of +20.5 dBm (113.24mW) [39], which complies with the IEEE 802.11b standard. If the Gateway device is damaged or turned off, the ESP32 server is reconfigured to operate in Access Point mode, generating a Wi-Fi signal with a coverage of up to 65 meters within the greenhouse.
The Gateway device and the ESP32 server node were installed in the center of the greenhouse because a star topology was used for the sensor network. The NAN client nodes were distributed across three sections of the greenhouse, while the NNAN nodes can be positioned anywhere in the greenhouse.
Fig. 5 identifies the coverage areas of the different nodes of the sensor network. The Gateway or web server generates a Wi-Fi signal that covers the entire greenhouse area (zone Z1). NAN Client 1 has a coverage area denoted by Z4, Z3 is the coverage area of Client 2, while NAN Client 3 has the coverage area denoted by Z2. Identifying these zones is essential for the network to cover a larger area using a tree topology [40].
Figure 5: Sensor Network Architecture- Greenhouse.
2.9. IoT Platform
The IoT enables the interconnection of physical devices with electronic components capable of collecting and sharing data in real time with other devices through a common platform [35].
Figure 6: Integration of Sensor Network and IoT Platform.
IoT platforms facilitate the capture of information collected by sensors, real-time data transmission, and remote device management. They also provide an interface to access their resources using internet protocols, allowing interaction with high-level programming languages to process data and remotely control devices [10].
Several experts have presented different architectures for the IoT, although the most common are the three- and five-layer architectures, which are widely analyzed by [41]. Regardless of the IoT architecture applied, it is essential to have communication. To achieve this, IoT technologies make use of the four layers of the TCP/IP model [42].
There are various protocols for communication and data transfer between IoT devices. For data transfer between the Web Server node (ESP32) of the sensor network and the IoT broker, the MQTT protocol was used because it is lightweight and compatible with devices and applications with limited resources (low bandwidth, limited computational power, low memory, etc.) [43].
An MQTT client is a hardware and/or software component that exchanges data by connecting to a broker [44]. The web server node of the sensor network (client) sends data to the broker (server). In an IoT platform using the MQTT protocol, there is a “Publish-Subscribe” mechanism, where the client is called the publisher, and the process is called publication. The action of receiving data from the broker (server) by a client (subscriber) is known as a subscription. Subscribers have graphical access to sensor network data using the Grafana software.
It is important to note that a broker can serve multiple subscribers and publishers, depending on the hardware capacity of the machine on which it runs. A client can play the role of both publisher and subscriber.
The MQTT protocol employs three levels of Quality of Service (QoS) to ensure message delivery. [45] used QoS 2, which is the highest level of service in MQTT and ensures that each message is received by the recipient.
The Eclipse Mosquitto broker acts as an MQTT intermediary and supports QoS levels 0 (at most once), 1 (at least once), and 2 (exactly once) [46]. These characteristics make MQTT reliable for IoT applications. The Eclipse Mosquitto IoT server, along with the Node-RED programming tool, the InfluxDB database, and the Grafana application, is hosted on an IBM System x3250 M2 server running Ubuntu 18.04.
The data from the sensor network is stored using the InfluxDB database [47]. The Grafana application allows connection to various data sources, monitoring services, and metric systems to collect information and display it graphically to the user. The dashboard developed in the Grafana application permits users to visualize the data from the publishing devices in real time.
3. Results and discussion
The instrumentation system developed for monitoring environmental variables in greenhouses was subjected to a set of tests in different controlled and real conditions. Initially, it was validated in a controlled environment to ensure the accuracy of the measurements and the stability of the hardware and firmware. Subsequently, it was implemented in a real environment, where its performance was evaluated over a period of 21 hours. Variables similar to those studied by [48] were monitored, including ambient temperature, soil moisture, UV radiation, illumination and relative humidity, with 10-minute intervals between each measurement. These data allowed the identification of stable patterns and critical behaviors related to the greenhouse microclimate.
Fig. 7 shows two representative graphs of the measurements taken in the developed system. In the upper graph (Node 1), it is observed that the ambient temperature varies between 26.4 and 27.4 °C, with thermal peaks around noon due to maximum solar radiation. This daytime pattern suggests the need to adjust the greenhouse ventilation during the hottest hours. The lower graph (Node 2) shows soil moisture, which presents a stable behavior with slight increases in the cooler hours due to reduced evaporation. Around 2:00 pm, a slight decrease in humidity is recorded, reflecting the impact of the increase in ambient temperature. These results highlight the system’s ability to monitor soil conditions in real time, informing irrigation-related decisions.
Figure 7: Graphs depicting ambient temperature and soil humidity data.
Fig. 8 shows a control panel developed in Grafana that integrates multiple variables measured at Node 3 over three days. The upper graph shows temperature fluctuations between 20 and 30 °C, with daytime highs and nighttime lows.
Figure 8: Graphs depicting the ultraviolet radiation index.
The indicators show the levels of illumination (988 lux) and UV radiation (index of 5.9). These figures allow us to evaluate the impact of sunlight on the crops. Fig. 8 shows soil humidity, which varies significantly throughout the day, reaching peaks close to 80% at times of low temperature and dips to 50% during the hottest hours. This analysis capacity makes it possible to optimize irrigation, avoiding problems such as root asphyxia due to excess water or dehydration due to a lack of water.
In comparison with studies such as [49], which designed a modular system based on Xbee technology to monitor basic variables in greenhouses using a GUI developed in Matlab software, the proposed system incorporates a wider range of sensors, Wi-Fi technology, and a user interface based on the Grafana tool. The Matlab software, although robust, involves costs in license acquisition, and it is complex to deliver applications in an accessible way. In contrast, Grafana is open-source software, allowing greater flexibility, customization, web deployment, and native integration with databases such as InfluxDB. Limitations have been identified in the use of industrial HMI screens for data visualization due to the cost of acquiring equipment and licenses [50], whereas our study overcomes this by employing Grafana, open-source software, which allows real-time data visualization through interactive dashboards accessible from smart devices, significantly reducing costs and facilitating the scalability of the system.
Likewise, [51] used LoRaWAN technologies for data collection over long distances, demonstrating their energy efficiency and coverage. However, they did not address the integration of real-time graphical interfaces for the user to visualize the data nor the possibility of scaling the system to new sensors, as mentioned by [52]. In contrast, our study allows a more interactive and accessible experience for end users since the dashboard presented in Fig. 8 allows real-time data visualization from any end device with network access. The developed hardware platform allows the integration of a larger number of sensors according to the needs of the application environment.
This instrumentation system contributes to information collection by combining low-cost hardware with open-source software, eliminating economic barriers for small-scale farmers. The data collected and visualized in real time mean that transfer functions can be established to optimize ventilation and irrigation in greenhouses. This represents an advance over research projects such as [53], which highlighted the importance of integrating IoT in monitoring systems but limited its scope to data collection and storage, without addressing specific applications that allow immediate and automated action on agricultural systems. It did not explore critical functions, such as automatic control of irrigation and ventilation, which are essential in maintaining optimal crop conditions and maximizing resource use efficiency. Our proposal not only collects and visualizes data in real time but also lays the groundwork for integrating automated processes, representing a more comprehensive and practical approach to precision agriculture.
In Fig. 7, the graphs demonstrate the system’s ability to monitor temperature and humidity variations in real time, providing reliable data to identify critical weather patterns within the greenhouse. This information provides a solid basis for designing and implementing more effective climate management strategies. In addition, the clarity of the graphic representation and the stability of the data collected prove the system’s robustness. This facilitates its scalability and integration in larger greenhouses or with specific monitoring requirements adapted to different types of crops and environmental conditions.
The implementation of this system in a greenhouse provides farmers with a tool to access real-time information, facilitating strategic decision-making based on accurate and up-to-date information. The ability to integrate key measurements, such as UV radiation and lighting levels, allows operators to adjust critical environmental variables, such as shading or artificial lighting, quickly and efficiently. This is particularly important in sensitive crops, where even small variations in environmental conditions can significantly impact yields. By minimizing unnecessary energy use through data-driven adjustments, the system helps reduce operating costs, making it especially valuable for growers with limited resources. Optimizing the use of natural and artificial light not only improves crop productivity but also promotes sustainable farming practices by reducing the energy footprint.
Compared to traditional monitoring methods, which often rely on manual inspections or expensive and less accessible tools, this system offers a more economical, scalable, and adaptable solution to the needs of different types of crops and environments. The clear and understandable visualization of these variables, as shown in Fig. 8, allows growers to easily interpret the data and respond in a timely manner, maximizing productivity and ensuring crop quality.
Moreover, by monitoring soil moisture, both dehydration and over-irrigation, problems identified by [54] concerning smart irrigation systems, can be avoided.
The use of open-source technologies significantly reduces initial implementation costs and eliminates dependence on proprietary licenses, making them accessible to small and medium-scale farmers. Furthermore, their modular and scalable nature allows the integration of new sensors and functionalities adapted to the specific needs of each crop or region. This not only fosters local innovation and technological customization but also democratizes precision agriculture by making these tools accessible to rural communities. Thus, it promotes a more inclusive, sustainable, and efficient agriculture, capable of meeting global challenges like food security and climate change.
Although the system proved to be functional and stable, limitations were identified. For instance, the modules’ outer casings are not airtight, which could affect their durability in very humid conditions. Additionally, the integration of new sensors requires advanced technical skills, limiting their adoption by farmers with less access to technical training.
In future developments, it is advisable to improve the casing design to protect the electronic components better, as well as to implement artificial intelligence to automate decision-making based on data patterns. These improvements will further align the system with the practical needs of modern, sustainable agriculture.
This study is notable for implementing a low-cost platform that monitors environmental variables in real time and facilitates their interpretation through an interactive and accessible system. This allows resources to be used well and accurate decisions to be taken, overcoming the limitations of previous systems that did not integrate open-source tools or provide practical scalability for different agricultural contexts.
4. Conclusions
Climate change has led farmers to devise strategies to minimize possible crop damage. As a result, greenhouses have emerged as an option to isolate plantations and create an optimal environment for crop growth. Farmers often control environmental variables within greenhouses, manually and experimentally, which could lead to crop damage.
For this reason, a wireless sensor network connected to the IoT based on ESP32 and ESP8266 modules was created to monitor environmental variables in crops under greenhouses. This allowed users to know in real time, locally or remotely, all the environmental variables that affect the crop through the data collected by the sensors. The information is represented on a dashboard consisting of various graphs that help the user to make decisions.
The sensor network structure in star topology consists of a server node and three client nodes attached to the network. These nodes are in constant communication to acquire the various environmental variables inside the greenhouse. Each of the nodes presents a hardware and software element (firmware) that was subjected to various operation tests in controlled and real environments.
The use of MQTT in a wireless sensor network offered an efficient and reliable solution for data transfer to the Eclipse Mosquitto broker. Thanks to its low bandwidth consumption, ability to maintain persistent connections, and adjustable quality of service levels, MQTT has become a useful protocol for transmitting data through the IoT. Using the InfluxDB database, the information was backed up, and software such as Node-RED and Grafana enabled the development of a dashboard that visualizes the variables in real time within the greenhouse.
References
- [3] Lucero-López, C.Y., Castruita-Esparza, L.U., Legarreta-González, M.A., Olivas-García, J.M., Uranga-Valencia, L.P., and Luján-Álvarez, C., Impacto del cambio climático en la agricultura del Distrito de Riego 005, Chihuahua, México, Revista Mexicana de Ciencias Agrícolas, 13(6), pp. 1003-1014, 2022, DOI: https://doi.org/10.29312/remexca.v13i6.2881 [URL] 🠔
- [8] Varela-Saráuz, A.V., Estudio de la producción y comercialización del tomate riñon (Lycopersicum Esculentum) en el cantón Pimampiro, de la provincia de Imbabura Universidad Técnica del Norte, Pregrado en Ingeniera en Agronegocios Avalúos y Catastros, Ibarra, Ecuador, Universidad Técnica del Norte, 2018, pp. 131. 🠔
- [9] Molanes, C., and Córdova, T., Diseño e implementación de un sistema electrónico de control basado en FPGA, para las condiciones climáticas de un invernadero para el cultivo de tomate en la ciudad de Tacna, Ingeniería Investiga, 1(1), pp. 96-106, 2019. DOI: https://doi.org/10.47796/ING.V1I1.126 [URL] 🠔
- [13] Gordillo-Gordillo, E.A., y Maya-Olalla, E.A., Red de sensores inalámbricos bajo protocolo lora y gestión de procesos para la analítica de datos mediante meta sistema operativo para monitoreo ambiental en invernaderos, Pregrado en Ingeniería en Electrónica y Redes de Comunicación, Ibarra, Ecuador, Universidad Técnica del Norte, 2021, 167 P. 🠔
- [14] Ortiz, L., Hernández, L., Muñoz, B., and Costes, A., Diseño IoT de invernadero para el control de variables mediante técnicas de inteligencia artificial Greenhouse IoT Design for Variable Control through Artificial Intelligence, Research in Computing Science, 151(6), pp. 173-186, 2022. 🠔
- [17] Cortés-Cortés, C.L., Montaño-Argote, M.A., Osorio, A.M., Cortés-Cortés, C.L., Montaño-Argote, M.A., Osorio, A.M. and Guerrero-González, N., Diseño y análisis sistémico de una red backhaul autogestionable en topologías estrella y anillo para conectividad rural en Caldas, Ciencia e Ingeniería Neogranadina, 32(1), pp. 43-57, 2022. DOI: https://doi.org/10.18359/RCIN.5531 [URL] 🠔
- [19] Cinco-Solis, A., Implementación del modelo OSI mediante radios definidos por software, Pregrado en Ingeniero en Telecomunicaciones, Mexico, Universidad Nacional Autónoma de México, 2020, 54 P. 🠔
- [20] Vera, L., Pilosor, J., and Machuca, M., Red inalámbrica de sensores para monitoreo y control de cultivos de Citrullus Lanatus (Sandía), Revista Científica de Informática ENCRIPTAR, pp. 15-24, 2022. 🠔
- [21] Avellaneda, J.V., Rodríguez, J.R., y López, D.A., Servicios de televisión sobre la plataforma de internet (IPTV-IMS) usando Protocolo de Flujo en Tiempo Real (RTSP) y Protocolo de Transferencia de Hipertexto (HTTP), Informacion Tecnologica, 25(1), pp. 67-78, 2014. 🠔
- [22] Mitrovic, N., Dordevic, M., Veljkovic, S., and Dankovic, D., Implementation of WebSockets in ESP32 based IoT Systems, in: 15th International Conference on Advanced Technologies, Systems and Services in Telecommunications (TELSIKS), Institute of Electrical and Electronics Engineers, Nis, Serbia, 2021, pp. 261-264. DOI: https://doi.org/10.1109/TELSIKS52058.2021.9606244 [URL] 🠔
- [24] Baron, J., Vanegas, S.C., y Rocha, C.E., Gestión del ambiente del invernadero mediante un microcontrolador electrónico para el cultivo de vegetales, Espacios, 41(19), pp. 1-19, 2020. 🠔
- [25] Castillo, F., and Giraldo, M., Fortalecimiento del proceso de la siembra y cuidado de la planta del aguacate Hass en los invernaderos a través de la implementación de un dispositivo inteligente basado en las tecnologías internet de las cosas - IoT, cloud computing y machine learning, en: Encuentro Internacional de Educación en Ingeniería ACOFI - Asociación Colombiana de Facultades de Ingeniería - Acofi, Cali, Colombia, 2022, pp. 1-8. DOI: https://doi.org/10.26507/PAPER.2625 [URL] 🠔
- [28] Tyutyundzhiev, N., Angelov, C., Arsov, T., Lovchinov, K., Nitchev, H., Mutafov, A., and Alexieva, G., Remote datalogging of solar UV irradiation using open-source ESP32 platform and MQTT protocol, Journal of Physics: Conference Series, 2436(1), art. 012003, 2023. DOI: https://doi.org/10.1088/1742-6596/2436/1/012003 [URL] 🠔
- [29] Mubarakah, N., Soeharwinto, and Iddha, F., Prototype an ESP32-based room humidity and temperature controller with IoT, in: 6th International Conference on Electrical, Telecommunication and Computer Engineering (ELTICOM), Institute of Electrical and Electronics Engineers, Medan, Indonesia, 2022, pp. 121-126. DOI: https://doi.org/10.1109/ELTICOM57747.2022.10038085 [URL] 🠔
- [30] Shukla, A., and Diwan, R., IOT based load automation with remote access surveillance using ESP 32 CAMand ESP 8266 module, Annals of the Romanian Society for Cell Biology, 25, pp. 6904-6914, 2021. 🠔
- [32] Cerda-Mejía, V.R., Guijarro-Rubio, O.E., Benítez-Cortés, I., Cerda-Mejía, G.L., Guardado-Yordi, E., Ortega-Tenezaca, D.B., González-Suárez, E., and Pérez-Martínez, A., Remote monitoring of operational parameters for the cane honey production process, Lámpsakos, 25, pp. 3991, 2021. DOI: https://doi.org/10.21501/21454086.3991 [URL] 🠔
- [33] Al-Abbas, I., ESP32 based data logger, International Journal of Computer Science and Mobile Computing, 8(5), pp. 259-267, 2019. 🠔
- [34] Srisuchinwong, D., Sukhachewanon, B., and Chanwimalueang, T., Acquiring unobtrusive sleep-related signals through an ESP32-based data logger, in: 13th International Conference on Knowledge and Smart Technology (KST), Institute of Electrical and Electronics Engineers, Bangsaen, Chonburi, Thailand, 2021, pp. 38-42. DOI: https://doi.org/10.1109/KST51265.2021.9415820 [URL] 🠔
- [36] Rattanapoka, C., Chanthakit, S., Chimchai, A., and Sookkeaw, A., An MQTT-based IoT cloud platform with flow design by Node-RED, in: 1st Research, Invention, and Innovation Congress (RI2C), Institute of Electrical and Electronics Engineers, Bangkok, Thailand, 2019, pp. 1-6. DOI: https://doi.org/10.1109/RI2C48728.2019.8999942 [URL] 🠔
- [38] González, I., Calderón, A.J., and Folgado, F.J., IoT Software for Industrial Monitoring in Supervisory Systems Course: Initial Experience with Grafana, in: 3rd International Technology, Education and Development Conference, Iated Digital Library Home, Valencia, Spain, 2023, pp. 4925-4931. DOI: https://doi.org/10.21125/INTED.2023.1279 [URL] 🠔
- [39] Maier, A., Sharp, A., and Vagapov, Y., Comparative analysis and practical implementation of the ESP32 microcontroller module for the Internet of Things, in: 7th International Conference on Internet Technologies and Applications, Wrexham, UK, 2017. 🠔
- [40] Escobar, C., Celis, J., Sepúlveda, S., Castro, S., Medina, B., y Guevara, D., Algoritmo de nodos adaptativos para solucionar el problema de los nodos huérfanos en una Red Inalámbrica de Sensores ZigBee en topología de árbol, Ingeniare. Revista Chilena de Ingeniería, 29(2), pp. 285-296, 2021. DOI: https://doi.org/10.4067/S0718-33052021000200285 [URL] 🠔
- [41] Niyigena, V.d.P., Li, Z., Lumorvie, V.E., Nambajemariya, F., Niu, X., Kwizera, V.d.P.N., Li, Z., Lumorvie, V.E., Nambajemariya, F., and Niu, X., IoT based greenhouse real-time data acquisition and visualization through Message Queuing Telemetry Transfer (MQTT) protocol, Advances in Internet of Things, 11(2), pp. 77-93, 2021. DOI: https://doi.org/10.4236/AIT.2021.112006 [URL] 🠔
- [42] Moustafa, N., Turnbull, B., and Choo, K.K.R., An ensemble intrusion detection technique based on proposed statistical flow features for protecting network traffic of internet of things, IEEE Internet of Things Journal, 6(3), pp. 4815-4830, 2019. DOI: https://doi.org/10.1109/JIOT.2018.2871719 [URL] 🠔
- [43] Sahadevan, A., Mathew, D., Mookathana, J., and Jose, B., an offline online strategy for IoT using MQTT, in: 4th International Conference on Cyber Security and Cloud Computing (CSCloud), Institute of Electrical and Electronics Engineers, New York, NY, USA, 2017, pp. 369-373. DOI: https://doi.org/10.1109/CSCloud.2017.34 [URL] 🠔
- [44] Bryce, R., Shaw, T., and Srivastava, G., MQTT-G: a publish/subscribe protocol with geolocation, in: 41st International Conference on Telecommunications and Signal Processing (TSP), Institute of Electrical and Electronics Engineers, Athens, Greece , 2018, pp. 1-4. DOI: https://doi.org/10.1109/TSP.2018.8441479 [URL] 🠔
- [47] Tyutyundzhiev, N., Angelov, C., Lovchinov, K., Arsov, T., and Nitchev, H., Solar UV irradiation monitoring in Bulgaria using narrow-band digital sensors and open-source InfluxDB database, in: Conference Proceedings, vol. 4, Proceedings, R., Rojen, Sofia, Bulgaria, 2020, pp. 179-184. https://doi.org/10.21175/RadProc.2020.36 [URL] 🠔
- [48] Amaya-Díaz, J.C., Rojas-Estrada, L., Cárdenas-Ruiz, C.A., Ariza-Colpas, P.P., Piñeres-Melo, M.A., Ramayo-González, R.E., Morales-Ortega, R.C., Ovallos-Gazabon, D.A., and Collazos-Morales, C.A., Monitoring system of environmental variables for a strawberry crop using IoT tools, Procedia Computer Science, 170, pp 1083-1089, 2020. DOI: https://doi.org/10.1016/j.procs.2020.03.067 [URL] 🠔
- [49] Monroy-García, O., Rolón-Quintero, D., y Sepulveda, S., Sistema inalámbrico modular de bajo costo para supervisar variables ambientales en invernaderos: un respaldo al agricultor de pequeña escala, Revista Científica, 2, pp. 164-179, 2017. DOI: https://doi.org/10.14483//udistrital.jour.RC.2017.29.a5 [URL] 🠔
- [52] Elijah, O., Bakhit, A.A., Rahman, T.A., Chua, T.H., Ausordin, S.F., and Razali, R.N., Production of strawberry using internet of things: a review, Indonesian Journal of Electrical Engineering and Computer Science, 15(3), pp. 1621-1628, 2019. DOI: https://doi.org/10.11591/ijeecs.v15.i3.pp1621-1628 [URL] 🠔
- [53] Azraai, M.A., Rani, R.Q., Qibtiah, R.M.H., Imran, S.M., and Zulfadhli, S.M., Development of Fragaria monitoring system by intelligent control using Raspberry Pi 3, Review of International Geographical Education (RIGEO), 11(7), pp. 560-568, 2021. DOI: https://doi.org/10.48047/rigeo.11.07.57 [URL] 🠔







