IoT based soil analysis and Crop recommendation using Machine Learning

Agricultural research is the country's most important economic source, especially for India and Pakistan. Soil is an important and important element in agriculture. There are several soil types in India and pakistan. To predict the types of crops that can be grown on that particular soil type, it is

2025-06-28 16:28:20 - Adil Khan

Project Title

IoT based soil analysis and Crop recommendation using Machine Learning

Project Area of Specialization Artificial IntelligenceProject Summary

Agricultural research is the country's most important economic source, especially for India and Pakistan. Soil is an important and important element in agriculture. There are several soil types in India and pakistan. To predict the types of crops that can be grown on that particular soil type, it is necessary to understand the characteristics of the soil type. In this case, machine learning technology provides a flexible way. Soil classification by soil nutrients is very useful. Alternatively, farmers can predict which crops they can grow on a particular soil type. Data mining and machine learning are new technologies in agriculture and horticulture.

Farming community of Pakistan is still not well educated to execute modern solutions of farming and they are still working old techniques taught to them by their ancestors and hence are unable to produce extra production and are facing lack of production due to incomplete knowledge of soils and respective crops suitable to that land.

our proposed system provides a platform which recommend the suitable crops based on determining the soil macro nutrients i.e., N, P, K, environmental factors (humidity. temperature) and pH captured by various sensors embedded in soil.

We used IoT based devices and sensors to collect real time soil parameters. Crops recommendations can be produced by evaluating soil nutrients, pH, environmental factors (Humidity, temperature) and then comparing with predefined dataset by using machine learning techniques. In the conclusion, The suggested crops list according to the given soil sample will provide to farmer via android app.

Project Objectives

Objectives of our projects are described below:

Project Implementation Method

In our system, we have made a portable setup using small, light-weight sensors (Node MCU, temperature/humidity, Soil PH, NPK). we embedded the sensors and used their output to perform a considerable set of experiments in order to evaluate and distinguish between range values of sensors and compare with our trained dataset and give us suitable result if valid.

The data collected from all the sensors using micro controller Node MCU send real values to the Arduino software for live monitoring.

Further, Arduino software deliver that real time data to thingspeak platform where we can see the live continuously running graph of incoming data and further it will send to cloud platform where it will compare with trained dataset using ML algorithm techniques like we use ‘Decision Tree Algorithm with adaboost’ for our system and produces suitable results if applicable and the tested results will be shown on an android app.

Below Figure. shows the complete working of project:

'IoT based soil analysis and Crop recommendation using Machine Learning' _1659401520.png

Benefits of the Project

If we are taking about Potential applications of this project, it is significant that it is very useful and effective tools for farmers to identify that which soil is suitable for growing respective crops well by knowing the pH level of the soil. While using the all-old ways of growing crops it wasn’t possible to identify that which crop is suitable for respective land due to which the crop growth was highly effected but with the usage of this technology farmers can identify that specific land area for every crop. In this world hunger it’s important to grow crop on a suitable land so that farmers can harvest crops on time and hence supply it to the world. So, in that context this project is playing a valid role in identifying a suitable land for every crop.

This project is mostly beneficial for our country economic growth and especcially for the Farmer's to easily produce suitable crops with accurate estimation of soil parameters.

Unfortunately, many farmers still practice old farming methods. Farmers in rural areas have historically chosen crops based on personal experiences rather than having adequate knowledge of the soil and other influencing elements.

Therefore, we have build a advanced method of IoT based hardware system to analyze the soil parameters and using ML algorithm/techniques to compare and classifies the results of soil parameters data and then show results on an android app and all the setup of our proect is portable which is easy to carry, easy to implant and easy to check the applicable results via android app.

Technical Details of Final Deliverable

In technical details, firstly we gain the sensors of our need for this project hardware setup and those sensors or hardware things we use are mentioned in the below hardware list of content. Then we manage the sensors in an appropriate form like we take a breadboard where we attach all the sensors with the main micro controller namely ‘Node MCU’ using standard and jumper wires. For the experiment test we use these sensors like we put NPK and soil PH sensor into a soil sample and the other sensor temperature and humidity sensor gives live environment and temperature values and NPK and PH sensor also gives real time data values on the computer software platform like software ‘Arduino’ with the help of micro controller. Further these real time values we are seeing that being monitoring delivers to thingspeak where we can see a live continuously running graph of incoming data values. Further…. We take the real time data from thingspeak and sent to GCP cloud platform where we store and train our dataset and there it will compare the real time values of sensors with trained dataset to predict the suitable crop for the given soil sample. In the end we will show the tested results on an Android app which will make using firebase.

Hardware List:

In the end product of this project, It gives a portable hardwar setup which will use to implant sensors into soil for testing and an Android app for displaying the applicable results of testing.

Final Deliverable of the Project HW/SW integrated systemCore Industry ITOther Industries Agriculture Core Technology Artificial Intelligence(AI)Other Technologies Internet of Things (IoT), Cloud Infrastructure, Wearables and ImplantablesSustainable Development Goals Decent Work and Economic Growth, Industry, Innovation and InfrastructureRequired Resources
Item Name Type No. of Units Per Unit Cost (in Rs) Total (in Rs)
Total in (Rs) 54440
Miscellaneous Miscellaneous 11000010000
Soil NPK sensor Equipment11338013380
Bread Board Equipment1500500
DHT 22 Equipment1800800
DHT 11 Equipment2200400
Node mcu Equipment2480960
Power Adapter 12v Equipment25501100
MAX 485 RS 485 Equipment3120360
Soil PH sensor Equipment11264012640
Jumper wires pack Equipment2100200
Data cable Equipment2300600
Ph sensor Equipment155005500
ph sensor Equipment180008000

More Posts