Somesh Thesis
Somesh Thesis
Master of Technology
submitted by
Master of Technology
in
Power Electronics and Machine Drives
1. External Examiner
2. Internal Examiner
Date:
Place:
CERTIFICATE
This is to certify that the dissertation entitled Solar Based Smart Irrigation
System submitted by Somesh Rajesh Dhawale (MIS No. 122149005) is a record
of bonafide work carried out by him, under our guidance, at the College of
Engineering, Pune, in partial fulfillment of the requirement for the award of the
degree of Master of Technology (Electrical Engineering) with specialization in
Power Electronics and Machine Drives from Savitribai Phule Pune University.
Date:
Place: Pune
The successful completion of any project depends not only on the person
working on it but on all the people surrounding him/her who contribute to the
work. Acknowledging them is the least we can do for them.
Firstly, I express my gratitude towards the Head Electrical Engineering
Department College of Engineering, Pune, for the facilities and infrastructure of
the department. I would like to thank my guides, S. M. Kakade, and R. S. Kulkarni,
for giving me the opportunity to work on this project. They have been great
mentors, and their words have always inspired me to work harder.
I would like to acknowledge my family for their love and support. Their
faith in me is the true motivation.
In the conventional irrigation system, improper water management and irregular electricity
supply result in water losses and decreased crop yield. It may also affect the health of the soil. To
overcome these problems, a solar-powered smart irrigation system can be used. The smart
irrigation system consists of solar powered water pump and automatic water flow control. This
system will measure moisture in the soil around the plant and release water whenever required.
Therefore, water use can be optimized and modified per the plant’s requirement. Also, our work
aims at providing real-time updates about the soil moisture condition and ambient temperature so
that the user can decide regarding water flow control using the internet/mobile; the information
received from various sensors can be updated in a web portal through the IOT module employed
within the system. If the temperature and the moisture level are below the optimum limit, the
irrigation will be activated automatically. However, this setup requires a considerable amount of
power, and looking at the impending scarcity of non-renewable resources, we are considering
using solar energy to power up our proposed system. Thus, in this project, we aim to develop a
novel irrigation technique considering various ways of irrigating agricultural land using solar
power. Further, we will attempt to remove human intervention with artificial intelligence.
Contents
Chapter 1 Introduction 01
1.1 Introduction to the System 01
1.2 Problem Statement 02
1.3 Objectives 02
1.4 Scope of Project 02
1.5 Report Overview 03
Chapter 7 Publication 59
References 60
List of Tables
1 Snippet of Crop Prediction Dataset..............................................39
2 Experimental Outcome.................................................................49
3 Generated Dataset from Sensors..................................................53
List of Figures
1 Working Mechanism of the Proposed System...........................................11
2 Architecture of Irrigation System.............................................................13
3 Solar panel................................................................................................14
4 Soil moisture sensor..................................................................................15
5 DHT11 sensor...........................................................................................16
6 Relay.........................................................................................................17
7 Circuit for Relay........................................................................................17
8 Wifi Module ESP8266..............................................................................18
9 DC water pump.........................................................................................20
10 Arduino IDE software...............................................................................21
11 Thing Speak Interface...............................................................................24
12 Experimental Hardware Setup...................................................................29
13 Snubber circuit diagram.............................................................................30
14 Snubber circuit model................................................................................30
15 Bridge circuit and microcontroller.............................................................32
16 Circuit diagram of Op-amp circuit.............................................................32
17 Op-amp circuit for ADC conversion...........................................................33
18 Water level indicator circuit.......................................................................34
19 Water level indicator..................................................................................34
20 Relay module.............................................................................................35
21 Flow diagram for the proposed system......................................................38
22 Steps to train the dataset in ANN...............................................................41
23 Thing Speak dashboard.................................................................................45
24 Representation of humidity and temperature...............................................46
25 Water level indicators on ThingSpeak...........................................................47
26 Motor status on ThingSpeak.......................................................................48
27 Gaussian Naive Bayes Confusion Matrix..................................................50
28 Kernel Naive Bayes Confusion Matrix......................................................50
29 Training and Validation loss of ANN........................................................51
30 Training and Validation accuracy of ANN.................................................51
31 Training and Validation loss ……………………………….52
32 Training and Validation accuracy ……………………………….52
33 Motor Status Distribution ……………………………….54
34 Correlation Matrix ……………………………….54
35 Training and Validation loss plot ……………………………….55
36 Training and Validation Accuracy plot ……………………………….55
Chapter 1
Introduction
1
senses that the moisture content is more than a particular value. We can innovate the system to
upload the data regarding pump status and moisture content status to a remote server for further
analysis.
1.3 Objectives
1. To design and make a prototype of the solar-powered IOT-based smart irrigation system.
2. To collect the data using various sensors such as soil moisture sensor, DHT11, and DC
water pump.
3. To analyze and use the data to drive the water pump.
4. To analyze the soil quality data for predicting suitable crops to increase the yield.
2
limitations, and maintenance aspects to ensure the system's practicality and long-term
sustainability. Moreover, the project will highlight the significance of human factors, such as
farmer behavior and training needs, to promote the successful adoption and effective utilization
of the smart irrigation system in real-world agricultural scenarios. Through this endeavor, the
solar-based smart irrigation system seeks to enhance agricultural productivity, conserve water
resources, and contribute to a greener and more sustainable future.
The report is divided into five chapters to discuss the work carried out by the researchers.
In Chapter 1, the introduction to solar-based Irrigation systems is expressed in detail. The chapter
also deals with the motivation for the work, objective, problem statement, and proposed
methodologies.
Chapter 2 deals with a literature survey, where the works of different researchers have been
reviewed to find out the gaps and pathways for further work.
Chapter 3 discusses the proposed methodology for the Solar and Irrigation Systems with several
sensors in detail. It also discusses the required Software and Hardware component for the
prototype with their features and specifications.
Chapter 4 discusses crop suggestion methodologies which can be a valuable tool for farmers to
make informed decisions.
Chapter 5 discusses the results of the system are discussed in this
chapter. Chapter 6 concludes the work and shows direction for future
work.
3
Chapter 2
Literature
Review
Sumedha Mujoo et al. [1] have designed an intelligent irrigation system using an IoT-
enabled control valve that perpetually supervises the field parameters and controls water usage
accordingly. This serves to avoid the unnecessary wastage of water resources, thereby
conserving them. A battery-operated solar power-driven system can be a renewable energy
source and a key to reducing power and energy demands. This system tries to fill the gap
between quantity and quality when demand rises. The system prototype uses open standards,
making it easy and cost- effective.
S. Harishankar et al. [2] have constructed a system consisting of a solar-powered water
pump and an automatic water flow control using a moisture sensor. The proposed irrigation
system consists mainly of solar pumping and automatic irrigation modules. In the automatic
irrigation module, the water outlet valve of the tank is electronically controlled by a soil moisture
sensing circuit. Also, the stepper motor is used to manage the cross-sectional area of the valve to
be opened, controlling the flow of water. Therefore, the amount of water flowing is proportional
to the moisture difference. The system requires minimal maintenance and attention because it is
self- starting.
G. Ravi Kumar et al. [3] monitored the soil’s moisture content during dry and wet
conditions with a moisture sensor circuit. Based on the moisture content, they calculated the
corresponding relative humidity. They irrigated the soil based on its nature using a PC-based
LabVIEW system, NI my RIO, IOT, GSM, and an automatic water inlet setup. This setup also
monitors and records constantly changing temperature, humidity, and sunlight. This recorded
data can be used to control and optimize water flow so that plant growth and yield are
maximized.
Pavan Kumar Naik et al. [4] created an automatic system for agricultural plantations
placed in a remote location and provides the necessary water to the plantations when the soil
humidity falls below a set-point value. This work uses soil moisture, temperature, and humidity
4
sensors placed in plant root zones and transmits this data to an Android application. A threshold
value of
5
a soil moisture sensor was programmed into a microcontroller to control water quantity. The
motor is turned on and off based on the sensor values.
Srishti Rawal [5] has designed GSM/Bluetooth-based remote-controlled embedded
system for irrigation. The system sets the irrigation time depending on the temperature and
humidity readings from sensors and the crop type and can automatically irrigate the field when
unattended. The GSM network exchanges information between the far end and the designed
system through SMS. This system is a typical application of IOT in agriculture and has achieved
satisfactory results in the actual operation.
Saleh Elkelani Babaa et al. developed the system using soil moisture sensors connected to
the Arduino Uno and a global system for mobile communication that is used to transmit and
receive the data between the controller and the user [6]. In this paper, they propose an intelligent
irrigation system using solar power that drives water pumps to pump water from a bore well to a
tank, and the outlet valve of the tank is automatically regulated using an Arduino UNO, GSM,
and moisture sensor to control the flow rate of water from the tank to the irrigation field, which
optimizes the use of water.
Puneeth Kumar G.B. et al. [7] have constructed the single-axis solar tracking system used
for irrigation along with Zigbee. LDRs are placed on solar panels to help track the maximum
intensity of sunlight and collect more electricity. The generated electricity is stored in a DC
battery, which pumps the water for the irrigation system. The microcontroller is interfaced with
the DC pump, LCD, and Zigbee module.
In [8], The automatic irrigation system with PV solar tracking was designed by Basim
Alsayid et al. In this, a humidity sensor in the soil and temperature sensors in the air are used to
check the need for irrigation to operate a pump powered by the PV system. This PV system is a
two-axis tracking one. Sensors are installed on PV panels to check the sun’s position so that the
panels are always perpendicular to the sun. A microcontroller is used to control this. ISIS
simulation software is used to manage the system.
Jitesh Shastri et al. [9] have designed a solar energy-powered automated irrigation system
using a Wi-Fi link, an ESP module, and the Internet of Things (IoT), which connects the
hardware system to the user at any remote location. This has implemented an automated field
irrigation system using a low-cost ESP32 microcontroller. This used IOT in the system to
receive data and
6
control the pump's operation. All the updates and real-time data gathered from sensors are then
uploaded to the cloud, which can be accessed anywhere and anytime.
Ashraf Zaher et al. [10] have designed the system. Using the Arduino microcontroller,
they have increased the design's versatility by providing more extensibility and allowing the user
to add more sensors with minimal additional programming effort. The wireless communication
employed in the ASSIS system offers the added advantage of not requiring any wires buried in
the soil. With the rapid technological advances, other wireless techniques could be employed to
improve the system’s connectivity, e.g., IoT.
J.E. Tamil Malar et al. [11] have designed an intelligent irrigation system using electronic
sensors incorporated into the agricultural field. Based on the value detected from the sensor, a
response could be obtained for the field and the crops. The information from the sensor can be
updated on a particular website or webpage through the IoT module used within the system, i.e.,
the temperature and the moisture are monitored through the IoT. If the temperature and the
moisture level are below the optimum limit, the irrigation is activated automatically, so there is
no need for the regulation of the water manually.
7
2.3 Existing traditional and solar-based smart irrigation systems.
The effectiveness of any irrigation system depends on various factors such as climate, soil type,
plant types, and local water regulations. When considering a solar-based smart irrigation system,
evaluating the system's specific features, functionality, and performance is essential.
Below is a comparison table between an existing traditional irrigation system and a solar-based
smart irrigation system:
Aspect Traditional Irrigation System Solar-Based Smart
Irrigation System
Power Source Grid or Manual Solar Panels
Control Mechanism Manual or basic timer-based Automated with sensors and
timers
Watering Schedule Fixed schedule Adaptive and customizable
schedule
Water Usage Efficiency Moderate High
Irrigation Precision Limited control over water flow Precise and targeted irrigation
Weather Adaptation Manual adjustments needed Automatic adjustment to
weather
Soil Moisture Monitoring Usually, manual Automated sensors
Remote Monitoring and Not available Available via mobile app or
Control web
Cost Lower upfront cost Higher upfront cost (solar
panels)
Long-Term Savings Moderate High due to efficient water
usage
Environmental Impact Higher water wastage Reduced water wastage
Maintenance Simple and minimal Requires periodic
maintenance
Integration with Weather Not possible Integrated with weather
Data forecasts
Ease of Installation Simple Requires expertise for setup
8
Watering Flexibility Limited control over irrigation Customizable watering based
on specific plant needs, soil
type, and location
Evaporation Losses Watering may occur during Smart systems can adjust
peak heat, leading to higher watering times to minimize
evaporation losses evaporation losses
Irrigation Scheduling Typically fixed-time intervals Smart systems can adjust
schedules for different
seasons and plant growth
stages
Watering Area Uniform watering across the Zoning capability allows
Management entire area customized irrigation for
different areas
Water Source Monitoring Lacks monitoring of water Can monitor water source
source health and levels. health and provide alerts for
low water levels
Water Quality Monitoring Rarely includes water quality Some smart systems offer
monitoring. water quality sensors to
ensure
healthy irrigation
Drought Management Limited ability to manage water Smart systems can optimize
scarcity. water use during droughts or
water restrictions
Leak Detection No automatic leak detection Smart systems may detect
leaks and send alerts for
timely repairs
Integration with Sensors Limited integration with It can be integrated with
external sensors various sensors like rain
sensors, flow meters, etc.
Data Analytics No data analytics capabilities Smart systems can analyze
data for better insights and
decision-making
9
Scalability Limited scalability options It can be easily expanded to
cover larger areas or
additional zones
adaptability to Landscape May not adapt well to changes Smart systems can adjust
Changes in landscape or plant growth irrigation based on landscape
alterations
10
Chapter 3
Proposed Methodology
3.1 The Proposed System
The methodology for setting up the solar-powered water pump system involves several key
steps. First, a suitable location must be chosen for the solar panel installation, ensuring it receives
optimal sunlight exposure throughout the day. This location should be free from obstructions,
such as trees or tall structures, that could shade the panel. Once the ideal location is identified,
the solar panel must be securely mounted using appropriate brackets or stands to ensure stability
and longevity. The panel must be aligned at the optimal angle to maximize sunlight absorption,
considering the geographical latitude and the season. Next, the solar panel should be connected
to a charge controller to regulate the charging process and prevent overcharging the 12-volt DC
battery. The battery is a crucial energy storage unit, allowing continuous water pumping even
during non-sunny periods.
After connecting the battery, the water pump can be integrated into the system. The pump's
power requirements must be compatible with the 12-volt DC output of the battery. Necessary
safety mechanisms, such as fuses or circuit breakers, should be in place to safeguard the system
from potential electrical issues. For automation, sensors or timers can be incorporated to detect
the moisture levels in the land. This will enable the water pump to activate only when the soil
moisture drops below a predetermined threshold, optimizing water usage and minimizing waste.
The system must be monitored and maintained to ensure efficiency and longevity. This includes
cleaning the solar panels from dirt and debris, inspecting electrical connections, and checking the
battery's condition. Proper maintenance practices will help sustain the system's performance and
extend its operational life.
To achieve this task, we are using the soil moisture sensor module. The soil moisture sensors
will be placed inside the field and connected to the microcontroller. The moisture sensor will
continuously sense the moisture content of the soil and send it to the microcontroller, where the
moisture content value will be compared with a predefined level. When the moisture level drops
11
below the predefined level, the microcontroller will send a command to activate the water pump.
After the motor supplies water to the field, the moisture sensor will simultaneously sense the
moisture content and send the data to the microcontroller. Since the area is getting water now,
the moisture level of the field will start increasing; this increase in the moisture content will
again be compared with a predefined moisture level. The pump will automatically turn off when
it reaches the predefined moisture level. This water pump will also work manually by pressing
the key.
For the Sunlight based watering system, the water level in the water tub must be determined first.
If the water level lies within the specified range, then the system will check the soil moisture
sensor, and if the soil is dry, watering can be started until the conditions for wet soil are met.
Once the conditions are met, the watering will stop. The working mechanism of the proposed
system is illustrated in the following figure 1.
Also, the data obtained from the soil moisture and temperature and humidity sensors are stored,
displayed, and monitored. The new thresholds can be estimated from stored data using artificial
intelligence techniques. In this manner, the system will be automated.
12
system
13
works:
Solar Panels: The system starts with solar panels strategically positioned to receive
maximum sunlight exposure throughout the day. These panels convert sunlight into
electrical energy through the photovoltaic effect.
Charge Controller: The electrical energy generated by the solar panels is direct current
(DC). The charge controller plays a crucial role in regulating the charging process of the
batteries. It ensures that the batteries are charged efficiently and prevents overcharging,
which could lead to damage.
Energy Storage (Batteries): Excess energy produced by solar panels during sunny periods
is stored in batteries. These batteries act as reservoirs, keeping the electricity for later use
during cloudy days or at night when solar energy generation is low.
Soil Moisture Sensors: The smart irrigation system includes soil moisture sensors placed
at strategic locations in the field to measure the water content in the soil. These sensors
provide real-time data about the soil moisture levels, indicating when the crops need
watering.
DHT11 sensor: The DHT11 sensor is a temperature and humidity sensor that can be
placed near the crops. It measures the ambient temperature and humidity levels,
providing valuable environmental data to the smart irrigation system.
Weather Station: A weather station is integrated into the system to collect real-time
weather data. This data includes information such as temperature, humidity, and
precipitation. The weather station helps the system make informed decisions about when
and how much irrigation is needed, considering the current weather conditions.
Microcontroller: The microcontroller acts as the central control unit of the smart
irrigation system. It collects data from various sources, including soil moisture sensors
and the weather station. The microcontroller processes this data and runs an irrigation
algorithm to determine the optimal irrigation schedule based on the specific crop's needs
and environmental conditions.
Water Pump: The water pump is an essential system component responsible for drawing
water from the water source, such as a well or reservoir, and delivering it to the crops.
The water pump is powered by the stored solar energy in the batteries.
Automated Valves: Automated valves control water flow to different sections or zones of
14
the irrigation system. The microcontroller controls these valves based on the irrigation
algorithm's calculations. When the soil moisture level falls below a predetermined
threshold and the weather conditions indicate the need for irrigation, the microcontroller
activates the water pump and opens the appropriate valves to supply water to the crops.
Communication Module: The smart irrigation system includes a communication module
that enables remote monitoring and control. It allows the user to access the system's data
and receive real-time updates from anywhere using a computer, smartphone, or tablet.
ThingSpeak Software: ThingSpeak is an IoT platform that integrates with the smart
irrigation system. The microcontroller sends the collected sensor data, including
temperature, humidity, soil moisture levels, and irrigation activity status, to ThingSpeak's
cloud servers using Wi-Fi connectivity. ThingSpeak processes and stores this data,
providing the user with real-time monitoring and historical analysis through intuitive
graphical representations, charts, and custom visualization tools.
Combining solar panels, soil moisture sensors, a weather station, a microcontroller, a water
pump, automated valves, a communication module, and ThingSpeak software creates a
sophisticated solar-based smart irrigation system. This system optimizes water usage, reduces
water wastage, and promotes sustainable agricultural practices, leading to improved crop yield
and efficient water management.
15
3.3 HARDWARE DESCRIPTION
3.3.1 Solar Panel:
A solar panel is an electrically connected solar photovoltaic module mounted on a supporting
structure. A photovoltaic module is a packaged, connected assembly of solar cells. The solar
panel can be used as a more extensive photovoltaic system component to generate and supply
electricity in commercial and residential applications. We use a 12V 10W, Vmax=17, Imax=0.59
solar panel and lead acid battery for energy storage. The battery has a rating of 12V, 5A.
16
levels.
Sensitivity: The sensor provides accurate measurements of soil moisture with a high
sensitivity to changes in moisture levels.
Operating Voltage: Typically operates within a voltage range of 3.3V to 5V.
Compatibility: Microcontrollers, Arduino boards, and other digital platforms can be
easily interfaced.
Applications: Soil moisture sensors are widely used in intelligent irrigation systems,
agricultural monitoring, and plant growth control.
DHT11 sensor:
Purpose: The DHT11 Sensor is a digital temperature and humidity sensor for
environmental monitoring.
Sensing Capability: It measures the surrounding environment's temperature and humidity
levels.
Output: Digital output, providing precise and calibrated readings for temperature and
humidity.
Temperature Range: Usually capable of measuring temperatures in the range of 0°C to
50°C with an accuracy of ±2°C.
Humidity Range: Typically, capable of measuring relative humidity from 20% to 90%
RH with an accuracy of ±5% RH.
Response Time: The DHT11 sensor quickly responds, providing real-time temperature and
17
humidity readings.
Operating Voltage: Typically operates within a voltage range of 3.3V to 5V.
Compatibility: Microcontrollers, Arduino boards, and other digital platforms can be
easily interfaced.
Applications: DHT11 sensors are widely used in weather stations, home automation,
indoor climate control, and environmental monitoring systems.
3.3.3 Relay:
A relay is an electrically operated switch. Many relays use an electromagnet to operate a switch
mechanically, but other operating principles, such as Cube relays, are used. Relays are used
where it is necessary to control a circuit by a low-power signal (with complete electrical isolation
between control and controlled circuits), or where several courses must be controlled by one
signal.
• Relay was invented in 1835 by the US scientist Joseph Henry (1797–1878).
• Relays are switching devices.
• They are using an electromagnet to operate a switching mechanism in mechanical form.
• They are also used if it is necessary to control a circuit by a low-power signal or where several
courses must be controlled by one signal.
• The Relays were used for long-distance telegraph circuits, repeating the signal from one circuit,
and re-transmitting it to another.
• Relays are used in telephone exchanges and to perform logical operations.
• Relays are the essential component used for protection switching for electrical components.
18
Figure 6: Relay
Working of Relay
• It works on the principle of electromagnetic attraction.
• When the relay circuit senses the fault current, it energizes the electromagnetic Field, producing
a temporary magnetic field.
• This magnetic field moves the relay armature to open or close connections. The small power
relay has only one contact, and the high-power relay has two contacts for opening the switch.
• The inner section of the relay is shown in the figure below. It has an iron core which is wound
by a control coil.
• The power supply is given to the coil through the load contacts and the control switch.
• The current flows through the coil, producing the magnetic field around it.
• Due to this magnetic field, the upper arm of the magnet attracts the lower arm.
• Hence close the circuit, which makes the current flow through the load.
• If the contact is already closed, it moves oppositely and opens the contacts.
19
Key Features:
• Micro-controller development board can be used as modules, can be used as an appliance control
• 5V - 12 V control signal of the TTL (Transistor–Transistor Logic)
• Control DC or AC signals can control the 220V AC Load There is a normally open and open
ordinarily closed contact Useful to control a motor, a led strip, or any other module.
20
provided by excellent community support.
Features:
• 802.11 b/g/n
• Wi-Fi Direct (P2P), soft-AP
• Integrated TCP/IP protocol stack
• Integrated TR switch, blunt, LNA, power amplifier, and matching network
• Integrated PLLs, regulators, DCXO, and power management units
• +19.5dBm output power in 802.11b mode
• Power down leakage current of less than 10uA
• 1MB Flash Memory
• Integrated low-power 32-bit CPU could be used as an application processor.
• SDIO 1.1 / 2.0, SPI, UART
• STBC, 1×1 MIMO, 2×1 MIMO
• A-MPDU A-MSDU aggregation 0.4ms guard interval
• Wake up and transmit packets in less than 2ms
• Standby power consumption of less than 1.0mW (DTIM3)
3.3.4 DC Pump
A DC water pump, also known as a direct current water pump, is an electrical device that
operates on DC power, typically powered by batteries, solar panels, or other DC power sources.
These pumps are commonly used in various applications, including irrigation systems, water
circulation, aquariums, etc. Here are the specifications and details of a typical DC water pump:
Voltage: DC water pumps are available in various voltage ratings, ranging from 12V to
24V. The specific voltage requirement will depend on the pump's design and application.
Flow Rate: The flow rate of a water pump is measured in gallons per hour (GPH) or liters
per hour (LPH). It indicates the volume of water the pump can move in each time. DC
water pumps come in different flow rate options to suit different needs, ranging from
low- flow pumps for small applications to high-flow pumps for larger systems.
Maximum Head/Pressure: A DC water pump's maximum head or pressure represents its
ability to push water vertically against gravity or through resistance. It is measured in feet
or meters. A higher maximum head value indicates that the pump can lift water to greater
21
heights or overcome higher resistance in the system.
Power Consumption: DC water pumps’ power consumption ratings are typically
measured in watts. It indicates the amount of electrical power the pump requires to
operate efficiently.
Pump Type: DC water pumps come in various types, including submersible, inline, and
diaphragm pumps. The choice of pump type depends on the specific application
requirements and whether the pump needs to be submerged in the water or installed
externally.
Material and Build: The construction material of the pump is essential, primarily when
used in different environments. Common materials include stainless steel, plastic, or
brass, depending on the pump's purpose and compatibility with the water or liquid being
pumped.
Noise Level: Some DC water pumps operate quietly, making them suitable for indoor and
noise-sensitive applications like aquariums or small water features.
Protection Features: Many DC water pumps have built-in features such as low-voltage,
over-current, and over-temperature protection. These features help prevent damage to the
pump and ensure its longevity.
Size and Dimensions: The physical size and dimensions of the pump are crucial
considerations, mainly when space is limited, or it needs to fit inside specific containers
or systems.
Specifications of DC pump: 8-15V, 0.6-1 A, 4W, capacity 4L/min.
22
3.4 SOFTWARE DESCRIPTION
23
3.4.3 ThingSpeak software
ThingSpeak is an IoT analytics platform service that allows us to aggregate, visualize, and
analyze live data streams in the cloud. We can send data to ThingSpeak from our devices, create
instant visualization of live data, and send alerts. ThingSpeak provides instant visualizations of
data posted by our devices to ThingSpeak. With the ability to execute MATLAB code in
ThingSpeak, we can perform online analysis and process data as it comes in. ThingSpeak is often
used for prototyping and proof-of-concept IoT systems that require analytics. Using a Rest API
or MQTT, we can send data from any internet-connected device directly to ThingSpeak. In
addition, cloud- to-cloud integrations with The Things Network, Senet, the Libelium Meshlium
gateway, and Particle.io enable sensor data to reach ThingSpeak over LoRaWAN and 4G/3G
cellular connections.
With ThingSpeak, you can store and analyze data in the cloud without configuring web servers,
and you can create sophisticated event-based email alerts that trigger based on data coming in
from your connected devices.
COLLECT:
Collecting sensor data and sending it to the cloud offers numerous advantages for various
applications. Our modern world is filled with sensors in homes, smartphones, automobiles, city
infrastructure, and industrial equipment, detecting and measuring information like temperature,
humidity, and pressure. Using platforms like ThingSpeak, we can aggregate data from these
sensors and transmit it to the cloud. ThingSpeak facilitates the storage of this data in private
channels, ensuring data privacy, and allowing sharing it through public channels. Once the data
is securely stored, it becomes accessible for analysis, visualization, and even integration with
social media, web services, and other devices, enabling valuable insights and enhanced
functionality for various industries and use cases.
ANALYSE:
Analyzing and visualizing data in ThingSpeak offers powerful advantages for gaining insights
and extracting valuable information from the collected sensor data. With easy access to
MATLAB, we can leverage its capabilities to convert, combine, and calculate new data, enabling
us to derive more meaningful conclusions from the raw data. Moreover, scheduling
calculations at specific
24
times allows for automated and efficient data processing. We can visually explore relationships,
patterns, and trends within the data through built-in plotting functions, facilitating a deeper
understanding of its underlying behavior. Additionally, combining data from multiple channels
can create more sophisticated analyses, enabling us to gain comprehensive insights into complex
interactions and correlations.
ACT:
Using ThingSpeak to act on data offers a versatile and efficient way to automate responses and
control devices based on real-time data streams. The platform provides essential tools for
seamless device communication, enabling swift reactions to incoming raw or calculated data
within a channel. Whether it's a simple task like receiving a tweet when the temperature crosses a
specific threshold or a more complex action like activating a motor when the water level drops in
a water tank, ThingSpeak empowers users to define and execute various actions easily.
Additionally, the capability to queue up commands for devices allows for smooth and
coordinated control, ensuring that devices respond appropriately to changing conditions. This
flexibility and reliability make ThingSpeak an ideal choice for implementing automated actions
and remotely controlling devices, streamlining processes, and enhancing overall efficiency
across various applications and industries.
ThingSpeak Features:
ThingSpeak offers many features, making it a powerful IoT data management and automation
platform. One of the key features is the ability to collect data in private channels, allowing users
to create new channels and store analyzed data. Users can easily set up channels with specific
field settings, such as temperature and humidity measurements, by signing in with MathWorks
Account credentials or creating a new account. Moreover, ThingSpeak facilitates data sharing
through public channels, enabling users to share data with others, as shown in Fig.11.
25
Figure 11: ThingSpeak Interface
To share data with the public, users can use public channels. After creating a channel,
they can enable public access to that channel. This allows anyone with the channel's URL
to access and view the data. Users can generate API keys for secure access and then share
the channel's URL with others. Public channels are useful when users want to make their
data available to a wider audience or collaborate with others in the ThingSpeak
community.
RESTful and MQTT APIs:
26
ThingSpeak provides RESTful and MQTT APIs for seamless communication with
devices and applications. Users can use these APIs to programmatically create, update,
clear, and delete channels. For example, users can use the RESTful API to send HTTP
requests (GET, POST, PUT, DELETE) to interact with their channels and update the
data. The MQTT Publish method allows real-time updates to channel feeds, and MQTT
Subscribe allows receiving messages when a channel's data changes.
MATLAB Analytics and Visualizations:
ThingSpeak's integration with MATLAB empowers users to perform advanced data
analysis and visualization. Users can leverage the MATLAB Analysis app to prepare,
filter, and analyze data. For instance, they can calculate average values, perform
statistical operations, and eliminate outliers. The platform offers various visualization
tools, including charts, gauges, and maps, enabling users to create insightful visual
representations of their data.
Event Scheduling:
The TimeControl app in ThingSpeak enables event-based automation and scheduling of
actions. Users can define a unique name for TimeControl and specify the frequency and
recurrence pattern, such as one-time, daily, or hourly intervals. They can link
TimeControl with other ThingSpeak apps like MATLAB Analysis, ThingHTTP,
ThingTweet, or TalkBack to trigger specific actions at scheduled times or intervals.
Alerts:
ThingSpeak supports alert mechanisms to monitor and respond to channel events. Users
can use apps like React, MATLAB Analysis, ThingHTTP, ThingTweet, and TalkBack to
trigger actions when specific conditions are met. For example, they can set up alerts to
notify them when certain data thresholds are exceeded or when channel activity becomes
inactive. These alerts help users stay informed and take immediate action when
necessary.
ThingSpeak provides a comprehensive platform for collecting, sharing, analyzing, visualizing,
and automating IoT data. Its versatility and integration with MATLAB make it a powerful tool
for researchers, developers, and enthusiasts in various industries, enabling them to harness the
full potential of their IoT applications and projects.
27
3.4.4 GOOGLE COLLAB NOTEBOOK
Google Colab is a free cloud service provided by Google that allows you to write and
execute Python code in a Jupyter Notebook environment directly from your web browser. It's a
popular platform among data scientists, researchers, and students for running machine learning
experiments, data analysis, and more. To use Google Colab, you need a Google account and a
web browser. You can access it by searching for "Google Colab" or going directly to
https://colab.research.google.com/.
In this project, the generated and Kaggle datasets are trained in ANN and CNN. Also, the results
are shown in the confusion matrix and flowcharts. Here are some key details about Google
Colab:
Jupyter Notebooks: Google Colab provides a Jupyter Notebook interface, which allows
you to write and run code in an interactive and organized manner. Notebooks can include
code cells, text cells, and multimedia elements, making them great for documenting your
work and sharing insights.
Cloud-Based: Google Colab runs on Google's cloud infrastructure, which means you
don't need to install anything on your local machine. All the computation and storage
happen on Google's servers.
Free GPU and TPU: One of the major advantages of Google Colab is that it provides
access to free Graphics Processing Units (GPUs) and Tensor Processing Units (TPUs).
These hardware accelerators can significantly speed up training and inference for
machine learning models.
Integration with Google Drive: You can save your Colab notebooks directly to your
Google Drive, making storing and sharing your work easy.
Package Support: Colab has many popular Python packages pre-installed, including
libraries like NumPy, pandas, TensorFlow, PyTorch, and more. However, you can also
install additional packages if needed.
Collaboration and Sharing: You can easily share your Colab notebooks with others.
Notebooks can be shared like documents, and collaborators can view, edit, and run the
code in a shared environment.
Code Cells and Text Cells: You can write and execute Python code in code cells and
28
include explanatory text, images, and formatted content in text cells. This makes it a great
tool for combining code and documentation.
Limited Resources: While Google Colab provides free access to GPUs and TPUs, there
are limitations regarding the computational resources and session time you can use.
These limitations can vary based on your usage and the demand for Google's
infrastructure.
Saving and Exporting: You can save your notebooks to your Google Drive, GitHub or
download them locally. This makes it easy to save your work and share it with others.
29
Evaluation and Metrics: The Classifier App provides visualizations and metrics to help
you assess the model's performance. Common evaluation metrics include accuracy,
precision, recall, F1-score, and confusion matrices.
Prediction and Visualization: Once the model is trained, you can use it to directly predict
new data within the app. You can also visualize decision boundaries, feature importance,
and other model insights.
Exporting Models: After creating a model that meets your satisfaction, you can export it
in various formats (such as MATLAB code or a trained model object) for use in other
applications or environments.
App Customization: MATLAB allows you to customize the app's appearance and
behavior to some extent. This can be useful if you want to create a specific interface for a
particular task.
Learning and Documentation: MATLAB provides documentation and tutorials to help users
understand how to use the Classifier App effectively and make informed decisions about model
selection and configuration.
30
Figure 12: Experimental Hardware Setup
In the proposed system, the solar panel generates electricity stored in the battery. The snubber
circuit protects the system from voltage irregularities. The bridge converter circuit adapts the
voltage for the different components. With the help of the op-amp circuit and ADC, the
microcontroller receives sensor inputs, including water level and temperature/humidity readings.
Based on this data, the microcontroller controls the motor through the relay module to initiate or
stop irrigation operations as part of a smart irrigation system.
31
Figure 13: Snubber circuit diagram
They help to dampen or absorb the energy of these spikes, protecting sensitive
components from damage and reducing electromagnetic interference (EMI). In the context of
battery charging from solar panels, a snubber circuit can protect the charging circuitry from
voltage spikes and transients induced by the switching action of the charge controller or by the
varying solar irradiation levels. After the snubber circuit, a 12V battery is connected to power the
system. Also, one LED is connected to the circuit to indicate the solar connection. When the
panel is connected, the LED glows ON.
32
3.5.2 Bridge Circuit:
A bridge circuit is an electrical circuit commonly used for measuring resistance changes
or detecting imbalances. It's often used in strain gauges, temperature, and pressure sensors. The
basic concept involves forming a loop with four resistors and measuring the voltage difference
between two points in the loop. When the resistances are balanced, there's no voltage difference;
any changes in resistance can be detected as a voltage difference that can be used for
measurement purposes. The bridge circuit consists of the following:
Four Resistors: Two known resistors (R1 and R2) and two variable resistors (R3 and R4).
R3 and R4 could be sensors whose resistance changes due to the measured parameter
(e.g., strain, temperature, pressure).
Power Supply: The bridge circuit requires a power supply to create a voltage across the
circuit.
When the bridge is balanced, the ratio of R1/R2 is equal to that of R3/R4, and there's no
voltage across the measurement points. Any imbalance in the resistances due to changes in the
sensors' resistance will result in a voltage difference that can be measured and used for sensing
applications.
A bridge converter circuit in this system plays a crucial role in converting the DC voltage
from the solar panel or battery to the desired form for the connected devices. It can convert the
DC voltage to a different DC voltage level as required. This ensures efficient power transfer and
enables the proper operation of the devices connected to the system. The microcontroller serves
as the control center of the project. It receives input from various sensors, such as the water level
circuit and DHT11 sensor, through appropriate interfaces. The microcontroller then processes
this data, making decisions based on programmed instructions and predefined logic. It controls
the relay module to turn the motor on or off based on the irrigation requirements determined by
the sensor inputs.
33
Figure 15: Bridge circuit and microcontroller
34
In this circuit:
The analog signal is applied to the non-inverting input of the op-amp.
R1, R2, and R3 are resistors.
The inverting input of the op-amp is connected to the junction of R2 and R3 (virtual
ground configuration).
The output of the op-amp is connected to the input of the ADC.
35
Figure 18: Water level indicator circuit
The system's water level indicator is enhanced to include 25%, 50%, 75%, and 100% tank filling
levels. The microcontroller compares the water level readings with predefined thresholds,
allowing it to determine the current tank filling percentage. LED indicators are connected to the
microcontroller's output pins, each representing a specific filling percentage (e.g., one LED for
25%, two for 50%, three for 75%, and four for 100%). The microcontroller is programmed to
blink the corresponding LEDs based on the current tank filling percentage. Additionally, the
water level data and the filling percentage are transmitted to the Thingspeak server for remote
monitoring and analysis, shown in Fig. 19. This integration provides real-time information on the
tank's status and allows for effective irrigation system monitoring.
36
3.5.5 Relay module:
The relay module in the system acts as an electrically operated switch controlled by the
microcontroller. The relay module typically has an input pin that accepts a digital signal from the
microcontroller. The microcontroller can provide a logic high or low signal to the input pin to
control the relay. When the microcontroller sends a signal (e.g., a logic high) to the relay
module, it energizes the relay's coil, closing the contacts and allowing electrical current to flow
through the motor, turning it on. Sending a different signal (e.g., a logic low) de-energizes the
relay, opening the contacts and, disconnecting the motor's power supply, turning it off.
37
Chapter 4
Crop suggestion system
This chapter delves into the implementation of a crop suggestion module that plays a
pivotal role in elevating the capabilities of a smart irrigation system. The central objective is to
provide farmers with a sophisticated tool for intelligent crop recommendations, a process
intricately woven with crucial factors such as soil quality, prevailing weather conditions, and the
availability of water resources. Employing the prowess of advanced data analytics and cutting-
edge machine learning techniques, this module is engineered to revolutionize the crop selection
process, yielding higher harvests and more optimal resource employment. By delving into a
thorough analysis of pertinent data points, this system offers invaluable assistance to farmers,
enabling them to make judicious choices that enhance agricultural productivity and embrace
sustainability and efficiency. As a foundational element of this endeavor, the Kaggle dataset
"crop recommendation" takes center stage, furnishing the data necessary to empower this
intelligent agricultural decision-making tool.
38
pH Level: The acidity or alkalinity of the soil, which can affect nutrient availability to
plants.
Rainfall: The amount of rainfall in the region affecting water availability for crops.
Crop type: The crops historically grown in similar conditions.
Label (Target): The recommended crop for combining environmental factors.
39
Figure 21: Flow diagram for the proposed system
A. System Setup
The ‘Classification Learner App’ in MATLAB's Statistics and machine learning toolbox is used
to create and analyze the algorithms. With input data and defined classes, this program automates
training several supervised machine learning classifiers. The prediction function in MATLAB
allows trained classifiers to be imported and used to forecast results for new input data. The app
supports 30 classifier types in the latest version of MATLAB (R2022b).
B. Data Collection
In this work, we have used the dataset stated in [16]. This dataset was created for 22 crops every
year across different states. The data was collected via sensors installed on various farmlands.
The dataset comprised 2200 rows and eight columns, which includes crop, rainfall, humidity, pH
level, potassium, nitrogen, and phosphorus, as shown in Table I. This data can be used to train
machine learning models for crop yield prediction and help farmers make informed decisions.
40
TABLE I: SNIPPET OF CROP PREDICTION DATASET [16]
C. Pre-processing Step
The initial step in the implemented method is data pre-processing. It involves dealing with
missing numbers, ensuring the data is formatted correctly, and extracting essential features. For
accurate analysis, data formatting must be done correctly. The data gathered during this stage
will be imported into MATLAB for the desired output.
D. Feature Extraction
In machine learning, feature extraction is essential for reducing the data needed to characterize a
large dataset. By selecting the most critical predictive features, we can reduce the overall size of
the dataset used for training. The features typically include soil characteristics, crop type, and
weather conditions in crop yield prediction. The correlation matrix is frequently used to guide
the selection of features, with characteristics with higher correlation values frequently chosen as
significant yield predictors.
E. Data Prediction
80% of the crop recommendation dataset is used for training and validation. The remaining 20%
data is used for testing. This data split is carried out randomly. Classification Learner App in
MATLAB offers built-in validation strategies to evaluate the trained model's predicted efficacy.
41
Some of the validation strategies are no validation, holdout, and cross-validation. No validation
uses all the input data for training and uses the same training data to build the confusion matrix.
Holdout validation separates the input data into two sets: one for model training and the other for
model validation. The data is partitioned into separate sets using cross-validation, with just one
set used for validation and the others for training. The default choice for validation is q = 5.
Regardless of the chosen validation strategy, the final predictive model is trained using the entire
data set.
42
difference between the predicted output and the actual target and then adjusting the
weights and biases using optimization techniques like gradient descent. Backpropagation
iteratively refines the network's parameters to reduce the prediction error.
Following are the steps to train the dataset in ANN:
43
to retain important features while discarding less relevant information. Max-pooling and
average-pooling are common pooling techniques.
Fully Connected Layers: CNNs often end with one or more fully connected layers after
several convolutional and pooling layers. These layers process the learned features and
produce the final classification or regression output.
Stride and Padding: Stride defines the step size of the filter as it moves across the input,
affecting the output's spatial size. Padding can be added to the input to maintain spatial
dimensions after convolution.
Filters and Feature Maps: Filters are small matrices that detect specific features in an
image, like edges or textures. As filters slide over the input, they create feature maps
highlighting these features' presence.
Hierarchical Feature Learning: CNNs automatically learn features at different levels of
abstraction. Lower layers capture simple features like edges, while deeper layers capture
complex features like object parts.
Following are the steps to train the dataset in CNN:
A. Data Preparation:
Collect and preprocess your dataset. Common preprocessing steps include resizing
images to a consistent size, normalizing pixel values, and splitting data into training,
validation, and testing sets.
Label your data appropriately to associate each image with the correct class or category.
44
Define the layers and their configurations based on your design.
F. Training:
Loop through multiple epochs (complete passes through the training data).
For each epoch, iterate through mini batches of training data.
Feed the mini batch through the network:
Forward pass: Compute the predictions by applying convolution, activation, pooling, and
fully connected layers.
Backward pass (Backpropagation): Compute gradients of the loss with respect to the
model's parameters.
Update the model's parameters using the chosen optimizer and computed gradients.
G. Validation:
After each epoch, evaluate the model's performance on the validation set using the
chosen evaluation metrics.
Monitor the validation metrics to prevent overfitting. If performance on the validation set
starts to degrade, consider adjusting hyperparameters or using techniques like dropout.
H. Testing:
Once training is complete, assess the final performance of the model on the testing set,
using the same evaluation metrics.
45
I. Fine-tuning (Optional):
If the model's performance is unsatisfactory, you can experiment with changes in the
architecture, hyperparameters, or data preprocessing.
46
Chapter 5
Results and Discussion
ThingSpeak is of paramount significance in the domain of IoT owing to its central role in data
collection, storage, and visualization. Its user-friendly dashboard converts raw data into
insightful visual representations, enabling real-time monitoring and rapid prototyping of IoT
applications. With MATLAB integration for advanced analysis and the ability to set up alerts
and reactions, ThingSpeak empowers users to make informed decisions and respond swiftly to
critical events. It is an educational tool that supports collaboration, reduces infrastructure costs,
and scales effortlessly, cementing its role as a foundational platform for diverse IoT endeavors.
47
Displaying soil moisture, humidity, and temperature data on ThingSpeak involves harmonizing
sensors, microcontrollers, and the ThingSpeak platform. Through programmed code, the
microcontroller gathers data from the sensors and, with the aid of ThingSpeak's API, transmits
this information to a dedicated ThingSpeak channel. The channel, configured with specific fields
for each parameter, acts as the repository for the incoming data, facilitated by a unique API key
and Channel ID. Visualizations tailored to each data type, like line charts, allow for intuitive
tracking of changes over time, fostering real-time monitoring, as shown in Fig 24.
Creating a water level indicator through the utilization of ThingSpeak presents a robust
and adaptable solution for the dynamic monitoring of water levels across a spectrum of
applications. This ingenious system involves the integration of hardware components,
microcontrollers, and the powerful IoT capabilities of ThingSpeak's platform. At its core, the
hardware setup entails the integration of a specialized water-level circuit with a microcontroller
that serves as the conduit between the physical world and the digital realm. The microcontroller
becomes the central data collection and transmission element, extracting measurements from the
water level sensor and seamlessly transmitting them to ThingSpeak's cloud infrastructure. This
transmission is facilitated by ThingSpeak's well-documented Application Programming Interface
(API), where data is structured and sent using the API key associated with the ThingSpeak
channel and the designated
48
field, in this case, "Tank Level." This field resides within the created ThingSpeak channel, acting
as the repository for incoming water level data, while the unique Channel ID and API key
authenticate secure data transfer.
The heart of the system is the meticulously crafted code within the microcontroller. This
code orchestrates data acquisition, formatting, and transmission, constructing HTTP POST
requests, incorporating API keys, and ensuring precise data transfer. Once data is ingested into
the ThingSpeak channel, the platform's visualization tools come to life. Through a user-friendly
interface, dynamic visual representations like line charts, gauges, and bar graphs provide real-
time insights into water level variations over time. These visualizations transform raw data into
actionable insights, enabling users to decipher trends and deviations readily. The system's
sophistication doesn't halt visualization; ThingSpeak's React feature introduces an element of
intelligence. Users having premium subscriptions can configure alerts triggered by predefined
thresholds, instigating notifications via email or SMS when water levels reach critical levels.
49
5.1.3 Water Pump Status
To create a motor status indicator using ThingSpeak, you can set up a channel on the
ThingSpeak platform, designed to display the real-time status of a motor as either "ON" or
"OFF". By interfacing your motor with a microcontroller (e.g., Arduino) and utilizing the
ThingSpeak library, you can periodically update the channel with the current motor status using
HTTP requests. This data can then be visualized in the ThingSpeak dashboard, providing a
simple and effective means of remotely monitoring the motor's operational state.
This chapter uses and trains the Kaggle dataset on two platforms [16]. Ten different algorithms are trained
in the Matlab classification learner app, and in the Google Colab, the ANN and CNN were trained.
50
used to compare the models. The ROC curve illustrates the trade-off between true and false positive rates
for various threshold values. Accuracy is defined as the proportion of adequately predicted instances
among all instances. The performance of the models can be assessed and contrasted by evaluating these
metrics. All the models were evaluated, and their obtained accuracies are mentioned in Table II.
Table II shows the performance of ten different machine learning algorithms on a specific
dataset. Each algorithm is ranked based on its accuracy on the validation dataset, which is the
percentage of correct predictions made by the model. The table also includes information on the
model's total cost on the validation dataset, which includes factors such as computational
resources or time required to train the model. The prediction speed of each algorithm is measured
in observations per second, which indicates how quickly the model can make predictions on new
data once it has been trained. Finally, the training time for each algorithm is also included, which
measures the time required to train the model on the dataset. One can determine the best-suited
algorithm for crop prediction by comparing these parameters for each algorithm. The confusion
matrix results show the accuracy of the algorithms, as shown in Fig. 27 and Fig. 28, respectively.
We achieved that Gaussian Naive Bayes and Kernel Naive Bayes give the optimum solution for
the used dataset.
51
Figure 27: Gaussian Naive Bayes Confusion Matrix
52
5.2.2 Results of ANN and CNN in Google Colab:
Figure 30 represents the graph for the accuracy of the training and the validation dataset
given. Figure 30 shows that the highest accuracy obtained for the training and the validation
dataset was 98.21 and 87.14 (in percentage), respectively. Figure 29 represents the graphical
comparison of the training and validation loss for the given input dataset. The training and
validation loss obtained for the higher accuracy is 4.72 and 8.20, respectively.
53
Similarly, for the CNN the results are the following:
Figure 31 represents the graph for the accuracy of the training and the validation dataset given.
Figure 31 shows that the highest accuracy obtained for the training and the validation dataset was
99.0 and 98.64 (in percentage), respectively. Figure 32 represents the graphical comparison for the
54
training and validation loss for the given input dataset. The training and validation loss obtained
for the higher accuracy is 7.5, respectively.
So, from the above results, the CNN model showcased commendable accuracy and loss on both
the training and validation sets, underscoring its proficiency in handling image-related tasks and
complex feature extraction.
DATA DESCRIPTION:
The dataset provided encompasses measurements of soil moisture, humidity, temperature, and
motor status collected from various sensors and instruments. These include soil moisture sensors,
temperature sensors, humidity sensors, and water pumps used for controlling water flow. The
measurements were gathered at different locations, including crop fields and gardens, and from
multiple soil samples. The data covers a period of two months, specifically from 1st March 2023
to 1st May 2023. Measurements were recorded and stored every 15 minutes daily.
The dataset comprises 5858 rows and five columns, including date and time, soil moisture,
temperature, humidity, and motor status.
In addition to the environmental parameters, the dataset also includes information regarding
irrigating dates, times, and irrigation schedules. This supplementary information provides
context and enables researchers and practitioners to analyze the relationship between
environmental factors and irrigation practices. The dataset offers a valuable resource for
studying precision
55
agriculture, optimizing water usage, and understanding the impact of soil moisture, humidity,
and temperature on crop growth and health.
56
indicates an inverse relationship, where an increase in one variable is associated with a decrease
in the other.
By plotting the training and validation loss over epochs, as done in the provided code, we can
visually analyze the convergence and performance of the model. The plot helps to identify if the
model is underfitting (both training and validation loss remain high), overfitting (training loss
decreases significantly while validation loss increases), or finding a good balance (both training
and validation loss decrease and stabilize).
Analyzing the Training and Validation Loss graphs allows us to make informed decisions
regarding model training, such as adjusting the number of epochs, changing the model
architecture, or applying regularization techniques to improve the model's performance.
57
training accuracy continuously improves while the validation accuracy remains relatively stable,
it indicates good generalization and suggests that the model is learning the underlying patterns in
the data. On the other hand, if the validation accuracy starts to decrease or remains significantly
lower than the training accuracy, it may indicate overfitting, where the model is memorizing the
training data and not generalizing well to unseen data.
The goal is to achieve high accuracy on the training and validation sets, with a minimal gap
between them. This indicates that the model learns effectively and can predict new, unseen data
accurately. This model achieved satisfactory accuracy (0.9855) and loss (0.0511) on the training
and validation sets. The trained ANN model is a foundation for motor status prediction.
58
Chapter 6
Conclusion and Future Work
In this chapter, we conclude our work. Here, we also discuss a few potential areas for future
work.
6.1 Conclusion
The implemented system integrates various hardware components for data collection and the
solar system for power supply. When comparing the performance of an ANN model with a CNN
model on Kaggle's dataset, it becomes evident that the CNN model exhibited noteworthy
achievements. Specifically, the CNN model displayed satisfactory levels of accuracy and loss on
both the training and validation sets of the dataset.
Also, on the same dataset, in MATLAB's classifier app, Gaussian Naive Bayes and Kernel Naive
Bayes algorithms emerged as optimal solutions, achieving an impressive accuracy of 99.5%.
The generated dataset from sensors was analyzed, preprocessed, and used to train the model. The
ANN-trained model demonstrated promising results in predicting motor status. The model
achieved satisfactory accuracy (0.9855) and loss (0.0511) on the training and validation sets. The
trained ANN model is a foundation for motor status prediction.
The prospects of a solar-based smart irrigation system, leveraging crop suggestion and ML
techniques, present an exciting opportunity to transform the field of agriculture. Progress in
machine learning algorithms, such as deep learning and reinforcement learning, is set to enhance
the precision of crop recommendations, catering to specific farm conditions. Incorporating IoT
devices and remote sensing technologies will offer a comprehensive view of agricultural
parameters, enabling real-time data-driven decision-making. Moreover, the system's adaptability
to climate change, considering evolving weather patterns for crop choices, ensures resilience in
farming practices. The smart irrigation system can empower farmers to make economically
sound crop selections by integrating market demand data. Furthermore, ML-driven
optimization of
59
irrigation schedules based on solar energy availability will lead to prudent water resource
management. Embracing cloud-based solutions ensures efficient data management and easy
access, while mobile app enhancements will enrich user experience and interaction. Encouraging
collaborative farming networks will foster collective learning and knowledge exchange, while
AI- enabled automation enables smart and autonomous decision-making.
60
Chapter 7
Publication
1. Somesh R. Dhawale, Suhas Kakade, Rohan Kulkarni, Muhammed Fasil C, " Application
of ML in Crop Selection for Precision Agriculture," published at International
Conference on Digital Applications, Transformation, and Economy (ICDATE) miri
malaysia 2023,
2. Somesh R. Dhawale; Suhas Kakade; Rohan Kulkarni; Mohit Kumar Shakya; Suraj
Sawant, "Analysing Environmental Factors and Enabling AI-driven Crop
Recommendation in a Smart Irrigation Project: A Case Study Using a Comprehensive
Dataset.", submitted at Journal Data in Brief.
3. Somesh R. Dhawale; Suhas Kakade; Rohan Kulkarni, “Solar based smart irrigation
system using ML techniques”, to be submitted to an International Journal on Advances in
Precision Agriculture.
61
References
[1] Mujoo, Sumedha, Anjali Sharma, Kamini Gaikwad, Swati Madhe, Subrahmanyam Sista, and
Mamta Khatape. "Smart Irrigation System using IoT based Control Valve." In 2021 Asian
Conference on Innovation in Technology (ASIANCON), pp. 1-5. IEEE, 2021.
[2] Harishankar, S., R. Sathish Kumar, K. P. Sudharsan, U. Vignesh, and T. Viveknath. "Solar
powered smart irrigation system." Advance in electronic and electric engineering 4, no. 4 (2014):
341-346.
[3] G. Ravi kumar, T.Venu Gopal, V.Sridhar, G.Nagendra, “Smart Irrigation System”,
International Journal of Pure and Applied Mathematics, Volume 119 No. 15 2018
[4] Naik, Pavankumar, Arun Kumbi, Kirthishree Katti, and Nagaraj Telkar. "Automation of
irrigation system using IoT." International journal of Engineering and Manufacturing science 8,
no. 1 (2018): 77-88. [6] Srishti Rawal, “IOT based Smart Irrigation System” International
Journal of Computer Applications (0975 – 8887) Volume 159 – No 8, Feb. 2017
[5] Babaa, Saleh Elkelani, Muneer Ahmed, B. S. Ogunleye, Shahid Ali Khan, S. A. Al-Jahdhami,
and John Regan Pillai. "Smart irrigation system using arduino with solar power." International
journal of engineering research & technology (ijert) 9, no. 05 (2020): 7.
[6] Puneeth Kumar G.B, Swathi H.C, Hampana Devi C.M, Rakshitha C.J, Sushmitha K.G,
“Solar Powered Sensor Base Irrigation System”, International Journal of Engineering Research
Technology (IJERT), ISSN: 2278-0181, Volume 6, Issue 13
[7] Alsayid, Basim, Jafar Jallad, Muhammad Dradi, and Ola Al-Qasem. "Automatic irrigation
system with pv solar tracking." (2013).
[8] Shastri, Jitesh, Deepesh Narkar, Mandar Sase, and Rashmi Kale. "Implementation of Solar Based
Irrigation System for Conditions like Pandemic." In 2021 4th Biennial International Conference on
Nascent Technologies in Engineering (ICNTE), pp. 1-5. IEEE, 2021.
[9] Zaher, Ashraf, Hidab Hamwi, Aisha Almas, Salma Al-Baitamouni, and Mona Al-Bathal.
"Automated smart solar irrigation system." (2018): 11-6.
[10] Malar, JE Tamil, and M. Vaishnavi. "IoT based Smart Irrigation System using ESP32." In 2022 3rd
International Conference on Electronics and Sustainable Communication Systems (ICESC), pp. 1751-
1755. IEEE, 2022.
[11] Darshna, S., T. Sangavi, Sheena Mohan, A. Soundharya, and Sukanya Desikan. "Smart
irrigation system." IOSR Journal of Electronics and Communication Engineering (IOSR-JECE)
10, no. 3 (2015): 32-36.
62
[12] Zhiying, Zhang, Jia Haiqing, Zhang Shutong, and Ji Jianshe. "The electricity management
system of agricultural irrigation based on fee control terminal." In 2018 China International
Conference on Electricity Distribution (CICED), pp. 2-6. IEEE, 2018.
[13] Namala, K. K., Krishna Kanth Prabhu AV, Anushree Math, Ashwini Kumari, and Supraja
Kulkarni. "Smart irrigation with embedded system." In 2016 IEEE Bombay Section Symposium
(IBSS), pp. 1-5. IEEE, 2016.
[14] Rout, Kshirod Kumar, Samuchita Mallick, and Sivkumar Mishra. "Solar powered smart
irrigation system using Internet of Things." In 2018 2nd International Conference on Data
Science and Business Analytics (ICDSBA), pp. 144-149. IEEE, 2018.
[15] Uddin, Jia, SM Taslim Reza, Qader Newaz, Jamal Uddin, Touhidul Islam, and Jong-Myon
Kim. "Automated irrigation system using solar power." In 2012 7th International Conference on
Electrical and Computer Engineering, pp. 228-231. IEEE, 2012.
[16] https://www.kaggle.com/datasets/atharvaingle/crop-recommendation-dataset.
[17] Jagadeeswari, M., C. S. Manikandababu, S. Kavya, R. Prasanna, and S. Madumitha.
"Artificial Intelligence based Crop Recommendation System." In 2022 4th International
Conference on Inventive Research in Computing Applications (ICIRCA), pp. 1127-1133. IEEE,
2022.
[18] Somesh R. Dhawale, Suhas Kakade, Rohan Kulkarni, Muhammed Fasil C, " Application of
ML in Crop Selection for Precision Agriculture," Paper published to International Conference on
Digital Applications, Transformation, and Economy (ICDATE) 2023.
[19] Sharma, Abhinav, Muskaan Bhargava, and Akshay Vijay Khanna. "AI-Farm: A crop
recommendation system." In 2021 International Conference on Advances in Computing and
Communications (ICACC), pp. 1-7. IEEE, 2021.
[20] Eli-Chukwu, Ngozi Clara. "Applications of artificial intelligence in agriculture: A review."
Engineering, Technology & Applied Science Research 9, no. 4 (2019): 4377-4383.
[21] Devi, M. Aruna, Dhina Suresh, D. Jeyakumar, D. Swamydoss, and M. Lilly Florence.
"Agriculture Crop Selection and Yield Prediction using Machine Learning Algorithms." In 2022
Sec. Intl. Conf. on AI and Smart Energy (ICAIS), pp. 510-517. IEEE, 2022.
63