0% found this document useful (0 votes)
22 views19 pages

Paper 18526

Uploaded by

Veerendra K.S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views19 pages

Paper 18526

Uploaded by

Veerendra K.S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ISSN (Online) 2581-9429

IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

Soil Based Fertilizer Recommendation using IOT


Mr. Sagara T V1, Ananya M V2, Chetan3, Chetan Kumar B Humbi4, Harshitha Y5
Associate Professor, Department of Electronics and Communication Engineering1
Project Associates, Department of Electronics and Communication Engineering2,3,4,5
Ballari Institute of Technology and Management, Ballari, Karnataka, India

Abstract: Agriculture is an essential need for human life and IOT serves like the better platform for the
smart agriculture. Agricultural issues have always hampered the country's development. Smart farming,
which entails modernizing the conventional farming methods, is the only solution to this challenge. As a
result, the goal of this project is to make agriculture smarter through the use of automation and IoT
technology.

Keywords: Agriculture.

I. INTRODUCTION
Agriculture is an essential need for human life and IOT serves like the better platform for the smart agriculture.
Agricultural issues have always hampered the country's development. Smart farming, which entails modernizing the
conventional farming methods, is the only solution to this challenge. As a result, the goal of this project is to make
agriculture smarter through the use of automation and IoT technology.
The use and adoption of IoT solutions for agriculture it's constantly growing. With India being a land of versatile soils,
the Indian economy is majorly based in agriculture while agricultural productivity it's dependant upon the type of soil.
However, the major problem with the Indian farmers it's insufficient knowledge about the soil. Each soil type has
different characteristics like there are various nutritions present in the soil. The deficiency about the nutritions in soil
decreases the crop productivity. So, there's a need for soil analysis. Alarming situation about farmers' suicide has led the
idea to put efforts in the design and development of a sophisticated soil testing and fertilizer recommendation system.
In Automated farming, we aim to reduce human errors and human efforts by monitoring the soil quality using soil
sensor via webserver.
The key feature about our system it's to determine suitable crops and the fertilizers for the current state of soil by
calculating the pH and moisture content in soil. Our system it will be used for soil analysis in order to increase crop
yield. Based upon soil analysis report, fertilizers it will be recommended to the user. Fertilizers will be recommended
using nutrient status table which is stored in the database. By comparing values about nutrients with table, classification
it will be done and accordingly fertilizers it will be recommended to the user. Our system it will help farmers for better
yield about crops which in turn maximizes the profit. This increases the financial status about the farmers!

1.1 Problem Definition


With every change in weather condition the fertility of soil keeps on changing. The monitoring is necessary for healthy
crop production since the fertility of a soil varies at different parts of field. Moisture sensor are used to determine the
water content in the soiland also used to predict suitable crop. Nutrient contents are determined on the basis of sensed
parameters. The soil fertility state is considered by obtaining average of all observation from different parts of land.
After calculating fertility, system will determine suitable crops for tested land and farmer gets an idea of what fertilizer
is required.
1.3 Scope
By using this Proposed System farmer can efficiently monitor their field & soil. Farmer can get the detailed information
regarding soil from home itself, Rather than visiting the lab for Soil Testing. System will suggest the Fertilizer and
which crop should farmer bow in that particular soil by analyzing the parameters like NPK value, Moisture value, etc of
the soil. Maintaining the record of Land fertility will become very easy & access it from anywhere using your mobile
device. In Future by using Smart Agriculture, Automatic Fertilizer spraying may also be possible.

Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 189


[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

1.3 Proposed System


Human Life is fully depend upon food. Due to increasing population and tremendous climate change Production of
Crop is a major deal. There for Fertilizers are used to gain the Production of crop. Our Proposed System will replace the
old fashioned Farming Technique with Smart Agriculture system. In this system, Automated Remotely Monitored
Fertility monitoring Technique are used. Detection and Quality of Soil is determined by calculating different
Parameters and Nutrients contents of soil i.e. nitrogen, phosphorus & potassium (NPK). Water content of Soil is
calculated by Moisture sensor which is attached to Remote system. Portable device is used to take samples of the soil
from different parts of that particular Land. The design and development of an IoT device with integrated machine
learning capabilities for continuously monitoring soil moisture, humidity, temperature, and NPK levels using three
different sensors. This device provides real-time data, enabling precise and timely agricultural decision-making.
The application of machine learning algorithms to analyze the collected data and generate crop recommendations based
on observed patterns. These recommendations contribute to optimizing crop growth and maximizing yield potential,
promoting efficient resource utilization in agriculture.
After Inserting that Data, The Application will digitally calculate the result and Present Farmer the Fertilizer name
which can be suitable for that particular Soil and also recommends which Crop will be suitable to grow in that Soil. So
Farmer can make their Strategies for farming accordingly with data that has generated and can take steps to increase the
effectiveness of Fertilizer and effectiveness of crops and use them relevantly.
In essence, our motivation lies in the potential to transform traditional farming practices, reduce expenses, customize
agricultural methods, and expand the reach of sustainable and efficient crop management. By addressing these
challenges, we strive to contribute to a more productive, profitable, and environmentally conscious agricultural
landscape.

1.4 Advantages and Purpose of proposed system


Precision Agriculture: IoT devices can collect real-time data on soil conditions such as moisture levels, pH, nutrient
content, and temperature. This data can be used to precisely tailor fertilizer recommendations to the specific needs of
each section of a field, optimizing crop growth and minimizing waste.
Cost Efficiency: By accurately determining the fertilizer needs of each area of a field, farmers can avoid over-
fertilization, which can be costly and environmentally harmful. IoT-enabled systems can help farmers save money by
ensuring that they only apply the necessary amount of fertilizer where it is needed.
Environmental Sustainability: Over-application of fertilizers can lead to nutrient runoff, which can pollute waterways
and harm ecosystems. By using IoT to apply fertilizers more precisely, farmers can reduce the environmental impact of
their operations.
 Time Savings: IoT devices can continuously monitor soil conditions and automatically adjust fertilizer
applications as needed. This saves farmers time and labor compared to traditional methods of soil testing and
fertilizer application.
 Data-driven Decision Making: By collecting and analyzing data from IoT devices, farmers can gain insights
into soil health trends over time. This data can inform long-term decision making, such as crop rotation
strategies and soil management practices.
The purpose of using IoT for soil-based fertilizer recommendations is to optimize crop yield, minimize input costs, and
reduce environmental impact. By leveraging real-time data and automation, farmers can make more informed decisions
about fertilizer application, leading to more sustainable and profitable agriculture practices.
The system's adaptability ensures resilience to changing environmental factors. Ultimately, the project seeks to
revolutionize traditional farming practices, focusing on reducing costs, customization, and scalability to create a more
efficient, profitable, and sustainable agricultural ecosystem.

Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 190


[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

II. LITERATURE SURVEY


[1] K. Bodake, R. Ghate, H. Doshi, P. Jadhav, B. Tarle
In this paper, Bodake et al. propose a soil-based recommendation system leveraging Internet of Things (IoT)
technology. The system aims to provide tailored fertilizer recommendations based on real-time soil data collected
through IoT sensors. By integrating IoT devices for soil monitoring and analysis, the authors present a methodology for
optimizing fertilizer application in agricultural practices. This study contributes to the field of precision agriculture by
offering a technologically advanced approach to soil fertility management, potentially leading to improved crop yields
and sustainable farming practices.
[2] A. Sarwar, V. Singh, V. Sharma
Present a study focused on the analysis of soil characteristics and the prediction of rice crop yield using a machine
learning approach. The authors leverage machine learning algorithms to analyze soil data and predict rice crop yields
based on various soil parameters. By employing advanced computational techniques, this research contributes to
agricultural decision-making processes by providing insights into the relationship between soil properties and crop
productivity. The study demonstrates the potential of machine learning in optimizing agricultural practices and
enhancing crop yield predictions for improved farming outcomes.
[3] R.K. Rajak, A. Pawar, M. Pendke, P. Shinde, S. Rathod, A. Devare
Introduce a crop recommendation system designed to maximize crop yield through the utilization of machine learning
techniques. This system analyzes various factors such as soil characteristics, climate conditions, and historical crop
performance data to provide personalized recommendations for crop selection. By employing machine learning
algorithms, the authors aim to optimize agricultural decision-making processes and enhance crop yields. This research
contributes to the advancement of precision agriculture by offering a data-driven approach to crop selection, potentially
leading to increased productivity and profitability for farmers.
[4] S. UshaKiruthika, S. Kanaga Suba Raja, S.R. Ronak, S. Rengarajen, P. Ravindran
Present a study on the design and implementation of a fertilizer recommendation system tailored for farmers. The
system utilizes data-driven approaches to analyze soil properties, crop requirements, and environmental factors to
generate personalized fertilizer recommendations. By leveraging advanced technologies and agricultural expertise, the
authors aim to assist farmers in optimizing fertilizer usage, enhancing crop yields, and improving overall agricultural
productivity. This research contributes to the development of practical solutions for precision agriculture, addressing
the challenges faced by farmers in making informed decisions regarding fertilizer application.
[5] Z. Ren, X. Lu
Present a study on the design of a fertilization recommendation knowledge base and its application. The paper likely
discusses the development of a knowledge base system that incorporates various factors such as soil properties, crop
types, climate conditions, and fertilization practices. By integrating geographical information systems (GIS) and
informatics techniques, the authors aim to provide a comprehensive platform for generating tailored fertilization
recommendations to optimize agricultural productivity and sustainability. This research contributes to the field of agro-
geoinformatics by offering innovative solutions for precision agriculture and resource management.
[6] Gondchawar N, Kawitkar RS
Present a study on IoT-based smart agriculture. The paper likely explores the application of Internet of Things (IoT)
technology in agricultural practices, focusing on aspects such as soil monitoring, crop management, and environmental
sensing. By leveraging IoT devices and sensor networks, the authors aim to improve efficiency, productivity, and
sustainability in agriculture. This research contributes to the advancement of precision farming by integrating modern
technologies to address challenges faced by farmers and enhance agricultural operations.
[7]Aruvansh Nigam, Saksham Garg, Archit Agrawal
The paper presented the various machine learning algorithms for predicting the yield of the crop on the basis of
temperature, rainfall, season and area. Experiments were conducted on Indian government dataset and it has been
established that Random Forest Regressor gives the highest yield prediction accuracy. Sequential model that is Simple
Recurrent Neural Network performs better on rainfall prediction while LSTM is good for temperature prediction. By
combining rainfall, temperature along with other parameters like season and area, yield prediction for a certain district
can be made. Results reveals that Random Forest is the best classifier when all parameters are combined. This will not
Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 191
[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

only help farmers in choosing the right crop to grow in the next season but also bridge the gap between technology and
the agriculture sector.
[8] R. Garg, P. Jain, and R. K. Jain
In this paper, the authors review the use of machine learning algorithms for crop yield prediction. They discuss the
challenges associated with crop yield prediction, such as climate variability, limited data availability, and the need for
accurate crop phenotyping. The authors then provide a detailed analysis of various machine learning algorithms that
have been used for crop yield prediction, including decision trees, support vector machines, artificial neural networks,
and random [Link] paper also includes a discussion on the various data sources that can be used for crop yield
prediction, such as remote sensing, weather data, soil data, and historical crop yield data. The authors conclude that
machine learning algorithms can be effective tools for crop yield prediction, and that the integration of multiple data
sources can improve the accuracy of the predictions. They suggest that further research is needed to develop models
that can be easily applied by farmers and other stakeholders in the agricultural sector.
[9] S. Kumar, M. R. Gupta, and M. S. Bhatia
The article provides a comprehensive review of the different machine learning algorithms used for crop yield
prediction. The authors discuss the challenges involved in crop yield prediction and how machine learning can help
overcome these challenges. They also provide an overview of the various datasets used for crop yield prediction and the
performance metrics used to evaluate the accuracy of the models. The article highlights the advantages and limitations
of various machine learning algorithms such as Support Vector Machines (SVM), Random Forest, Artificial Neural
Networks (ANN), and Decision Trees. The authors provide a detailed analysis of each algorithm, including their
strengths and weaknesses. They also discuss the pre-processing techniques used to prepare the data for machine
learning, such as feature selection, normalization, and data augmentation.
[10] M. Kamble, D. Kumar, and P. Kumar
The authors reviewed various studies and research papers on the topic of crop yield prediction using machine learning
techniques. The review highlighted the different machine learning algorithms that have been used in the past, including
decision tree, random forest, support vector machines, and artificial neural networks. The study also discusses the
challenges and limitations of applying machine learning techniques for crop yield prediction. The authors noted that the
accuracy of the prediction is affected by various factors, such as the quality and quantity of input data, selection of
relevant features, and choice of machine learning algorithm. They also highlighted the need for further research to
address these challenges and to develop more accurate and robust models for crop yield prediction. Overall, the study
provides a comprehensive overview of the current state of research on crop yield prediction using machine learning
techniques. The authors’ analysis and insights into the various approaches and challenges of the field can serve as a
useful resource for researchers and practitioners in the agriculture domain.

III. COMPONENTS REQUIRED


3.1 Problem Statement
Conventional fertilizer application methods often result in inefficient use of resources and environmental pollution.
Existing soil nutrient management techniques may not provide real-time data or tailored recommendations for
individual fields.
There is a need for a comprehensive soil-based fertilizer recommendation system that utilizes moisture and NPK
sensors with Node MCU ESP8266 integration to provide accurate, timely, and field-specific recommendations for
farmers.

3.2 Objective
 To develop a soil-based fertilizer recommendation system that utilizes moisture and NPK sensors with Node
MCU ESP8266 integration.
 To provide farmers with real-time data on soil moisture levels and nutrient content, along with tailored
fertilizer recommendations based on agronomic principles.
 To evaluate the feasibility and effectiveness of the developed system in optimizing agricultural practices and
enhancing crop productivity.
Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 192
[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

3.3 Feasibility Analysis


Technical Feasibility: Assess the technical capabilities of integrating moisture and NPK sensors with Node MCU
ESP8266, along with cloud storage and data analysis.
Economic Feasibility: Evaluate the cost-effectiveness of the proposed system in comparison to traditional fertilizer
application methods.
Operational Feasibility: Determine the ease of use and practicality of implementing the system in real-world
agricultural settings.

3.4 Hardware Components


3.4.1Arduino UNO

Figure 3.1 Arduino Uno


Arduino Uno is a microcontroller board based on 8-bit ATmega328P microcontroller. Along with ATmega328P, it
consists other components such as crystal oscillator, serial communication, voltage regulator, etc. to support the
microcontroller. Arduino Uno has 14 digital input/output pins (out of which 6 can be used as PWM outputs), 6 analog
input pins, a USB connection, A Power barrel jack, an ICSP header and a reset button.

Fig 3.2 Arduino Uno Pin configuration

Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 193


[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

The Arduino Uno board has a number of key features, including:


 14 Digital Input/Output Pins: These pins can be used to interface with a variety of digital devices, such as
sensors, LEDs, and switches.
 6 Analog Input Pins: These pins can be used to measure analog signals, such as light or temperature.
 16 MHz Clock Speed: This clock speed allows the microcontroller to run code quickly and efficiently.
 USB Connection: This connection allows the board to be programmed and powered through a computer.
 Power Jack: This jack allows the board to be powered by an external power supply.
 Reset Button: This button resets the board.

3.4.2 ESP8266 Wi-fi Module

Fig 3.3 ESP8266 Wi-Fi module


The company named Espressif Systems, a semiconductor company operating from China has produced ESP8266 Chip.
Basically it is the series or family of WiFi Chips. It also includes the presently WiFi series like ESP8266EX and
ESP8285 chips. ESP8266 is small package which includes 32-bit Tensilica microcontroller, standard digital peripheral
interfaces, antenna switches, power amplifier & filter and power management modules. It provides 2.4 GHz Wi-Fi
capabilities and also supported to (WPA/WPA2), Inter-Integrated Circuit, analog to digital conversion. It has 64Kb boot
Ram and Instruction Ram along with 96Kb of Data Ram.

Key features of ESP8266


 32 – bit microcontroller
 Central processing unit: 80 MHz or 160 MHz
 Instruction RAM: 32 KB
 Cache RAM: 32 KB
 User data RAM: 80 KB
 ETS system data RAM: 16 Kb
 External memory: 16 MB
 General purpose input output pins: 16
 SPI supported
 I2C interface supported
 I2S interface supported
 Wi-Fi standard of 802.11 b / g / n
 UART supported on specific pins
Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 194
[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

 10 – bit analog to digital converter (ADC)


 Protocol stack: TCP / IP

3.4.3 Moisture Sensor

Fig 3.4 Moisture Sensor


A soil moisture sensor is used to measure the amount of moisture (Water content) present in the soil. Water
monitoring is very important for a few crops. A soil moisture sensor is used to automate the process of monitoring
moisture levels in the soil.

Working:
The soil moisture sensor operates in a straightforward manner. The fork-shaped probe with two exposed conductors
acts as a variable resistor (similar to a potentiometer) whose resistance varies with the soil’s moisture content. This
resistance varies inversely with soil moisture:
 The more water in the soil, the better the conductivity and the lower the resistance.
 The less water in the soil, the lower the conductivity and thus the higher the resistance. The sensor produces an
output voltage according to the resistance, which by measuring we can determine the soil moisture level. A
typical soil moisture sensor consists of two parts.

1. The Probe
The sensor includes a fork-shaped probe with two exposed conductors that is inserted into the soil or wherever the
moisture content is to be measured. As previously stated, it acts as a variable resistor, with resistance varying according
to soil moisture.

Fig 3.5 Probes

Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 195


[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

2. The Module
In addition, the sensor includes an electronic module that connects the probe to the Arduino. The module generates an
output voltage based on the resistance of the probe, which is available at an Analog Output (AO) pin. The same signal
is fed to an LM393 High Precision Comparator, which digitizes it and makes it available at a Digital Output (DO) pin.

Fig 3.6 Moisture sensor module


The module includes a potentiometer for adjusting the sensitivity of the digital output (DO). We can use it to set a
threshold, so that when the soil moisture level exceeds the threshold, the module outputs LOW otherwise HIGH.

3.4.4 NPK Sensor

Fig 3.7 NPK Sensor


NPK sensors are devices that measure the amount of important nutrients such as N, P, and K in the soil. They measure
the concentration of various nutrients in the soil by inserting electrodes into the soil. These nutrients (Nitrogen,
Phosphorus, and Potassium) are key nutrients essential for plant growth, and obtaining accurate concentrations of these
nutrients is critical for crop growth and development.
Soil NPK sensors utilise a variety of technological principles to measure the levels of N, P, and K in the soil, thus
providing real-time information on soil nutrition.

Fig 3.8 Importance of Nutrients


Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 196
[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

The working principle of soil NPK sensors


The sensor includes a stainless steel probe that is rust-proof, electrolytic resistant, and saltalkali resistant. It can
therefore be used with any type of soil, including alkaline soil, acid soil, substrate soil, seedling bed soil, and coconut
bran soil. Soil NPK sensors work by measuring the levels of nitrogen (N), phosphorus (P), and potassium (K) in the
soil. These nutrients are essential for plant growth and are often added to soil as fertilizers. The sensor operates on 5-
30V and consumes very little power. According to the datasheet, it is capable of measuring nitrogen, phosphorus, and
potassium with a resolution of up to 1 mg/kg (mg/l).

Fig 3.9 Probes of NPK sensor


The probe is sealed to the body with high-density epoxy resin to prevent moisture from entering the body.
The best part is that the sensor has an IP68 rating, which means it is protected against dust and moisture, allowing it to
operate normally for a very long time. To be used effectively over long distances, the sensor features the RS485
communication interface and supports the standard Modbus-RTU communication protocol.
It should be noted that the sensor cannot be used with an Arduino directly. To communicate with Arduino, you’ll need
an RS-485 transceiver module that converts a UART serial stream to RS-485.

Fig 3.10 NPK Sensor Pin diagram


VCC is the VCC pin. Connects to 5V – 30V.
A is a differential signal that is connected to the A pin of the MAX485 Modbus Module.
B is another differential signal that is connected to the B pin of the MAX485 Modbus Module. GND is the Ground pin.
There are different types of soil NPK sensors, but most use either spectroscopy, electrochemical, or ion-selective
electrode technologies to measure nutrient levels. Spectroscopy sensors work by shining light on the soil and analyzing
the reflected light to determine the chemical composition of the soil. The reflected light contains information about the
wavelengths of light that are absorbed and scattered by different soil components, including nutrients such as N, P, and
K.
By analyzing the reflected light, the sensor can estimate the nutrient levels in the soil. Electrochemical sensors work by
using electrodes that are placed in the soil to detect electrical signals generated by the nutrients. The electrodes are
connected to a circuit that measures the electrical signals and converts them into nutrient levels. Ion-selective electrode
sensors work by using a special membrane that selectively detects the ions of interest. The membrane is placed in
contact with the soil and the ions in the soil diffuse through the membrane to the sensor. The sensor then measures the
concentration of the ions in the soil and converts it into nutrient levels.

Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 197


[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

Wiring a Soil NPK Sensor to an Arduino


The NPK sensor cannot be used directly with an Arduino. To communicate with Arduino, you’ll need an RS-485
transceiver module that converts a UART serial stream to RS-485, such as the one shown below.

Fig 3.11 RS-485 transceiver module

3.5 Software
3.5.1 Arduino IDE
The arduino software (IDE) is an open source software, which is used to programme the Arduino boards, and is an
integrated development environment, developed by [Link]. Allow to write and upload code to arduino boards. And
it consiste of many libraries and a set of examples of mini [Link] software (IDE) is compatible with different
operating systems (Windows, Linux, Mac OS X), and supports the programming languages (C/C++).The Arduino
software is easy to use for beginners, or advanced users. It uses to get started with electronics programming and
robotics, and build interactive prototypes.
You can tell your board what to do by sending a set of instructions to the microcontroller on the board.
To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on
Processing
Inexpensive: Arduino boards are relatively inexpensive compared to other microcontroller platforms.
Cross-platform: The Arduino Software (IDE) runs on Windows, Macintosh OSX, and Linux operating systems. Most
microcontroller systems are limited to Windows.
Simple, clear programming environment: The Arduino Software (IDE) is easy-to-use for beginners, yet flexible enough
for advanced users to take advantage of as well
Open source and extensible hardware: The plans of the Arduino boards are published under a Creative Commons
license, so experienced circuit designers can make their own version of the module, extending it and improving it.
Open source and extensible software: The Arduino software is published as open source tool and the language can be
expanded through C++ libraries.

3.5.2 ThingSpeak
ThingSpeak is an IoT analytics platform service that allows you to aggregate, visualize, and analyze live data streams in
the cloud. You can send data to ThingSpeak from your devices, create instant visualization of live data, and send alerts.
Send sensor data privately to the cloud. Analyze and visualize your data with MATLAB. Trigger a reaction.
The ThingSpeak server extracts the data and display it on a grape that we made in our account. ThingSpeak
an IOT (internet of things) platform/server that store sensors, actuators data in a cloud and lets you analyze the data in
graphical and tabular form.

3.5.3 Kaggle Dataset


Kaggle is a data science platform but it also supports dataset handling. "Kaggle Datasets" allows you to create your own
custom datasets, share them with others and easily import them into your notebooks. Additionally, you can add private
datasets which would only be visible to you. What makes this feature one of the most important ones in Kaggle is that it
gives you access to a wide variety of top-quality datasets shared by other users. You can easily find the datasets you
want with just a few search and filtering methods.
Kaggle allows you to download any dataset for free, but depending on what you are going to use it for, you may need to
pay attention to the license type of the datasets.
Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 198
[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

3.5.4 Machine Learning Algorithms:


Random Forest: The Random Forest is an ensemble machine learning model that combines multiple decision trees to
improve accuracy and robustness. Each tree in the forest is trained on a random subset of the data and a random subset
of features, promoting diversity among the trees. The model aggregates the predictions of all the trees, typically through
majority voting for classification or averaging for regression, to produce the final output. This approach helps to reduce
overfitting and enhance generalization to new data. Random Forests are highly versatile and effective for a wide range
of tasks, including classification, regression, and feature selection.

IV. METHADOLOGY
This crop recommendation system revolves around the concept of machine learning and IoT. The steps involved for
developing this system are:
[1] Data Collection: Gather a comprehensive dataset encompassing soil parameters (nitrogen, potassium, phosphorous,
pH levels, humidity and temperature) from geographical locations, incorporating historical records and real-time data.
The dataset should consist of the required parameters along with the corresponding crops suitable for cultivation.
[2]Data Pre-Processing:We will check for the irregularities in data like missing values, outliers, and inconsistencies
within the collected dataset which might have cause problems in system training. Extract relevant features, possibly
transforming or scaling data to enhance model performance.
[3]Model Development: Implement and train machine learning models (e.g., decision trees, random forests, gradient
boosting) to correlate soil and environmental data with recommended crops. Optimize model parameters using
techniques like cross-validation to improve predictive accuracy.
[4] System Integration: Establish a system to collect live soil data through IoT sensors, ensuring seamless data
transmission to the recommendation system. Develop algorithms to process incoming data in real-time and send this
data to the machine learning model we developed for the crop recommendations.
[5] User Interface and Deployment: Create a user-friendly interface for farmers to access the system and receive
personalized crop recommendations. Implement the system in a scalable and accessible manner.
[6]Evaluation and Refinement: Create a user-friendly interface for farmers to access the system and receive
personalized crop recommendations. Implement the system in a scalable and accessible manner.

Machine Learning Model Development


Dataset Preparation: Gather historical data linking soil properties to suitable crops for your target region. This data can
come from agricultural research or local farm records. Ensure the data is accurate, complete, and representative of the
crops and soil conditions you are interested in. Pre-process the data to handle missing values, outliers, and normalize
features for the chosen machine learning algorithm.

FIG 4.1 Block diagram of Crop Suggestive system

Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 199


[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

Model Selection and Training: Select a suitable machine learning algorithm based on data size, complexity, and desired
outcome. Common choices include: Decision Trees – Easy to interpret and implement, good for smaller datasets.
Support Vector Machines (SVMs) – Effective for high dimensional data. K-Nearest Neighbours (KNN) – Efficient for
smaller datasets. Train the model on the prepared dataset, splitting it into training and testing sets for evaluation. Fine-
tune hyperparameters of the model to optimize its performance.
Model Evaluation and Improvement: Evaluate the model's accuracy using metrics like precision. Analyse model errors
and identify areas for improvement. This may involve collecting additional data, refining feature selection, or trying
different algorithms.

V. IMPLEMENTATION

Fig 5.1 Represents the steps involved in development of the proposed system and they are described below
The proposed system is consisting of two important parts, first one is development and training of machine learning
model and second one is creating an IoT system which is capable of recording required soil parameters directly from
soil and finally integration of both.
[A] Data Collection: The data collection is the most important part as the training of the model and produced result will
be based on this dataset only, so, we have to select the dataset which consist of required parameters and accurate
recommendations, we can refer to several free websites like kaggle for the datasets.
Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 200
[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

[B] Data Pre-processing:Data pre-processing is a crucial step as collected dataset may involve a lot of irregularities like
missing data, noisy data and outliers, which can cause problems during the training of the model. So, it is better to
arrange the data in a format which is suitable for analysis and training. The methods which are used for data
preprocessing are data cleaning, data transformation, normalization, data reduction etc.
[C] Feature Engineering: Feature engineering is a way of creating & extracting new features and utilise them in order to
improve the performance of the machine learning model. It is an essential step and generally that features are taken into
consideration which affects the recommendation.
[D] Machine Learning Algorithm: Machine learning algorithms are computational model that enables computers to
learn patterns and make decisions or predictions without being explicitly programmed. The dataset is split into two
parts, training and testing dataset. According to a standard rule, 80% of dataset is used for training while 20% will be
used for testing and validation. There are different machine learning algorithms which are useful for the
recommendation system but we have to choose the algorithm with high accuracy.
The algorithms with higher accuracies are described below
Random Forest Algorithm: Random forest is an ensemble algorithm which is based on the concept of decision trees.
But, instead of one decision tree, multiple decision trees are deployed in the backend which produces individual results
and the final result is decided on the basis of majority voting. The random forest also has higher accuracy and is faster
as compared to gradient boosting.

VI. RESULT
This chapter deals with results and discussions. The following figures show the sensor deployment into the sample soil
mix interfaced with ESP8266 Node MCU/Arduino UNO to record the sensor output. Further, the sensor output (Soil
moisture and N P K Values) is to be compared with the existing database and the prediction of the CROP must be done.

6.1 Moisture sensor

Fig 6.1.1 Moisture sensor connection

Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 201


[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

Fig 6.1.2 Moisture sensor values on serial monitor

Fig 6.1.3 Display of moisture values in ThingSpeak


The above figures shows the integration of soil moisture sensors with ESP8266 wi-fi module and placed in a soil
sample. The soil sample should be slightly wet to get an optimum value. This sensor is continuously monitored over a
certain period and the values at various times are stored on the Thingspeak.

Connections:
Pin A0 of the moisture sensor module connects to pin A0 on the ESP8266
The GND pin on the moisture sensor module connects to a GND pin on the ESP8266
The VCC pin on the moisture sensor module connects to a 3v3 pin on the ESP8266

6.2 NPK Sensor with Arduino


The below figures shows the integration of the NPK Soil sensor with the Arduino. The Sensor should be placed in
lightly wet soil making sure no hard materials doesn’t come contact with the metal surfaces. The soil sample must be
slightly wet in order to obtain reasonable values if the soil is dry the sensor may be maximum values. Using this sensor

Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 202


[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

Nitrogen(N), Phosphorus(P), and Potassium(K) values of various soil samples are obtained. Which are very essential
nutrients for plant growth.

Fig 6.2.1NPK sensor with Arduino Fig 6.2.2 Display of NPK Values

6.3 Moisture and NPK Sensor Interfacing


Connections:
Moisture Sensor:
VCC: Connect to 3.3V or 5V pin of the ESP8266 (check the voltage requirement of your sensor).
GND: Connect to GND pin of the ESP8266.
Analog Output: Connect to any analog input pin of the ESP8266, e.g., A0.

NPK Sensor:
The connections for the NPK sensor may vary depending on the specific model you're using. Typically, these sensors
provide analog or digital output for each nutrient (N, P, K).
VCC: Connect to 3.3V or 5V pin of the ESP8266 (check the voltage requirement of your sensor).
GND: Connect to GND pin of the ESP8266.
Analog/Digital Output for Nitrogen (N): Connect to any available analog or digital input pin of the ESP8266.
Analog/Digital Output for Phosphorus (P): Connect to any available analog or digital input pin of the ESP8266.
Analog/Digital Output for Potassium (K): Connect to any available analog or digital input pin of the ESP8266.

Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 203


[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

Fig 6.3.1 Display of Moisture and NPK values on ThingSpeak

Fig 6.3.2 Crop predicated by the Algorithm (rice)

Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 204


[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

Fig 6.3.3 Crop predicated by the Algorithm (pomegranate)

Fig 6.3.4 Crop predicated by the Algorithm

VII. CONCLUSION
In conclusion, the fusion of IoT and machine learning on platforms like Kaggle offers a potent solution for soil-based
fertilizer recommendation. By harnessing real-time data from sensors and leveraging advanced algorithms, this
approach optimizes crop yields, minimizes resource wastage, and fosters sustainable agricultural practices.
By using sensors to gather real-time data from fields and clever computer algorithms to analyze it, farmers can grow
crops more efficiently. This means getting bigger harvests while using fewer resources and being kinder to the
environment. Though there are challenges, like keeping data safe and making sure everyone can use this technology,
Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 205
[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

the benefits for farmers are clear: healthier crops and more sustainable farming. Working together, we can make
farming smarter and better for everyone.
This approach offers several significant benefits for farmers and the environment. Firstly, it helps farmers optimize crop
yields by ensuring that plants receive the nutrients they need at the right time and in the right amounts. This leads to
healthier crops, bigger harvests, and increased profitability for farmers.
Secondly, by using resources more efficiently, such as reducing the overuse of fertilizers, this approach promotes
sustainability and environmental conservation. By minimizing nutrient runoff and soil erosion, it helps protect water
sources and ecosystems, contributing to long-term soil health and biodiversity.
Despite its potential, implementing IoT-based fertilizer recommendation systems also presents challenges. These
include concerns about data privacy and security, ensuring the reliability and accuracy of sensor data, and providing
access to technology for all farmers, regardless of their resources or location.
However, by addressing these challenges and fostering collaboration between stakeholders, including farmers,
researchers, technology developers, and policymakers, we can unlock the full potential of IoT and machine learning in
agriculture. Together, we can create a more resilient, efficient, and sustainable farming system that meets the needs of
both current and future generations.
Additionally, this approach promotes cost-effectiveness by reducing the need for excessive fertilization and labour,
while also empowering farmers with actionable insights to adapt to changing environmental conditions. It also opens
doors for innovation, encouraging the development of new technologies and solutions to address pressing agricultural
challenges in a rapidly evolving world.
In conclusion, the integration of IoT and machine learning for soil-based fertilizer recommendation represents a
promising approach to improving agricultural productivity, sustainability, and resilience. By harnessing the power of
data and technology, we can create a future where farming is not only more efficient and profitable but also more
environmentally friendly and equitable for all stakeholders involved.

VIII. FUTURE SCOPE


Advanced Sensor Technology: Continued advancements in sensor technology will lead to the development of more
sophisticated and cost-effective sensors for monitoring soil health. These sensors will provide even more detailed and
accurate data, enabling finer-grained fertilizer recommendations tailored to specific soil and crop conditions.
Integration of Multiple Data Sources: Future systems may integrate data from various sources beyond soil sensors, such
as weather forecasts, satellite imagery, and historical crop performance data. By combining multiple data streams,
farmers can gain a more comprehensive understanding of their fields and make more informed decisions.
Predictive Analytics: Machine learning algorithms will become increasingly adept at predicting future soil and crop
conditions based on historical data. This will enable proactive fertilizer recommendations, allowing farmers to
anticipate changes in soil health and adjust their management practices accordingly.
Real-Time Monitoring and Control: With the proliferation of IoT devices and connectivity technologies, farmers will
have the ability to monitor and control their fields in real-time from anywhere using mobile devices or computers. This
will enable more responsive and adaptive management practices, leading to improved productivity and resource
efficiency.
Cloud-Based Solutions: Cloud computing will play a crucial role in enabling scalable and accessible soil-based
fertilizer recommendation systems. Cloud-based platforms will provide farmers with easy access to advanced analytics
tools and allow for seamless integration with existing farm management software.
Customized Solutions for Different Regions: As soil and climate conditions vary widely across different regions, future
systems will likely offer customized solutions tailored to specific geographical areas. This will ensure that
recommendations are relevant and effective for local farming practices and environmental conditions.

REFERENCES
[1] K Bodake, R Ghate, H Doshi, P Jadhav, B Tarle, MVP Journal of Engineering Sciences, 2018,[Link]
[2] A. Sarwar, V. Singh, V. Sharma, Analysis of soil and prediction of crop yield (Rice) using Machine Learning
approach. Int. J. Adv. Res. Computer Sci. 8 (2017)
Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 206
[Link]
ISSN (Online) 2581-9429
IJARSCT
International Journal of Advanced Research in Science, Communication and Technology (IJARSCT)
International Open-Access, Double-Blind, Peer-Reviewed, Refereed, Multidisciplinary Online Journal
Impact Factor: 7.53 Volume 4, Issue 6, May 2024

[3] R.K. Rajak, A. Pawar, M. Pendke, P. Shinde, S. Rathod, A. Devare, Crop recommendation system to maximize crop
yield using machine learning technique. Int. Res. J. Eng. Technol. (IRJET) (2017)
[4][Link], S. Kanaga Suba Raja, S.R. Ronak, S. Rengarajen, P. Ravindran, Design and implementation of
fertilizer recommendation system for farmers. Test Eng. Manage. 83, 8840–8849 (2020)
[5] Z. Ren, X. Lu, Design of fertilization recommendation knowledge base and application, in 2012 First International
Conference on Agro-Geoinformatics (Geoinformatics)
[6]Gondchawar N, Kawitkar RS. IoT Based Smart Agriculture. International Journal of Advanced Research in
Computer and Communication Engineering (IJARCCE). 2016 Jun
[7] Aruvansh Nigam, Saksham Garg, Archit Agrawal “Crop Yield Prediction usingML Algorithms”, International
Journal of Engineering Research & Technology (IJERT),2019.
[8] R. Garg, P. Jain, and R. K. Jain, “Crop yield prediction using machine learningalgorithms: A review,” Journal of
Agricultural Science and Technology, vol. 21, no. 3, pp501-516, 2019.
[9] S. Kumar, M. R. Gupta, and M. S. Bhatia, “Crop yield prediction using machinelearning algorithms: A
comprehensive review,” International Journal of ComputerApplications, vol. 179, no. 6, pp. 1-6, 2018.
[10] M. Kamble, D. Kumar, and P. Kumar, “A review on crop yield prediction usingmachine learning techniques,”
International Journal of Advanced Research in Computer Science and Software Engineering, vol. 7, no. 4, pp. 260-267,
2017.

Copyright to IJARSCT DOI: 10.48175/IJARSCT-18526 207


[Link]

You might also like