4 Capstone Projects: Agriculture and Environment
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
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
| 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 |
4.5.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 |
4.5.1.4 Recommended Hardware
| Component | Options | Est. Cost |
|---|---|---|
| Microcontroller | ESP32, Arduino + LoRa | $10-20 |
| Soil Moisture | Capacitive (not resistive!) | $3-8 each |
| Soil Temperature | DS18B20 waterproof | $3-5 |
| Water Pump | 12V submersible, 3-5L/min | $8-15 |
| Relay Module | 1-4 channel, 5V/12V | $3-5 |
| Solar Panel | 6V 3W or 12V 5W | $10-20 |
| Battery | 18650 Li-ion with BMS | $10-15 |
| Water Sensor | HC-SR04 ultrasonic | $2-5 |
| Enclosure | IP65 waterproof box | $10-15 |
Solar power sizing requires matching daily energy consumption with panel output. ESP32 + LoRa transmits once/hour (30s active at 200mA, rest at 5mA sleep).
Daily energy budget:
Solar panel output (5W at 5 hours equivalent sun):
Panel produces 48x more than needed. With 80% charging efficiency, we get 20Wh/day, enough to run the system and charge a 18650 battery with about 11Wh capacity in roughly half a day, leaving margin for cloudy days.
4.5.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:
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)
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
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.
| 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 |
Checkpoint: 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.
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:
- Wi-Fi instead of LoRa: Requires router within 50m, but saves $15
- 2 zones instead of 3: Still demonstrates multi-zone concept
- USB power bank instead of solar: Manual charging, but reliable
- 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
| 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 |
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.
| Direction | Chapter | Topic |
|---|---|---|
| Current | Capstone Project 1: Smart Environment Monitor | Indoor air-quality and comfort monitoring |
| Next | Capstone Project 2: Smart Agriculture System | Soil sensing and automated watering |
| Also in this series | Capstone Project 3: Fleet Tracking System | GPS, cellular, and geofencing |
4.6.2 Capstone Project 1: Smart Environment Monitor
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
| ID | Requirement | Priority |
|---|---|---|
| F1 | Measure temperature (±0.5°C accuracy) | Must Have |
| F2 | Measure relative humidity (±3% accuracy) | Must Have |
| F3 | Measure CO2 levels (±50 ppm accuracy) | Must Have |
| F4 | Measure particulate matter (PM2.5) | Should Have |
| F5 | Measure ambient light (lux) | Should Have |
| F6 | Measure noise level (dB) | Could Have |
| F7 | Display real-time readings on local screen | Must Have |
| F8 | Send data to cloud every 5 minutes | Must Have |
| F9 | Send alerts when thresholds exceeded | Must Have |
| F10 | Provide historical data visualization | Must Have |
| F11 | Calculate and display air quality index | Should Have |
| F12 | Support multiple sensor nodes | Could Have |
4.6.2.3.2 Non-Functional Requirements
| ID | Requirement | Target |
|---|---|---|
| NF1 | Battery life (if portable) | > 7 days |
| NF2 | Data transmission reliability | > 99% |
| NF3 | Sensor reading latency | < 2 seconds |
| NF4 | System uptime | > 99.5% |
| NF5 | Data storage retention | 1 year |
| NF6 | Total hardware cost | < $100 |
4.6.2.4 Recommended Hardware
| Component | Options | Est. Cost |
|---|---|---|
| Microcontroller | ESP32, Raspberry Pi Pico W | $5-15 |
| Temperature/Humidity | DHT22, BME280, SHT31 | $5-15 |
| CO2 Sensor | MH-Z19B, SCD30, SCD40 | $15-50 |
| Particulate Sensor | PMS5003, SDS011 | $15-30 |
| Light Sensor | BH1750, TSL2561 | $2-5 |
| Sound Sensor | MAX4466, INMP441 | $3-8 |
| Display | 0.96” OLED, 2.4” TFT | $5-15 |
| Enclosure | 3D printed or project box | $5-10 |
Meeting the 7-day battery life target requires careful power budgeting. The calculation below is an intentionally optimistic screening case: it assigns 160mA to Wi-Fi transmit, 0.8mA to light sleep, 20mA to sensors, and only 200 ms to the whole active window every 5 minutes. A real budget must measure and include wake-up, sensor conversion, Wi-Fi association, DHCP, DNS, TCP/TLS/MQTT setup, display use, retries, regulator loss, and battery voltage sag.
Duty cycle calculation:
Average current:
Battery life (2x AA = 3000mAh):
With those best-case inputs, the arithmetic produces 136 days, or 19 times the target, but that ratio is not engineering margin for retries or display use because those costs were omitted from the active window. Measure the full active trace and substitute its charge before making a pass/fail claim. If the same unverified 200 ms assumption is reused for one-minute sampling, the screening result becomes 89 days; it remains a sensitivity example, not a battery-life prediction.
4.6.2.5 Architecture Design
| Layer | Responsibilities | Typical Components |
|---|---|---|
| Sensor node | Sample indoor environment signals and show local readings. | ESP32, BME280 or SHT31, CO2 sensor, PM2.5 sensor, BH1750 light sensor, sound-level sensor, OLED display |
| Firmware | Schedule readings, validate sensor ranges, calculate simple air-quality status, and publish telemetry. | Sensor drivers, calibration constants, MQTT client, retry queue |
| Cloud pipeline | Receive telemetry, store time-series data, and evaluate alert thresholds. | MQTT broker, time-series database, alert worker |
| Dashboard | Show 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}
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
| Criteria | Points | Excellent | Good | Needs Work |
|---|---|---|---|---|
| Hardware Assembly | 20 | Clean, reliable, documented | Working but messy | Intermittent issues |
| Sensor Accuracy | 15 | Within specs | Close to specs | Unreliable |
| Cloud Integration | 20 | Full pipeline, reliable | Basic connectivity | Data loss issues |
| Dashboard/Visualization | 15 | Professional, insightful | Functional | Basic |
| Alerts | 10 | Configurable, reliable | Working | Missing |
| Code Quality | 10 | Well-structured, commented | Readable | Spaghetti |
| Documentation | 10 | Complete, professional | Adequate | Minimal |
| Total | 100 |
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
Checkpoint: 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.
4.6.3 Within This Series
| Direction | Chapter | Topic |
|---|---|---|
| Current | Capstone Project 1: Smart Environment Monitor | Indoor air-quality and comfort monitoring |
| Next | Capstone Project 2: Smart Agriculture System | Soil sensing and automated watering |
| Also in this series | Capstone Project 3: Fleet Tracking System | GPS, cellular, and geofencing |
4.7 What’s Next
| If you want to… | Read this |
|---|---|
| Look up technical terms encountered during project work | IoT Glossary A-F |
| Review mathematical foundations for sensor calculations | Mathematical Foundations |
| Apply visual style standards to project diagrams and documentation | Reference Appendix |
| Access reference templates and supplementary materials | Appendix |
| Revisit data storage architectures for your project’s backend | Data 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.
