Next Article in Journal
Impact of Navigation Aid and Spatial Ability Skills on Wayfinding Performance and Workload in Indoor-Outdoor Campus Navigation: Challenges and Design
Previous Article in Journal
Aircraft Trajectory Prediction Enhanced through Resilient Generative Adversarial Networks Secured by Blockchain: Application to UAS-S4 Ehécatl
Previous Article in Special Issue
A Review on Applications of Fuzzy Logic Control for Refrigeration Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Determination of Crop Soil Quality for Stevia rebaudiana Bertoni Morita II Using a Fuzzy Logic Model and a Wireless Sensor Network

by
Angel-Primitivo Vejar-Cortés
1,
Noel García-Díaz
1,*,
Leonel Soriano-Equigua
2,
Ana-Claudia Ruiz-Tadeo
1 and
José-Luis Álvarez-Flores
2
1
Division of Postgraduate Studies and Research, Technological Institute of Colima, National Technological Institute of Mexico, Colima 28976, Mexico
2
Faculty of Mechanical and Electrical Engineering, University of Colima, Colima 28400, Mexico
*
Author to whom correspondence should be addressed.
Appl. Sci. 2023, 13(17), 9507; https://doi.org/10.3390/app13179507
Submission received: 18 July 2023 / Revised: 10 August 2023 / Accepted: 12 August 2023 / Published: 22 August 2023
(This article belongs to the Collection The Development and Application of Fuzzy Logic)

Abstract

:
Stevia rebaudiana Bertoni Morita II, a perennial plant native to Paraguay and Brazil, is also widely cultivated in the state of Colima, Mexico, for its use as a sweetener in food and beverages. The optimization of soil parameters is crucial for maximizing biomass production and stevioside levels in stevia crops. This research presents the development and implementation of a monitoring system to track essential soil parameters, including pH, temperature, humidity, electrical conductivity, nitrogen, phosphorus, and potassium. The system employs a wireless sensor network to collect quasi-real-time data, which are transmitted and stored in a web-based platform. A Mamdani-type fuzzy logic model is utilized to process the collected data and provide farmers an integrated assessment of soil quality. By comparing the quality data output of the fuzzy logic model with a linear regression model, the system demonstrated acceptable performance, with a determination coefficient of 0.532 for random data and 0.906 for gathered measurements. The system enables farmers to gain insights into the soil quality of their stevia crops and empowers them to take preventive and corrective actions to improve the soil quality specifically for stevia crops.

1. Introduction

Stevia, scientifically known as Stevia rebaudiana Bertoni, is a perennial plant that has been used for centuries as a natural sweetener and for medicinal purposes. It belongs to the Asteraceae family and is native to the northern regions of Paraguay and southern Brazil [1]. Stevia Morita II, a specific variety of Stevia rebaudiana Bertoni, was initially cultivated in Japan by Toyosigue Morita. This variant is characterized by its higher production of dried leaves and improved chemical composition, making it highly desirable for being up to 300 times sweeter than sucrose [2,3,4].
Stevia’s importance lies in its potential as a non-caloric sweetener and its use as a natural medicine. Its cultivation and usage have not only garnered attention for its economic value but also for its potential contribution to healthier dietary choices and the fight against chronic noncommunicable diseases such as obesity, diabetes, and cardiovascular diseases [3]. The chemical composition and steviol glycoside content in stevia leaves can vary depending on the country of cultivation, making it crucial to compare and understand these variations [1].
Stevia holds significant economic significance globally, with the projected market size estimated to reach between 1.4 billion and 1.6 billion USD by the year 2030. The market for stevia is segmented by regions, with North America currently dominating the largest revenue share as of 2021. However, regions such as Asia Pacific, Europe, and Latin America are expected to experience rapid growth due to the increasing demand for stevia in the food, beverages, and baking sectors [5,6]. It is worth noting that stevia is primarily commercialized in powder form, followed by liquid, and lastly as dried leaves.
The cultivation process of stevia can vary depending on the region and country. It generally consists of growth and pruning cycles that last for approximately 3 to 4 months. A common method of propagation is through asexual reproduction, where cuttings are taken from healthy stevia stems and used to replace older or diseased plants. When the stevia plant reaches a specific height or brix level, indicating its desired level of sweetness, it is harvested. The harvested plants are dried to remove moisture before undergoing further processing. The dried stevia leaves can be processed into various commercial forms, including powder, liquid extracts, or dried leaves [7].
The fertility of the soil plays a crucial role in the cultivation of stevia as it directly influences the yield and biomass production of the plant. To optimize the soil conditions and enhance stevia yield, it is recommended to maintain optimal levels of macro-nutrients, particularly nitrogen, phosphorus, potassium, and organic matter. Fertilization practices, such as applying organic matter and ensuring an adequate supply of nitrogen, phosphorus, and potassium, are essential for promoting increased stevia yield (stevioside concentration) and improving soil fertility [8,9,10].
Additionally, several factors have a significant impact on the plant yield and chemical composition of stevia, including temperature, pH levels, sunlight exposure, macronutrient concentration (through fertilization), planting density, and other environmental variables [3,11,12]. These factors can influence the perceived sweetness of stevia, which depends on rebaudioside A concentration, therefore changing the amount of leaf mass required to produce powdered or liquid forms of the plant [11].
The aforementioned soil factors in stevia cultivation play a crucial role in determining the quality and characteristics of the final product, which has significant economic implications for producers. It is essential to monitor and maintain these parameters within the desired range to ensure optimal conditions for stevia yield and stevioside concentration. This study specifically focuses on monitoring and interpreting these soil parameters to provide an assessment of the overall soil quality (SQ).
Monitoring systems, often referred to as internet of things (IoT) or precision agriculture systems, have emerged as a common solution for collecting data on various variables of interest. These systems enable the gathering of environmental variables [13,14,15,16,17], soil parameters [18,19,20,21,22], and water parameters [23]. Typically, such systems comprise electronic sensors designed to measure specific variables, along with microcontrollers or interconnected microcontrollers that interpret the sensor data and transmit it wirelessly as a wireless sensor network (WSN). In the case of a networked system, a dedicated device receives the transmitted data and stores them in a database, such as structured query language (SQL), either by sending requests to a cloud server or utilizing IoT services like ThingSpeak [15,18]. To facilitate data analysis, these monitoring systems often include a graphical interface that allows users to access and visualize the collected data. Moreover, the interface may support data export for further processing and analysis [13,14,16,17,19,20,21,22,23].
When implementing a monitoring system, selecting the appropriate technologies and tools is crucial. Among the commonly used microcontrollers, Espressif Systems Processor 32 (ESP32) and 8266 (ESP8266) are popular choices. These microcontrollers are often integrated into embedded development boards such as node microcontroller units (NodeMCUs) and TTGO boards made by LILYGO. Their popularity stems from their user-friendly nature and support for the Institute of Electrical and Electronics Engineers (IEEE) 802.11 protocol, also known as WIFI, enabling wireless communication and internet access when connected to compatible networks [14,15,17,18,22].
Wireless data transmission in monitoring systems can be achieved through various protocols, including radio frequency modules, long-range radio (LoRa), and IEEE 802.11. Each protocol offers distinct advantages, such as range, data rate, bandwidth, and module cost [22,24]. In the literature, LoRa and IEEE 802.11 have been frequently mentioned and used. LoRa is known for its long-distance transmission capability, although at a lower data rate compared to WIFI. It also has lower power consumption during its operation, which is particularly beneficial for WSNs that rely on battery power [19,24].
Data collected from monitoring systems can be stored in various ways. One common option is to send measurements over the internet to an IoT platform, such as ThingSpeak, Adafruit input–output (IO), clouds, or the IBM Watson IoT Platform [15,17,18]. These platforms provide convenient and scalable solutions for storing and managing sensor data. Another approach is to implement a custom cloud server. This can be achieved by setting up a message queuing telemetry transport (MQTT) broker, which allows for efficient and reliable data transfer between devices and the server. Alternatively, data can be received through hypertext transfer protocol (HTTP) requests, processed, and then stored in a database [16,20]. Implementing a custom cloud server provides more flexibility and control over the data storage and management process.
In some monitoring systems, data processing techniques such as artificial intelligence (AI) models, including neural networks and fuzzy systems, are employed to create valuable insights about the observed variables. These AI models analyze the collected data and generate results that provide a more comprehensive understanding of the variable status and behavior. By using AI-interpreted data, monitoring systems can offer a more accessible and user-friendly approach to gaining meaningful insights and making informed decisions [25,26,27,28].
Fuzzy logic systems have been a useful tool since their creation in 1988 [29]. These systems have various variants that fulfill different approaches, such as expert-based knowledge systems like Mamdani [30,31,32]; Takagi–Sugeno systems [33] which combine fuzzy rules with linear equations; and hybrid models like Adaptive Neuro-Fuzzy Inference Systems (ANFIS), which combine neural networks with fuzzy logic [34]. Each variant offers unique advantages and applications in different domains.
After the aforementioned information, it can be established that stevia is an important plant and product worldwide, and during its cultivation process, many variables affect stevia’s biomass and stevioside production, such as soil variables. In order to supervise these parameters, a monitoring system can be implemented, and many solutions provide a feasible option using a WSN and a cloud server as main components. To provide a concise answer for the SQ, a data processing technique such as fuzzy logic model can be implemented, which leads to the hypothesis that implementing a Mamdani fuzzy logic model that uses the pH, temperature, humidity, electrical conductivity, nitrogen, phosphorus, and potassium of the stevia crop soil as inputs, gathered from a monitoring system, can determine the SQ with a statistically significant determination coefficient (r2).
By obtaining insights into the SQ of the stevia crop, producers can make informed decisions and implement necessary measures to enhance stevia crop production. Nevertheless, another crucial factor to consider is the adoption of technology, a topic addressed in [35]. Several barriers to technology adoption exist, potentially preventing farmers or stakeholders from integrating technological innovations into their processes. These barriers might encompass social or cultural norms, the migration costs of technology, insufficient dissemination or diffusion, limited operational or technical knowledge, and a need for continuous education about emerging technologies.
Using these barriers as a foundation, various strategies can be proposed to overcome them and consequently boost technology adoption. These strategies may be focused on enhancing farmers’ understanding through effective communication about the application of agronomic innovations and their potential impacts on production quality. Another approach could involve providing demonstrations or samples showcasing the capabilities of the innovation [36].
In this study, as emphasized by [37], it is important to disseminate the proposed monitoring system to farmers through effective communication. This includes conveying the range of variables it can measure, enhancing their understanding of their stevia crop soil, demonstrating the user-friendly nature of the web platform for data access, highlighting the straightforward and swift maintenance process, discussing the potential for expanding measurements to other variables if needed and emphasizing the benefits of informed decisions for irrigation and fertilization. If feasible, a practical demonstration of the system’s operation could further enhance the communication process.
The contributions of this work can be summarized as follows: (a) the design and implementation of an effective Mamdani fuzzy inference system that accurately determines physicochemical qualities, macronutrient concentration, and overall SQ using seven essential soil parameters of a Stevia Morita II crop; (b) the development of a WSN utilizing ESP32-based boards with embedded LoRa communication for efficient collection of the soil parameters using recommended standard 485(RS-485)-based sensors; and (c) the integration of the WSN with a custom web platform, enabling data storage and processing and providing an intuitive user interface for easy access, visualization, and data export.

2. Materials and Methods

The proposed solution, as depicted in Figure 1, entails the implementation of a monitoring system. This system consists of a WSN responsible for measuring soil parameters. The measured data are then transmitted to the developed web-based system, where they are stored in a structured query language (SQL) database. The gathered data are processed by a fuzzy logic model (FLM), which generates a numerical value representing SQ.
As mentioned in the previous section, in order to determine the SQ of a stevia crop it is necessary to measure soil parameters and check if these are inside an optimal range [1,2,8]. For this study, seven soil parameters were selected: pH, humidity, temperature, electric conductivity, nitrogen, phosphorus, and potassium. These correspond to the physicochemical quality and macronutrient concentration of the soil, and by using these indicators, an overall SQ can be determined.

2.1. Wireless Sensor Network

This section contains the hardware, data transmission, storage, and implementation aspects of the WSN. These components are essential for the efficient operation of the network. The hardware includes the master node, sensor node, and sensors, which are responsible for collecting data from the environment. Data transmission is facilitated through technologies like LoRa and IEEE 802.11 protocols [14,15,24], enabling effective communication between nodes and the web platform. Additionally, the implementation aspect of a WSN involves the position where the components, such as sensor nodes and repeaters, are physically deployed. This section provides a comprehensive overview of these key components that contribute to the successful functioning of the wireless sensor network.

2.1.1. Hardware and Software

The WSN is composed of a single master node, many sensor nodes, and their respective sensors. The master node is a TTGO board that contains an ESP32 microcontroller, an organic light emitting diode (OLED) display connected using the inter-integrated circuit (I2C) protocol, very useful for debugging applications as well as showing important information about the system status on screen, and a LoRa antenna that is interfaced through the serial peripheral interface (SPI) protocol. It is powered by a connected battery power bank, ensuring continuous operation for up to five consecutive days.
The sensor node utilizes a TTGO board, similar to the master node, but requires additional electronic components due to the specific requirements of the sensor used to measure the considered soil parameters. The sensor has an RS-485 interface and requires a 12-volt (V) power supply, while the power bank only provides 5 V of direct current (DC). To address this, a MAX-485 module is employed to convert the serial signals to the RS-485 protocol. Furthermore, an XL6009 DC-DC step-up module converter is employed to boost the 5 V power from the source to the required 12 V for the sensor. Additionally, a 5 V to 3.3 V level shifter is used to reduce the voltage of the signals, ensuring the protection of the ESP32 microcontroller [14]. For a visual representation of the interconnected components, see Figure 2.
The selection of the JXBS-3001 sensor for this application was based on its comprehensive capabilities in measuring temperature, humidity, pH, electrical conductivity, nitrogen, phosphorus, and potassium (NPK) values from the soil, all within a single device [38]. The manufacturer states that the device has a precision of ±0.5 °C for temperature, ±3% for humidity inside a 0–53% range and ±5% for 53–100%, ±0.3 for pH, and ±2% full scale for NPK (from 0 to 1999 mg/kg range, which is approximately 40 mg/kg). Precision for electric conductivity was not provided.
To obtain measurements using a microcontroller, a simplified serial request–answer communication protocol is established, and it is also defined by the manufacturer [38]. The microcontroller sends a single message containing specific information: the sensor’s address code, function code (typically for reading or writing), start register address, data length, and two cyclic redundancy check (CRC) bytes. Upon receiving the request, the sensor responds with a packet containing its own address, the sent function code, the number of data bytes, the requested data, and two CRC bytes. This process allows efficient data exchange between the microcontroller and the sensor, facilitating reliable measurements without relying on external software and complex connections.

2.1.2. Data Transmission

The WSN utilizes LoRa technology for message transmission. Each node in the network is equipped with a TTGO board featuring an embedded LoRa antenna, eliminating the need for additional electronics and wiring to establish communication between nodes. Due to the substantial number of variables contained in a single measurement, high transmission speeds are not required, especially considering that each message consists of approximately 120 bytes.
The WSN implements a custom media access control (MAC) protocol on a star topology, which utilizes a message structure based on JavaScript object notation (JSON) strings. These JSON messages contain vital information such as transmitter address and receiver address, as well as message types, enabling effective communication and status monitoring within the network.
In terms of the WSN operation, a master-controlled communication approach is followed. When the master node is powered up, it fetches the configuration from the web platform, which includes the sensor node address list and the time intervals between measurements. Upon reaching the scheduled time, the master node initiates a broadcast message to trigger the sensor nodes to take soil measurements using the JXBS-3001 sensor.
After a 5 s interval, the master node iterates through the node address list, sending data request commands to collect the recently obtained data. To ensure reliable data retrieval, if a sensor node fails to respond, the data request command is sent up to four additional times with a 1 s timeout for each attempt. Each received measurement from the sensor nodes is appended to a list.
The master node, which is connected to the internet, sends all the accumulated data to an endpoint on the web platform using an HTTP-POST request. The payload of this request is in JSON format, containing all the measurements as the request body, and includes an application/JSON header to specify the data type.
The developed MAC protocol offers scalability, allowing the WSN to accommodate up to 252 sensor nodes. Additionally, it provides the flexibility to incorporate various types of sensor nodes, expanding beyond soil parameter measurements. This opens up opportunities to integrate sensors for air temperature, humidity, water pH, electrical conductivity, and other environmental factors.

2.1.3. Data Storage

The master node plays a crucial role in sending all the collected measurements to the web platform for storage. These data are transmitted using a POST request to a designated endpoint on the platform.
Upon receiving an incoming request, the web platform follows a sequence of steps. It starts by processing the content and confirming its compatibility with the correct method. If the content is in JSON format, it is sanitized for any potential issues. Then, the credentials of the master node are verified, and the incoming measurements are assessed.
If a measurement is beyond the acceptable range (where any parameter contains 0 or 65,535 or is outside the sensor’s measuring range), it is disregarded because it is considered an outlier. Concurrently, the metadata of the sensor node are updated to reflect an online status, along with an indication of a “bad measurement” and a timestamp. This information is useful for troubleshooting purposes. When all checks pass successfully, the measurement is stored in the database. The node’s metadata are adjusted accordingly, and this process continues for the remaining measurements.
At the end of the process, the web platform acknowledges the successful receipt of the data by sending a confirmation message back to the master node, ensuring data integrity and reliable transmission.
This systematic approach ensures that data remain accessible for future retrieval and in-depth analysis. It guarantees secure storage in a centralized database, accessible from anywhere and at any time.

2.1.4. Implementation

The system underwent an initial laboratory testing phase lasting three weeks. This rigorous testing confirmed the system’s stability, ensuring a consistent connection and the continuous monitoring of soil parameters. Additionally, the microcontroller programs implemented a watchdog feature, which automatically resets the nodes in the event of unexpected errors. This proactive approach effectively resolves a significant portion of potential issues, demonstrating the system’s readiness for field implementation.
The WSN implementation was performed on a Stevia Morita II crop, owned by Rancho Tajeli. Figure 3 provides a satellite view of the node layout within the stevia crop. The blue circles represent the sensor nodes, while the red square represents the master node. It is worth noting that the master node is positioned near a building with an available internet connection. The layout also demonstrates that the maximum distance between any sensor node and the master node does not exceed 150 m, enabling stable communication without the need for repeaters or signal amplification.
For deployment in the stevia crop, sensor nodes were strategically installed. The sensor probes were placed following the manufacturer’s instructions at a depth of 0.25 m, inserting the steel probes horizontally, close to the roots of individual plants, as depicted in Figure 4. The JXBS-3001 sensor has a T90 of less than 10 s, this represents that it only requires that time to reach 90% of its final stable reading, therefore, any monitoring period should be above this timespan. For this study, a 5 min interval for measuring soil parameters was selected, so a total of 288 measurements per day could be collected [38]. The power banks powering the sensor nodes were replaced with other fully charged power banks every two to three days, ensuring uninterrupted monitoring routines and maintaining the system’s reliability.
Overall, the successful laboratory testing, coupled with the well-planned node layout and the strategic placement of sensor nodes, establishes the system’s robustness and suitability for field implementation.

2.2. Web-Based Platform

The web-based platform plays a crucial role in the overall functionality of the monitoring system. It serves as a foundational pillar, offering a comprehensive suite of tools for data storage, information retrieval, and visualization. Additionally, the platform provides the capability to export data, enabling its utilization in diverse applications as needed. The significance and functionality of the web-based platform will be explored in greater detail in the following subsections.

2.2.1. Web-Platform Functionality (Use Cases)

In order to develop a comprehensive and functional web platform, a thorough analysis of use cases was conducted. This involved identifying the key actors and the actions they would perform. To enhance the process, interviews were conducted with stevia farmers, allowing for valuable insights into their needs and experiences with similar technologies.
The identified actors within the system are as follows: the stevia farmer (user), the administrator, the central nodes, and the backend itself. The user has the ability to authenticate and access the platform’s information. They can conveniently review the latest measurements through a spatial map, which displays data node by node. Additionally, the user can visualize historical data using a line chart, with the flexibility to adjust the time range and select specific nodes for visualization. Furthermore, users have the option to export data, allowing for sorting by timestamps and exporting either all nodes or specific ones.
The administrator possesses the same capabilities as the user, with additional administrative privileges. In addition to the user actions, the administrator can create, disable, or upgrade user accounts to administrator status. They have the authority to create and modify sensor node information, including address, alias, map coordinates, and sensor type (in this case, soil sensors). The administrator is also responsible for adding central nodes and managing their authentication credentials for secure server communication.
The master node, a central node in the network, has the ability to securely post measurements to the server via HTTP requests. Authentication credentials are required to ensure data security and integrity.
The backend serves as the core component of the web platform, receiving and processing all user interactions and system actions. It plays a crucial role in executing validation checks to ensure the integrity and security of the data. This includes verifying user authentication, validating input data, and enforcing access control policies. The backend also facilitates seamless communication with the database, allowing for the efficient storage and retrieval of information. It handles complex operations such as data aggregation, analysis, and generating relevant visualizations. Overall, the backend acts as the engine that drives the functionality of the web platform, ensuring smooth and reliable operation for all users and system components.

2.2.2. Structure

The web platform’s structure was carefully designed to accommodate the specific aforementioned functionalities. The implemented design, illustrated in Figure 5, provides a comprehensive framework for seamless user interaction.
Upon accessing the platform, users are presented with the landing page, which serves as an informative gateway, offering an overview of the system’s functionality and purpose. Once users successfully log in, they gain access to the main menu, which acts as a central hub for navigating through different sections tailored to their needs.
The current data section offers users a real-time visualization of the stevia crop field through an interactive map. Active elements, represented by sensor nodes, are displayed on the map. By hovering the cursor over or tapping on a node icon, a pop-up window appears, providing detailed information about the node’s parameters. Additionally, the window prominently showcases numeric values that convey the general quality of the stevia crop.
In the historical data section, users are empowered to delve into the past performance of the stevia crop. This section features an insightful plot accompanied by a control menu. The control menu enables users to search and select specific date ranges and sensor nodes, facilitating the examination of the crop soil variables over time. The plot can be exported as a PNG file, granting users the ability to generate reports utilizing these valuable data. The plotting functionality leverages the Chart.js open-source library, seamlessly integrated through dynamic JavaScript implementation. By fetching data through query parameters passed as JSON strings to designated endpoints, the webpage dynamically updates the existing plot without requiring a full page reload.
The export data section offers users the capability to extract and analyze data for further investigation. Using a menu similar to the historical data section, users can refine their data selection based on specific date ranges and sensor nodes. The chosen data are presented in a preview table on the website. JavaScript, employed for document object model (DOM) manipulation and HTTP requests to the platform’s endpoints, facilitates the creation of a dynamic table, similar to the functionality provided in the historical data section.
The configuration section grants users the flexibility to update their account settings, including password and email information, providing them with autonomy over their profiles.
The administration section is exclusively accessible to administrators, endowing them with privileged control and management capabilities. Within this section, administrators can create and configure sensor nodes, defining aliases, addresses, and coordinates for the map representation, and sensor types. Furthermore, administrators have the authority to disable sensor nodes as needed. Additionally, administrators possess the ability to add master nodes, which have assigned aliases and pass keys for enhanced application programming interface (API) security. The administration section also empowers administrators to create new user accounts, modify email addresses, reset passwords, disable accounts, and elevate user accounts to administrator status.
The API section serves as a vital component within the web platform, catering exclusively to the WSN. Consequently, it incorporates specific endpoints designed to facilitate seamless communication and ensure optimal operation. To maintain robust security measures, the API endpoints implement validation mechanisms for HTTP verbs, ensuring that only authorized actions are executed. Furthermore, to safeguard sensitive data, the API mandates the use of HTTPS connections, boosting the platform’s overall security posture.
In line with best practices for web application security, all data transmitted via the API is thoroughly sanitized, significantly reducing the risk of potential attacks, such as SQL injections. By diligently sanitizing the data, the platform minimizes the vulnerability to malicious manipulation and enhances the integrity of the system.
This meticulously structured web platform not only facilitates seamless user navigation but also ensures that each user, whether a farmer or an administrator, has access to the precise functionalities and tools required for efficient data analysis, decision-making, and system management.

2.2.3. Database

Data storage plays a critical role within the monitoring system’s web platform, encompassing sessions, user information, node configuration, and, most notably, the measurements themselves. To effectively meet this requirement, a deliberate approach was adopted, taking into account the limited number of sensor node types involved. Specifically, the system focuses on monitoring seven soil parameters, which allows for a fixed number of columns in the database. This deliberate design simplifies data management processes and ensures consistent storage practices.
To leverage the advantages inherent in a relational database management system like MySQL, the platform was structured accordingly. The structured nature of the data eliminates the need for dynamic schema modifications, streamlining data management procedures. Additionally, the adoption of a relational database approach enhances the system’s scalability, enabling the seamless integration of new sensor node types through the creation of additional tables.
By choosing a relational database approach, the platform ensures the efficient storage and retrieval of measurements. It can effectively handle large volumes of data while maintaining data integrity. Moreover, this design choice provides flexibility for future expansions, facilitating the smooth integration of new sensor node types through the creation of dedicated tables.

2.2.4. API Endpoints

As discussed in previous sections, the web platform incorporates an API that serves as a communication interface between the WSN and the backend. This communication is facilitated through HTTP requests initiated by the master node and handled by the web server. It is important to note that conventional IoT techniques, such as implementing MQTT servers, were not employed in this system. The decision to minimize implementation costs led to the adoption of shared hosting, which supports MySQL database, PHP: hypertext preprocessor, and the ability to install dependencies using a composer.
The primary endpoint utilized by the master node is “/API/getConfig.” It utilizes a GET request with a JSON payload in the request body. If the provided credentials match those stored in the database, the configuration is returned in JSON format. This endpoint serves the purpose of retrieving the necessary configuration parameters required for the WSN’s operation.
The second crucial endpoint is “/API/addMeasurements.” As the name implies, this endpoint is responsible for capturing and adding the measurements obtained from the WSN. The data are received in a POST request in JSON format, following the structure depicted in Figure 6. The payload includes the node ID and passkey, with the timestamp being optional but preferred. The data field consists of a list of JSON objects that carry information from the WSN, including addresses, sensor types, and the corresponding parameter values encapsulated under the data key.
By utilizing these endpoints, the web platform establishes a seamless connection between the WSN and the backend, ensuring the secure transfer of configuration data and measurements. This architecture guarantees the integrity and reliability of the collected information, enabling the platform to effectively process and analyze the data captured by the WSN.

2.3. Fuzzy Logic Model (FLM)

The third main component of the monitoring system is the FLM. In this subsection, we will present the structure of the FLM, including its inputs, which are pH, soil temperature, electric conductivity, soil humidity, and NPK nutrients, the output of the FLM (soil quality) and sub-outputs (physicochemical quality and macronutrient concentration), its rules, and how it was implemented for integration into the web platform.
A Mamdani-type fuzzy inference system (FIS) was chosen for the FLM due to its ability to incorporate expert knowledge [25,31]. This is particularly useful when dealing with the value range classifications of linguistic variables, such as low temperature, optimal temperature, etc. It also allows for the creation of custom outputs, such as medium-quality, medium-high-quality, or high-quality. Mamdani-type FISs are widely used in various domains, including performance assessment, the prediction of variables, and classification [26,31,39].
To effectively assess SQ, it was determined that the FLM should consider the influence of seven key soil parameters: pH, temperature, humidity, electric conductivity, nitrogen, phosphorus, and potassium. These parameters collectively provide valuable insights into the physical, chemical, and nutrient characteristics of the soil [10,40]. Recognizing that SQ encompasses multiple aspects, the FLM aims to decompose it into three primary outputs: physicochemical quality, macronutrient concentration, and overall SQ.
Physicochemical quality (PQ) captures the overall status of the soil’s physical and chemical properties, while macronutrient concentration (MC) focuses on the availability and balance of essential macronutrients [41,42], which are considered to be implemented as outputs of the FIS. Figure 7 provides a comprehensive overview of the fuzzy models developed to address each output.

2.3.1. Inputs

As discussed earlier, the quality of crop soil plays a significant role in determining yield production, including the concentrations of stevioside and rebaudioside in stevia [3,11]. For this study, seven parameters were selected: soil pH, temperature, humidity, electrical conductivity, nitrogen, phosphorus, and potassium. These parameters represent the physical, chemical, and nutrient composition of the soil, which, according to [12], can be used to determine soil quality.
Other variables, including biological processes, could also contribute to assessing soil quality, but measuring each variable, as shown in the literature, can be expensive and not easily automated using a WSN due to the need for human intervention. Therefore, the aforementioned seven parameters were chosen as they represent different aspects of the soil and encompass the most important nutrients [3,11]. Additionally, this choice aligns with the number of parameters that the JXBS-3001 soil sensor can measure, making it a practical selection for the monitoring system. Importantly, input values were not normalized as they did not display significant dispersion among them.
These parameters play a crucial role in determining SQ and have a direct impact on crop health and productivity. For a more comprehensive understanding of the fuzzy inputs of the model for each parameter, refer to Table 1. This table provides a detailed description of the linguistic variables used in the FLM and their corresponding membership functions (MF). It is worth noting that all the membership functions (MFs) in the model inputs are represented using trapezoidal functions. This decision was based on the work of [43], which highlights how trapezoidal functions are convenient for representing fuzzy ranges.
The MFs of each input in the fuzzy model can be visually represented by plotting the functions using their respective parameters. In Figure 8, two input plots are displayed. In (a), the pH input is shown with seven MFs, each representing a different linguistic term. It can be observed that there is an overlap of 0.1 units before and after each limit of the MFs. For instance, if the pH value is considered extra acidic until a limit of 5, the transition from extra acidic to very acidic begins at a pH value of 4.9 and continues until reaching 5.1. In (b), the temperature input is depicted with three MFs. The transitions between linguistic terms are noticeably smaller, with only a 2.5 °C overlap before and after each crisp limit.

2.3.2. Outputs

The fuzzy model produces three distinct outputs: SQ, PQ, and MC. To determine SQ, the model requires the calculation of PQ and MC, which are then fed back into the fuzzy system, as discussed in detail in the rules section. It is important to emphasize that SQ is not solely determined by either PQ or MC individually, but rather by the integration and combination of both factors.
Physicochemical quality represents the physical and chemical characteristics of the soil that influence its suitability for plant growth. Parameters such as pH, temperature, humidity, and electric conductivity are taken into account [41]. By evaluating the input values and their corresponding linguistic variables, the fuzzy model assigns a degree of PQ to the soil. This assessment includes linguistic terms such as low, medium, and high, allowing for the classification of the soil’s PQ based on the input parameters.
On the other hand, MC focuses on the levels of essential macronutrients, namely nitrogen, phosphorus, and potassium, in the soil. These nutrients are crucial for plant growth and development [42]. The fuzzy model assesses the input values of these nutrients and assigns a degree of MC, utilizing linguistic terms such as low, medium, and high.
The outputs of the FLM utilize triangular MFs for each linguistic term. This choice was made based on [43], which suggests that using triangular MFs is more appropriate for fuzzy numbers, which is the case for estimating each output.
The details of these MFs, including their linguistic terms and parameters, can be found in Table 2. This comprehensive table enhances the reproducibility of the fuzzy model, allowing others to accurately replicate and understand the implementation of the MFs for each output.
It is worth mentioning that the scale used for SQ and PQ ranges from 0 to 10. Both SQ and PQ employ a five-membership-function approach, including linguistic terms such as low, medium-low, medium, medium-high, and high. However, MC does not implement the medium linguistic term.
The determination of the number of MFs for each output variable is based on the combinations of the related input variables. In order to assign equal importance to each input, a binary simplification approach is applied. For example, in the case of PQ, which depends on four input variables, the resulting combinations are represented using zeros and ones. Although there are sixteen possible combinations, they can be grouped based on the number of ones in each row and then ordered into five groups. These groups represent the different levels of PQ, ranging from none being good to all being good. Similarly, for MC, which depends on three input variables, the same principle is applied. The combinations are grouped into four required groups, representing the different levels of MC. SQ, unlike MC and PQ, follows a different approach to determining the number of MFs. While MC and PQ have four and five MFs, respectively, resulting in 20 possible combinations, the assignment of MFs for SQ is based on expert knowledge.
The plotted MFs in Figure 9 demonstrate overlapping triangular shapes, enabling a smooth transition between linguistic terms. This design ensures a comprehensive assessment of SQ and MC, accounting for the gradual changes in input parameter values. The well-defined MFs play a crucial role in capturing the inherent uncertainty and providing accurate evaluations within the FIS [25,31].

2.3.3. Rules

The rules of the FLM are derived from the Mamdani algorithm, adhering to an IF-THEN structure. These rules serve as a meaningful representation of the universe of knowledge [29]. An example of a defined rule is
IF pH IS neutral AND temperature IS optimal AND humidity IS optimal AND EC IS low, THEN the PQ IS high.
Although theoretically feasible, defining a total of 5103 rules to cover all possible input combinations is impractical due to the significant time and effort required, as well as the potential for human error. Manual rule definition using graphical user interfaces like MATLAB’s fuzzy logic toolbox or coding in Python would not be a viable solution. As a result, an alternative approach was adopted, employing a binary simplification technique where parameters are categorized as either good or bad. This simplification resulted in a substantial reduction in the number of rules, bringing it down to just 128. To implement this binary simplification, the MFs of the input parameters were mapped to the good or bad classifications. For instance, in the case of nitrogen concentration, a low concentration was classified as bad, while medium and high concentrations were classified as good.
To organize and simplify the rule structure, the rules were categorized based on the desired outputs they aimed to determine. For instance, the determination of PQ focused on the inputs of pH, temperature, humidity, and electric conductivity. MC, on the other hand, relied on the inputs of nitrogen, phosphorus, and potassium. Lastly, the calculation of the SQ output considered the feedback obtained from the other two calculated outputs.
Through the process of categorization and binary simplification, the total number of rules in the system was significantly reduced. For PQ and MC, the binary simplification technique led to a reduction in the number of rules. However, for SQ, the same MFs as PQ and MC are considered as inputs. As a result, there are now 16 rules for determining PQ, 8 rules for MC, and 20 rules for SQ, totaling 44 rules that govern the fuzzy inference process.
It is noteworthy that the FLM consists of three sub-fuzzy models, as depicted in Figure 1. The first two sub-models calculate the PQ and MC based on the input variables. These intermediate results are then fed into the third sub-model, which determines the overall SQ. Despite its modular structure, it is important to understand that the FLM as a whole is treated as a single model. The outputs of the intermediate sub-models serve as inputs for the final sub-model, allowing for a comprehensive evaluation of the SQ. This integrated approach ensures that the relationships between the different components of SQ are properly considered and accounted for in the overall assessment.
Table 3 provides an extract of these rules. It is important to note that the activation of MC’s MF depends on the pre-mapped values of nitrogen, phosphorus, and potassium, which are classified as either good (1) or bad (0).
The rest of the fuzzy rules are in Appendix A, Table A1 and Table A2.

2.3.4. Implementation of the FLM

The implementation of the Mamdani FLM was facilitated by utilizing the Skfuzzy library, which is specifically designed for Python. This library provided a convenient and efficient solution for implementing all components of the fuzzy model, including inputs, outputs, rules, and visualizations of MF.
The declaration process for other inputs and outputs follows a similar structure, with outputs being declared as consequents instead of antecedents. Notably, both “FQ” and “MC” are declared twice, once as an output and again as an auxiliary input, allowing for the reuse of MFs and their parameters.
When declaring the rules for the fuzzy system, an empty list is initially created and then populated using the established binary simplification technique. Logical operations such as AND (represented by “&”) and OR (represented by “|”) are utilized to combine the conditions.
After thorough testing, the fuzzy model was encapsulated within a class to facilitate its usage. Upon the instantiation of the class, the methods for defining variables, rules, and the fuzzy inference system are executed in a sequential manner. This ensures that the model is properly set up and ready for evaluation. The evaluation process is initiated by calling the calculate method, which requires all necessary parameters as arguments. Initially, the model is evaluated using default PQ and MC values. Subsequently, the model is re-evaluated using the resulting PQ and MC values from the initial evaluation. Once the second evaluation is complete, all output values are encapsulated into a dictionary and returned, including SQ.
Additionally, a show method is implemented to enable the visualization of the MF of the selected input or output variables. This method allows for a visual representation of the MF, aiding in the interpretation and understanding of the fuzzy model.

3. Results

The results section is divided into four subsections: web platform results, wireless sensor network performance, gathered data insights, and model validation. These subsections present evidence of implementation and development, including pictures, screenshots, plots, and tables. They showcase the functionality of the web platform, the reliability of the sensor network, trends in the collected data, and the validation of the fuzzy model.

3.1. Web Platform Results

The web platform was developed using plain PHP, hypertext preprocessor, Hypertext Markup Language, JavaScript (JS), and Cascade Style Sheets (CSS), as discussed in its respective subsection. It comprises various modules or sections, such as current data, historical data, export data, configuration, management, and the API utilized by the WSN. The web platform consists of approximately 7600 lines of code, encompassing HTML, CSS, JS, and PHP files. Figure 10 showcases two screenshots of the user interface, (a) displays the main menu featuring buttons for each section. Clicking on a button redirects users to their respective sections. (b) depicts a plot that retrieves captured data by querying a specific date and a selected stevia node, in this case it shows the progression of all seven soil parameters, each with a different color, through time range.
Figure 11 showcases another screenshot of the web platform, specifically the export data section. This section provides users with the functionality to export data from the measurements table. Users have the flexibility to create queries based on date range and sensor node, allowing for customized data retrieval. Additionally, the export data section offers three quick buttons for relative timestamps, enabling users to easily access measurements from today, the last seven days, or the last 30 days.
The second image demonstrates the exported data in comma-separated values (CSV) format. This exemplifies the platform’s capability to interact with external software, facilitating data analysis and further processing outside of the web platform itself.

3.2. Wireless Sensor Network Results

In Section 2.1.1, an overview of the main components of the WSN is provided. The WSN was successfully deployed in the field for a duration of approximately 36 days, during which a substantial amount of data was collected. A total of 5432 measurements were made by the sensor nodes, and these measurements were securely transmitted and stored in the web platform for further analysis.
To illustrate the captured data, Figure 12 shows a plot representing one day of monitoring. The plot reveals interesting insights regarding the dynamics of the monitored variables. Notably, at around 9:00 a.m., there was an irrigation event, which is evident from the increase in the humidity levels in the crop. Throughout the day, the humidity gradually decreased, indicating the gradual water loss due to environmental factors. On the other hand, variables such as macronutrients remained relatively stable, showing minimal fluctuations during the observed day. According to public weather data, for that day, the temperature was 22–32 °C and the sky was sunny; therefore, there was no precipitation, and the temperature matches our measurements.
This snapshot of data provides a glimpse into the temporal dynamics and patterns of the monitored variables within the stevia crop. It demonstrates the effectiveness of the WSN in capturing and recording these measurements, enabling a comprehensive understanding of the crop’s environmental conditions and their potential impact on its growth and development.

3.3. Collected Data

In the analysis of the collected data, a total of 5432 measurements were recorded during the active phase of the monitoring system. Figure 13 presents the initial findings, utilizing histograms to depict the distribution of certain parameters. It is evident that some parameters, such as temperature, pH, and humidity, exhibit variations within a specific range over time. On the other hand, the levels of NPK macronutrients show relatively minimal fluctuations.
The assessment of SQ in the stevia crop where the monitoring system was implemented reveals a low-quality status. The pH values indicate strong acidity rather than being close to neutral. While the temperature remains within acceptable limits, the humidity levels predominantly remained low, only reaching optimal conditions temporarily during irrigation. The electrical conductivity of the soil remained consistently low, indicating favorable conditions. However, the concentration of macronutrients, specifically nitrogen, phosphorus, and potassium, was consistently low throughout the monitoring period. Consequently, the overall SQ is estimated to be low at 2.5 out of 10.
These findings have been shared with the owners and farmers of the stevia crop, along with recommended actions to improve SQ based on the identified deficiencies.

3.4. Fuzzy Model Validation

Fuzzy model validations are commonly conducted using various metrics, among which the determination coefficient or r2 is widely utilized [10,40,49,50]. The r2 can be interpreted as the proportion of the variance in the dependent variable can be predicted from the independent variables. It can also be used to compare the outputs of two models, then observe if there is some linearity. Ranging from 0 to 1, a value of 0 indicates a nonlinear relationship between variables and 1 indicates a perfect linear relationship [50,51]. It is important to note that an r2 value above 0.5 is considered statistically acceptable [33,52] and also considered the best metric to evaluate regression models, even better than mean squared error (MSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and symmetric absolute percentage error (SMAPE) [51].
In the context of this particular study, it is not possible to compare the results of the fuzzy model with a quality standard due to the model’s nature, which is expert knowledge-based and developed using data ranges. As an alternative approach, a linear model was fitted to the processed dataset following the application of the fuzzy model, enabling a comparative analysis.
To validate the model’s performance, a sample was extracted from the complete dataset. The sample size was determined using a 95% confidence level and a 5% margin of error, resulting in a total of 359 rows. The model’s effectiveness was assessed by calculating the r2 value, which obtained a value of 0.906, indicating a high degree of linearity between the linear model and the fuzzy model. However, it is important to acknowledge that the results exhibit limited variation, as evidenced by the data distribution depicted in Figure 14a. It has two main clusters of the predicted outputs, one centered at 2.5 and the other at 5 on the SQ scale.
In order to evaluate the model’s generalization capabilities, it was further assessed using a completely random dataset generated using Python programming libraries for the input variables inside the universe of disclosure of each one. The random dataset was processed by the fuzzy model, a linear model was fitted based on the results, and the r2 value was calculated. The obtained r2 value was 0.532, lower than the r2 value obtained from the collected data but still considered acceptable because it exceeds the threshold of 0.5. Notably, the values in the random dataset are now grouped into four different clusters instead of two, with more transition values observed between these clusters, as depicted in Figure 14. The data distribution of the randomly generated dataset is illustrated in Figure 15, where the SQ histogram visually highlights the aforementioned clusters.

4. Discussion

The results of this study demonstrate that the developed monitoring system effectively measures and analyzes key soil parameters, such as pH, temperature, humidity, electrical conductivity, nitrogen, phosphorus, and potassium, to assess SQ in stevia crops. The findings align with our initial hypotheses, indicating that the model can determine SQ effectively by using the seven aforementioned soil parameters because the obtained r2 was 0.906 for measured data, and a value of 0.532 was obtained for randomly generated data, surpassing the threshold of 0.5 when compared to a linear model, indicating in both cases a statistically significant result. Furthermore, the observed relationships between the measured parameters and the fuzzy model outputs provide valuable insights into the physicochemical quality and macronutrient concentration of the soil. Once the monitoring system has been tested in the field, is accepted by farmers, and is statistically significant, it is ready for replication for Stevia Morita II crops and other types of crops, under the consideration that some range adjustments for variables and even rules have to be made.
No other work was found that also focused on assessing soil quality for a Stevia Morita II crop using a Mamdani fuzzy model; however, in the literature, different monitoring systems are presented, which, like this one, use wireless sensor networks to measure, transport, and store data. LoRa and WIFI protocols were common choices as well. Other works also implement fuzzy models. These are valid for their intended purpose such as predicting the chance of the propagation of plant diseases or assessing students’ performance.
The implications of these findings are significant for stevia producers. This innovation was effectively introduced in a Mexican stevia plantation, made possible by employing strategies to overcome adoption barriers. Effective communication played a vital role in demonstrating how the system addressed the technical requirement for assessing the crop’s soil quality. The system’s user-friendly and visually engaging interface also enhanced its utility for farmers. The monitoring system provides periodic data and historical access, enabling informed decisions about soil management and crop health. Monitoring SQ indicators allows for optimizing nutrient application, irrigation strategies, and overall crop productivity. Furthermore, the system’s continuous operation, coupled with a reliable web server, ensures uninterrupted data collection and analysis, enhancing its practicality and usefulness in the field.
Based on the findings of this study, several promising avenues for future research emerge. Expanding the monitoring system to other crop systems would provide valuable insights into the generalizability of the developed approach. Additionally, incorporating additional parameters and variables, such as organic matter content or microbial activity, could enhance the comprehensiveness and accuracy of the SQ assessment. Furthermore, exploring alternative FISs, such as Takagi–Sugeno–Kang or other artificial intelligence techniques, would be beneficial to further improve the precision and predictive capabilities of the monitoring system.

5. Conclusions

This study underscores how the developed monitoring system, coupled with a fuzzy logic module, effectively evaluates essential soil parameters that impact soil quality. Through our analysis, we proved our hypothesis that a comprehensive evaluation of soil quality for stevia cultivation can be achieved by assessing pH, temperature, humidity, electrical conductivity, nitrogen, phosphorus, and potassium together using a Mamdani fuzzy inference model by using the determination coefficient as metric obtaining a value of 0.906 for real measured data and 0.532 for a randomly generated dataset, both surpassing the 0.5 threshold for acceptance.
The novelty of this work can be seen as the integration of a wireless sensor network using LoRa and WIFI protocols, a web-based platform for data storage and data access, and a statistically valid Mamdani fuzzy inference system to assess the soil quality of a Stevia Morita II crop using the aforementioned seven soil parameters.

Author Contributions

Conceptualization, A.-P.V.-C. and N.G.-D.; methodology, A.-P.V.-C.; software, A.-P.V.-C.; validation, A.-P.V.-C., N.G.-D. and L.S.-E.; formal analysis, N.G.-D. and L.S.-E.; investigation, A.-C.R.-T. and J.-L.Á.-F.; resources, N.G.-D.; data curation, A.-P.V.-C.; writing—original draft preparation, A.-P.V.-C., N.G.-D. and L.S.-E.; writing—review and editing, A.-P.V.-C., N.G.-D., L.S.-E., A.-C.R.-T. and J.-L.Á.-F.; supervision, N.G.-D. and L.S.-E.; project administration, N.G.-D.; funding acquisition, N.G.-D. All authors have read and agreed to the published version of the manuscript.

Funding

This research received funding from “Tecnológico Nacional de México” through the “PROYECTOS DE INVESTIGACIÓN CIENTÍFICA, DESARROLLO TECNOLÓGICO E INNOVACIÓN” program, with project code 13832.22-P.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Requests to access the datasets should be directed to the corresponding author.

Acknowledgments

The authors of this paper would like to express their gratitude to CONACYT and PRODEP for their financial support, as well as TecNM for administrative and technical support. Additionally, special thanks are extended to Rancho Tajeli for providing the opportunity to implement the monitoring system on their stevia crops.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

In Table A1, the rule list of PQ is shown. It can be noted that it is a total of 16 rules. In Table A2, the rule list of SQ is displayed, with a total of 20 rules.
Table A1. Fuzzy model rule list for physicochemical quality.
Table A1. Fuzzy model rule list for physicochemical quality.
pHTemperatureHumidityECOutput’s Activated MFCorresponding Output
0000LowPhysicochemical Quality
0001Medium-low
0010Medium-low
0100Medium-low
1000Medium-low
0011Medium
0101Medium
0110Medium
1001Medium
1010Medium
1100Medium
0111Medium-high
1011Medium-high
1101Medium-high
1110Medium-high
1111High
Table A2. Fuzzy model rule list for soil quality.
Table A2. Fuzzy model rule list for soil quality.
PQMCOutput’s Activated MFCorresponding Output
LowLowLowSoil Quality
LowMedium-lowLow
LowMedium-highMedium-low
LowHighMedium-low
Medium-lowLowMedium-low
Medium-lowMedium-lowMedium-low
Medium-lowMedium-highMedium-low
MediumLowMedium-low
Medium-highLowMedium-low
Medium-lowHighMedium
MediumMedium-lowMedium
MediumMedium-highMedium
MediumHighMedium
Medium-highMedium-lowMedium
Medium-highMedium-highMedium-high
Medium-highHighMedium-high
HighLowMedium-high
HighMedium-lowMedium-high
HighMedium-highHigh
HighHighHigh

References

  1. Ramírez-Jaramillo, G.; Lozano-Contreras, M.G. LA PRODUCCIÓN DE Stevia rebaudiana Bertoni EN MÉXICO. Agro Prod. 2018, 10, 84–90. [Google Scholar]
  2. Aguilar Marín, S.B.; Laitón Jiménez, L.A.; Mejía García, F.E.; Felipe Barrera Sánchez, C.F. Desarrollo de un protocolo para el establecimiento in vitro de Stevia rebaudiana variedad Bertoni Morita II. RIAA 2016, 7, 99–106. [Google Scholar] [CrossRef]
  3. Leszczynska, T.; Piekło, B.; Kopec, A.; Zimmermann, B.F. Comparative Assessment of the Basic Chemical Composition and Antioxidant Activity of Stevia rebaudiana Bertoni Dried Leaves, Grown in Poland, Paraguay and Brazil—Preliminary Results. Appl. Sci. 2021, 11, 3634. [Google Scholar] [CrossRef]
  4. Iatridis, N.; Kougioumtzi, A.; Vlataki, K.; Papadaki, S.; Magklara, A. Anti-Cancer Properties of Stevia rebaudiana; More than a Sweetener. Molecules 2022, 27, 1362. [Google Scholar] [CrossRef]
  5. Stevia Market Size, Share, Trends, Growth, Forecast|Analysis Report. 2022–2030. Available online: https://www.emergenresearch.com/industry-report/stevia-market (accessed on 10 July 2023).
  6. Stevia Market Size is Projected to Reach USD 1.40 Billion by 2030, Growing at a CAGR of 8.9%: Straits Research. Available online: https://www.globenewswire.com/en/news-release/2022/07/06/2475219/0/en/Stevia-Market-Size-is-projected-to-reach-USD-1-40-Billion-by-2030-growing-at-a-CAGR-of-8-9-Straits-Research.html (accessed on 10 July 2023).
  7. Le Bihan, Z.; Cosson, P.; Rolin, D.; Schurdi-Levraud, V. Phenological growth stages of stevia (Stevia rebaudiana Bertoni) according to the Biologische Bundesanstalt Bundessortenamt and Chemical Industry (BBCH) scale. Ann. Appl. Biol. 2020, 177, 404–416. [Google Scholar] [CrossRef]
  8. Hirich, E.H.; Bouizgarne, B.; Zouahri, A.; Ibn Halima, O.; Azim, K. How Does Compost Amendment Affect Stevia Yield and Soil Fertility? Environ. Sci. Proc. 2022, 16, 46. [Google Scholar] [CrossRef]
  9. Youssef, M.A.; Yousef, A.F.; Ali, M.M.; Ahmed, A.I.; Lamlom, S.F.; Strobel, W.R.; Kalaji, H.M. Exogenously applied nitrogenous fertilizers and effective microorganisms improve plant growth of stevia (Stevia rebaudiana Bertoni) and soil fertility. AMB Express 2021, 11, 133. [Google Scholar] [CrossRef] [PubMed]
  10. Tatli, S.; Mirzaee-Ghaleh, E.; Rabbani, H.; Karami, H.; Wilson, A.D. Prediction of Residual NPK Levels in Crop Fruits by Electronic-Nose VOC Analysis following Application of Multiple Fertilizer Rates. Appl. Sci. 2022, 12, 11263. [Google Scholar] [CrossRef]
  11. Angelini, L.G.; Martini, A.; Passera, B.; Tavarini, S. Cultivation of Stevia rebaudiana Bertoni and Associated Challenges. In Sweeteners; Mérillon, J.M., Ramawat, K., Eds.; Reference Series in Phytochemistry; Springer: Cham, Switzerland, 2018. [Google Scholar] [CrossRef]
  12. Norris, C.E.; Bean, G.M.; Cappellazzi, S.B. Introducing the North American project to evaluate soil health measurements. Agron. J. 2020, 112, 3195–3215. [Google Scholar] [CrossRef]
  13. Chatziantoniou, A.; Papandroulakis, N.; Stavrakidis-Zachou, O.; Spondylidis, S.; Taskaris, S.; Topouzelis, K. Aquasafe: A Remote Sensing, Web-Based Platform for the Support of Precision Fish Farming. Appl. Sci. 2023, 13, 6122. [Google Scholar] [CrossRef]
  14. Ahmed, M.A.; Gallardo, J.L.; Zuniga, M.D.; Pedraza, M.A.; Carvajal, G.; Jara, N.; Carvajal, R. LoRa Based IoT Platform for Remote Monitoring of Large-Scale Agriculture Farms in Chile. Sensors 2022, 22, 2824. [Google Scholar] [CrossRef]
  15. Fathy, C.; Ali, H.M. A Secure IoT-Based Irrigation System for Precision Agriculture Using the Expeditious Cipher. Sensors 2023, 23, 2091. [Google Scholar] [CrossRef] [PubMed]
  16. Miao, H.Y.; Yang, C.T.; Kristiani, E.; Fathoni, H.; Lin, Y.S.; Chen, C.Y. On Construction of a Campus Outdoor Air and Water Quality Monitoring System Using LoRaWAN. Appl. Sci. 2022, 12, 5018. [Google Scholar] [CrossRef]
  17. Rokade, A.; Singh, M.; Malik, P.K.; Singh, R.; Alsuwian, T. Intelligent Data Analytics Framework for Precision Farming Using IoT and Regressor Machine Learning Algorithms. Appl. Sci. 2022, 12, 9992. [Google Scholar] [CrossRef]
  18. Seyar, M.H.; Ahamed, T. Development of an IoT-Based Precision Irrigation System for Tomato Production from Indoor Seedling Germination to Outdoor Field Production. Appl. Sci. 2023, 13, 5556. [Google Scholar] [CrossRef]
  19. Tsiropoulos, Z.; Gravalos, I.; Skoubris, E.; Poulek, V.; Petrík, T.; Libra, M. A Comparative Analysis between Battery- and Solar-Powered Wireless Sensors for Soil Water Monitoring. Appl. Sci. 2022, 12, 1130. [Google Scholar] [CrossRef]
  20. Tagarakis, A.C.; Kateris, D.; Berruto, R.; Bochtis, D. Low-Cost Wireless Sensing System for Precision Agriculture Applications in Orchards. Appl. Sci. 2021, 11, 5858. [Google Scholar] [CrossRef]
  21. Jiménez-Buendía, M.; Soto-Valles, F.; Blaya-Ros, P.J.; Toledo-Moreo, A.; Domingo-Miguel, R.; Torres-Sánchez, R. High-Density Wi-Fi Based Sensor Network for Efficient Irrigation Management in Precision Agriculture. Appl. Sci. 2021, 11, 1628. [Google Scholar] [CrossRef]
  22. López Rivero, A.J.; Martínez Alayón, C.A.; Ferro, R.; Hernández de la Iglesia, D.; Alonso Secades, V. Network Traffic Modeling in a Wi-Fi System with Intelligent Soil Moisture Sensors (WSN) Using IoT Applications for Potato Crops and ARIMA and SARIMA Time Series. Appl. Sci. 2020, 10, 7702. [Google Scholar] [CrossRef]
  23. Carucci, F.; Gagliardi, A.; Giuliani, M.M.; Gatta, G. Irrigation Scheduling in Processing Tomato to Save Water: A Smart Approach Combining Plant and Soil Monitoring. Appl. Sci. 2023, 13, 7625. [Google Scholar] [CrossRef]
  24. Andrade, R.O.; Yoo, S.G. A Comprehensive Study of the Use of LoRa in the Development of Smart Cities. Appl. Sci. 2019, 9, 4753. [Google Scholar] [CrossRef]
  25. Elfakki, A.O.; Sghaier, S.; Alotaibi, A.A. An Intelligent Tool Based on Fuzzy Logic and a 3D Virtual Learning Environment for Disabled Student Academic Performance Assessment. Appl. Sci. 2023, 13, 4865. [Google Scholar] [CrossRef]
  26. Hegazi, M.O.; Almaslukh, B.; Siddig, K. A Fuzzy Model for Reasoning and Predicting Student’s Academic Performance. Appl. Sci. 2023, 13, 5140. [Google Scholar] [CrossRef]
  27. Al-Yaari, M.; Aldhyani, T.H.H.; Rushd, S. Prediction of Arsenic Removal from Contaminated Water Using Artificial Neural Network Model. Appl. Sci. 2022, 12, 999. [Google Scholar] [CrossRef]
  28. Moayedi, H.; Tien Bui, D.; Dounis, A.; Ngo, P.T.T. A Novel Application of League Championship Optimization (LCA): Hybridizing Fuzzy Logic for Soil Compression Coefficient Analysis. Appl. Sci. 2020, 10, 67. [Google Scholar] [CrossRef]
  29. Zadeh, L.A. Fuzzy logic. Computer 1988, 21, 83–93. [Google Scholar] [CrossRef]
  30. Zheng, H.; Yang, S. A Trajectory Tracking Control Strategy of 4WIS/4WID Electric Vehicle with Adaptation of Driving Conditions. Appl. Sci. 2019, 9, 168. [Google Scholar] [CrossRef]
  31. Lambat, Y.; Ayres, N.; Maglaras, L.; Ferrag, M.A. A Mamdani Type Fuzzy Inference System to Calculate Employee Susceptibility to Phishing Attacks. Appl. Sci. 2021, 11, 9083. [Google Scholar] [CrossRef]
  32. Zhao, H.; You, J.; Wang, Y.; Zhao, X. Offloading Strategy of Multi-Service and Multi-User Edge Computing in Internet of Vehicles. Appl. Sci. 2023, 13, 6079. [Google Scholar] [CrossRef]
  33. Rosales-Manzo, D.; García-Díaz, N.; Ruiz-Tadeo, A.; García-Virgen, J.; Farías-Mendoza, N. Sistema difuso Takagi-Sugeno para predecir el riesgo de propagación de Sigatoka Negra Mycosphaerella fijiensis en el cultivo de plátano. Rev. Int. De Investig. E Innovación Tecnológica 2020, 8, 12–24. [Google Scholar]
  34. Chopra, S.; Dhiman, G.; Sharma, A.; Shabaz, M.; Shukla, P.; Arora, M. Taxonomy of Adaptive Neuro-Fuzzy Inference System in Modern Engineering Sciences. Comput. Intell. Neurosci. 2021, 2021, 6455592. [Google Scholar] [CrossRef] [PubMed]
  35. Klerkx, L.; Rose, D. Dealing with the game-changing technologies of Agriculture 4.0: How do we manage diversity and responsibility in food system transition pathways? Glob. Food Secur. 2020, 24, 100347. [Google Scholar] [CrossRef]
  36. Iyabano, A.; Leeuwis, C.; Lie, R.; Toillier, A.; Waters-Bayer, A. Making decisions about agroecological innovations: Perspectives from members of farmers’ organizations in Burkina Faso. Int. J. Agric. Sustain. 2023, 21, 2239056. [Google Scholar] [CrossRef]
  37. Strong, R.; Wynn, J.T., II; Lindner, J.R.; Palmer, K. Evaluating Brazilian Agriculturalists’ IoT Smart Agriculture Adoption Barriers: Understanding Stakeholder Salience Prior to Launching an Innovation. Sensors 2022, 22, 6833. [Google Scholar] [CrossRef]
  38. JXBS-3001 Soil NPK Sensor User Manual. Available online: https://5.imimg.com/data5/SELLER/Doc/2022/6/XB/EU/YX/5551405/soil-sensor-jxbs-3001-npk-rs.pdf (accessed on 14 May 2023).
  39. Cardone, B.; Di Martino, F. A Fuzzy Rule-Based GIS Framework to Partition an Urban System Based on Characteristics of Urban Greenery in Relation to the Urban Context. Appl. Sci. 2020, 10, 8781. [Google Scholar] [CrossRef]
  40. Coutinho, R.M.; Sousa, A.; Santos, F.; Cunha, M. Contactless Soil Moisture Mapping Using Inexpensive Frequency-Modulated Continuous Wave RADAR for Agricultural Purposes. Appl. Sci. 2022, 12, 5471. [Google Scholar] [CrossRef]
  41. Al-Hawas, I.A.; Hassan, S.A.; AbdelDayem, H.M. Potential Applications in Relation to the Various Physicochemical Characteristics of Al-Hasa Oasis Clays in Saudi Arabia. Appl. Sci. 2020, 10, 9016. [Google Scholar] [CrossRef]
  42. Ramirez-Builes, V.H.; Küsters, J.; Thiele, E.; Leal-Varon, L.A.; Arteta-Vizcaino, J. Influence of Variable Chloride/Sulfur Doses as Part of Potassium Fertilization on Nitrogen Use Efficiency by Coffee. Plants 2023, 12, 2033. [Google Scholar] [CrossRef]
  43. Sadollah, A. Introductory Chapter: Which Membership Function is Appropriate in Fuzzy System? In Fuzzy Logic Based in Optimization Methods and Control Systems and Its Applications; IntechOpen: Rijeka, Croatia, 2018. [Google Scholar] [CrossRef]
  44. Osorio, N.W. pH del suelo y disponibilidad de nutrientes. MISNV 2012, 1, 1–4. [Google Scholar]
  45. Madhumathi, R.; Arumuganathan, T.; Shruthi, R. Soil NPK and Moisture analysis using Wireless Sensor Networks. In Proceedings of the 11th International Conference on Computing, Communication and Networking Technologies (ICCCNT), Bengaluru, India, 1–6 July 2020. [Google Scholar]
  46. Cultivo de Stevia en el Huerto Paso a Paso: Poda, Riego, Cosecha y Más. Available online: https://www.agrohuerto.com/cultivo-de-stevia-en-el-huerto/ (accessed on 13 March 2023).
  47. Soriano Soto, M.D. Conductividad eléctrica del suelo. Obj. De Aprendizaje. Artículos Docentes 2018, 1, 1–4. [Google Scholar]
  48. Stevia. Available online: https://www.gob.mx/cms/uploads/attachment/file/726330/Stevia.pdf (accessed on 14 March 2023).
  49. Mauri, P.V.; Parra, L.; Mostaza-Colado, D.; Garcia, L.; Lloret, J.; Marin, J.F. The Combined Use of Remote Sensing and Wireless Sensor Network to Estimate Soil Moisture in Golf Course. Appl. Sci. 2021, 11, 11769. [Google Scholar] [CrossRef]
  50. De Vos, B.; Cools, N.; Verstraeten, A.; Neirynck, J. Accurate Measurements of Forest Soil Water Content Using FDR Sensors Require Empirical In Situ (Re)Calibration. Appl. Sci. 2021, 11, 11620. [Google Scholar] [CrossRef]
  51. Chicco, D.; Warrens, M.J.; Jurman, G. The coefficient of determination R-squared is more informative than SMAPE, MAE, MAPE, MSE and RMSE in regression analysis evaluation. PeerJ Comput. Sci. 2021, 7, e623. [Google Scholar] [CrossRef] [PubMed]
  52. Humphrey, W.S. A Discipline for Software Engineering; Addison-Wesley Professional: Boston, MA, USA, 1995; ISBN 978-0201546101. [Google Scholar]
Figure 1. Block diagram of the implemented monitoring system.
Figure 1. Block diagram of the implemented monitoring system.
Applsci 13 09507 g001
Figure 2. Block diagram of the sensor node’s components.
Figure 2. Block diagram of the sensor node’s components.
Applsci 13 09507 g002
Figure 3. Node distribution on Rancho Tajeli.
Figure 3. Node distribution on Rancho Tajeli.
Applsci 13 09507 g003
Figure 4. Implementation of a sensor node on a Stevia Morita II crop.
Figure 4. Implementation of a sensor node on a Stevia Morita II crop.
Applsci 13 09507 g004
Figure 5. Web platform structure.
Figure 5. Web platform structure.
Applsci 13 09507 g005
Figure 6. Expected JSON for the API’s endpoint for adding measurements, it supports different node types and showcases different node addresses.
Figure 6. Expected JSON for the API’s endpoint for adding measurements, it supports different node types and showcases different node addresses.
Applsci 13 09507 g006
Figure 7. FLM composed of three interconnected fuzzy models that determine physicochemical quality macronutrient concentration, and soil quality.
Figure 7. FLM composed of three interconnected fuzzy models that determine physicochemical quality macronutrient concentration, and soil quality.
Applsci 13 09507 g007
Figure 8. Visual representation of each linguistic term of (a) input pH MFs; (b) input temperature’s MFs.
Figure 8. Visual representation of each linguistic term of (a) input pH MFs; (b) input temperature’s MFs.
Applsci 13 09507 g008
Figure 9. Visual representation of each linguistic term of (a) soil quality MFs; (b) macronutrient concentration MFs.
Figure 9. Visual representation of each linguistic term of (a) soil quality MFs; (b) macronutrient concentration MFs.
Applsci 13 09507 g009
Figure 10. (a) Main menu of the web platform. (b) Historical data section, including a plot showing all soil parameters with different colors.
Figure 10. (a) Main menu of the web platform. (b) Historical data section, including a plot showing all soil parameters with different colors.
Applsci 13 09507 g010
Figure 11. (a) Export data section of the web platform, showing the query menu that allows for date range selection and node selection. (b) CSV file downloaded using the data export section of the web platform.
Figure 11. (a) Export data section of the web platform, showing the query menu that allows for date range selection and node selection. (b) CSV file downloaded using the data export section of the web platform.
Applsci 13 09507 g011
Figure 12. Monitored variables’ evolution over one day. Plot generated using the web platform.
Figure 12. Monitored variables’ evolution over one day. Plot generated using the web platform.
Applsci 13 09507 g012
Figure 13. Histograms of data collected using the monitoring system.
Figure 13. Histograms of data collected using the monitoring system.
Applsci 13 09507 g013
Figure 14. (a) Scatter plot of the fuzzy model compared to the linear regression model using collected data from the stevia crop. (b) Scatter plot of the fuzzy model compared to the linear regression model using randomly generated data.
Figure 14. (a) Scatter plot of the fuzzy model compared to the linear regression model using collected data from the stevia crop. (b) Scatter plot of the fuzzy model compared to the linear regression model using randomly generated data.
Applsci 13 09507 g014
Figure 15. Histograms of the randomly generated data for fuzzy model validation.
Figure 15. Histograms of the randomly generated data for fuzzy model validation.
Applsci 13 09507 g015
Table 1. Fuzzy model inputs.
Table 1. Fuzzy model inputs.
Soil ParameterUniverse of DisclosureLinguistic TermMF * TypeMF * Parameters
abcd
pH Extra acidicTrapezoidal004.95.1
Very acidicTrapezoidal4.95.15.45.6
Moderately acidicTrapezoidal5.45.65.96.1
0–14Slightly acidicTrapezoidal5.96.16.46.6
NeutralTrapezoidal6.46.67.27.4
AlkalineTrapezoidal7.27.47.98.1
Very alkalineTrapezoidal7.98.11414
Temperature (°C) ColdTrapezoidal001520
0–50OptimalTrapezoidal15202530
HotTrapezoidal25305050
Humidity (%) DryTrapezoidal006575
0–100OptimalTrapezoidal65758595
WetTrapezoidal8595100100
Electric conductivity (uS/cm) LowTrapezoidal00450550
0–1500MediumTrapezoidal4505509501050
HighTrapezoidal950105015001500
Nitrogen (mg/kg) LowTrapezoidal00106.6126.6
0–300MediumTrapezoidal106.6126.6177.5197.5
HighTrapezoidal177.5197.5300300
Phosphorus (mg/kg) LowTrapezoidal004.24.8
0–20MediumTrapezoidal4.24.88.89.4
HighTrapezoidal8.89.42020
Potassium (mg/kg) LowTrapezoidal0044.154.1
0–180MediumTrapezoidal44.154.1111.6121.6
HighTrapezoidal111.6121.6180180
Parameter ranges were obtained from different authors, pH crisp ranges are retrieved from [44], NPK values from [45], temperature from [46], electric conductivity from [47], and humidity from [48]. * MF is the abbreviation of membership function.
Table 2. Fuzzy Model Outputs.
Table 2. Fuzzy Model Outputs.
Output NameUniverse of DisclosureLinguistic TermMF TypeMF Parameters
abc
Soil Quality LowTriangular001.5
Medium-lowTriangular12.54
0–10MediumTriangular3.556.5
Medium-highTriangular67.59
HighTriangular8.51010
Macronutrient Concentration LowTriangular002
0–10Medium-lowTriangular13.56
Medium-highTriangular46.59
HighTriangular81010
Physicochemical Quality LowTriangular001.5
Medium-lowTriangular12.54
0–10MediumTriangular3.556.5
Medium-highTriangular67.59
HighTriangular8.51010
MF is the abbreviation of membership function.
Table 3. Fuzzy model rule list for macronutrient concentration.
Table 3. Fuzzy model rule list for macronutrient concentration.
NitrogenPhosphorusPotassiumOutput’s Activated MF *Corresponding Output
000LowMacronutrient concentration
001Medium-low
010Medium-low
100Medium-low
011Medium-high
101Medium-high
110Medium-high
111High
* MF is the abbreviation of membership function.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Vejar-Cortés, A.-P.; García-Díaz, N.; Soriano-Equigua, L.; Ruiz-Tadeo, A.-C.; Álvarez-Flores, J.-L. Determination of Crop Soil Quality for Stevia rebaudiana Bertoni Morita II Using a Fuzzy Logic Model and a Wireless Sensor Network. Appl. Sci. 2023, 13, 9507. https://doi.org/10.3390/app13179507

AMA Style

Vejar-Cortés A-P, García-Díaz N, Soriano-Equigua L, Ruiz-Tadeo A-C, Álvarez-Flores J-L. Determination of Crop Soil Quality for Stevia rebaudiana Bertoni Morita II Using a Fuzzy Logic Model and a Wireless Sensor Network. Applied Sciences. 2023; 13(17):9507. https://doi.org/10.3390/app13179507

Chicago/Turabian Style

Vejar-Cortés, Angel-Primitivo, Noel García-Díaz, Leonel Soriano-Equigua, Ana-Claudia Ruiz-Tadeo, and José-Luis Álvarez-Flores. 2023. "Determination of Crop Soil Quality for Stevia rebaudiana Bertoni Morita II Using a Fuzzy Logic Model and a Wireless Sensor Network" Applied Sciences 13, no. 17: 9507. https://doi.org/10.3390/app13179507

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop