3  Capstone Project 2: Smart Agriculture System

capstone
projects

One of three capstone project briefs in this series – along with Capstone Project 1: Smart Environment Monitor and Capstone Project 3: Fleet Tracking System. The shared capstone approach (reviewable claims, the thin-slice method, and interface evidence) is introduced in Part 1; this part works through the Smart Agriculture System brief.

The second brief adds actuation. That changes the review question from “did the system observe correctly?” to “did the system act safely when soil, weather, water level, and schedule evidence disagreed?”

3.1 Capstone Project 2: Smart Agriculture System

Project Overview

Domain: Precision Agriculture / Smart Farming

Difficulty: Advanced

Duration: 6-8 weeks

Team Size: 2-3 people

3.1.1 Project Description

Build an automated plant care system that monitors soil conditions, environmental factors, and plant health, then automatically waters plants based on intelligent algorithms. The system should work both indoors (houseplants) and outdoors (garden), with solar power capability for remote deployment.

3.1.2 Project Context

Smart irrigation projects show how IoT can reduce manual monitoring, improve watering consistency, and make resource use visible. Your system should demonstrate closed-loop sensing and actuation while still protecting plants from unsafe automated decisions.

3.1.3 Requirements Specification

3.1.3.1 Functional Requirements

ID Requirement Priority
F1 Measure soil moisture at multiple depths Must Have
F2 Measure soil temperature Must Have
F3 Measure ambient temperature and humidity Must Have
F4 Control water pump/valve Must Have
F5 Implement watering schedules Must Have
F6 Smart watering based on soil moisture Must Have
F7 Measure light levels (PAR for plants) Should Have
F8 Detect water tank level Should Have
F9 Weather forecast integration Should Have
F10 Multi-zone support (different plants) Could Have
F11 Camera for visual monitoring Could Have
F12 Plant health ML classification Could Have

3.1.3.2 Non-Functional Requirements

ID Requirement Target
NF1 Solar-powered operation 3+ days without sun
NF2 Watering accuracy ±10% of target volume
NF3 LPWAN range > 500m (LoRa)
NF4 Water savings vs. manual > 30%
NF5 System cost < $150

3.1.5 System Architecture

Layer Responsibilities Typical Components
Field node Sense soil and weather conditions, decide whether local actuation is safe, and drive the pump or valve through a relay. ESP32, soil moisture sensors, soil temperature sensor, pump relay, battery, charge controller
Gateway Bridge long-range field traffic to the internet when Wi-Fi is not available at the planting area. LoRa receiver, Raspberry Pi or ESP32 gateway, Wi-Fi or Ethernet uplink
Cloud services Store readings, combine weather forecasts with local readings, and generate commands or alerts. Weather API, decision engine, database, dashboard, notification service
Operator interface Let the learner monitor moisture history, override watering, and inspect system health. Web dashboard, alert rules, device status panel

Data and command flow:

  1. Field node samples soil moisture, soil temperature, water level, and ambient conditions.
  2. Node publishes readings over LoRa or Wi-Fi.
  3. Gateway or cloud service stores readings and evaluates watering rules.
  4. Safe watering commands return to the node, where local firmware checks final safety constraints before actuating the pump.

3.1.6 Smart Watering Algorithm

def should_water(soil_moisture, weather_forecast, last_watered):
    """
    Intelligent watering decision algorithm.

    Args:
        soil_moisture: Current soil moisture (0-100%)
        weather_forecast: Dict with rain_probability, temp
        last_watered: Datetime of last watering

    Returns:
        (should_water: bool, duration_seconds: int)
    """

    # Define thresholds (plant-specific)
    DRY_THRESHOLD = 30      # Water if below this
    WET_THRESHOLD = 70      # Never water above this
    RAIN_THRESHOLD = 60     # Don't water if rain likely
    MIN_INTERVAL_HOURS = 6  # Minimum time between watering

    # Check if too soon since last watering
    hours_since = (datetime.now() - last_watered).total_seconds() / 3600
    if hours_since < MIN_INTERVAL_HOURS:
        return (False, 0)

    # Check if rain is expected
    if weather_forecast['rain_probability'] > RAIN_THRESHOLD:
        return (False, 0)  # Let nature do the work

    # Check soil moisture
    if soil_moisture > WET_THRESHOLD:
        return (False, 0)  # Already wet enough

    if soil_moisture < DRY_THRESHOLD:
        # Calculate watering duration based on how dry
        deficit = DRY_THRESHOLD - soil_moisture
        duration = min(deficit * 2, 60)  # Max 60 seconds
        return (True, duration)

    return (False, 0)
Knowledge Check: Smart Watering Algorithm

3.1.7 Implementation Milestones

3.1.7.1 Week 1-2: Sensor Integration

3.1.7.2 Week 3-4: Actuation & Control

3.1.7.3 Week 5-6: Connectivity & Power

Knowledge Check: Connectivity Protocol Selection

3.1.7.4 Week 7-8: Intelligence & Dashboard

3.1.8 Evaluation Rubric

Criteria Points Description
Sensor Integration 20 Accurate, calibrated, reliable
Watering Control 20 Precise, safe, effective
Power Management 15 Solar-capable, efficient
Connectivity 15 Long-range, reliable
Algorithm 15 Smart decisions, water savings
Documentation 15 Complete, reproducible
Total 100

SammyCheckpoint: Smart Agriculture

You now know:

  • The must-have path measures soil moisture, soil temperature, ambient temperature and humidity, schedule state, smart watering, and pump or valve control.
  • The safety logic includes dry and wet thresholds, a rain threshold, and a 6-hour minimum interval so one bad reading cannot drive repeated watering.
  • The evidence package should cover calibration, relay behavior, LoRa or Wi-Fi choice, solar margin for 3+ days without sun, and outdoor credential protection.

Knowledge Check: Security for Outdoor Deployments

Scenario: Student team with $120 budget wants to build a complete smart agriculture system (sensors + actuators + connectivity + cloud + dashboard). How to maximize functionality within budget?

Initial wishlist (exceeds budget): - ESP32 ($8) + LoRa module ($15) = $23 - 3x soil moisture sensors ($8 each) = $24 - Soil temperature sensor ($5) - Water pump + relay ($12) - Solar panel 5W ($18) + battery + BMS ($15) = $33 - Total: $97 … still need enclosure, wiring, cloud costs

Budget optimization:

Component Expensive Option Budget Alternative Savings
Connectivity LoRa module $15 Wi-Fi only (use ESP32 built-in) $15
Soil sensors 3x capacitive $24 2x capacitive $16 $8
Solar system 5W panel + BMS $33 USB power bank ($12) + charge at night $21
Enclosure IP65 waterproof $15 Plastic food container + silicone ($4) $11
Cloud AWS IoT $5/mo ThingsBoard free tier $5/mo

Final BOM ($98):

  • ESP32 development board: $8
  • 2x capacitive soil moisture sensors: $16
  • DS18B20 waterproof temperature sensor: $5
  • 12V water pump: $8
  • 5V relay module: $3
  • 10,000mAh USB power bank: $12
  • DHT22 (air temp/humidity): $6
  • Jumper wires, connectors: $8
  • DIY enclosure (food container + silicone): $4
  • Tubing, fittings: $8
  • Micro-USB cable: $3
  • Breadboard for prototyping: $5
  • Total: $98 (under budget!)

Trade-offs made:

  1. Wi-Fi instead of LoRa: Requires router within 50m, but saves $15
  2. 2 zones instead of 3: Still demonstrates multi-zone concept
  3. USB power bank instead of solar: Manual charging, but reliable
  4. DIY enclosure: Not IP65 rated, but adequate for protected outdoor location

Project scope adjusted:

Included in the first working version:

  • Soil moisture monitoring for two zones
  • Threshold-based automated watering
  • Environmental monitoring for temperature and humidity
  • Cloud dashboard with historical data
  • Manual override through a web interface

Deferred until the core version is stable:

  • Solar power; use USB charging first
  • LoRaWAN; use Wi-Fi first
  • Weather API integration; keep as a later enhancement

Key insight: Budget constraints force prioritization. The team identified must-have features for monitoring, control, and cloud visibility, then deferred solar, LoRa, and weather integration. The result is a functional system within budget.

3.2 Within This Series

Direction Chapter Topic
Previous Capstone Project 1: Smart Environment Monitor Indoor air-quality and comfort monitoring
Current Capstone Project 2: Smart Agriculture System Soil sensing and automated watering
Next Capstone Project 3: Fleet Tracking System GPS, cellular, and geofencing