Chapters

4 Capstone Projects: Agriculture and Environment

capstone
projects

4.1 Start With the Decision

A field node and an indoor monitor may share sensors but face different power, weather, and network limits. Each project brief must turn those limits into testable evidence.

4.2 Route Overview

This is part 3 of 3. Review Capstone Projects: Selection and Fleet Tracking for the preceding evidence.

4.3 Learning Objectives

  • Design agriculture and environment-monitoring project evidence.
  • Define power, connectivity, calibration, and acceptance checks.

4.4 Chapter Roadmap

  • Capstone Project 2: Smart Agriculture System
  • Capstone Project 1: Smart Environment Monitor
  • What’s Next
  • Navigation
  • Summary
  • Key Takeaway

4.5 Capstone Project 2: Smart Agriculture System

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 on the Capstone Projects hub; 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?”

4.5.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

4.5.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.

4.5.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.

4.5.1.3 Requirements Specification

4.5.1.3.1 Functional Requirements
IDRequirementPriority
F1Measure soil moisture at multiple depthsMust Have
F2Measure soil temperatureMust Have
F3Measure ambient temperature and humidityMust Have
F4Control water pump/valveMust Have
F5Implement watering schedulesMust Have
F6Smart watering based on soil moistureMust Have
F7Measure light levels (PAR for plants)Should Have
F8Detect water tank levelShould Have
F9Weather forecast integrationShould Have
F10Multi-zone support (different plants)Could Have
F11Camera for visual monitoringCould Have
F12Plant health ML classificationCould Have
4.5.1.3.2 Non-Functional Requirements
IDRequirementTarget
NF1Solar-powered operation3+ days without sun
NF2Watering accuracy±10% of target volume
NF3LPWAN range> 500m (LoRa)
NF4Water savings vs. manual> 30%
NF5System cost< $150

Knowledge Check: Soil Moisture Sensor Selection

4.5.1.5 System Architecture

LayerResponsibilitiesTypical Components
Field nodeSense 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
GatewayBridge 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 servicesStore readings, combine weather forecasts with local readings, and generate commands or alerts.Weather API, decision engine, database, dashboard, notification service
Operator interfaceLet the learner monitor moisture history, override watering, and inspect system health.Web dashboard, alert rules, device status panel

Data and command flow:

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

4.5.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

4.5.1.7 Implementation Milestones

4.5.1.7.1 Week 1-2: Sensor Integration
  • Soil moisture sensor calibration (dry/water/soil)
  • Temperature sensor integration
  • Basic data logging to serial
4.5.1.7.2 Week 3-4: Actuation & Control
  • Pump/valve control with relay
  • Basic watering schedule
  • Water level monitoring
4.5.1.7.3 Week 5-6: Connectivity & Power
  • LoRa or Wi-Fi connectivity
  • Solar power system
  • Battery management

Knowledge Check: Connectivity Protocol Selection

4.5.1.7.4 Week 7-8: Intelligence & Dashboard
  • Weather API integration
  • Smart watering algorithm
  • Dashboard with plant profiles
  • Documentation and testing

4.5.1.8 Evaluation Rubric

Read the rubric as a single field-deployment argument. Calibrated sensors establish the evidence, watering control acts on it, power and connectivity keep the loop available outdoors, the algorithm explains when action is permitted, and documentation preserves calibration, safety, and recovery steps. No category can compensate for an unsafe or unreviewable control path.

CriteriaPointsDescription
Sensor Integration20Accurate, calibrated, reliable
Watering Control20Precise, safe, effective
Power Management15Solar-capable, efficient
Connectivity15Long-range, reliable
Algorithm15Smart decisions, water savings
Documentation15Complete, reproducible
Total100

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. Those readings and actions must share a traceable zone and time context.

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. Test the inhibit path as carefully as the watering path.

The evidence package should cover calibration, relay behavior, LoRa or Wi-Fi choice, solar margin for 3+ days without sun, and outdoor credential protection. Together those records make the field claim reproducible.

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:

ComponentExpensive OptionBudget AlternativeSavings
ConnectivityLoRa module $15Wi-Fi only (use ESP32 built-in)$15
Soil sensors3x capacitive $242x capacitive $16$8
Solar system5W panel + BMS $33USB power bank ($12) + charge at night$21
EnclosureIP65 waterproof $15Plastic food container + silicone ($4)$11
CloudAWS IoT $5/moThingsBoard 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.

4.5.2 Within This Series

DirectionChapterTopic
PreviousCapstone Project 1: Smart Environment MonitorIndoor air-quality and comfort monitoring
CurrentCapstone Project 2: Smart Agriculture SystemSoil sensing and automated watering
NextCapstone Project 3: Fleet Tracking SystemGPS, cellular, and geofencing

4.6 Capstone Project 1: Smart Environment Monitor

One of three capstone project briefs in this series — along with Capstone Project 2: Smart Agriculture System and Capstone Project 3: Fleet Tracking System. The shared capstone approach — turning a project idea into a reviewable claim, protecting a thin sensor-to-decision slice, and treating interfaces as evidence — plus the submission guidelines and project-selection framework are on the Capstone Projects hub. The first brief keeps the system relatively contained: indoor sensing, Wi-Fi/MQTT delivery, cloud storage, and a dashboard that makes room conditions visible.

4.6.1 Within This Series

Build the Claim Before the Dashboard

Telemetry is a time-linked record from a device. Message Queuing Telemetry Transport (MQTT) is a lightweight method for sending named data streams through a message service. Picture a classroom monitor that tracks heat, damp air, and air quality. A bright chart is easy to build, but it can hide an unplugged sensor or a value with the wrong units.

Write the user decision first. Name what will be sensed, how often, in which units, and which limit should cause a warning. Keep device identity, time, quality, and software version with each record. Give local safe action a path that does not depend on the remote screen.

Test a normal day, a bad reading, a missing sensor, a lost link, a restart, and a changed warning limit. Check what the room user sees and what evidence the project owner can review later.

A student build is not a certified safety system. The deeper sections guide design, parts, data flow, tests, and review so the final project states what it proved and what remains outside scope.

DirectionChapterTopic
CurrentCapstone Project 1: Smart Environment MonitorIndoor air-quality and comfort monitoring
NextCapstone Project 2: Smart Agriculture SystemSoil sensing and automated watering
Also in this seriesCapstone Project 3: Fleet Tracking SystemGPS, cellular, and geofencing

4.6.2 Capstone Project 1: Smart Environment Monitor

Project Overview

Domain: Environmental Monitoring / Smart Building

Difficulty: Intermediate

Duration: 4-6 weeks

Team Size: 1-2 people

4.6.2.1 Project Description

Design and build a comprehensive indoor environment monitoring system that tracks air quality, temperature, humidity, light levels, and noise. The system should provide real-time dashboards, historical analytics, and automated alerts when conditions exceed healthy thresholds.

4.6.2.2 Project Context

Indoor environment monitoring helps facility teams spot poor ventilation, comfort problems, and air-quality trends before they become persistent operational issues. Your system should turn raw sensor readings into clear dashboard signals and actionable alerts.

4.6.2.3 Requirements Specification

4.6.2.3.1 Functional Requirements
IDRequirementPriority
F1Measure temperature (±0.5°C accuracy)Must Have
F2Measure relative humidity (±3% accuracy)Must Have
F3Measure CO2 levels (±50 ppm accuracy)Must Have
F4Measure particulate matter (PM2.5)Should Have
F5Measure ambient light (lux)Should Have
F6Measure noise level (dB)Could Have
F7Display real-time readings on local screenMust Have
F8Send data to cloud every 5 minutesMust Have
F9Send alerts when thresholds exceededMust Have
F10Provide historical data visualizationMust Have
F11Calculate and display air quality indexShould Have
F12Support multiple sensor nodesCould Have
4.6.2.3.2 Non-Functional Requirements
IDRequirementTarget
NF1Battery life (if portable)> 7 days
NF2Data transmission reliability> 99%
NF3Sensor reading latency< 2 seconds
NF4System uptime> 99.5%
NF5Data storage retention1 year
NF6Total hardware cost< $100

Knowledge Check: Hardware Selection for Environment Monitoring

4.6.2.5 Architecture Design

LayerResponsibilitiesTypical Components
Sensor nodeSample indoor environment signals and show local readings.ESP32, BME280 or SHT31, CO2 sensor, PM2.5 sensor, BH1750 light sensor, sound-level sensor, OLED display
FirmwareSchedule readings, validate sensor ranges, calculate simple air-quality status, and publish telemetry.Sensor drivers, calibration constants, MQTT client, retry queue
Cloud pipelineReceive telemetry, store time-series data, and evaluate alert thresholds.MQTT broker, time-series database, alert worker
DashboardShow current conditions, historical trends, and alert history for facility review.Grafana or web dashboard, room cards, threshold panels

Data flow:

Step 1 — Sensors provide temperature, humidity, CO2, particulate, light, and noise readings. Step 2 — ESP32 validates and publishes readings over Wi-Fi using MQTT. Step 3 — Cloud services store time-series data and evaluate alert thresholds. Step 4 — Dashboard presents current status, trends, and alerts for facility staff.

4.6.2.6 Implementation Milestones

4.6.2.6.1 Week 1-2: Hardware Assembly & Basic Firmware

Deliverables:

  • Assembled sensor node on breadboard
  • Basic firmware reading all sensors
  • Serial output of sensor values
  • Local OLED display working

Code Checkpoint:

// Milestone 1: Basic sensor reading
void loop() {
    float temp = readTemperature();
    float humidity = readHumidity();
    int co2 = readCO2();
    float pm25 = readPM25();

    Serial.printf("T:%.1f H:%.1f CO2:%d PM2.5:%.1f\n",
                  temp, humidity, co2, pm25);
    displayOnOLED(temp, humidity, co2, pm25);
    delay(5000);
}
4.6.2.6.2 Week 3-4: Connectivity & Cloud Integration

Deliverables:

  • Wi-Fi connectivity with reconnection handling
  • MQTT publishing to broker
  • Cloud database storing data
  • Basic Grafana dashboard

MQTT Topic Structure:

environment/
  +-- {device_id}/
  |   +-- temperature
  |   +-- humidity
  |   +-- co2
  |   +-- pm25
  |   +-- light
  |   +-- status
  +-- alerts/
      +-- {device_id}

Knowledge Check: MQTT Topic Design

4.6.2.6.3 Week 5-6: Analytics, Alerts & Polish

Deliverables:

  • Alert rules configured (email/SMS)
  • Historical trend analysis
  • Air quality index calculation
  • Enclosure design/assembly
  • Documentation complete

4.6.2.7 Evaluation Rubric

CriteriaPointsExcellentGoodNeeds Work
Hardware Assembly20Clean, reliable, documentedWorking but messyIntermittent issues
Sensor Accuracy15Within specsClose to specsUnreliable
Cloud Integration20Full pipeline, reliableBasic connectivityData loss issues
Dashboard/Visualization15Professional, insightfulFunctionalBasic
Alerts10Configurable, reliableWorkingMissing
Code Quality10Well-structured, commentedReadableSpaghetti
Documentation10Complete, professionalAdequateMinimal
Total100

4.6.2.8 Extension Ideas

Treat each extension as a new contract, not a decorative extra. Voice alerts add accessibility and notification-state questions; occupancy learning adds training and validation evidence; a mobile client adds authentication and stale-state handling; multiple rooms add routing and mesh reliability; and building-management integration adds an authority boundary that must fail safely.

Add voice alerts via speaker Implement machine learning for occupancy detection Create mobile app for monitoring Add multiple rooms with mesh networking Integrate with building management systems

SammyCheckpoint: Environment Monitor

You now know:

  • The must-have path measures temperature, humidity, CO2, local display state, cloud data every 5 minutes, alerts, and historical visualization.
  • The portable power target is more than 7 days; the worked battery arithmetic is a best-case screen until the full active trace, retries, conversion losses, and battery sag are measured.
  • The review evidence should connect sensor accuracy, MQTT topic design, InfluxDB retention/downsampling, dashboard state, and alert behavior.

Knowledge Check: Data Storage Strategy

4.6.3 Within This Series

DirectionChapterTopic
CurrentCapstone Project 1: Smart Environment MonitorIndoor air-quality and comfort monitoring
NextCapstone Project 2: Smart Agriculture SystemSoil sensing and automated watering
Also in this seriesCapstone Project 3: Fleet Tracking SystemGPS, cellular, and geofencing

4.7 What’s Next

If you want to…Read this
Look up technical terms encountered during project workIoT Glossary A-F
Review mathematical foundations for sensor calculationsMathematical Foundations
Apply visual style standards to project diagrams and documentationReference Appendix
Access reference templates and supplementary materialsAppendix
Revisit data storage architectures for your project’s backendData Storage and Databases

4.9 Summary

Capstone projects bring the course together by asking students to define a real IoT problem, select sensors and actuators, design connectivity, handle data, secure the system, and evaluate whether the result meets user and operational requirements.

4.10 Key Takeaway

A strong capstone is judged by the complete system argument: problem, stakeholders, architecture, data flow, security, validation, and trade-offs. The prototype matters, but the engineering justification matters just as much.


This hub covers the shared capstone approach, submission guidelines, and project-selection framework. Build the project itself in Capstone Project 1: Smart Environment Monitor, Capstone Project 2: Smart Agriculture System, or Capstone Project 3: Fleet Tracking System.

4.11 Continue Your Route

This final part closes the route from Capstone Project 2: Smart Agriculture System through Key Takeaway. Return to Capstone Projects: Selection and Fleet Tracking or continue from the capstone module index.