Next Article in Journal
Twice-Split Phosphorus Application Alleviates Low Temperature Stress by Improving Root Physiology and Phosphorus Accumulation, Translocation, and Partitioning in Wheat
Next Article in Special Issue
Achieving the Rewards of Smart Agriculture
Previous Article in Journal
Synthesis and Application of Modified Lignin Polyurea Binder for Manufacturing a Controlled-Release Potassium Fertilizer
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Blockchain-Based Crop Recommendation System for Precision Farming in IoT Environment

1
Department of Computer Science and Engineering, Institute of Technology, Nirma University, Ahmedabad 382481, India
2
Power Engineering Department, Gheorghe Asachi Technical University of Iasi, 700050 Iasi, Romania
3
Power Systems Department, Politehnica University Timisoara, 300223 Timisoara, Romania
4
Software Engineering Department, College of Computer and Information Sciences, King Saud University, Riyadh 11437, Saudi Arabia
5
Computer Science Department, Community College, King Saud University, Riyadh 11437, Saudi Arabia
*
Authors to whom correspondence should be addressed.
Agronomy 2023, 13(10), 2642; https://doi.org/10.3390/agronomy13102642
Submission received: 14 September 2023 / Revised: 6 October 2023 / Accepted: 6 October 2023 / Published: 19 October 2023
(This article belongs to the Special Issue IoT in Agriculture: Rationale, State of the Art and Evolution)

Abstract

:
In agriculture, soil is a vital element that decides the quality and yield of agricultural produce. Soil consists of various nutrients such as nitrogen (N), phosphorous (P), potassium (K), the potential of hydrogen (pH), and water content. Nitrogen is responsible for building chlorophyll, which helps produce proteins and thus directly contributes to plant growth and development. Phosphorous is needed to develop root systems and flowers, whereas potassium helps increase disease resistance. Each of these play a role in crop cultivation. Thus, in this research paper, considering the fact that soil health will provide farmers with the best selection of crops that are compatible with their farm’s soil nutrients, we propose an algorithm for recommending a set of suitable crops based on various soil attributes. These soil nutrients can be collected in real-time using soil sensors, such as N, P, K, and pH, and humidity sensors. They can be deployed in farms where the cultivation takes place. These sensor readings would then be transferred to the blockchain layer, thereby validating the data and ensuring it is tamper-proof and evident. The crop recommendation model uses data from these sensors in real-time, increasing the results’ accuracy. The last stage leads us to display these results via a user dashboard, which helps the farmers to keep in check with their farm’s practices, and their sensor states from remote locations.

1. Introduction

Our entire ecosystem has been highly dependent on agriculture for many of the last few decades. Agriculture involves the scientific process of cultivating soil and growing crops. It includes practicing various activities such as horticulture, aquaculture, livestock production, and farming. Farming is essential to a country’s economy and to individuals, as the food we consume comes from farms. Globally, India is understood as the second most populous country, which leads to a greater demand for food in India. Thus, farmers employ various methods such as crop rotation, the use of organic fertilizers, modern irrigation techniques, and intercropping to enhance crop yield and increase agricultural outputs. In India, intercropping was traditionally performed using mixed cropping, where two or more crops were grown together in the same field [1]. This practice allows farmers to maximize their available resources and reduce the risk of crop failure. This approach raised concerns, however, as farmers usually pick a crop based on their instincts without considering salient factors such as soil health, weather conditions, and market price. The consequences for the same include bad harvests and less profits for farmers [2].
To combat the aforementioned problems, many researchers have provided various solutions. For example, Gupta et al. [3] presented the use of an Internet of things (IoT)-based smart farming method, which improved an agricultural system by monitoring the field in real-time. Factors like humidity, temperature, etc., were considered, and machine learning (ML) algorithms were applied—which recommended a suitable crop. Further, Bhuyan et al. [4] provided a statistical look at the features, and they indicated the best crop type based on the given features. ML algorithms, like the k-nearest neighbor, support vector machine, random forest, and gradient-boosting trees, have been examined for crop-type prediction. Panigrahi et al. [5] developed an ML model to predict farm production. Data were collected and trained using supervised ML with six distinct regression models to estimate the crop yield. The productivity of a crop also depends on the nutrient content of the soil. However, these solutions have not considered important attributes such as nitrogen (N), phosphorus (P), potassium (K), and pH sensors, which play a vital role in determining the effective crop yield.
In line with the above-said issues, Ref. [6] explored the correct usage of soil nutrients such as N, P, and K. Their exploration was used to develop a knowledge-based system using IoT sensors. Furthermore, Ahmed et al. [6] used an improved genetic algorithm (IGA) to recommend an optimal setting for the nutrients of different crops. In addition, Paul et al. [7] classified soil into low, medium, and high categories using data mining techniques such as naive Bayes to predict the crop yield. Despite the various benefits of previous approaches for crop nutrient prediction, it has some disadvantages, such as—instead of using a dataset with values in a discrete format (low, mild, and bad)—the fact that working on attributes that have continuous values can lead to imprecise outcomes. Algorithms using nutrients like N, P, and K can make inaccurate predictions. Thus, utilizing all essential attributes would lead to comparatively better crop predictions.
Soil nutrient deficiency can be treated by adding fertilizers to soil. As such, farmers presume that adding readily available fertilizers can improve the quality of their yield in a short period of time. Repeated use of these fertilizers can produce contaminated harvests and reduce soil fertility. Thus, it is important to understand specific nutrient deficiencies in the soil and to look for an appropriate solution. This invites the need for a fertilizer recommendation system that suggests fertilizers based on a nutrient deficiency in the soil. This results in optimized resource use and better crop yields. Information sharing in an IoT-based system through an open wireless channel can pose various security risks. Since the system is connected to the internet, it is vulnerable to cyber attacks such as hacking, data breaches, malware, etc. The real-time data from the sensors can be hindered, manipulated, and altered; hence, anomalies in the prediction of a crop can occur. Since farmers rely on such apps, they may grow the crop in a manner that is recommended by an erroneous prediction model; therefore, they would then be at a loss as they would not receive a healthy harvest.
Cloud computing is another excellent technology that enables us to store valuable data from our sensors on the cloud, and it even allows us to access it remotely [8]. The paper on an IoT framework for precision agriculture by Bakthavatchalam et al. [9] proposed a system for interfacing real-world data with sensors. These sensors were deployed in various locations and were combined to form a network. The responses acquired by these sensors could then be stored and accessed via the cloud. However, the use of a cloud system can have challenges like data security and reliability. Data transmitted over the cloud can be tampered with and used for illegitimate purposes. Nevertheless, like any challenge, there is a solution to this particular problem.
The blockchain can be implemented to overcome these problems. It ensures enhanced security, increased transparency, traceability, faster transactions, and data-sharing techniques. It can be used to build a trusted and open agriculture ecosystem, even when the parties in the system may not trust each other. The study of Hang Xiong [10] represents the integration of agriculture with the blockchain in his work. It examines the applications of blockchain technology, which can help create reliable food supply chains and can build trust between producers and customers. The paper also talks about smart farming methods, the transactions made by farmers, and the forming of the ecosystem that utilizes blockchain technology in the agricultural sector. Demestichas [11], in his paper, talks about the lack of transparency and traceability in the food supply chains. The paper highlights the need for blockchain technologies that are fueled by other digital traceability systems, such as Radio-Frequency Identification sensors, IoT, etc., which increase the transparency and traceability of the food supply chains. Transmission of data through wireless mediums such as cellular networks can pose various security threats, such as stealing information to gain access to private data. Devices connected via cellular networks are vulnerable to malware, viruses, or to denial of service attacks. Also, data can be tampered with and an unauthorized user can modify users’ private data. For example, due to the openness of the network, an adversary can perform data injection attacks that can modify the recommended crop. Such manipulation can jeopardize the crop recommendation system. Hence, a tamper-proof mechanism is required to ensure the security and privacy of the crop recommendation in precision farming. From that viewpoint, blockchain technology is a viable solution for tackling the security threats of precision farming. The blockchain poses several security advantages over conventional data storage (databases); for instance, the blockchain uses a decentralized approach through which to distribute crop data between different blockchain nodes. Similarly, transparency ensures that all data must be shared and visible to the legitimate users of the blockchain. Likewise, immutability offers secure data storage without allowing any unauthorized access. Incorporating this technology fulfills the requirements for a transparent, trustworthy, and traceable environment for crop recommendation in precision farming. It eliminates intermediaries and hence aids individuals to handle their data independently. Various research papers have implanted blockchain technology to overcome the security risks in various transmission channels to ensure security in an IoT-based system. Here, blockchain technology comes to the rescue by ensuring transparency and the easy traceability of the data [12].
Lin et al. [13] presented the significant advantage of integrating blockchain and IoT technology, wherein they utilized the modern information and communication technology (ICT)-based smart agriculture. Further, they also used blockchain networks to enhance the local and regional agricultural scales. Alternatively, Rahman et al., in [14], introduced a reliable and scalable data-sharing framework that involves access control through which to enhance security in smart agriculture systems. The framework includes anonymous entities that ensure users their data privacy. Their proposal ensured trustworthiness, privacy, scalability, high-throughput sequencing, information-intensive farming, and accessibility. The authors of [15] proposed a cybersecurity monitoring framework that employed different Arduino sensor kits, cloud modules, and Ethereum-based smart contracts. The smart contracts were deployed on a Rinkeby test network and assessed using different evaluation metrics, such as network latency. Table 1 presents the comparative analysis of the proposed and existing state-of-the-art works.

1.1. Research Contributions

The major contributions of the article are as follows.
  • We proposed a crop recommendation system for precision farming using N, K, P, and pH sensors. We considered an IoT-based agriculture environment by installing distinguished sensors, collecting soil data, and recommending the best few crops.
  • Further, we adopted blockchain technology for securing the sensor data that were captured from N, K, P, and pH sensors. It offers data immutability and transparency for the best recommendations.
  • The proposed framework was assessed and analyzed using different evaluation metrics, such as a data graph of the sensors, smart contract user-defined functions, and transaction cost. In addition, we designed a dashboard for the users to analyze the soil nutrient level for efficient farming.

1.2. Organization

The rest of the paper is organized as follows. Section 2 presents the proposed framework for crop recommendation. Section 3 discusses the results analysis of the proposed framework with its real-time deployment on a user interface. Section 4 concludes the paper.

2. Proposed Framework

The presented framework demonstrated in Figure 1 depicts the workings of the various stages of the crop recommendation system. The system consists of six stages: data collection, data migration, data preprocessing, the use of blockchain technology, implementation of a crop recommendation algorithm, and a user dashboard. Figure 2 shows the workflow of the proposed crop recommendation system. Each stage is elucidated as follows.

2.1. Data Collection

The dataset we created for the crop recommendation model resulted from the compilation of raw data from multiple online references. The dataset covers five main attributes, namely nitrogen (N), phosphorous (P), potassium (k), pH, and water content. In addition, it is composed of 49 different agricultural products, which—when classified botanically—consist of crops, fruits, and vegetables. The values in the dataset indicate a desirable range for the N, P, and K content, as well as the pH and water content in the soil that corresponds to every crop. In our first stage, we install farm sensors to collect the data of the relevant soil attributes such as soil pH, nitrogen, phosphorus, potassium, and water content. In the proposed work, we employed different sensors to monitor various parameters such as soil moisture, temperature, pH level, and nutrient content. To ensure the accuracy of our data, we implemented sensor calibration procedures. For that, each sensor undergoes the calibration process in a controlled environment that mimics the field (farm) conditions. This process is repeated at regular intervals, typically every 30–40 s (this range was chosen after going through various studies in the literature), to maintain the precision of measurements. Moreover, the frequency of the sensor operation is configured based on the specific needs of each crop type. For instance, moisture sensors that operate more frequently during dry seasons or some crops that require consistent soil moisture levels. By incorporating these calibration procedures and adjusting operation frequency, we aim to provide accurate and timely data for our crop recommendation system. Data can be derived from an observation or a measurement of any event; thus, soil nutrient, pH, and humidity sensors provide us with real-time data on soil constituents and conditions. Consider N  { x | x = 5 and attributes measured } and SN (the reading of S different sensors), where SN = { x | x to Z * } . S i N j is the deviation for the jth attribute for the sensor ( S i ). These sensors will be programmed to collect the data in a CSV format, which will be further migrated for processing. Table 2 presents the sample data from the N sensors for a time frame T, where P t S i represents the sensor data from sensor i at an instant t, i goes from 1 to N, and t goes from 1 to T.

2.2. Data Migration/Transmission

After the data have been collected, the next step is to transmit the data from the sensors to the cloud server. The data generated from the sensors are sent to the cloud with the help of a cellular network. The cellular network works well with large coverage areas. Cellular modems are used as the medium to modulate the analog signal that is generated by the sensors so that the data can be transmitted using cellular networks. During the data migration to the cloud server, we utilize a message query telemetry transport (MQTT) network protocol that efficiently disseminates the data among different deployed sensors for precision farming. Here, the MQTT protocol defines two network entities, i.e., a message broker (source sensors) and a client (destination sensor). In the proposed work, the deployed sensor publishes a message for a specific task related to precision farming, and all devices that are subscribed to that task will receive the message. For example, a moisture sensor can publish moisture data on a topic like “crop/farming”, and any device subscribed to this topic will receive these data. Further, MQTT uses bi-directional communication, i.e., it can publish sensor data and will still be able to receive configuration information or control commands from brokers or from other sensors. Hence, MQTT facilitates the communication between devices, enables real-time data exchange, and minimizes unnecessary network traffic. The data are then stored on the cloud server, from where it can be fetched whenever needed.

2.3. Data Prepossessing

Data preprocessing is required to eliminate inconsistencies in the data. Figure 3 outlines the various preprocessing steps. Inconsistencies may include missing values, errors, noise, duplicate values, and data from different units and ranges. This makes the data difficult to read and hence needs to be processed. The sensors may be damaged, malfunctioned, or damaged, due to which sensors may give missing values. These missing values can be removed by interpolation, extrapolation, and smoothing, or with the help of machine learning algorithms. We removed the missing values by an interpolation technique, where the value of the missing values was determined with the help of nearby valid data [16].
The average of the valid data was taken, and the missing values were replaced by that value. Moreover, the data can include values in different ranges and units. Thus, the data need to be normalized so that we do not receive anomalies while using these data to recommend a crop. Normalization is required so that the values that belong to different ranges and units are normalized between 0–1. The min-max algorithm was used to normalize our data from the sensors. The main aim of the min-max algorithm is to perform a linear transformation on the data and to bring it between 0 and 1. The formula is as follows:
x s c a l e d = x x m i n x m a x x m i n .
Here, x m i n and x m a x are the minimum and maximum values of the data, respectively, and x s c a l e d is the scaled data in the range of (0,1). This algorithm results in a range with smaller standard deviations, which subdue the influence of outliers and, at the same time, conserve the relationship among the original values.

2.4. Blockchain Layer

The fourth stage involves the use of blockchain technology. Clean and processed sensor data from the cloud are moved to the next layer. This layer will validate sensor readings, i.e., the N, P, K, and pH readings from the sensors, and it will ensure they are tamper-proof and evident, as shown in Figure 4. Each block on the blockchain will store these readings from the IoT devices along with its timestamp, thus maintaining a record of the real-time data that are fetched from the sensors. Smart contracts automate the process and eliminate the need for dependency on third parties. Smart contracts are essentially self-executing programs written into a blockchain that consists of the terms of an agreement or contract. Once the conditions of the contract are met, it executes the smart contracts, which then automates all the transactions and streamlines various commercial processes. These actions would otherwise need the dependency of third parties. The blockchain provides data security with the use of private and public keys. The data received are securely stored inside the immutable blockchain ledger. Smart contracts thus confirm that data remains secure, thereby preventing unauthorized access or tampering. Thus, no other entity has to verify that the data coming from the sensor is from a genuine actor. The smart contract has several attributes and user-defined functions, as shown in Figure 5. It includes the farmer’s name, address, crop name, batch ID, soil nutrient values, and timestamp. These attributes and functions validate/verify the crop data based on the conditions created in the smart contract. After satisfying all the conditions in the smart contacts, the data are stored in the blockchain [17]. This ensures the authenticity of all the sensor readings as no one can delete or modify the data stored in this blockchain.

2.5. Crop Recommendation Model

Consider the following, we have n sensors { S 1 , S 2 , S 3 , , S n } S that are used for sensing the nutrient content of the soil. Consider n soil nutrients { S 1 N 1 , S 2 N 2 , S 3 N 3 , , S n N n } S i N i that correspond to the reading of each S i sensor for a given time frame. Also, consider a dataset with crops { C 1 , C 2 , C 3 , , C r } C , where r is the total number of crops that corresponds with { C 1 N 1 , C 2 N 2 , C 3 N 3 , , C n N n } as a range of recommended values corresponding to those N attributes. The algorithm checks if S N i is a subset of C i N i { i { 1 , , n } } . If it is a subset, then C y is the recommended crop. If the n − 1 readings of S i N i are not the subset of C i N i , then the algorithm will recommend increasing the S i N i to become a subset of S i N i . In Algorithm 1 (line 1), we created an array R. Then (lines 2–5), the loop starts and compares the sensor reading, S i N i , with a lower limit and upper limit of C n N n . Here, L corresponds to the list of lists, which comprises the crop names and the lower limits of C n N n (i.e., the recommended values) that are associated with that crop. Similarly, the upper limit consists of the crop name and the upper limit of C n N n that are associated with that crop. This lower list and upper list are denoted as L and R, respectively. If SR[i] satisfies the condition, then (line 6) we append the C[i] corresponding to the array R[].
Algorithm 1  Recommended crop result algorithm.
Inputs: Lower limit list L, Upper limit list U, and Sensor data SN
Output: Result R
1:
R=[]
2:
for i in range(len(SN)): do
3:
    for j in range(len(L)): do
4:
        if  a l l  (L[j][i+1] < = SN[i] then
5:
           if SN[i] > = U[j][i+1]) then
6:
               R.append(L[j][0])
7:
           end if
8:
        end if
9:
    end for
10:
end for
11:
Return R

2.6. User Dashboard

After implementing the crop recommendation model of the sensor data, we obtained a set of the most preferred crops suitable for various measurements, such as soil nutrients, the pH, and water content. Growing these crops would benefit farmers by improving the productivity of the farmlands by maximizing the use of available resources. The last stage leads us to display these results via the user dashboard. The dashboard will simplify the process of monitoring and analyzing the data from various farm resources, such as nutrients, the pH, and humidity sensors. It can help farmers to keep in check with their farms from remote locations.

3. Results and Discussion

This section illustrates the performance analysis of the proposed work. It is bifurcated into three phases, i.e., recommendation-based results, blockchain-based results, and the implementation interface. A detailed explanation of each phase is as follows.

3.1. Recommendation-Based Results

Figure 6 shows the real-time data of the soil nutrients from the sensors at different time instances. The soil nutrients include N, P, K, and the pH. The y-axis depicts sensor values for each nutrient (mg/kg), and the x-axis represents the change in value concerning time (in hours). The graph shows an hourly report outline of the nutritional levels of each nutrient.
Further, Figure 7a shows the probability of several soil nutrients that were received from the soil sensors that fall into the recommended range of the soil nutrients of a particular crop. As can be interpreted from the graph, the probability that all four nutrients match the required range of a particular crop is the lowest. A crop will be recommended only if any of the four, three, or two of the total soil nutrients fall into the required range for growing that crop. Otherwise, the crop will not be recommended in the case of only one match or no match. Figure 7b depicts the favorable range of the soil nutrient values of the crop mango and its corresponding sensor readings. The orange bar in the graph represents the required range of values of soil nutrients to grow mangoes. In comparison, the black line in the graph is the discrete sensor values that were retrieved from the sensors deployed on a farm. All the black lines were inside the orange bar of all the mango soil nutrients, which implies that the mangoes could be grown since all the soil nutrient requirements were satisfied.
Figure 7c depicts the favorable range of soil nutrient values for the crop “carrot” and its corresponding sensor readings. The orange bar in the graph represents the required range of the soil’s nutrient value to grow carrots. In contrast, the black line in the graph is the discrete sensor values that were retrieved from the sensors deployed on a farm. The sensor readings of N, P, and the pH satisfied the soil nutrient requirements since they were inside the orange bar, whereas the sensor reading of K was not inside the orange bar, which means the sensor reading of K did not fall into the required range for growing carrots.
Figure 8 depicts the favorable range of soil nutrient values of the crop “watermelon” and its corresponding sensor readings. The orange bar in the graph represents the required range of the soil nutrient values needed to grow watermelon. In comparison, the black line in the graph is the discrete sensor values retrieved from the sensors deployed on a farm. The sensor readings of K and P satisfied the soil nutrient requirements since they were inside the orange bar. In contrast, the sensor readings of N and pH were not inside the orange bar, meaning the K and pH readings did not fall into the required range for growing watermelon.

3.2. Blockchain-Based Results

This section discusses the blockchain results, where the recommended crop from the recommendation system was securely stored inside the distributed and immutable ledger. Toward this goal, we designed a smart contract that validates the incoming crop-recommended data to enhance the security and privacy of the proposed work. In the smart contract, we included different get() and set() functions to register the farmers, their crops, their recommended crops, the chemical properties of their crops (N, K, and P), and timestamps. Figure 9 shows the user-defined functions involved in the designed smart contract. Once the smart contract is implemented, it is compiled using a solidity compiler with version 0.8.18+commit.87f61d96. Then, the compiled smart contract is deployed on a test network, i.e., the Sepolia test network when using a MetaMask wallet version 11.0.0.
Figure 10 shows the transaction cost when deploying smart contract functions on the distributed and immutable ledger. It refers to the amount of gas required to execute a transaction on the Ethereum-based public blockchain. Here, each function is deployed or executed on the blockchain; this operation consumes computational resources, so a transaction fee is required from the blockchain participants. These resources are measured in gas, a unit of calculation representing the amount of computational work needed to act.

3.3. Implementation Interface

Figure 11 displays the application dashboard of the user. The dashboard tracks the various parameters of the farm and then visually depicts the same. It includes displaying the total number of sensors deployed on the farm from which we receive data; furthermore, an analysis of the sensor data, the graphical representation of the soil nutrients, the water content of the soil, and the recommended crops from the formerly mentioned parameters is then carried out.

3.3.1. Information about the Sensors

One of the features of the user dashboard is in displaying the number of sensors online. It concludes the number of sensors from which the data is retrieved, and it uses that data to analyze it for the recommendation of a particular crop. As can be inferred from Figure 11, there are four sensors online from which the data is received. The weekly readings from the N, P, and K sensors are portrayed graphically. The dashboard also displays the pH of the soil, which can be seen as “5.4” in Figure 11.

3.3.2. Water Content of the Soil

The amount of water the soil holds is an essential parameter for the healthy growth of a crop. The dashboard graphically represents the water level in the soil. The graphs input the monthly readings of the water content of the soil. As can be inferred from the graph, the water content was the highest in March.

3.3.3. Comparing the Sensor and the Desired Range of the Soil Nutrients for Growing a Particular Crop

The dashboard also includes a graphical representation of the analysis made through the sensor data and from the dataset.

3.3.4. Recommended Crops

In the end, after considering all the essential factors, the recommendation system recommends the most suitable crops to be grown on the user’s farm. As seen in Figure 11, wheat and rice were recommended to the user, along with useful tips such as increasing or decreasing a particular soil nutrient content in the farm to ensure the healthy growth of that particular crop. The tips help to improve production and promise a good harvest for the user.

4. Conclusions

This paper used a recommender system algorithm to recommend crops to farmers based on soil nutrient attributes such as N, P, K, and pH. Soil sensors are deployed on a farm, and the readings are transmitted via the cellular network to the cloud. The data from the cloud are procured and then input into the algorithm via a blockchain-based system, thus ensuring the data’s secure traversal without any intrusion. The algorithm outputs the recommended crops that can be grown on the farm. The choice of crop affects the yield; hence, with the accuracy of our algorithm, only the crops that promise a healthy harvest and profit for farmers are suggested.
In future work, we would recommend crops that can be mixed-cropped based on their compatibility, as well as the type of irrigation system that would best benefit the farmers.

Author Contributions

Conceptualization: R.G., S.T., D.H.P., B.C.N., A.T. and K.P.S.; writing—original draft preparation: D.H.P., K.P.S., R.G., S.A., N.K.J., B.C.N. and F.A.; methodology: S.T., R.G., F.A., A.T. and N.K.J.; writing—review and editing: S.T., R.G., A.T., N.K.J., B.C.N. and F.A.; investigation: D.H.P., K.P.S., S.T., A.T., R.G. and F.A.; visualization: D.H.P., K.P.S., R.G., B.C.N. and S.A. All authors have read and agreed to the published version of the manuscript.

Funding

This work was funded by the Researchers Supporting Project Number (RSPD2023R681), King Saud University, Riyadh, Saudi Arabia.

Data Availability Statement

No data are associated with this research work.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Haider, W.; Rehman, A.U.; Abbasi, M.A.; Khan, S.; Durrani, N.M. Towards Hybrid Smart Irrigation for Mixed-Cropping. In Proceedings of the 2022 Global Conference on Wireless and Optical Technologies (GCWOT), Malaga, Spain, 14–17 February 2022; pp. 1–6. [Google Scholar] [CrossRef]
  2. Jaybhaye, N.; Tatiya, P.; Joshi, A.; Kothari, S.; Tapkir, J. Farming Guru:—Machine Learning Based Innovation for Smart Farming. In Proceedings of the 2022 4th International Conference on Smart Systems and Inventive Technology (ICSSIT), Tirunelveli, India, 20–22 January 2022; pp. 848–851. [Google Scholar] [CrossRef]
  3. Gupta, A.; Nagda, D.; Nikhare, P.; Sandbhor, A. Smart crop prediction using IoT and machine learning. Int. J. Eng. Res. Technol. 2021, 9, 18–21. [Google Scholar]
  4. Bhuyan, B.P.; Tomar, R.; Singh, T.P.; Cherif, A.R. Crop Type Prediction: A Statistical and Machine Learning Approach. Sustainability 2023, 15, 481. [Google Scholar] [CrossRef]
  5. Panigrahi, B.; Kathala, K.C.R.; Sujatha, M. A Machine Learning-Based Comparative Approach to Predict the Crop Yield Using Supervised Learning With Regression Models. Procedia Comput. Sci. 2023, 218, 2684–2693. [Google Scholar] [CrossRef]
  6. Ahmed, U.; Lin, J.C.W.; Srivastava, G.; Djenouri, Y. A nutrient recommendation system for soil fertilization based on evolutionary computation. Comput. Electron. Agric. 2021, 189, 106407. [Google Scholar] [CrossRef]
  7. Paul, M.; Vishwakarma, S.K.; Verma, A. Analysis of Soil Behaviour and Prediction of Crop Yield Using Data Mining Approach. In Proceedings of the 2015 International Conference on Computational Intelligence and Communication Networks (CICN), Jabalpur, India, 12–14 December 2015; pp. 766–771. [Google Scholar] [CrossRef]
  8. Kumari, A.; Gupta, R.; Tanwar, S.; Kumar, N. Blockchain and AI amalgamation for energy cloud management: Challenges, solutions, and future directions. J. Parallel Distrib. Comput. 2020, 143, 148–166. [Google Scholar]
  9. Bakthavatchalam, K.; Karthik, B.; Thiruvengadam, V.; Muthal, S.; Jose, D.; Kotecha, K.; Varadarajan, V. IoT Framework for Measurement and Precision Agriculture: Predicting the Crop Using Machine Learning Algorithms. Technologies 2022, 10, 13. [Google Scholar] [CrossRef]
  10. Xiong, H.; Dalhaus, T.; Wang, P.; Huang, J. Blockchain Technology for Agriculture: Applications and Rationale. Front. Blockchain 2020, 3, 7. [Google Scholar] [CrossRef]
  11. Demestichas, K.; Peppes, N.; Alexakis, T.; Adamopoulou, E. Blockchain in Agriculture Traceability Systems: A Review. Appl. Sci. 2020, 10, 4113. [Google Scholar] [CrossRef]
  12. Gupta, R.; Tanwar, S.; Kumar, N. Blockchain and 5G integrated softwarized UAV network management: Architecture, solutions, and challenges. Phys. Commun. 2021, 47, 101355. [Google Scholar] [CrossRef]
  13. Lin, J.; Shen, Z.; Zhang, A.; Chai, Y. Blockchain and IoT based food traceability for smart agriculture. In Proceedings of the 3rd International Conference on Crowd Science and Engineering, Singapore, 28–31 July 2018; pp. 1–6. [Google Scholar]
  14. Ur Rahman, M.; Baiardi, F.; Ricci, L. Blockchain Smart Contract for Scalable Data Sharing in IoT: A Case Study of Smart Agriculture. In Proceedings of the 2020 IEEE Global Conference on Artificial Intelligence and Internet of Things (GCAIoT), Virtual Conference, 12–16 December 2020; pp. 1–7. [Google Scholar] [CrossRef]
  15. Chaganti, R.; Varadarajan, V.; Gorantla, V.S.; Gadekallu, T.R.; Ravi, V. Blockchain-Based Cloud-Enabled Security Monitoring Using Internet of Things in Smart Agriculture. Future Internet 2022, 14, 250. [Google Scholar] [CrossRef]
  16. Tawakuli, A.; Engel, T. Towards Normalizing The Design Phase of Data Preprocessing Pipelines For IoT Data. In Proceedings of the 2022 IEEE International Conference on Big Data (Big Data), Osaka, Japan, 17–20 December 2022; pp. 4589–4594. [Google Scholar] [CrossRef]
  17. Mancer, M.; Terrissa, L.S.; Ayad, S.; Laouz, H. A Blockchain-based approach to securing data in smart agriculture. In Proceedings of the 2022 International Symposium on Innovative Informatics of Biskra (ISNIB), Biskra, Algeria, 7–8 December 2022; pp. 1–5. [Google Scholar] [CrossRef]
Figure 1. The proposed framework.
Figure 1. The proposed framework.
Agronomy 13 02642 g001
Figure 2. Work flow of the crop recommendation system.
Figure 2. Work flow of the crop recommendation system.
Agronomy 13 02642 g002
Figure 3. Preprocessing steps.
Figure 3. Preprocessing steps.
Agronomy 13 02642 g003
Figure 4. Flow of the data storage via a blockchain network.
Figure 4. Flow of the data storage via a blockchain network.
Agronomy 13 02642 g004
Figure 5. Structure of a block.
Figure 5. Structure of a block.
Agronomy 13 02642 g005
Figure 6. Real-time sensor data.
Figure 6. Real-time sensor data.
Agronomy 13 02642 g006
Figure 7. (a) Probability of a number of soil nutrients matching the sensor data. (b) The readings from the sensor for mangoes satisfies the preferred ranges. (c) The readings from the sensor for carrots satisfies only three of the preferred ranges.
Figure 7. (a) Probability of a number of soil nutrients matching the sensor data. (b) The readings from the sensor for mangoes satisfies the preferred ranges. (c) The readings from the sensor for carrots satisfies only three of the preferred ranges.
Agronomy 13 02642 g007
Figure 8. Sensor data Graph.
Figure 8. Sensor data Graph.
Agronomy 13 02642 g008
Figure 9. The user-defined functions utilized in the designed smart contract.
Figure 9. The user-defined functions utilized in the designed smart contract.
Agronomy 13 02642 g009
Figure 10. Transaction cost while deploying smart contract functions.
Figure 10. Transaction cost while deploying smart contract functions.
Agronomy 13 02642 g010
Figure 11. Implementation interface.
Figure 11. Implementation interface.
Agronomy 13 02642 g011
Table 1. Comparative analysis of the existing surveys on crop prediction.
Table 1. Comparative analysis of the existing surveys on crop prediction.
AuthorYearObjectiveMethodologyProsCons
Gupta et al. [3]2021Smart crop prediction using IoTDecision tree, KNN, and SVM algorithmsPresented the use of IoT-based smart farming to predict suitable cropsSoil nutrients such as nitrogen, phosphorous, and potassium were not considered
Bhuyan et al. [4]2023Crop type prediction involved using a machine learning approachKNN, SVM, RF, and GBAimed to statistically analyze the crops to recommend the best crop based on weather and soil features-
Panigrahi et al. [5]2023Crop yield prediction using supervised learningML algorithms, such as regression, decision tree, etc.Analyzed ML algorithms to develop accurate crop yield predictionResearchers were concentrating more on crop yield rather than crop selection
Ahmed et al. [6]2021Nutrient recommendation systemIGAImproved IGA to provide an optimal prediction of nutrients settings for different cropsDid not consider attributes such as soil pH, temperature, and humidity
Paul et al. [7]2015Presented data mining-based predictions of soil behavior, as well as crop yield predictionsNaive BayesData mining techniques were used to classify the soil, i.e., low, medium, and high categories, to maximize the crop yieldWorked on a dataset that had a discrete format such as low, mild, and bad, which could lead to less accurate results
Bakthavatchalam
et al. [9]
2022Presented an IoT system for precision agricultureMultilayer perceptron, JRip, and decision tablesWas based on environmental factors and on smart crop recommendations for maximizing crop yieldThe sensor data were stored on the cloud/backend, which can lead to potential security breaches
Lin et al. [13]2018Integration of the blockchain and IoTICT e-agriculture modelPresented a security framework that blended blockchain technology with IoT devices.Did not consider the scalability of the blockchain system
Rahman et al. [14]2020Proposed an access control scheme for smart agriculture with distributed data-sharingUsed anonymous identities to ensure user privacyEnsured trust, privacy, scalability, high-throughput sequencing, and information-intensive farmingNo discussion was had on the consensus and cryptographic algorithms
Chaganti et al. [15]2022Proposed a secure IoT-based agriculture monitoring framework that uses the blockchainIoT sensors, AWS cloud, and Remix IDE with a Rinkeby test networkEnabled remote monitoring, security alerts, and negligible network latencyDid not consider the scalability of the blockchain system
Table 2. Sample data from four sensors in the time frame T = 4.
Table 2. Sample data from four sensors in the time frame T = 4.
TimeNitrogen (S1)Potassium (S2)Phosphorous (S3)Potential of Hydrogen pH (S4)
P 1 2.641.563.45.5
P 2 2.8561.623.655.6
P 3 2.941.63.4285.5
P 4 31.593.65.7
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

Patel, D.H.; Shah, K.P.; Gupta, R.; Jadav, N.K.; Tanwar, S.; Neagu, B.C.; Attila, S.; Alqahtani, F.; Tolba, A. Blockchain-Based Crop Recommendation System for Precision Farming in IoT Environment. Agronomy 2023, 13, 2642. https://doi.org/10.3390/agronomy13102642

AMA Style

Patel DH, Shah KP, Gupta R, Jadav NK, Tanwar S, Neagu BC, Attila S, Alqahtani F, Tolba A. Blockchain-Based Crop Recommendation System for Precision Farming in IoT Environment. Agronomy. 2023; 13(10):2642. https://doi.org/10.3390/agronomy13102642

Chicago/Turabian Style

Patel, Devangi Hitenkumar, Kamya Premal Shah, Rajesh Gupta, Nilesh Kumar Jadav, Sudeep Tanwar, Bogdan Constantin Neagu, Simo Attila, Fayez Alqahtani, and Amr Tolba. 2023. "Blockchain-Based Crop Recommendation System for Precision Farming in IoT Environment" Agronomy 13, no. 10: 2642. https://doi.org/10.3390/agronomy13102642

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