0% found this document useful (0 votes)
4 views14 pages

Smart Eco-Irrigation System Report

The Eco-irrigate technical report details a Smart Irrigation System designed to optimize water usage in agriculture using an ESP32 microcontroller and various sensors. The system automates irrigation based on soil moisture levels, monitors water quality, and allows remote control via the Blynk app. Recommendations for improvement include integrating weather data, enhancing sensor capabilities, and utilizing machine learning for better irrigation predictions.

Uploaded by

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

Smart Eco-Irrigation System Report

The Eco-irrigate technical report details a Smart Irrigation System designed to optimize water usage in agriculture using an ESP32 microcontroller and various sensors. The system automates irrigation based on soil moisture levels, monitors water quality, and allows remote control via the Blynk app. Recommendations for improvement include integrating weather data, enhancing sensor capabilities, and utilizing machine learning for better irrigation predictions.

Uploaded by

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

Eco-irrigate

Technical report
Maadi STEM High School for Girls
Group no.11321
Codes
// Pin Definitions
#define LED_BUILTIN 2
// Onboard LED used for system status indication.
#define Buzzer 16
// Buzzer pin for alerting users in case of high turbidity or other
conditions.
#define WATER_FLOW_SENSOR_PIN 27
// Digital pin connected to the water flow sensor.
#define TURBIDITY_SENSOR_PIN 35
// Analog pin connected to the turbidity sensor to monitor water
quality.
#define SOIL_MOISTURE_SENSOR_PIN 32
// Analog pin connected to the soil moisture sensor to measure water
content in the soil.
#define BLYNK_TEMPLATE_ID "TMPL2jNyz9NsQ"
// Blynk template ID for the project.
#define BLYNK_TEMPLATE_NAME "SoilTeam"
// Blynk template name for the project.
#define BLYNK_AUTH_TOKEN
"DGMYUK7Um7vHyFUyNkOUQ6x1NeIF0Ww6"
// Authentication token for connecting to the Blynk app.

1|Page
#include <BlynkSimpleEsp32.h>
// Library for connecting the ESP32 to Blynk.
#include <WiFi.h> // WiFi library for ESP32.
#include <WiFiClient.h> // WiFi Client library for network
communication.
#define BLYNK_PRINT Serial
// Enables Blynk debugging messages via serial monitor.

const int relay = 33;


// Pin connected to the relay module to control the water pump.
char auth[] = "*";
// Placeholder for the Blynk authentication token.
char ssid[] = "momo"; // WiFi SSID.
char pass[] = "123456789"; // WiFi password.

// Constants and Variables for Water Flow Sensor


long currentMillis = 0; // Tracks the current time for flow sensor
calculations.
long previousMillis = 0; // Tracks the previous time for flow
sensor calculations.
int flowInterval = 1000; // Interval for calculating water flow rate
(1 second).
float calibrationFactor = 4.5; // Calibration factor for converting
pulses to flow rate.

2|Page
volatile byte pulseCount; // Tracks the pulse count from the
water flow sensor.
byte pulse1Sec = 0; // Stores the number of pulses in one second.
float flowRate; // Stores the calculated water flow rate.
unsigned int flowMilliLitres; // Stores the volume of water in
milliliters.
unsigned long totalMilliLitres; // Tracks the total volume of
water used.

// Constants for Turbidity Sensor


const int turbidityThreshold = 50; // Threshold for water
turbidity in NTU.

// Variables for Soil Moisture Sensor


int soilMoistureValue; // Stores the soil moisture reading.

// Function for Water Flow Sensor Interrupt


void IRAM_ATTR pulseCounter() {
pulseCount++;
// Increments the pulse count for every pulse detected by the flow
sensor.
}

3|Page
void setup() {
// Initialize Serial Communication
[Link](115200);
// Start serial communication at 115200 baud rate for debugging.
[Link](BLYNK_AUTH_TOKEN, ssid, pass,
"[Link]", 80);
// Connect to Blynk cloud server.

// Setup Water Flow Sensor


pinMode(LED_BUILTIN, OUTPUT); // Configure onboard
LED as output.
pinMode(WATER_FLOW_SENSOR_PIN,
INPUT_PULLUP);
// Set water flow sensor pin as input with pull-up.
pinMode(Buzzer, OUTPUT); // Configure buzzer pin as
output.
pulseCount = 0; // Initialize pulse count.
flowRate = 0.0; // Initialize flow rate.
flowMilliLitres = 0; // Initialize water volume.
totalMilliLitres = 0; // Initialize total water volume.
previousMillis = 0; // Reset previous time.

attachInterrupt(digitalPinToInterrupt(WATER_FLOW_SE

4|Page
NSOR_PIN), pulseCounter, FALLING); // Attach interrupt to
count pulses.

// Initialize sensors
[Link]("Initializing sensors...");
pinMode(relay, OUTPUT); // Configure relay pin as output.
}

void loop() {
[Link](); // Run Blynk for real-time monitoring.

// Handle Water Flow Sensor


currentMillis = millis();
if (currentMillis - previousMillis > flowInterval) {
pulse1Sec = pulseCount; // Capture pulse count for the
interval.
pulseCount = 0; // Reset pulse count.

flowRate = ((1000.0 / (millis() - previousMillis)) *


pulse1Sec) / calibrationFactor; // Calculate flow rate.
previousMillis = millis(); // Update previous time.

5|Page
flowMilliLitres = (flowRate / 60) * 1000; // Convert flow rate
to milliliters.
totalMilliLitres += flowMilliLitres;
// Accumulate total water volume.

// Debugging output for flow rate and volume


[Link]("Water Flow Rate: ");
[Link](int(flowRate)); // Integer part of flow rate.
[Link](" L/min\t");
[Link]("Total Volume: ");
[Link](totalMilliLitres);
[Link](" mL");
}

// Handle Turbidity Sensor


int turbidityValue =
analogRead(TURBIDITY_SENSOR_PIN);
// Read analog value from turbidity sensor.
turbidityValue = map(turbidityValue, 0, 4096, 100, 0);
// Map sensor value to NTU range.
[Link]("Turbidity Value: ");
[Link](turbidityValue);

6|Page
turbidityValue > turbidityThreshold ? digitalWrite(Buzzer,
HIGH) : digitalWrite(Buzzer, LOW);
// Activate buzzer if turbidity exceeds threshold.

// Handle Soil Moisture Sensor


soilMoistureValue =
analogRead(SOIL_MOISTURE_SENSOR_PIN);
// Read soil moisture value.
soilMoistureValue = map(soilMoistureValue, 0, 4096, 100,
0);
// Map soil moisture to percentage.
[Link]("\nThe Relay will go on or off.....\n");
if (soilMoistureValue <= 20) {
digitalWrite(relay, LOW); // Turn on relay to start pump.
} else {
digitalWrite(relay, HIGH); // Turn off relay to stop pump.
}
[Link]("Soil Moisture: ");
[Link](soilMoistureValue);
[Link]("%");

// Send data to Blynk app

7|Page
[Link](V0, soilMoistureValue); // Soil moisture
data.
[Link](V1, turbidityValue); // Turbidity data.
[Link](V2, flowRate); // Water flow rate data.

// Add delay to manage overall loop timing


[Link]();
[Link](soilMoistureValue);
[Link](",");
[Link](turbidityValue);
[Link](",");
[Link](flowRate);
[Link]();
delay(3000); // Wait for 3 seconds before the next loop iteration.
}

8|Page
Abstract
The Smart Irrigation System is a cutting-edge solution designed to optimize the use
of water in agriculture. With increasing global water scarcity and the need for more
sustainable farming practices, this project aims to provide an automated system for
irrigation that responds to the real-time conditions of the soil. The system utilizes
ESP32 microcontroller technology in combination with soil moisture, water flow,
and turbidity sensors to ensure that crops receive adequate water without over-
watering.
The project employs Blynk, a mobile app, to monitor and control the irrigation
system remotely. The system activates a water pump based on soil moisture levels,
which helps conserve water and improves overall farming efficiency. This project
not only addresses the challenge of water conservation but also demonstrates how
IoT (Internet of Things) technology can be applied to agriculture, enhancing
productivity while minimizing environmental impact.

Methods
The system consists of several key components and follows a structured approach
for its implementation:

1. ESP32 Microcontroller: The ESP32 serves as the central controller for the
system, managing sensor data, processing it, and sending commands to the
water pump.
2. Sensors:
o Soil Moisture Sensor: Measures the amount of moisture in the soil
and activate the water pump if the moisture reaches 20 % which is
dry.
o Water Flow Sensor: determine how much water is being used in
irrigation and check for blockage or any irregularities in flow.
o Turbidity Sensor: check water quality. If the turbidity reaches 50
NTU, the system triggers a buzzer to alert users about contamination.
3. Blynk Application: The Blynk app allows users to remotely monitor the
soil moisture levels, water flow, and turbidity in real-time. It also enables
manual control of the irrigation system and the water pump.
4. Water Pump: The water pump is triggered automatically when the soil
moisture drops below a preset threshold, activating the irrigation process.
5. System Integration: The sensors are connected to the ESP32, which
processes the sensor data and sends it to the Blynk app. The system is
9|Page
powered by a stable power source, and the components are connected using
appropriate wiring and communication protocols.

Results

10 | P a g e
Analysis

11 | P a g e
12 | P a g e
Recommendation
To enhance the Smart Irrigation System, several improvements can be made. First,
integrating weather forecasting data would help adjust irrigation based on rainfall,
temperature, and humidity, preventing overwatering. Advanced soil sensors can
improve moisture monitoring across different soil types for better precision.
Remote monitoring through mobile apps or web interfaces would give farmers
more flexibility to manage schedules and receive real-time alerts. To optimize
energy usage, adding solar panels could reduce costs and make the system more
sustainable. Additional sensors, like temperature and pH, could provide more
detailed insights into crop health and soil conditions. Using machine learning to
predict irrigation needs based on data would further improve water efficiency. A
filtration system would help protect both the sensors and plants by ensuring clean
water. Regular maintenance, updates, and offering training to farmers would also
increase adoption and ensure optimal performance.

Conclusion
our Smart Irrigation System met its objectives successfully. It automates irrigation,
saves water, and ensures clean water delivery to crops. The sensors worked
accurately, with soil moisture and water flow tests showing high reliability. The
system is affordable and scalable, making it ideal for farms in water-scarce areas.
By using this technology, we can improve crop health, conserve water, and
promote sustainable agriculture.

13 | P a g e

Common questions

Powered by AI

The Smart Irrigation System incorporates IoT technology by using an ESP32 microcontroller to manage data from multiple sensors, such as soil moisture, water flow, and turbidity sensors. This data is processed to automatically control a water pump based on real-time soil moisture levels, preventing over-watering and conserving water. Furthermore, the system employs the Blynk mobile app for remote monitoring and control, allowing farmers to adjust settings and observe irrigation status from a distance .

To ensure clean water delivery, the Smart Irrigation System uses a turbidity sensor to monitor water quality, triggering an alert if turbidity exceeds the threshold of 50 NTU. To prevent over-watering, the system includes a soil moisture sensor that activates the water pump only when moisture levels drop below 20%, indicating dry soil. These measures, coupled with real-time data processing and control through the Blynk app, help maintain optimal water use .

The Smart Irrigation System promotes sustainable farming by automating and optimizing water use, which conserves water and prevents wastage. It uses sensors to monitor soil moisture, water quality, and flow, reducing manual intervention and enhancing resource efficiency. Additionally, the system's integration with IoT technology via the Blynk app provides remote monitoring and control, furthering sustainability by minimizing environmental impact and improving agricultural productivity .

The Blynk application enhances the Smart Irrigation System's functionality by allowing users to remotely monitor real-time data concerning soil moisture, water flow, and turbidity. It provides a user-friendly interface for controlling the irrigation system and water pump, enabling manual adjustments and tracking system status from anywhere. This facilitates efficient water management and timely responses to irrigation needs, improving overall irrigation performance .

The ESP32 microcontroller acts as the central controller in the Smart Irrigation System. It manages sensor data by processing inputs from soil moisture, water flow, and turbidity sensors, then sends commands to the water pump based on this data. This facilitates automatic irrigation when soil moisture levels are low. The ESP32 also communicates with the Blynk app to provide real-time monitoring and control of the system, ensuring efficient water use and system management .

In water-scarce areas, the Smart Irrigation System addresses the challenge of water conservation by automating water management based on real-time soil moisture data. This minimizes water wastage by applying precise amounts of water only when needed. The system's IoT connectivity through the Blynk app allows effective monitoring and control, ensuring water is used efficiently while improving crop health. These approaches contribute to sustainable farming practices in regions where water resources are limited .

Proposed enhancements for the Smart Irrigation System include integrating weather forecasting data to adjust irrigation based on environmental factors, adding advanced soil sensors for more precise moisture monitoring, and incorporating additional sensors like temperature and pH to better understand crop health. The use of solar panels could optimize energy usage, and employing machine learning would further improve water efficiency by predicting irrigation needs. Regular maintenance, updates, and farmer training are also recommended to ensure optimal system performance .

Solar panel integration is recommended to optimize the Smart Irrigation System's energy usage by providing a renewable power source. This reduces dependency on conventional energy, lowers operational costs, and enhances the sustainability of the system. Solar power aligns with the project's goals of environmental impact minimization, making the system more viable for remote and off-grid locations .

The water flow sensor in the Smart Irrigation System measures the rate of water utilization during irrigation. It helps detect abnormalities like blockages or irregular flow patterns, ensuring that water is efficiently distributed. By providing feedback on water usage, this sensor aids in the optimization of irrigation schedules and resource management .

Integrating machine learning into the Smart Irrigation System could enhance performance by analyzing historical and real-time data to predict future irrigation needs, leading to more accurate water usage. It can identify patterns and optimize watering schedules based on soil and environmental conditions, further conserving water and improving crop yield. This adaptive approach enables the system to respond dynamically to varying conditions, thus maximizing efficiency .

You might also like