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

DIPLOMA IN COMPUTER SCIENCE (SYSTEMS

DEVELOPMENT)

COMPUTING PROJECT REPORT


DCS 5604

AUTOMATIC PLANT WATERING SYSTEM

STUDENT’S NAME
STUDENT’S ID
STUDENT’S IC

A project report submitted in partial fulfilment of the requirements


for the award of Diploma of Computer Science

February 2023
1

DECLARATION

I hereby declare that this project report is based on my original work except for
citations and quotations which have been duly acknowledged. I also declare that it
has not been previously and concurrently submitted for any other diploma or award at
Crescendo International College or other institutions.

Signature: ______________________________

Student’s Name: XX XX XX
2

ACKNOWLEDGEMENTS

First and foremost, xxxxxxxxxx, my supervisor, deserves my gratitude for her


direction, advise, and constructive remarks on the project development process,
requirement specification, and other topics. She also showed me how to construct a
good system and guided me through the software development life cycle. She gives
me a lot of feedback during the system development process, which improves the
project's overall quality.

I also like to take this time to express my gratitude to all my friends who contributed
ideas and suggestions for this project, as well as assisting me with system testing.
Their assistance is greatly appreciated.

Then, I like to thank my parents for their unwavering supports, which have guided me
through the process of completing this project this semester. They also give a lot of
comments about my ideas in making the project successful. I would never have
gotten this far without their help.
3

ABSTRACT

The primary purpose of this project is to use a soil moisture sensor to determine whether the
condition of the soil is dry or moist, and to design an automatic plant watering system to
improve the quality of plant watering and subsequently be able to maintain green
environmental conditions for a long period of time in a good and systematic way. This
automatic system can also be able to provide many benefits to humans, such as setting the
amount of humidity and dryness of plant and soil conditions that are accurate for precision in
monitoring plant conditions over time. Automated plant watering systems can also save users
energy by eliminating the need to manually monitor and manually water the plants. This
automatic plant watering is also linked to a monitoring system in the device using device
technology, reducing the burden more to check soil moisture. The system uses a device
application, the Blynk program, to display the current soil condition, indicating whether it is dry
or wet. If the soil is dry according to the selected moisture level, the system will water the
plants automatically. The system uses ESP32, Blynk and devices. For the hardware, the
water pump is utilised to pump water and water the plants automatically in according to the
rules that set by the ESP32 controller.
TABLE OF CONTENTS

DECLARATION 1
ACKNOWLEDGEMENTS 2
ABSTRACT 3
TABLE OF CONTENTS 4
LIST OF FIGURES 6
LIST OF TABLES 7
Chapter 1: Introduction 8
1.1 Past Works 8
1.2 Problem Statement 8
1.3 Objectives 9
1.4 Method Used 10
1.5 Scope and Limitations 11
Chapter 2: Literature Review 12
2.1 Introduction 12
2.2 Preliminary Investigations 13
Chapter 3: Methodology 18
3.1 Introduction 18
3.2 Description of Methods 18
3.3 Root Cause Analysis 23
Chapter 4: Results and discussions 24
4.1 Introduction 24
4.2 System Outputs/Experimental Results 25
4.3 Result Analysis 28
Chapter 5: Conclusion And Recommendations 29
5.1 Strengths and Weaknesses 29
5.2 Conclusion 30
5.3 Future Works 31
References 32
Appendices 33
LIST OF FIGURES

1. Figure 1: ESP32 Microcontroller 11


2. Figure 2: Soil Moisture Sensor 12
3. Figure 3: Micro Submersible Water Pump DC 3V-5 13
4. Figure 4: Relay Module 14
5. Figure 5: Project Flowchart 17
6. Figure 6: Block Diagram 18
7. Figure 7: Automatic Plant Watering System 22
8. Figure 8: Moisture Sensor Detects Dryness 22
9. Figure 9: Blynk Notification Alert 23
10. Figure 10: Final Coding for Automatic Plant Watering System 24
LIST OF TABLES

1 Table of results 25
CHAPTER 1: INTRODUCTION

1.1 Past Works

There are titles such as Automatic Plant Watering System using Arduino, Smart Soil
Moisture Measurement, and Plant Watering Monitor System based on my findings
with projects linked to smart automatic plant watering system. The downsides of this
project are, first and foremost, the use of an Arduino. The majority of Arduinos do not
have Wi-Fi and using ESP32 is an excellent option. Also, the monitor system can
employ Blynk rather of focusing solely on serial displays. Finally, there is a system
that does not have an automatic watering system and merely includes a soil moisture
level sensor. I conducted an investigation of a system that combines these flaws for
them. As a result, the automatic plant watering system is developed with a
combination of Internet of Things (IoT), Blynk, ESP32, and devices for automatic
monitoring and watering. Data such as soil moisture or dryness levels will be
collected. A water pump will pump water through a tube directed to the plant to
moisten the soil to avoid the dryness of the plant.

1.2 Problem Statement

Difficulty In Monitoring Weather Changes


Users can not accurately track the environmental conditions surrounding the plants
from time to time. Users may only manually assuming the soil moisture, which
sensed, and the temperature surrounding the plants by only using the traditional
method of plant care. Wireless technologies exist today and are used in a variety of
fields. Users require a gadget that can wirelessly send plant conditions to device so
the user can monitor the plants condition anytime and anywhere. Users will be
notified of the environmental conditions surrounding the plant by using the
technology. As example, Blynk System. Blynk System is not only available in Website
but, it also available in mobile applications. User can monitor their soil moisture by
using the Blynk application only.
Use Conventional Methods Rather Than Technology

This automatic plant watering technology system increases efficiency by using


existing facilities such as electronic goods. ESP32 is able to channel the connection
between components and the internet. This makes it easier for the user in terms of
time, budget, and energy.

1.3 Objectives

To develop the automation system using ESP32

Several smart controls can be implemented by developing a system with ESP32. One
of them is the ability to monitor the real-time state immediately from the Blynk
application. Other than that, ESP32 control the watering system, pumps, and
inspections afterwards. ESP32 can control multiple appliances and also the entire
system using the ESP32 Wi-Fi Module and send the data to user.
To design simple automatic plant watering

To be user-friendly and to assist the user's task, this smart plant watering design
must be straightforward. This is also because we need to concentrate on the primary
function, which is automatic plant watering.

To take care of plants with an automatic technology system

This automated system should contribution in the care and monitoring of plants. If the
user is outside, user can still take care of the plant to water it automatically when the
soil is detected dry.

1.4 Method Used

This automatic system uses programming methods. The ESP32 used Arduino
programming language that used to interface with sensors and other devices
attached to microcontroller boards. In actuality, the programming languages are
based on C++ and C programming language and are intended to be user-friendly for
both non-programmers and beginners in programming.
1.5 Scope and Limitations

In this system, ESP32 microcontroller used C++ and C programming languages. The
project is a system to check and monitor the status of the soil moisture . It also
detects the soil status either the soil is in dry or moist condition. This automatic plant
watering system is made to prevent from the plants in a dry and dead state. It is
functioning regardless of environmental changes.

The automatic plant watering system will automatically water the plant if it meets the
conditions which:

The soil moisture value is lower than 1000, it indicates that the soil is in dry state and
the relay module will allow the water pump to water the plant through the tube and
moisten the soil. If the soil moisture value is higher than 1000, this indicates that the
soil is in damp state and the water pump does not need to pump any water for the
plant. In Blynk, the moisture value is always displayed using the gauge widget.

However, this system may fail to perform in terms of researching the soil's condition
in more depth, such as soil pH, humidity, and temperature surround the plant. The pH
sensor is able to measure the level of acidity and alkalinity of the soil. The humidity
and temperature sensor functions to measure the temperature and humidity of the
surrounding environment.
CHAPTER 2: LITERATURE REVIEW

2.1 Introduction

This chapter explains how to use the automatic plant watering system for users and
how to integrate the system with Blynk Application. It can also explain how the soil
moisture sensor is used to measure the moisture of the soil and, how the relay
module control the water pump.

In this era, watering your plants should not be a routine chore. The amount of water a
plant requires is continuously changing. In 1917, the eminent American horticultural
Liberty Hyde Bailey observed, "Watering plants usually demonstrates the gardener's
skill, or lack thereof. It is a technique that cannot be adequately described in print." A
plant can be watered by anyone. Yet, understanding how plants use water and the
numerous elements that come into plant play takes time and expertise. They include
the plant's soil texture, recent weather, time of day, and season. If the leaves and the
soil become wet, they have the entire day to dry out. It's considerably more difficult
for plant diseases to acquire a foothold when the foliage is dry.
2.2 Preliminary Investigations

In this modern age of globalization, Technology has evolved rapidly over the last few
decades, transforming our lives, and allowing us to progress alongside it. Technology
has done more than anything else to enable humans enjoy a life of luxury and
convenience making communication easy from anywhere in the world. We also know
more about our world and outer space thanks to technological advancements. Every
discipline credits its growth to technology, demonstrating the relevance of technology
in many aspects of our life.

As I have mentioned, the use of esp32 in this project greatly simplifies my project. Wi-
Fi connection is one of the strongest systems. Arduino microcontroller is also very
rare to be used as a microcontroller that can connect the controller with internet Wi-Fi
and also Bluetooth. Additionally, when the features of the Arduino and its add-ons are
compared to those of the Esp32, the cost of the Arduino and its add-ons is higher.

Aside from that, several other systems have the benefit of being completely
equipped, such as a pH sensor, buzzer, temperature, and humidity sensor. These
components can provide much more specific measurements of the soil's state in
order to make it more fertile. Nevertheless, the more sensors or components utilised,
the more pins from the ESP32 are needed, and the system can be delayed for a long
period.
ESP32

The ESP32 is a low-cost system on Chip (SoC) Microcontroller developed by


Espressif Systems, the same company that created the well-known ESP8266 SoC. It
is the successor to the ESP8266 SoC and it is available in single-core and dual-core
versions of Tensilica’s 32-bit Xtensa LX6 Microprocessor with integrated Wi-Fi and
Bluetooth.

ESP32 boards can read inputs such as a light on a sensor, a finger on a button, or a
Telegram message and convert them into outputs such as activating a motor, turning
on an LED, or publishing something online. This can instruct any board by sending a
set of instructions to the board’s microcontroller. You can use the programming
language and the Arduino Software (IDE) to accomplish this.

Figure 1: ESP32 Microcontroller


Soil Moisture Sensor

The soil moisture sensor works in a simplest method. The fork-shaped sensor, which
has two bare conductors, functions as a variable resistor that equivalent to a
potentiometer, with resistance that differed with the moisture content of the soil. This
sensor generates an output voltage based on the resistance, which we may measure
to calculate the soil moisture level.

Common soil moisture sensor is divided into two sections. First, the probe. A fork-
shaped sensor with two bare conductors is placed into the soil or anywhere else the
moisture is to be determined. It functions as a variable resistor, as originally
explained, with resistance adjusting with soil moisture. Next, the module. Output
voltage dependent on the probe's resistance created from the module, which is
accessible through an Analog Output (AO) pin. The same data is supplied into an
LM393 High Precision Comparator, which digitises it and outputs it to a Digital Output
(DO) pin.

Establish a limit to ensure that the module outputs LOW if the soil moisture level
exceeds the threshold, otherwise HIGH. This configuration is ideal for activating an
action when a given threshold is reached. For example, if the moisture level in the
soil surpasses a given threshold, a relay can be activated to begin watering the plant.

Figure 2: Soil Moisture Sensor


Micro Submersible Water Pump DC 3V-5V

Since the ESP32 cannot provide enough current to run the water pump directly, the
pump must connect to the ESP32's digital output pins and use a relay module as a
switch to manage the power to the pump. The ESP32's digital output pins can be
used to control the relay module. Pump powered by 3V to 6V power supply. These
pumps are often used in automobile, marine, and recreational vehicle applications,
alongside small-scale irrigation, water treatment, and other related systems.

Figure 3: Micro Submersible Water Pump DC 3V-5V


16
Relay Module

The relay module is a sort of electrical switch which can be regulated by an ESP32
microcontroller to turn on and off a water pump. Whenever the relay module is
activated, an electrical circuit is closed, enabling electricity to flow into the pump and
turn it on. Once the relay is de-energized, the circuit is opened, switching off the
current and setting off from the pump. Connect the relay module to the digital output
pins of the ESP32. VCC, GND, and IN are the three pins on a relay. VCC should just
be linked to the ESP32's 3.3V, GND to GND, and IN to an ESP32 digital pin. Once
the connections are established, the relay and switch the water pump on and off can
be controlled using the ESP32's digital output pins.

Figure 4: Relay Module


CHAPTER 3: METHODOLOGY

3.1 Introduction

This chapter will explain about the construction of this project. It will go overall of the
steps involved in completing the project and ensuring that all the goals are met. This
methodology goes over the project in depth at an early stage. Project selection,
preparation, hardware assembly, testing, and project troubleshooting are among it. It
will also describe the flowchart, which will show how my project operates. This
chapter will also go over the processes for circuit that have been used in. Using
software development represents one of the biggest developments in this project.
Software development, regardless of design or circuit, is a critical step in more
extensive study. Each subtopic of this methodology will be explained in greater detail.
This is capable of explaining to everyone the established system. This can also filter
out any flaws or ineffective systems in this project. According to step by step, there
are five approaches that will be employed to properly complete this project.

3.2 Description of Methods

Project Selection
This method for assessing projects to verify that they are aligned with your strategic
objectives and produce maximum performance. This assists you in selecting projects
based on a prioritized hierarchy. Project selection occurs in the early stages of a
project when you are dealing with ideas or suggestions.

There are advantages and practicality in this method. The benefits of the project take
the shape of a list of positive results. Motivation for taking on a project might range
from financial gain to social and cultural value, or even completing previous
agreements. Practicality refers to the likelihood of a project's success. All
undertakings are risky, and some are extremely complicated.

It might take time and a lot of investigation to determine the viability of any project.
This process is carried out as part of the project beginning step, which is known as a
development plan.
Project Preparation
Research-based coursework training will be prioritized throughout project planning. It
will offer students with a solid foundation in research methods and strategies required
for successful project planning, implementation, and completion. Investigation of the
literature and development of knowledge about the study domains relevant to the
course of study.

In Figure 5: Project Flowchart describes thoroughly the project’s workflow. The major
goal of this project is to create an automation system with ESP32. In Figure 6: Block
Diagram shows about how the construction flow of proses in collecting data.

The endeavour begins with a review of the literature. This section outlines the
project’s methodology for developing an automatic plant watering system. The
research for the project’s architecture design and examination of the circuit system
will continue in the next stage.

At this point, it will have a better understanding of the project and will set a few goals
for the project’s completion. Then, using an Arduino compiler, create a programme
and run it through its paces. If the programme is successful, go on to hardware
development, which involves building the circuit. The following step is hardware
testing, and if the trial fails, the hardware development must be redone.

The next phase is hardware and software combination testing, in which both
hardware and software are coupled to see if both the circuit and programme run
successfully. To guarantee that the programme achieved the desired result, the
results must be recorded.
Figure 5: Project Flowchart
Hardware Assembly
First, it starts with Soil Moisture Sensor. The Soil Moisture Sensor will measure or
estimate the amount of water in the soil to send the data to the ESP32. If the
measurement or estimate amount of water in the soil met the requirement, the relay
module will power the water pump. If not, the water pump will remain off. After that, it
will go to Blynk Gauge Widget display. The Blynk Gauge Widget will display the
current measurement or estimate the amount of water in soil and display it for the
user.

If the requirement does not meet, it will go back to the Soil Moisture Sensor to retake
the measurements.

Figure 6: Block Diagram


Project Testing
Software development was used to analyse and simulate the performance of each
circuit used to develop this project. Main software that used to make this project is
Arduino IDE. Arduino IDE is an application that allow people to code a program and
send the program to the ESP32. In Arduino IDE, C programming language is used to
build the program. Arduino IDE also has a Serial Monitor that allow people to see the
current activity or movement that have been made by the program. Arduino IDE is
used in making this project because the project need Arduino products inside it such
as ESP32. The most common way to build and execute the program to ESP32
products is with Arduino IDE. So that is why Arduino IDE is the chosen one.

The Arduino IDE can run all the programme that have been created and saved in the
software in this automatic door using solar generator. The Arduino Integrated
Development Environment (IDE) is a cross-platform application written in C and C++
for Windows, macOS, and Linux. It is used to build and upload programme to Arduino
compatible boards, as well as another vendor development boards with the support
of third-party cores.

Project Troubleshooting

Troubleshoot is a methodical technique to problem resolution that is frequently used


to identify and resolve problems with complicated machinery, electronics, computers,
and software systems. Usually troubleshooting methods begin with obtaining
information about the problem, such as unexpected behaviors or a lack of intended
capability.

When the problem as well as how to solve it are known. The next procedure involves
eliminating any unnecessary components to see if the problem persists. This phase
can aid in the identification of component incompatibility issues as well as problems
caused by others.
3.3 Root Cause Analysis

Root Cause Analysis is the process of determining the root causes of problems in
order to identify viable remedies. However, these remedies merely address the
symptoms and do not address the underlying reasons of those symptoms, such as a
stomach infection that requires medication or a broken automobile alternator that
must be serviced. To solve or study a problem, we must conduct a root cause
analysis to determine the specific source and how to resolve it.

This can assist avert numerous problems and consequences in this final year
assignment. Among the reasons that can cause issues or defects are imprecise and
incorrect data readings, a lack of component material testing, a lack of a backup plan
in the event of damage, and environmental concerns that we cannot control.
CHAPTER 4: RESULTS AND DISCUSSIONS

4.1 Introduction

This chapter will discuss the project’s results. The data were plotted. The statistics
were gathered and analysed as a necessary component of completing the final year
project, and the project's objectives were either completely satisfied or not met at all.
The following section discusses the simulation's impact and data collection in further
detail. The process of determining how the automatic system for this project should
be constructed in order to ensure that the automatic system of this project functions
and is used to ensure that this automatic system fulfils the quality requirements in the
market or consumers only.

The primary goal of this project is to create an automated plant watering system.
When the sensor detect soil in a dry state, the state will be recorded, and the water
pump will pump the water automatically to allow the soil to be in a stable moisture
condition suitable for the plant.
4.2 System Outputs/Experimental Results

Figure 7: Automatic Plant Watering System

Figure 8: Moisture Sensor detects dryness


Figure 9: Blynk Notification Alert
Figure 10: Final Coding for Automatic Plant Watering System
4.3 Result Analysis

Testing procedure used to confirm that a fully constructed system fits its criteria.
Many tests have been performed and if the trial fails, the development must be
redone.

This project has used many testing methods to complete the completion of this
project. Among the testing methods used are, system testing, performance testing,
compatibility testing and, Using Goal of enabling for Testing. System testing is a
process of evaluating an entire and integrated system to ensure that it meets stated
requirements. This project's software functioning is checked from beginning to end
using troubleshooting procedures. For instance, in programming using the Arduino
IDE

Performance testing is a type of semi evaluation that is used to identify how software
and hardware applications will behave under different conditions. The concept is to
put technology responsiveness and stability to the test in real-world scenarios.

All needs and objectives are met in a project that employs a simple and user-friendly
automatic system for analysing plant soil moisture and generating an automatic
watering system for plants. It will assist to increase productivity in the agricultural
industry on a small and large scale since they will no longer have to waste time
manually and physically analysing the moisture. It also helps to maintain plant fertility
by combining an automatic system with Blynk, which allows us to access data from a
database and only requires Wi-Fi internet to run this project successfully.

Conditions Result
Blynk
Moisture Sensor Value Serial Monitor Water Pump
Notification
Blynk
Water pump
Lower than 5 Notification Moisture
turn On
Alert Displayed Sensor Value
No Blynk Displayed
Water pump
More than 5 Notification
turn Off
Alert Displayed

Table 1: Table of results


29
CHAPTER 5: CONCLUSION AND RECOMMENDATIONS

5.1 Strengths and Weaknesses

This automatic plant watering system can provide every user with a fresh experience
by making work faster and easier. This approach, which has been thoroughly
researched, yields a result in which this project can employ only a moderate expense,
along with all add-on products. This technology system is powerful enough already to
power the project's automation system. The use of a strong microcontroller is more
than enough to make this system powerful. With a basic and minimalistic design,
users may easily utilize this project without having to master all of the features in
depth.

As a result, because the ESP32 microcontroller is also sometimes got problems, in


the process of completing this project became difficult. Coding compiler, which is the
Arduino IDE application, is also prone to delays. The system in Blynk also helps by
tracking the results of the project, which is the value of the soil moisture sensor but,
sometimes even after connecting to ESP32, Blynk always faces offline server
problems.

One of the primary benefits of this project is that it allows for speedier deployment as
compared to manual and physical implementation of the procedure by the user
himself. The established automatic system is very basic and easy, and it is capable of
providing good performance in the use of this system in daily use. This automation
technology may also detect dryness in the ground by just employing a moisture
sensor.

This enables any user to automate the process of watering plants. Finally, this
approach ensures that plants are not resistant to decreased tension or pressure, as
well as excessive watering.
31
5.2 Conclusion

To summarize, these examples demonstrate how to automate plant watering system.


It illustrates the automation system component's design. The connection then
illustrates most of the materials used in these projects. Additionally, the first objective,
which was to to develop the automation system using ESP32, has been
accomplished. Chapter 4 demonstrated the circuit diagram and prototype for this
system component.

Chapter 5 presents the project's conclusions and summary, as well as recommends


possible future directions for the project. On the other hand, the experiment's second
objective is to design simple automatic plant watering. The active automation system
has been successfully designed and tested. Following that, the automatic plant
watering performance will be analysed. Conditions influence the output of the
automation system.

A microprocessor, a moisture sensor, as well as other electrical instruments were


used to create an automatic system. It was discovered that the proposed
methodology regulates the moisture content of agricultural land soil. The power
supply will switch on the water pump to start pumping water when the soil is dry and
needs water and terminates when the soil's moist level remains constant when
desired.

Moisture sensors monitor the optimum moisture value of plants. If the moisture level
falls below the desired level, the moisture sensor sends a signal to the
microcontroller, causing the Water Pump to switch on and water the plant with
suitable duration to avoid excessive water while watering the plant. When the
necessary moisture level is attained, the system automatically shut off the water
pump. As a result, the complete system's functionality has been thoroughly tested,
and it is deemed to perform successfully.
33
5.3 Future Works

Future work on this project will integrate the entire automatic plant watering system,
ensuring that the outcomes are as efficient as possible. The architecture and
functionality of the automatic plant watering system can be modified or enhanced to
improve its performance and functionality.

The automatic plant watering system's architecture and configuration can be


improved are such as, add more capabilities as in the user alerting section, which is
by using the notification system from Telegram to update the user. Telegram app
usage is more popular than Blynk. This is because Telegram is one of the messaging
apps that users always use.

Next, add a sensor such as a sensor to measure soil ph. This Soil pH meter can help
users to know the level of acidity and alkalinity of the soil to ensure that plants grow in
healthy conditions.

Sensors, often known as objects, detect data and typically operate locally.
ThingSpeak allows sensors, instruments, and websites to communicate data to the
cloud, where it can be kept in a private or public channel. ThingSpeak defaults to
storing data in private channels, but public channels can be used to share data with
others. You can analyse and visualise data in a ThingSpeak channel, calculate new
data, and communicate with social media, web services, and other devices.

As a result, we can use two separate data displayers to obtain more precise results.
ThingSpeak provides capabilities for device communication that enable all of these
tasks and more. where we may Respond to data, both raw variables and study
results something which users generate as it flows into the network configuration the
device's command, line interface to execute.
REFERENCES

[1] https://howtoculinaryherbgarden.com/automatic-plant-watering-systems/

[2] https://www.researchgate.net/publication/
321307351_Automatic_Plant_Watering_System

[3] https://asianssr.org/index.php/ajct/article/view/977

[4] https://www.thesill.com/blog/top-ten-plant-care-tips

[5] https://www.instructables.com/Smart-Home-Automation-Using-Blynk-ESP32-
IoT-Projec/

[6] https://linuxhint.com/esp32-vs-arduino/#:~:text=Works%20on%20low
%20voltage%20level,cheaper%20than%20the%20Arduino%20Uno

[7] https://thecustomizewindows.com/2020/05/esp32-vs-arduino-how-esp32-is-
different-from-arduino/

[8] https://www.instructables.com/IoT-Project-Using-ESP32-NodeMCU-Network-
With-Blynk/

[9] https://forum.arduino.cc/t/5v-pin-to-power-usb-water-pump/294460/3

[10] https://www.tableau.com/learn/articles/root-cause-analysis

[11] https://stackify.com/best-software-testing-methods/

[12] https://iotcircuithub.com/indoor-plant-watering-system-esp32/

[13] https://community.home-assistant.io/t/atomated-plant-watering-using-
esp32/412011

[14] https://www.reddit.com/r/esp32/comments/powewm/
my_automated_plant_watering_system/

[15] Vinay Bakale and SiddheshTolakar,"Wireless Automatic Plant Irrigation


System", International Journal on Recent Technologies in Mechanical and Electrical
Engineering.
APPENDICES

#include <Esp32WifiManager.h>
#include <Blynk.h>
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
int _moisture,sensor_analog;
const int sensor_pin = A0; /* Soil moisture sensor O/P pin */
#define RELAY_PIN 27 // ESP32 pin GIOP27, which connects to the IN pin of relay

#define BLYNK_TEMPLATE_ID "TMPLpXNrOl0E"


#define BLYNK_TEMPLATE_NAME "PLNT MNTRNG"
#define BLYNK_AUTH_TOKEN "JUAf-aOQTAA_1znbSK8xptY8AaekLYNf"

/* Comment this out to disable prints and save space */


#define BLYNK_PRINT Serial

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

// Your WiFi credentials.


// Set password to "" for open networks.
char ssid[] = "Wifi";
char pass[] = "12345678910";

BlynkTimer timer;

void setup(){
Serial.begin(115200); /* Set the baudrate to 115200*/
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
37

pinMode(RELAY_PIN, OUTPUT);

Serial.println("Connecting to ");
Serial.println(ssid);

WiFi.begin(ssid, pass);

while (WiFi.status() != WL_CONNECTED)


{
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.println("WiFi connected");

void loop()
{
Blynk.run();
timer.run();

sensor_analog = analogRead(sensor_pin);
_moisture = ( 100 - ( (sensor_analog/4095.00) * 100 ) );
Serial.print("Moisture = ");
Serial.print(_moisture); /* Print Temperature on the serial window */
Serial.println("%");
delay(1000); /* Wait for 1000mS */

if(_moisture < 5 )
{
38

digitalWrite(RELAY_PIN, HIGH); // turn on pump 4 seconds


Serial.println("wterpump turned on");
delay(4000);
Serial.println("Waterpump turn on for 4 seconds");
Blynk.logEvent ("plant_moisture_alert", "Wterpump turn on for 4 seconds");
digitalWrite(RELAY_PIN, LOW); // turn off pump
Serial.println("waterpump turned off");
delay(4000);

else
{
digitalWrite(RELAY_PIN, LOW); // turn off pump
Serial.println("waterpump remain off ");

You might also like