Soil Monitoring with Crop and Fertilizer Recommendation using IOT and ML

Page 1


International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

Volume: 12 Issue: 05 | May 2025 www.irjet.net p-ISSN:2395-0072

Soil Monitoring with Crop and Fertilizer Recommendation using IOT and ML

Prof. P. N. Kate Deshmukh 1, Swarali Pathak 2, Sayali Shivpuje 3, Neha Taware 4, Vaishnavi Yewale 5

1 Professor, Department of Computer Engineering, SVPM’S College of Engineering Malegaon BK, Baramati, Maharashtra, India. 2, 3. 4, 5 Student, Department of Computer Engineering, SVPM’s College of Engineering, Malegaon BK, Maharashtra, India.

Abstract - Agriculture continues to be a vital and rapidly expanding sector of the Indian economy, with India ranking second globally in the production of several agricultural commodities. The adoption of advanced technologies like the Internet of Things (IoT) and Machine Learning (ML) has significantly improved agricultural methodologies by enabling smart soil monitoring and informed decisionmaking. This study presents a system that utilizes IoT-based sensors to measure key soil health indicators, including moisture content, pH value, temperature, and nutrient levels. Thedata collected fromthesesensors is analyzedthroughML algorithms to generate accurate crop and fertilizer recommendations based on specific soil conditions. By harnessing real-time monitoring and predictive analytics, the system aims to boost crop productivity, make efficient use of resources, and encourage sustainable agricultural practices. It helps tackle issues such as soil degradation, improper fertilizer usage, and mismatched crop choices, ultimately assisting farmers in improving yield and maintaining environmentalbalance.Furthermore,thesystemincorporates a user feedback mechanism, allowing farmers to share their experiences and outcomes. This enhances the platform's adaptability and usability. Despite occasional challenges due to limited technical knowledge or access, the system empowers farmers to make smarter decisions and improve overallagriculturalefficiency.

Keywords - Integrated Soil Monitoring, Crop Recommendation, Fertilizer Recommendation, IOT, ML, Real-Time Data Analysis

1.INTRODUCTION

The system designed for agricultural use has brought significant improvements in crop monitoring and fertilization. By leveraging advanced technologies, it has reduced dependency on manual labor while enhancing the overallhealthandproductivityofcrops.Thissystemselects the most suitable crop for a given soil type using key environmental and soil metrics such as pH level, temperature,humidity,andwaterretention.

Agriculture today is evolving through the integration of data-driven methods and smart technology, a movement commonly known as precision farming. One of the core challenges this approach addresses is soil degradation, which often results from excessive or improper farming practices.Thissystemfocusesonmaintainingsoilvitalityby continuously analyzing crucial soil parameters, ensuring sustainablecropproduction.

To achieve efficient farming outcomes, it is vital to evaluate fields based on specific criteria related to both crops and fertilizers. The model developed uses these inputs to recommend appropriate fertilizers that support healthy plant growth and improve yields. By implementing proper techniques and making informed decisions, farmers can producebetter-qualitycropswithfewerresources.

The use of Internet of Things (IoT) devices and machine learning (ML) algorithms has simplified the process of soil monitoringanddecision-making.Thesetechnologiescollect andanalyzereal-timedatatorecommendthebestcropand fertilizercombinationsforeachuniquesoilprofile.

Soil health is often compromised due to repeated cultivation, which reduces its nutrient content and productivity. This system aims to restore and maintain soil quality by regularly checking vital indicators such as pH, temperature,moisturecontent,andwatercapacity.Doingso not only improves the soil’s lifespan but also ensures consistentandhigh-yieldingcropgrowth.

For maximum productivity, historical data on various crop types must be evaluated alongside current soil conditions. By analyzing parameters like soil moisture, pH levels, and nutrient availability, the system provides precise recommendations. It also identifies missing nutrients and guidesfarmersinenrichingthesoilaccordingly.

This system evaluates essential soil parameters to support effective crop cultivation and enhance the overall health of specificcrops.Byimplementingthistechnology,farmerscan achievehigheryieldsofnutrient-richcrops.Italsoservesas a valuable tool to connect farmers especially those

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

Volume: 12 Issue: 05 | May 2025 www.irjet.net p-ISSN:2395-0072

unfamiliar with modern agricultural practices with the benefitsofadvancedtechnology.

Monitoring soil conditions is critical for healthy crop production, particularly because excessive use of chemical pesticidescandegradesoilquality.Overtime,suchpractices leadtonutrientloss,negativelyimpactingcropgrowth.This system helps mitigate those effects by regularly assessing keysoilindicatorsandrecommendingsuitablefertilizers.As a result, it minimizes the damage caused by the overuse of pesticides and fertilizers, supporting both sustainable farmingandimprovedsoilhealth.

3.Proposed Method

ThissectionpresentsthearchitectureofaproposedIoTbased soil monitoring system integrated with machine learning for real-time crop and fertilizer recommendations. The system is designed to analyzesoil nutrient content and recommend the most suitable crops and fertilizers accordingly. By combining Internet of Things (IoT) technology with machine learning, the system offers centralized data storage and intelligent analysis, helping identify the best crop choices and fertilizer requirements basedonreal-timesoilconditions.

Thearchitectureisdividedintothreecoremodules.Thefirst moduleinvolvesIoT-enabledsoilmonitoring,wheresensors measure specific soil parameters to understand soil characteristics.Thesecondmoduleusesthisdatatosuggest appropriate crops that are compatible with the current soil profile. The third module recommends fertilizers based on the soil’s nutrient levels, aiming to restore or maintain soil fertility.

This project proposes a complete solution that integrates real-time sensor data with historical agricultural data to enhance decision-making in farming. Sensors including those measuring nitrogen (N), phosphorus (P), potassium (K), temperature, and soil moisture are connected to a microcontroller unit such as an ESP8266 or Raspberry Pi. These devices transmit data to a cloud-based server for processingandstorage.

Inaddition to real-time data from the field, the system uses externaldatasetssourcedfromplatformslikeKaggle.These datasets include information on crop suitability and fertilizer usage for different soil conditions. This historical data plays a crucial role in training the machine learning modeltomakeaccuratepredictions.

MachinelearningalgorithmssuchasLinearRegression(LR), Random Forest (RF), Gaussian Naïve Bayes (GNB), Support Vector Machine (SVM), and k-Nearest Neighbors (KNN) are consideredfortrainingthemodel.Thesemodelsaretrained usingacombinationoflivesensordataandcurateddatasets to provide precise recommendations for crop and fertilizer selection.

The final output is presented through a user-friendly web application, where farmers can access personalized suggestions. These recommendations are generated based on real-time soil conditions and comprehensive data analysis, enabling farmers to make informed decisions aimedatimprovingbothcropyieldandsoilhealth.

It is important to note that this project is currently in the research and survey phase. The focus at this stage is on collecting relevant information, evaluating technical feasibility,anddesigningthesystemarchitecture.Theactual deployment or implementation of the system will be considered in later stages, depending on the results and insightsgainedduringthispreliminaryphase.

4.Methodology

1.TheimportanceofutilizingIoTforthesmartandefficient management of agricultural practices has been well acknowledged.

2. Key components necessary for developing an IoT-based agricultural monitoring system were identified. These includevarioussensorssuchastheNPKsensorfordetecting nitrogen, phosphorus, and potassium levels; the DHT11 sensor for temperature and humidity; a pH sensor; and a soil moisture sensor. Supporting hardware includes Raspberry Pi, ESP32 microcontroller, a 9V power adapter, andjumperwires.

3. These sensors are integrated into the system to collect real-time data on soil nutrient levels, pH, temperature, humidity,andmoisturecontent.

4. The DHT11 sensor specifically plays a role in tracking environmental parameters, which supports data-driven decisionsinfarmingactivities.

5. All sensor data is transmitted to the cloud using Raspberry Pi and ESP32, enabling remote monitoring and analysis.

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

Volume: 12 Issue: 05 | May 2025 www.irjet.net p-ISSN:2395-0072

6. The system enables continuous observation and dynamic adjustment of farming conditions, improving decisions relatedtocropselectionandfertilizerusage

5.Hardware Setup

6. Algorithm

In our project, “Soil Monitoring with Crop and Fertilizer RecommendationSystem,” weemployedthe Random Forest algorithm as the primary machine learning model to performtwokeypredictivetasks:

1. Crop Recommendation basedonsoilparameters.

2. Fertilizer Recommendation based on soil condition andcroptype.

TheRandomForestalgorithmwaschosenforitsrobustness, high accuracy, and ability to handle nonlinear relationships and mixed data types. It is an ensemble learning method that builds multiple decision trees during training and outputs the mode (for classification) or mean (for regression)oftheindividualtreepredictions.

Data Collection and Preprocessing

Wecollecteddatacomprisingfeaturessuchas:

• Soilnutrients(N,P,K)

• pHlevel

• Moisture

• Temperature

• Humidity

• Croptype(forfertilizerrecommendation)

The dataset was cleaned and normalized where necessary. Categorical features were encoded using label encoding or one-hotencoding,dependingontheirnature.

Model Training and Testing

Thedatasetwassplitintotrainingandtestingsets,typically with a 70:30 or 80:20 ratio. The Random Forest model was trained using the training set and evaluated on the test set using performance metrics such as accuracy, precision, recall,andF1-scoreforclassificationtasks.

Model Application

• Crop Recommendation: The model predicts the mostsuitablecropforagivensetofsoilparameters, helping farmers make data-driven planting decisions.

• Fertilizer Recommendation: Basedonthecurrent soilconditionandselectedcrop,themodelsuggests thebesttypeoffertilizertooptimizeyield.

Advantages of Using Random Forest

• Handles overfitting better than individual decision trees.

• Candealwithmissingvaluesandmaintainaccuracy foralargeproportionofmissingdata.

• Providesfeatureimportance,helpingtounderstand which soil attributes most influence crop/fertilizer suitability.

A. PH SENSOR

pH Sensor isusedtomeasuretheacidityoralkalinityofsoil by detecting its pH level. The sensor outputs the pH value, which helps in assessing soil health and suitability for specific crops. pH values range from 0 to 14, where a value of 7 is neutral; values below 7 indicate increasing acidity, while values above 7 indicate alkalinity. In addition to agriculturalapplications,pHsensorsarealsowidelyusedin manufacturing to ensure product quality and safety during variousprocesses.

Fig.1 PHSensor

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

Volume: 12 Issue: 05 | May 2025 www.irjet.net p-ISSN:2395-0072

B. TEMPERATURE AND HUMIDITY SENSOR

DHT11 Temperature and Humidity Sensor : The DHT11 sensor is designed to measure both temperature and relative humidity. It incorporates an 8-bit microcontroller that processes and outputs the data. For accurate readings, the sensor requires a specific time interval to collect and analyze the data. Humidity is measured by detecting changes in electrical resistance between two electrodes, which varies with the moisture level in the air. These humidity variations can influence multiple physical and chemical processes. Temperature measurement is based on aNegativeTemperatureCoefficient(NTC)thermistor,where resistance decreases as temperature increases. The DHT11 operates within a temperature range of 0°C to 50°C and a humidityrangeof20%to80%.Changesinhumiditydirectly affect the conductivity of the sensing material, which the sensordetectsandprocesses.

C. SOIL MOISTURE SENSOR

Soil Moisture Sensor : A soil moisture sensor is used to measure the water content in the soil, which is a crucial factor in agricultural productivity. This sensor helps determine the percentage of moisture present, allowing farmers to assess whether the soil has adequate water for crop growth. By understanding the water retention level, appropriate irrigation decisions can be made to avoid both under- and over-watering. In addition to agriculture, soil moisture data is also useful in irrigation system planning and climate studies. Supplying the right amount of water improves crop health and yields. For agricultural applications,thetypicaleffectivemoisturerangeisbetween 41%and80%.

D.

ESP32 Micro controller : The ESP32 microcontroller is equipped with a built-in Wi-Fi library that enables it to

connect to wireless networks using stored SSID and passwordcredentials.Itsupports a range of standard Wi-Fi authentication protocols, allowing secure network access. Furthermore, the ESP32 can be configured for more advanced authentication methods or customized to implementspecificsecurity solutions,makingitsuitablefor IoT applications that require reliable and secure wireless communication.

Fig.4.ESP32Microcontroller

E. JUMPER WIRE

Jumper wires are compact electronic cables with connectors at each end, used to create temporary connectionsbetweencomponentsonabreadboardorother prototyping platforms. They are available in various lengths short, medium, and long and come in different colorsforeasyidentificationandorganization.Jumperwires supportarangeofconfigurationsandofferaflexible,quick, and tool-free setup, making them ideal for prototyping and testingelectroniccircuits.

7. RESULT ANALYSIS

The proposed system for soil monitoring and fertilizer recommendation integrates real-time data acquisition through IoT sensors with intelligent prediction models powered by machine learning. This section presents the performance evaluation of both components data acquisition accuracy and model prediction performance basedonexperimentalresults.

7.1 Soil Parameter Monitoring Accuracy

The IoT-based system was deployed in a controlled agricultural environment to collect real-time data on soil moisture, pH, temperature, and nutrient levels. Sensor readingswerecomparedagainststandardlaboratoryresults tovalidateaccuracy.

Fig.2 TemperatureandHumiditySensor
Fig.3.SoilMoistureSensor
ESP32 MICRO CONTROLLER
Fig.5.JumperWires

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

Volume: 12 Issue: 05 | May 2025 www.irjet.net p-ISSN:2395-0072

Theresultsconfirmthatthesensorreadingsaresufficiently accurate for real-time monitoring and decision-making purposes.

7.2 Fertilizer Recommendation Model Performance

Machine learning algorithms including Decision Trees, Random Forest, and Support Vector Machines (SVM) were trainedonalabeleddatasetcomprisinghistoricalcrop,soil, and fertilizer records. The performance of the models was evaluated using standard metrics such as Accuracy, Precision,Recall,andF1-Score.

the system allows for more precise and efficient farm management, ultimately enhancing crop yields and optimizingfertilizerapplication.

The experimental analysis confirmed that the deployed IoT sensors accuratelycaptured critical soil parameterssuchas moisture, nutrient content, and temperature. Among the machine learning models tested, the Random Forest algorithm delivered the most reliable results in predicting appropriate fertilizers, tailored to both the soil condition and the type of crop being cultivated. Field evaluations further validated the system’s effectiveness, demonstrating improvements in crop output and more informed farming decisions.

Beyond improving productivity, this solution also promotes environmentally responsible farming by minimizing excessivefertilizeruse.Lookingahead,futuredevelopments will aim to expand the system’s adaptability across various climateconditions,improvetheaccuracyofpredictionswith broader datasets, and incorporate early warning mechanismsforpestanddiseasedetection.

9. FUTURE WORK

TheRandomForestmodeldemonstratedthehighestoverall performance,makingitthepreferredchoicefordeployment intherecommendationsystem.

7.3 System Integration and Real-Time Testing

Upon integrating theIoTandML componentsinto a unified system, field testing was conducted on two small-scale farms.Farmersreceivedfertilizerrecommendationsthrough a mobile interface. Post-deployment surveys showed a 1520% improvement in crop yield compared to previous cycles, attributed to better resource allocation and datadrivendecisions.

7.4 Limitations and Future Improvements

While the system performed effectively in controlled and semi-controlledenvironments,variationsinfieldconditions, sensor calibration drift, and regional fertilizer preferences remain as challenges. Future work will focus on integrating adaptive learning models and expanding the dataset to includeregion-specificcroppatternsandsoilconditions.

8. CONCLUSION

This research introduces an integrated solution for smart agriculture by combining IoT-based soil monitoring with machinelearning algorithms for fertilizer recommendation. Bymerging real-timesensordata with predictive modeling,

Looking ahead, several enhancements can be incorporated intothesystemtofurtherimproveitsfunctionalityanduser experience. One significant addition would be the integration of weather forecasting, enabling the system to analyze crop cultivation patterns based on real-time and predicted weather conditions. This would support better planningandriskmitigationforfarmers.

To enhance accessibility, a mobile application can be developed, offering a more user-friendly interface tailored specifically for farmers, as compared to the current webbasedplatform.

Automation can also be extended to irrigation and fertilizationprocesses,allowingthesystemtoactivatethese functions precisely when needed, based on real-time soil data.

Moreover, drone technology can be employed for tasks like fertilizer and water spraying, significantly reducing labor costswhileensuringefficientanduniformdistribution.

10. ACKNOWLEDGEMENT

We extend our heartfelt gratitude to everyone who has supported and guided us throughout the course of this project, “Soil Monitoring with Crop and Fertilizer RecommendationUsingIoTandMachineLearning.”

Weareespeciallythankfultothelabassistantsandtechnical staff,whoseexpertiseandtimelyassistancewithequipment and troubleshooting played a crucial role in overcoming technicalchallenges.

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

Volume: 12 Issue: 05 | May 2025 www.irjet.net p-ISSN:2395-0072

Our sincere appreciation also goes to our peers and colleagues for their valuable feedback, motivation, and continuoussupportthroughoutthedevelopmentprocess.

Lastly, we would like to express our deepest thanks to our families and friends for their unwavering encouragement, patience, and understanding, which have been a constant sourceofstrengthduringthisjourney.

11. REFERENCE

[1]Author(S), ”Smart Soil Monitoring And Crop Recommendation System by Using IOT and Machine Learning Technology, ” in proc. 2024 10th international conf. on Advanced Computing and Communication Systems(ICACCS),Coimbatore,IndiaMar.2024

[2]M. R. Islam, K. Oliullah, M. M Kabir, M.Alom, and M.F. Mridha, ”Machine Learning Enabled IOT System for Soil Nutrients Monitoring and Crop Recommendation, ”in proc. 2024 10th International Conf, on Advanced Computing and Communication Systems (ICACCS), Coimbatore,IndiaMar.2024.

[3]Author(S), ”Soil Monitoring and Fertilizers Recommendation System, ” in Proc. Conference Name, Location,Year,pp.xx-xx.

[4]B. Kashyap and R. Kumar, ”Sensing Methodologies in AgricultureforSoilMoistureandNutrientsMonitoring,” IEEE Access, vol.9,pp.1401- 1415, jan. 2021, doi:10.1109/ACCESS.2021.3052478

[5]A. A. Khan, M. Faheem, R. N. Bashir, C. Wechtaisong, and M.Z.Abbas, ”Internet of Things (IOT) Assisted Context Aware Fertilizer Recommendation, ”IEEE Access,vol.10,pp.1401-1415, Dec .2022, doi: 10.1109/ACCESS.2022.3228160

[6]A.Reyana, S.Kautish, P. M. S. Karthik, I.A.AI-Baltah, M.B.Jasser, and A.W.Mohamed, ”Accelerating Crop Yield: Multisensor Data Fusion and Machine Learning for Agriculture Text Classification, ” IEEE Access,vol.11,pp. 14011415, Feb. 2023, doi: 10.1109/ACCESS.2023.3249205

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.