← Back to list

Smart Agriculture System Using IoT: ESP32 Project with Source Code, Circuit, Report & PPT

Smart Agriculture System Using IoT: ESP32 Project with Source Code, Circuit, Report & PPT

Filemakr · 2026-05-12 14:15 · 0 claps · 7.5 min read
#source-code #report #ppt
Open on Medium ↗
Wiki topics: CUL · Culture & Media 📟 · Gadgets & IoT

Smart Agriculture System Using IoT: ESP32 Project with Source Code, Circuit, Report & PPT

Smart Agriculture System Using IoT: ESP32 Project with Source Code, Circuit, Report & PPT

Subtitle: A complete final-year project guide to building a Smart Agriculture System using IoT, ESP32, sensors, dashboard, automatic irrigation, database logging, report format, PPT structure, and viva-ready explanation.

Introduction: A Final-Year IoT Project That Actually Solves a Real Problem

Need a final-year project that looks impressive in demo, is easy to explain in viva, and includes hardware, software, dashboard, database, automation, report, and PPT?

A Smart Agriculture System using IoT is one of the strongest project ideas because it connects real farming problems with practical engineering skills. Instead of manually checking soil condition, water availability, and temperature, the system uses sensors and a microcontroller to collect field data and automate irrigation decisions.

For example, when soil moisture drops below a safe level, the ESP32 can turn the water pump ON through a relay. When moisture reaches the required level, the pump turns OFF. If the water tank is low or rain is detected, the system can stop irrigation and send an alert.

This makes the project more than a basic sensor demo. It becomes a complete IoT-based smart farming system with monitoring, automation, cloud storage, dashboard visualization, and optional AI/ML features.

Quick Answer: What Is a Smart Agriculture System?

A Smart Agriculture System is an IoT-based farming solution that uses sensors, controllers, cloud storage, dashboards, and automation logic to monitor soil and environmental conditions and improve irrigation decisions.

For students, a complete version usually includes:

Layer

What It Does

Sensor layer

Reads soil moisture, temperature, humidity, rain, and water level

Controller layer

Uses ESP32, NodeMCU, Arduino, or Raspberry Pi to process data

Database layer

Stores live and historical readings in Firebase, MySQL, or ThingSpeak

Dashboard layer

Shows readings, pump status, charts, alerts, and logs

Automation layer

Controls irrigation based on threshold logic

AI/ML layer

Adds crop recommendation, pest detection, or yield prediction

Project at a Glance

Item

Recommended Choice

Project type

IoT + Automation + Dashboard

Best controller

ESP32

Difficulty

Beginner to intermediate

Core sensors

Soil moisture, DHT11/DHT22, water-level, rain sensor

Output

Automatic irrigation + live dashboard

Database

Firebase or MySQL

Best for

B.Tech, BE, BCA, MCA, BSc IT, MSc IT

Advanced add-ons

MQTT, LoRa, weather API, crop recommendation, pest detection

Submission assets

Source code, report, PPT, circuit diagram, viva questions

Why Smart Agriculture Matters

Smart agriculture is not just a college-project trend. Agriculture is moving toward data-driven decision-making through IoT, satellite data, AI, dashboards, and advisory systems.

India’s Krishi-DSS is an example of this shift because it provides access to agriculture-related data such as satellite imagery, weather, reservoir storage, groundwater levels, and soil-health information. The National Pest Surveillance System also uses AI and ML for early pest and disease detection, and PIB reported that it supports 66 crops and more than 432 pest species as of December 2025.

For a final-year project, this gives your Smart Agriculture System strong real-world relevance.

Main Problem Solved by the Project

Traditional farming often depends on manual observation. A farmer checks the soil, estimates whether irrigation is needed, and reacts only after a problem appears.

A smart agriculture project solves four common problems:

  • Over-irrigation: Water is wasted even when soil moisture is sufficient.
  • Under-irrigation: Crops do not receive water at the right time.
  • Manual monitoring: Farmers must physically inspect fields.
  • Delayed decisions: Temperature, humidity, water-level, or pest issues are noticed late.

The system reduces manual effort by collecting real-time data and taking automatic action.

Components Required for Smart Agriculture System Using IoT

Component

Purpose

ESP32 / NodeMCU

Reads sensors and sends data online

Soil moisture sensor

Detects soil dryness

DHT11 / DHT22

Measures temperature and humidity

Relay module

Switches pump ON/OFF

Mini water pump

Supplies water in demo model

Water-level sensor

Prevents dry pump operation

Rain sensor

Skips irrigation during rainfall

Firebase / MySQL / ThingSpeak

Stores sensor readings

Web dashboard / Blynk app

Displays real-time data and alerts

For most students, ESP32 + Firebase/MySQL + web dashboard is the best stack. ESP32 has built-in Wi-Fi, enough GPIO pins, and strong support for IoT projects.

ESP32 Circuit Diagram and Pin Connection Plan

Add a real circuit diagram image in the published version. Until then, use this connection plan:

Module

ESP32 Pin Type

Purpose

Soil moisture sensor

Analog GPIO

Reads soil moisture level

DHT11/DHT22

Digital GPIO

Reads temperature and humidity

Water-level sensor

Analog/digital GPIO

Detects low tank level

Rain sensor

Digital GPIO

Detects rainfall

Relay module

Digital GPIO

Controls water pump

Pump

External power via relay

Irrigation output

Important: Do not connect the pump directly to ESP32. Use a relay module and a separate power supply to protect the board.

Smart Agriculture System Architecture

A professional Smart Agriculture System has four layers:

1. Sensor Layer

This layer collects field data using soil moisture, temperature, humidity, rain, pH, NPK, water-level, and light sensors.

2. Controller Layer

The ESP32 reads sensor values, applies threshold logic, controls the relay, and sends data to the cloud.

3. Cloud / Database Layer

Firebase is useful for real-time sync. MySQL is better when building a PHP, Python Flask, or Node.js dashboard. ThingSpeak is a beginner-friendly IoT analytics option.

4. Application Layer

The dashboard displays soil moisture, temperature, humidity, pump status, alerts, historical charts, and irrigation logs.

Working Flow of the System

The basic algorithm is simple:

  1. Start the ESP32.
  2. Connect to Wi-Fi.
  3. Read soil moisture, temperature, humidity, rain, and water level.
  4. Convert raw sensor values into readable units.
  5. Compare moisture with the threshold.
  6. Turn pump ON if soil is dry.
  7. Turn pump OFF if soil is wet, tank is low, or rain is detected.
  8. Upload readings to Firebase/MySQL.
  9. Display live data on the dashboard.
  10. Store alerts and irrigation logs.

Example automation logic:

Condition

Action

Moisture below 35%

Pump ON

Moisture between 35% and 60%

Monitor

Moisture above 60%

Pump OFF

Water tank low

Pump OFF + alert

Rain detected

Skip irrigation

Source Code Flow

You do not need to publish the full source code on Medium. Instead, show the logic clearly and link to the full FileMakr source-code package.

Basic code flow:

setup() connect_wifi() initialize_sensors() initialize_database() set_relay_pin_output()

loop() read_soil_moisture() read_temperature_humidity() read_water_level() read_rain_status()

if water_level_low: pump_off() create_alert(“Low water level”) else if rain_detected: pump_off() create_alert(“Rain detected”) else if moisture < threshold: pump_on() else: pump_off()

upload_data_to_database() update_dashboard() delay()

This explains the project clearly during viva because it shows input, processing, decision-making, output, and storage.

Database Design for Dashboard and Reports

A good final-year project should store historical data, not just show live values.

Table

Important Fields

users

user_id, name, email, password, role

sensor_readings

id, moisture, temperature, humidity, water_level, rain_status, created_at

irrigation_logs

id, pump_status, moisture_value, action_time

alerts

id, alert_type, message, status, created_at

crops

crop_id, crop_name, ideal_moisture, ideal_temp

This database structure helps you generate charts, reports, testing proof, and admin controls.

Dashboard Features to Include

A strong dashboard should include:

  • Live soil moisture percentage
  • Temperature and humidity cards
  • Pump ON/OFF status
  • Manual pump override
  • Daily moisture trend chart
  • Alert panel
  • Admin threshold settings
  • Irrigation history
  • Exportable report data

For a better project, add role-based login. A farmer can view readings and control irrigation, while an admin can manage users, thresholds, crops, and reports.

Cost Estimation

Version

Includes

Estimated Cost Level

Basic demo

ESP32, soil moisture, relay, pump

Low

Intermediate

DHT22, water-level, rain sensor, dashboard

Medium

Advanced

LoRa, pH/NPK sensor, weather API, AI module

Higher

Use the basic version first. Add advanced modules only after the core irrigation system works.

Implementation Guide

Step 1: Define the Scope

Start with automatic irrigation using soil moisture. Avoid adding AI/ML before the basic system is stable.

Step 2: Test Sensors Separately

Test soil moisture, DHT11/DHT22, rain, and water-level sensors one by one. This prevents debugging confusion.

Step 3: Calibrate Soil Moisture

Record raw values in dry soil and wet soil.

Soil Condition

Example Raw Reading

Dashboard Value

Dry soil

3200

10%

Medium soil

2100

45%

Wet soil

1200

80%

Without calibration, the pump may turn on or off at the wrong time.

Step 4: Add Relay and Pump Control

Use relay-based switching. Keep pump power separate from ESP32 power.

Step 5: Connect Firebase or MySQL

Store every reading with a timestamp. This supports charts, logs, and project-report screenshots.

Step 6: Build the Dashboard

Show live readings, pump status, alerts, and history. Keep the UI simple enough to explain in viva.

Advanced Features to Make the Project Stand Out

MQTT Communication

MQTT is lightweight and useful for IoT devices. Use topics like:

farm/field1/moisture farm/field1/pump farm/field1/alerts

Weather API Integration

Use OpenWeatherMap or a similar API to delay irrigation if rain is predicted.

Crop-Specific Thresholds

Different crops need different moisture levels. Add a crop table and let the user select crop type.

LoRa for Large Fields

Wi-Fi is fine for demos. LoRa is better for long-range field nodes where Wi-Fi coverage is weak.

AI/ML Add-ons

Machine learning can support crop recommendation, yield prediction, plant disease detection, and pest classification.

Report, PPT and Viva Preparation

Your project report should include:

  • Abstract
  • Problem statement
  • Objectives
  • Existing system
  • Proposed system
  • Architecture diagram
  • Circuit diagram
  • Components
  • Database design
  • Source-code flow
  • Implementation screenshots
  • Testing table
  • Advantages and limitations
  • Conclusion
  • Future scope

PPT slides should follow this order:

  1. Title
  2. Problem statement
  3. Objectives
  4. System architecture
  5. Components
  6. Circuit diagram
  7. Dashboard screenshots
  8. Working flow
  9. Testing results
  10. Conclusion and future scope

FAQs

1. What is a Smart Agriculture System?

A Smart Agriculture System is an IoT-based farming system that monitors soil and environmental conditions using sensors and automates irrigation or crop-management decisions.

2. Is Smart Agriculture a good final-year project?

Yes. It combines IoT, sensors, microcontrollers, database, dashboard, automation, and optional AI/ML features, making it suitable for technical demonstration and viva.

3. Which controller is best for this project?

ESP32 is usually the best choice because it has built-in Wi-Fi, multiple GPIO pins, and strong support for IoT dashboards.

4. Can I build it using Arduino?

Yes, but Arduino Uno needs an extra Wi-Fi or GSM module for online monitoring. ESP32 is easier for cloud-connected projects.

5. What sensors are used?

Common sensors include soil moisture, DHT11/DHT22, water-level, rain, pH, NPK, light, and optional DS18B20 soil-temperature sensor.

6. Can this project work without machine learning?

Yes. A rule-based IoT system with threshold-based irrigation is enough for a strong basic final-year project.

7. What should the dashboard show?

It should show soil moisture, temperature, humidity, pump status, alerts, daily trends, and irrigation logs.

8. Can I include source code, report, and PPT?

Yes. A complete academic submission should include controller code, backend/dashboard code, database schema, report, PPT, circuit diagram, screenshots, and viva questions.

Conclusion

A Smart Agriculture System using IoT is a strong final-year project because it solves a real problem while demonstrating hardware, software, automation, database, and dashboard skills.

Start with the core version: ESP32, soil moisture sensor, relay-controlled pump, Firebase/MySQL storage, and live dashboard. Then add advanced features such as weather API, MQTT, LoRa, crop-specific thresholds, pest detection, and AI-based recommendations.

The goal is not just to build a circuit. The goal is to explain a complete system: problem, architecture, components, code flow, automation logic, database, dashboard, testing, limitations, and future scope.

That is what turns a basic IoT demo into a high-scoring final-year project.


메타데이터
post_id
b4535a8b5e20
slug
smart-agriculture-system-using-iot-esp32-project-with-source-code-circuit-report-ppt-b4535a8b5e20
url
https://medium.com/@filemakr/smart-agriculture-system-using-iot-esp32-project-with-source-code-circuit-report-ppt-b4535a8b5e20
canonical_url
https://medium.com/@filemakr/smart-agriculture-system-using-iot-esp32-project-with-source-code-circuit-report-ppt-b4535a8b5e20
author_url
https://medium.com/@filemakr
status
ok
fetched_at
2026-06-13 00:08:42