Seminar FInal Report (ANN)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 42

ABSTRACT

In India, over 60.43% of land cover accounts for agriculture. But it is impossible to meet the
growing needs of the nation if we rely on the ancient methods of farming as we must sustainably
and efficiently harvest most of the available agricultural land. This project aims to implement an
economic smart system which utilizes high-tech sensors and the Internet of things to smartly
harvest crops. The salient features of the system are It’s a mobile-app controlled module which
uses a set of sensors (Electromagnetic, NPK, Optical, Electrochemical) to sense the nutritional
contents and texture of the soil and it’s analyzed by introducing advanced K-Means
Clustering/Random Forest/ Decision Tree algorithm to predict which type of crop can be
cultivated and utilizes infrared and laser sensors to design sowing pattern which maximizes the
output. It also monitors soil moisture and curates’ irrigation patterns like drip irrigation. An in-
built weather-forecast prediction will predict precipitation and changes the irrigation cycle to
avoid the chances of over/under irrigation. During the crop growth phase, the module senses the
real-time needs of the crop and alerts the farmer. Additionally, as a security measure, it uses a
versatile infrared sensor to detect motion and an alarm system to scare away predators. All the
functionalities are controlled by mobile applications governed and supervised by Machine
Learning algorithms and performed by high-tech sensors and actuators with microcontrollers and
RaspberryPi.

1
TABLE OF CONTENTS

Page No.

ABSTRACT 1

1 INTRODUCTION 4

1.1 Introduction 4

1.1.1 Problem Statement 5

1.2 Aim of the Project 5

1.3 Project Domains 5

1.4 Scope of the project 5

1.5 Methodology 6

2 LITERATURE REVIEW 7

3 PROJECT DESCRIPTION 10

3.1 Existing System 10

3.2 Proposed System 10

3.3 Feasibility Study 11

3.3.1 Economic Feasibility 11

3.3.2 Technical Feasibility 11

3.3.3 Social Feasibility 11

3.4 System Specification 12

3.4.1 Hardware Specification 12

3.4.2 Software Specification 12


2
4 MODULE DESCRIPTION 13

4.1 General Architecture 13

4.2 Design Phase 15

4.2.1 Data Flow Diagram 15

4.2.2 UML Diagram 16

4.2.3 Use Case Diagram 17

4.2.4 Sequence Diagram 18

4.3 Module Description 20

5 IMPLEMENTATION AND TESTING 26

5.1 Input and Output 26

5.2 Testing 27

5.3 Types of Testing 29

5.3.1 Unit Testing 29


5.3.2 Integration Testing 29
5.3.3 Functional Testing 29
5.3.4 Test Result

5.4 Testing Strategy 24

6 RESULTS AND DISCUSSIONS 32

6.1 Efficiency of proposed system 32

6.2 Comparison of Existing and proposed system 32

6.3 Sample Code 33

7 CONCLUSION AND FUTURE ENHANCEMENTS 34

7.1 Conclusion 34

7.2 Future Enhancements 35

8 SOURCE CODE AND POSTER REPENTATION 36

REFERENCES 40
3
CHAPTER 1

INTRODUCTION

1.1 Introduction

Recently, Agriculture is considered among the key strengths of the global country’s economy.
The practice of farming is one of the main occupations in the world and the product key to the
variety of crops. In recent times, agriculture is facing problems that may threaten its future, such
as drought, crop quality, and productivity problems, Yield prediction problems. The world’s
population is growing by about three people per second, equivalent to 250,000 people per day,
and by 2025 the world’s population will reach 8 billion, and the planet’s population is expected to
reach about 9.6 billion in 2050, according to figures from the Food and Agriculture Organization
(FAO) of the United Nations to keep pace with this steady increase, farmers must upturn food
production while conserving the environment and use natural resources rationally, but they
cannot do it on their own, and customary farming techniques do not enable them to do. So,
modern technologies play an essential role in helping to face the growing food needs of the
world’s population. Agriculture is suffering a great transformation in the gathering and use of
data to apprise useful farming decisions. Smart farming is the utilization of modern Information
and Communication Technology (ICT) like machine learning algorithms in agriculture and the
rationalization of the use of natural resources, as a capital-based system, advanced technology in
food farming in sustainable and clean ways. Innovative technologies are bringing assistance to
the majority of people around the world in various applications. Presently, the Internet of Things
(IoT), and data analysis such as big data analytics and data science have begun to play an
important role in people’s daily lives, extending their abilities to adjust to the environs around
them. Generally, the agro-industrial and environmental areas apply IoTs and data analysis in both
diagnostics and control of the smart farming systems by providing vital information to the final
farming, the consumer about the basis, and the properties of the agro-products and systems.

4
1.1.1 Problem Statement

Firstly, the key problem is in most parts of the world the farmers are unaware of the cause of
the failure of crops and often unattended. This project acts as an assistant to farmers and it
controls and monitors all the stages of agriculture.

1.2 Aim of the Project

The aim of the project is to develop an IoT device and interface to monitor and control
agricultural practices with the help of Machine Learning algorithms.

1.3 Project Domain

The domain of the project is Machine Learning. The progress of machine learning techniques
has been challenging when it comes to complex sensors. All the sensors are centrally
connected in the IoT environment.

1.4 Scope of the Project

The project aims to automate and monitor the phases of farming with a sensor monitoring
system using machine learning, and to make it cost-efficient. it measures the parameters of the
testing matrix with help of high-quality sensors. By using micro-controllers/computers the data
is dynamically processed and saved in the cloud. The data is driven through the model in real-
time and output is obtained. The results are evaluated based on past metrics.

5
1.5 Methodology

The methodology carried out in this model is, firstly the primary sensors like NPK and soil
sensors are deployed to collect the preliminary static and demographic data of the
environment and alert the users about the status. In the upcoming stages, the sensors are
switched between the sleep and active state to conserve power and other resources. The
moisture sensor senses the moisture content of the soil and using OpenWeatherAPI it
monitors the weather for rainfall and alters the irrigation by controlling the water flow. The
data collected from the sensors are pre-processed to optimize and remove any null points and
it is fed to a well-trained machine learning model to predict the desired outcome.

6
CHAPTER 2
LITERATURE REVIEW

SL NO TITLE AUTHOR METHODOLOGY

This project
includes various
features
like GPS based
Suma, N., remote controlled
Samson, S. R., monitoring,
IOT Based Smart
Saranya, S., moisture &
Agriculture
1 Shanmugapriya,
Monitoring temperature
G., & Subhashri, sensing, intruders
System
R scaring, security,
leaf wetness and
proper irrigation
facilities.

ML with computer
Machine Learning Abhinav Sharma, vision are reviewed
Applications for Arpit Jain,Prateek for the classification
2 of a different set of
Precision Gupta, Vinay crop images in
Agriculture Chowdary order to monitor the
crop quality and
yield
assessment

7
It discusses IoT
Machine Learning
Yemeserach based data-driven
Techniques in
Mekonnen, Srikant
Wireless Sensor smart farm prototype
3 h
Network Based
Namuduri, Lamar as an integrated food,
Precision
Burton
Agriculture energy water system

8
The goal of smart
Precision Agriculture agriculture is to
Using Advanced Vijaykumar
Technology of IoT, develop a decision-
Ponnusamy,
Unmanned Aerial making support
4 Soumya
Vehicle, Augmented system for farming
Reality, and Machine Natarajan
management.
Learning

Internet of Things
(IoT) and This paper describes
Agricultural Achilles D the main principles
5
Unmanned Aerial Boursians Maria, of IoT technology,
Vehicles (UAVs) S.Papadopoulo including intelligent
in smart farming sensors

Othmane Friha , It is a
Internet of Things comprehensive
Mohamed Amine
for the Future of Ferrag , review of emerging
6 Smart Agriculture: A Lei Shu , , technologies for
Comprehensive Leandros the internet of
Survey of Emerging Maglaras , things (IoT)-based
Technologies Xiaochan Wang smart agriculture.

This paper exhibits


a comprehensive
Integrating
survey on the
blockchain and the
Mohammed Torkya, importance of
internet of things in
Aboul ul integrating both
precision Ellahassanein
7 blockchain and IoT
agriculture:
in developing
Analysis,
smart applications
opportunities, and
in precision
challenges
agriculture.

9
This paper presents
the CropDeep species
classification and
The crop vision
Yang-Yang detection dataset,
dataset for deep-
Zheng., Jian-Lei consisting of 31,147
learning- based
Kong., Xue-Bo images with over
8 classification and
Jin 49,000 annotated
detection in precision
instances from 31
agriculture
different classes.

This paper proposes

A Reversible Automatic a Reversible


Selection Normalisation Automatic Selection
(RASN) Deep Network Xuebo Jin., Normalization
for Predicting In the JiashuaiZhang., (RASN) network,
9
Smart Agriculture Tingli Su., Yuting Bai integrating the
System normalization and
renormalization
layer

The main goal of


this article is to
acquire an
Big Data And awareness of the
AI Revolution Big Data latest
Showkat Ahmed
In Precision applications in
Bhat., Nen-Fu Huang
10
Agriculture: smart agriculture
Survey And and be acquainted
Challenges with related social
and financial
challenges to be
concentrated on.

10
CHAPTER 3

PROJECT DESCRIPTION

3.1 Existing System

The existing system operates in a close and controlled environment. In this system, It deploys
high-level machinery to maintain control of the environment and it's not economical,
therefore most of the users can’t afford it. It doesn't offer any kind of automation; most of the
systems are manually operated.

3.2 Proposed System

The proposed system is a hybrid model consists of both hardware and software support, It can
be operated in an open environment, It collects the data using semiconductor sensors which
consume less power and it’s economical. It also provides support through machine learning
algorithms which ensure precision and predict the outcome. The model is presented to the
user through a GUI interface.

3.2.1 Advantages

 Intelligent data collection


 Waste reduction
 Process Automation
 Increased Production
 Water conservation
 Lowered Operation Cost

11
3.3 Feasibility Study

A Feasibility study is carried out to check the viability of the project and to analyze the
strengths and weaknesses of the proposed system. The application must be evaluated. The
feasibility study is carried out in three forms
• Economic Feasibility
• Technical Feasibility
• Social Feasibility

3.3.1 Economic Feasibility

The proposed system does not require any high-cost equipment. This project can be
developed within the available software.

3.3.2 Technical Feasibility

The proposed system is completely a Machine learning model. The main tools used in this
project are Anaconda prompt, Visual studio, Kaggle data sets, Jupyter Notebook And the
language used to execute the process in Python. The above-mentioned tools are available for
free and technical skills required to use this tools are practicable. From this we can conclude
that the project is technically feasible.

3.3.3 Social Feasibility

Social feasibility is a determination of whether project will be acceptable or not. our project is
Eco-friendly for society and there is no social issues. our project must not be threatened by
the system instead must accept it as a necessity. since our project is applicable for every
individual in the society to take care about the society and environment. The level of the
acceptance of System is very high and it depends on the methods deployed in the system. our
system is highly familiar with the society

12
3.4 System Specification

3.4.1 Hardware Specification

• Processor - Intel i5-8250 CPU @1.60GHz 1.80GHz


• 512 GB SSD
• NVIDIA GEFORCE RTX
• CPU QUAD CORES 13
• Temperature Sensor
• Soil Sensor
• Moisture Sensor
• Rechargeable Battery
• ARDUINO UNO

3.4.2 Software Specification

• ANACONDA
• ANACONDA PROMPT
• PYTHON
• VISUAL STUDIO
• GIT

13
CHAPTER 4
MODULE DESCRIPTION

4.1 General Architecture

Figure 4.1 Architecture Diagram

The sentiment analysis of Twitter data is an emerging field that needs much more attention.
An architecture diagram is a visual representation that maps out the physical implementation
of a software system. It shows a general structure of the software system and the associations,
limitations and boundaries between each element

14
FIG 4.1.2. General Proposed operational Architecture

FIG 4.1.3. Proposed Operational layered architecture

FIG 4.1.4. Main steps in the proposed architecture based on IA techniques

15
4.2 Design Phase

4.2.1 Data Flow Diagram

Figure 4.2 Data Flow Diagram

A data flow diagram (DFD) is a graphical or visual representation using a standardized set of
symbols and notations to describe a business's operations through data movement. They are
often elements of a formal methodology such as Structured Systems Analysis and Design
Method (SSADM). Superficially, DFDs can resemble flow charts or Unified Modeling
Language (UML), but they are not meant to represent details of software logic.

16
4.2.2 UML Diagram

Figure 4.3 UML Diagram

A UML diagram is a diagram based on the UML (Unified Modeling Language) with the purpose
of visually representing a system along with its main actors, roles, actions, artifacts or classes, in
order to better understand, alter, maintain, or document information about the system.

17
4.2.3 Use Case Diagram

Figure 4.4 Use Case Diagram

A use case diagram is used to represent the dynamic behavior of a system. It encapsulates the
system's functionality by incorporating use cases, actors, and their relationships. It models the
tasks, services, and functions required by a system/subsystem of an application. It depicts the
high-level functionality of a system and also tells how the user handles a system.

18
4.2.4 Sequence Diagram

Figure 4.5 Sequence Diagram

Figure 4.5 represents a sequence diagram is a Unified Modeling Language (UML) diagram
that illustrates the sequence of messages between objects in an interaction. A sequence
diagram consists of a group of objects that are represented by lifelines, and the messages that
they exchange over time during the interaction. it represents a timeline that begins at the top
and descends gradually to mark the sequence of interactions. Each object has a column and
the messages exchanged between them are represented by arrows.

18
4.2.5. FLOW DIAGRAM

A flow diagram is a graphical representation that illustrates the sequence of steps or processes

involved in a system, operation, or procedure. It is used to depict the logical flow of information,

materials, or tasks from one point to another within a system. Flow diagrams typically use

standardized symbols and arrows to represent each step or process, with the arrows indicating the

direction and flow of the sequence. This allows the diagram to provide a visual representation of

how a system operates and how the different components interact with one ano ther.

Figure 4.5 Flow Diagram

19
4.3 Module Description

4.3.1 ARDUINO UNO

The Arduino Uno is a microcontroller board based on the ATmega328(datasheet).It has 14


digital input/output pins(of which 6 can be used as PWM outputs),6 analog inputs, a 16 MHz
crystal oscillator, a USB connection ,a power jack, an ICSP header , and a reset button.

4.3.2 WIFI MODULE-ESP 8266

ESP8266 Wi-Fi Module is SOC with TCP/IP protocol stack integrated which facilitates
any microcontroller to access Wi-Fi network. ESP8266 module is cost effective module
and supports APSD for VOIP Applications and Bluetooth co-existence interfaces.
Technical Specifications: 802.11b/g/n; Wi-Fi Direct, 1MB Flash Memory, SDIO 1.1/2.0,
SPI, UART, Standby Power Consumption of <1.0mW.

4.3.3 TEMPERATURE SENSOR-DS18B20

The DS18B20 temperature sensor provides 9-bit to 12-bit Celsius temperature measurements
and has alarm function with non-volatile user-programmable upper and lower trigger points.
The DS18B20 has 64-bit serial code which allows multiple DS18B20s to function on same
1-wire bus. Technical Specifications: Unique 1-Wire Interface; Measures Temperature from
-55oC TO +125oC; Coverts temperature to 12-bit digital word in 750ms.

4.3.4 SOIL MOISTURE SENSOR-FC 28

20
Soil Moisture Sensor is used for measuring the moisture in soil and similar materials. The
sensor has two large exposed pads which functions as probes for the sensor, together acting as
a variable resistor. The moisture level of the soil is detected by this sensor. When the water
level is low in the soil, the analog voltage will be low and this analog voltage keeps increasing
as the conductivity between the electrodes in the soil changes. This sensor can be used for
watering a flower plant or any other plants requires automation.

4.3.5 RECHARGABLE BATTERY

The sealed lead-acid (SLA) 12V, 9Ah rechargeable battery is rated at a 5-hour (0.2) and 20-
hour (0.05C) discharge. Longer discharge times produce higher capacity readings because of
lower losses. The lead-acid performs well on high load currents. This battery act as an internal
power supply for the whole circuit.

4.3.6 EXTERNAL AC ADAPTER

A 12V AC adapter can also be considered as a component in the circuit for external power
supply for the circuit which enabled the circuit to be switched ‘ON’ in case if the battery
power is very low for use. The adapter can directly act as an AC/DC convertor to provide
pure DC current externally to the circuit.

21
ARDUINO
ARDUINOUNO
UNO WIFI MODULE-ESP
8266

TEMPERATURE SENSOR-
DS18B20
SOIL MOISTURE SENSOR-FC 28

RECHARGABLE BATTERY EXTERNAL AC ADAPTER

22
4.4 EXPERIMENTAL RESOURCES

4.4.1 NodeMCU development board

NodeMCU is an open-source IoT development platform which includes a firmware system

development board that runs on ESP8266 Wi-Fi SoC. It has its own voltage regulator module and

USB-UART. It is very convenient for development. The pin rules, the breadboard also has a big

advantage in the wiring. The NodeMCU development board features GPIO, PWM, I2C, 1-Wire, and

ADC. It provides hardware advanced interfaces that free application developers from complex

hardware configurations and register operations. The development language of NodeMCU is not only

Lua but also C++, Python (MicroPython) and Java (Smart.js). We use the CP2102 version of the

board here, as shown below.

FIG. The appearance of the NodeMCU based on the ESP8266 development board

4.4.2. DHT11 temperature and humidity sensor

DHT11 digital temperature and humidity sensor, which is a temperature and humidity composite

sensor with calibrated digital signal output, which has good reliability and stability. The DHT11
23
includes an NTC temperature measuring element and a resistive sensing element connected to an 8-bit

microcontroller. The calibration coefficients are stored in the OTP memory (write once, not erasable)

in the form of a program. These calibration coefficients are called internally during the processing of

the detection signal. It uses a single-wire serial interface to make system integration simple and fast.

The DHT11 is small in size and low in power consumption and is available in a 4-pin single-row pin

package for easy connection.

FIG.DHT11 Temperature and Humidity Sensor

4.4.3. Soil moisture sensor


Soil Moisture Sensor is used for measuring the moisture in the soil and similar materials. The sensor

has two large exposed pads that function as probes for the sensor, together acting as a variable

resistor. The moisture level of the soil is detected by this sensor. When the water level is low in the

soil, the analog voltage will be low and this analog voltage keeps increasing as the conductivity

between the electrodes in the soil changes. This sensor can be used for watering a flowering plant or

any other plants that require automation. Technical Specification: 3.3V to 5V; Analog Output; VCC

external 3.3 V to 5V.

24
FIG. Soil Moisture Sensor

4.4.4. Water Level Sensor


The water level sensor is an easy-to-use, cost-effective high level/drop recognition sensor, which is

obtained by having a series of parallel wires exposed traces measured droplets/water volume in order

to determine the water level. Easy to complete water to analog signal conversion and output analog

values can be directly read Arduino development board to achieve the level alarm effect.

FIG . Water Level Sensors

4.4.5. Rain Sensor


This is one kind of switching device which is used to detect the rainfall. It works like a switch and the

working principle of this sensor is, whenever there is rain, the switch will be normally closed.

25
FIG. Rain Sensor

26
CHAPTER 5

IMPLEMENTATION AND

TESTING

5.1 Input and Output

Figure 5.1 Training Data

5.2 Testing

Testing is the process of evaluating a system or its component(s) with the intent to find
whether it satisfies the specified requirements or not.

Figure 5.2 Testing Data


21
(a) (b)
Z
Fig. 5.2.1 Plot of Model
(a) Plot of Model Loss on Training and Validation of Air-Temperature using LSTM-based models. (b) Loss on Training and Validation
of Air-Temperature using GRU-based models.
1 :

(a) (b)
Fig. 5.2.2 Plot of Model
(a) Plot of Model Loss on Training and Validation of Soil-Moisture using LSTM-based models. (b) Loss on Training and Validation
of Soil-Moisture using GRU-based models.

(a) (b)
:
Fig. 5.2.3 (a) Plot of Model Loss on Training and Validation of Air-Humidity using LSTM-based
Plot of Model
models.Loss
(b) on Training and Validation
of Air-Humidity using GRU-based models.
TABLE 5: RMSE, MSE, MAE of the LSTM and GRU based models for (Air-Temperature, Soil-Moisture,
Air- Humidity) Training and Validation.

Parameters LSTM GRU

RMSE MSE MAE RMSE MSE MAE

Soil-Moisture
0.0268 0,0007 0.0114 0.0220 0,0004 8 0.0101

Air-Humidity
11.7550 138,18 8.1946 12.9778 168.4255 8.4585

Air-
Temperature 1.4090 1.9855 1.0777 1.3331 1.7771 1.0167
5.3 Types of Testing

5.3.1 Unit Testing

Unit testing is a beneficial software testing method where the units of source code is tested to
check the efficiency and correctness of the program.

5.3.2 Integration Testing

Integration testing is the second level of the software testing process comes after unit testing.
In this testing, units or individual components of the software are tested in a group. The focus
of the integration testing level is to expose defects at the time of interaction between
integrated components or units.

5.3.3 Functional Testing

It is a type of software testing which is used to verify the functionality of the software
application, whether the function is working according to the requirement specification. In
functional testing, each function tested by giving the value, determining the output, and
verifying the actual output with the expected value. Functional testing performed as black-
box testing which is presented to confirm that the functionality of an application or system
behaves as we are expecting. It is done to verify the functionality of the application.

30
5.3.4 Test Result

Figure 5.3 Output

23
Testing Strategy

• Unit testing: Unit testing verifies the bits of code to check the viability of the code.

• Integration testing: Integration testing is carried out to the efficiency of the model
with functional requirements.

• Functional testing: The functional testing is done to verify the output with the
provided input against the functional requirements.
CHAPTER 6

RESULTS AND DISCUSSIONS

6.1 Efficiency of the Proposed System

The model proposed in this study enhances the features of the existing system, It introduces
the dynamic changes in IoT devices through machine learning to improve the accuracy and
precision of the outcome. It follows an integrated hybrid multimodal mechanism to achieve
real-time analysis and output. It is deployed in a centralised IoT network to achieve better
performance and speeds.

6.2 Comparison of Existing and Proposed System

Organic farmers usually do not have the opportunity to address the actual symptoms of
deficiency through the foliar application of synthetic fertilization, therefore, the main treatment
is realized by green manure crop cultivation and application of organic fertilizers. The aim of
this long-term experiment was to compare two different production systems with and without
livestock in terms of organic farming, and a control variant with no fertilization was also
included (treatment 1). The production system without animal husbandry was based on solely
the application of renewable external resources (compost or digestate) (treatment 2) and the
same fertilization with the addition of auxiliary substances (AS) (treatment 3). The production
system with animal husbandry included utilization of fertilizers produced on the farm
(fermented urine or manure) using solely farm fertilizers (treatment 4) and in addition with AS
(treatment 5). Each treatment had three replications. This work describes the average yields
from four experimental years and five experimental localities. Winter wheat, potatoes, winter
wheat spelt and legume-cereal mix with corn were used and examined as model crops during
the first four years of this long-term research. The highest average yield of winter wheat grain
and potato tubers during the first two years of the experiment were obtained after the
treatments 2 (7.1 t/ha grain, 33.9 t/ha tubers) and 3 (7.0 t/ha grain, 34.1 t/ha tubers).
6.3 Sample Code

byte values[11];
SoftwareSerial mod(2,3);

void setup() {
Serial.begin(9600);
mod.begin(9600);
pinMode(RE, OUTPUT);
pinMode(DE, OUTPUT);

display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
//initialize with the I2C addr 0x3C (128x64)
delay(500);
display.clearDisplay();
display.setCursor(25, 15);
Predictive analytics: Machine
learning can also be used for
predictive analytics, allowing
farmers to anticipate problems

Output
CHAPTER 7

CONCLUSION AND FUTURE ENHANCEMENTS

7.1 Conclusion

IoT based SMART FARMING SYSTEM for Live Monitoring of Temperature and Soil
Moisture has been proposed using Arduino and Cloud Computing. The System has high
efficiency and accuracy in fetching the live data of temperature and soil moisture. The IoT
based smart farming. System being proposed via this report will assist farmers in increasing the
agriculture yield and take efficient care of food production as the System will always provide
helping hand to farmers for getting accurate live feed of environmental temperature and soil
moisture with more than 99% accurate results.
In this paper, we discussed about farming with IoT for providing many useful services
to the farmers in society in future. Many of the smart applications can be developed by
the IOT and vastly utilized by users. The working of smart devices in farming allows
farmers to apply amount of many resources at right time and right place in right time.
This type of farming is having less cost. This system operates many machines and
equipment’s very smartly and collects the data based on these equipment from the field
by configuring the problems when they are detected. Farming with IOT helps in
mitigating the shortage of food by demanding the existing land for stronger utilization at
minimum cost. Smart farming is a notion that quickly snaps on the agricultural field. This
offers automated farming techniques, useful data collection and high-rigor crop control.
The main goal of this Smart Farming is to optimize the harvesting land per unit by using
modern methods to achieve best in terms of quality, quantity and financial return. Finally,
some of the probable solutions are examined by approaching some related research
initiatives.
7.2 Future Enhancements

Future work would be focused more on increasing sensors on this system to fetch more data
especially with regard to Pest Control and by also integrating GPS module in this system to
enhance this Agriculture IoT Technology to full-fledged Agriculture Precision ready product.

1. Improved sensor technology: The accuracy and reliability of sensor technology are crucial
to the success of any IoT-based system. In the future, advancements in sensor technology
could lead to better data collection and analysis, enabling farmers to make more informed
decisions.
2. Integration with other technologies: IoT-based smart farming systems can be integrated
with other technologies like precision agriculture, big data analytics, and blockchain to
provide even more insights and benefits to farmers.
3. Automated decision-making: The use of machine learning algorithms can enable
automated decision-making in the farming system. By analyzing data from sensors and
other sources, the system can make decisions on its own, such as adjusting the watering
schedule or applying fertilizer.
4. Predictive analytics: Machine learning can also be used for predictive analytics, allowing
farmers to anticipate problems before they occur. For example, by analyzing weather
patterns and soil data, the system can predict crop yields and identify potential diseases
before they spread.
5. User-friendly interfaces: User interfaces can be improved to make the system more user-
friendly for farmers. This can include mobile apps that provide real-time data and alerts, as
well as easy-to-use dashboards that provide insights into the performance of the system.
6. Integration with robotics: IoT-based smart farming systems can be integrated with robotics
to automate tasks like harvesting and planting. This can improve efficiency and reduce
labor costs for farmers.
CHAPTER 8

SOURCE CODE & POSTER PRESENTATION

8.1 Sample Code

#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels


#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset
pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

#define RE 8
#define DE 7

//const byte code[]= {0x01, 0x03, 0x00, 0x1e, 0x00, 0x03, 0x65, 0xCD};
const byte nitro[] = {0x01,0x03, 0x00, 0x1e, 0x00, 0x01, 0xe4, 0x0c}; const
byte phos[] = {0x01,0x03, 0x00, 0x1f, 0x00, 0x01, 0xb5, 0xcc}; const byte
pota[] = {0x01,0x03, 0x00, 0x20, 0x00, 0x01, 0x85, 0xc0};

byte values[11]; SoftwareSerial mod(2,3);

void setup() { Serial.begin(9600); mod.begin(9600); pinMode(RE, OUTPUT);


pinMode(DE, OUTPUT);

display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //initialize with the I2C addr


0x3C (128x64)
delay(500); display.clearDisplay(); display.setCursor(25, 15);
display.setTextSize(1); display.setTextColor(WHITE); display.println(" NPK
Sensor"); display.setCursor(25, 35); display.setTextSize(1);
display.print("Initializing"); display.display(); delay(3000);
}
void loop() {
byte val1,val2,val3;
val1 = nitrogen();
delay(250);
val2 = phosphorous();
delay(250);
val3 = potassium();
delay(250);

Serial.print("Nitrogen: ");
Serial.print(val1);
Serial.println(" mg/kg");
Serial.print("Phosphorous: ");
Serial.print(val2);
Serial.println(" mg/kg");
Serial.print("Potassium: ");
Serial.print(val3);
Serial.println(" mg/kg");
delay(2000);

display.clearDisplay();

display.setTextSize(2);
display.setCursor(0, 5);
display.print("N: ");
display.print(val1);
display.setTextSize(1);
display.print(" mg/kg");

display.setTextSize(2);
display.setCursor(0, 25);
display.print("P: ");
display.print(val2);
display.setTextSize(1);
display.print(" mg/kg");

display.setTextSize(2);
display.setCursor(0, 45);
display.print("K: ");
display.print(val3);
display.setTextSize(1);
display.print(" mg/kg");

display.display();
}
byte nitrogen(){

digitalWrite(DE,HIGH);

digitalWrite(RE,HIGH);
delay(10);

if(mod.write(nitro,size
of(nitro))==8){

digitalWrite(DE,LOW);

digitalWrite(RE,LOW);
for(byte
i=0;i<7;i++){

//Serial.print(mod.read
(),HEX);
values[i] =
mod.read();

Serial.print(values[i],
HEX);
}
Serial.println();
}
return values[4];
}

byte phosphorous(){

digitalWrite(DE,HIGH);

digitalWrite(RE,HIGH);
delay(10);

if(mod.write(phos,sizeo
f(phos))==8){

digitalWrite(DE,LOW);

digitalWrite(RE,LOW);
for(byte
i=0;i<7;i++){
byte nitrogen(){

digitalWrite(DE,HIGH);

digitalWrite(RE,HIGH);
delay(10);

if(mod.write(nitro,size
of(nitro))==8){

digitalWrite(DE,LOW);

digitalWrite(RE,LOW);
for(byte
i=0;i<7;i++){

//Serial.print(mod.read
(),HEX);
values[i] =
mod.read();

Serial.print(values[i],
HEX);
}
Serial.println();
}
return values[4];
}

byte phosphorous(){

digitalWrite(DE,HIGH);

digitalWrite(RE,HIGH);
delay(10);

if(mod.write(phos,sizeo
f(phos))==8){

digitalWrite(DE,LOW);

digitalWrite(RE,LOW);
for(byte
i=0;i<7;i++){
REFERENCES

1. Rezk, N. G., Hemdan, E. E. D., Attia, A. F., El-Sayed, A., & El-Rashidy, M. A.
(2021). An efficient IoT based smart farming system using machine learning
algorithms. Multimedia Tools and Applications, 80(1), 773-797.
2. Bhanu, K. N., Jasmine, H. J., & Mahadevaswamy, H. S. (2020, June). Machine
learning implementation in IoT based intelligent system for agriculture. In 2020
International Conference for Emerging Technology (INCET) (pp. 1-5). IEEE.
3. Vij, A., Vijendra, S., Jain, A., Bajaj, S., Bassi, A., & Sharma, A. (2020). IoT and
machine learning approaches for automation of farm irrigation system. Procedia
Computer Science, 167, 1250-1257.
4. Rehman, A., Liu, J., Keqiu, L., Mateen, A., & Yasin, M. Q. (2020). Machine learning
prediction analysis using IoT for smart farming. International Journal, 8(9).
5. Vijaykumar Ponnusamy.,& Sowmya Natarajan B. Precision Agriculture using
Advance Technologyof IoT.
6. Yang-Yang-Zheng., Jian-Lie Kong The crop vision dataset for deep-learning-based
classification and detection in precision agriculture
7. Moammed Torkya (2020) Integrating blockchain and the internet of things in
precision agriculture: Analysis, opportunities, and challenges.
8. Maduranga, M. W. P., & Abeysekera, R. (2020). Machine learning applications in IoT
based agriculture and smart farming: A review. Int. J. Eng. Appl. Sci. Technol, 4(12),
24-27.
9. Rezk, N. G., Hemdan, E. E. D., Attia, A. F., El-Sayed, A., & El-Rashidy, M. A.
(2021). An efficient IoT based smart farming system using machine learning
algorithms. Multimedia Tools and Applications, 80(1), 773-797.
10. Dahane, A., Benameur, R., Kechar, B., & Benyamina, A. (2020, October). An IoT
based smart farming system using machine learning. In 2020 International
Symposium on Networks, Computers and Communications (ISNCC) (pp. 1-6). IEEE.

You might also like