1640  Capstone Projects

1640.1 Capstone Projects for IoT Mastery

These comprehensive projects integrate multiple concepts from across the book into real-world IoT system designs. Each project is designed for 4-8 weeks of work and covers the full IoT stack from sensors to cloud analytics.

Learning Objectives

After completing a capstone project, you will be able to:

  • Design and implement a complete IoT system from requirements to deployment
  • Integrate hardware (sensors, actuators) with software (firmware, cloud)
  • Apply security best practices throughout the IoT stack
  • Analyze data and create meaningful visualizations
  • Document and present technical solutions professionally
  • Work with real-world constraints (power, cost, connectivity)

1640.2 Prerequisites

Before starting a capstone project, you should have completed:

  • Sensor Fundamentals and at least one sensor lab
  • Networking Fundamentals including MQTT or similar protocol
  • Cloud Computing basics or edge computing concepts
  • Security Fundamentals including device authentication
  • Basic programming skills (Python, C/C++, or JavaScript)
NoteKnowledge Check: Project Planning Priorities

1640.3 Capstone Project 1: Smart Environment Monitor

NoteProject Overview

Domain: Environmental Monitoring / Smart Building

Difficulty: ⭐⭐ Intermediate

Duration: 4-6 weeks

Team Size: 1-2 people

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

1640.3.2 Business Context

Poor indoor air quality costs businesses $150 billion annually in lost productivity. Your system will help facility managers maintain healthy environments and comply with workplace safety regulations.

1640.3.3 Requirements Specification

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

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

1640.3.5 Architecture Design

%% fig-alt: "System architecture diagram for Smart Environment Monitor showing three layers: Sensor Node layer with temperature, CO2, PM2.5, and light sensors connected to ESP32 MCU with OLED display and Wi-Fi; Network layer using MQTT over Wi-Fi; Cloud layer with MQTT broker, InfluxDB time-series database, Grafana dashboards, Node-RED automation, and email alerts."
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#16A085', 'lineColor': '#E67E22', 'secondaryColor': '#ECF0F1'}}}%%
flowchart TB
    subgraph Sensors["🌑️ Sensor Node"]
        T["Temperature<br/>DHT22"]
        CO2["CO2<br/>MH-Z19B"]
        PM["PM2.5<br/>PMS5003"]
        L["Light<br/>BH1750"]
    end

    subgraph MCU["πŸ”§ Microcontroller"]
        ESP["ESP32<br/>Main Controller"]
        OLED["OLED Display"]
        SD["SD Card<br/>Backup"]
    end

    subgraph Cloud["☁️ Cloud Layer"]
        MQTT["MQTT Broker<br/>Mosquitto"]
        DB["InfluxDB<br/>Time-Series DB"]
        VIZ["Grafana<br/>Dashboards"]
        RULES["Node-RED<br/>Automation"]
        ALERT["Alerts<br/>Email/SMS"]
    end

    T & CO2 & PM & L --> ESP
    ESP --> OLED
    ESP --> SD
    ESP -->|Wi-Fi/MQTT| MQTT
    MQTT --> DB
    MQTT --> RULES
    DB --> VIZ
    VIZ --> ALERT
    RULES --> ALERT

    style T fill:#E67E22,color:#fff
    style CO2 fill:#E74C3C,color:#fff
    style PM fill:#9B59B6,color:#fff
    style L fill:#F1C40F,color:#000
    style ESP fill:#2C3E50,color:#fff
    style MQTT fill:#16A085,color:#fff
    style DB fill:#3498DB,color:#fff
    style VIZ fill:#27AE60,color:#fff

1640.3.6 Implementation Milestones

1640.3.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);
}

1640.3.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}
NoteKnowledge Check: MQTT Topic Design

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

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

1640.3.8 Extension Ideas

  • 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
NoteKnowledge Check: Data Storage Strategy

1640.4 Capstone Project 2: Smart Agriculture System

NoteProject Overview

Domain: Precision Agriculture / Smart Farming

Difficulty: ⭐⭐⭐ Advanced

Duration: 6-8 weeks

Team Size: 2-3 people

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

1640.4.2 Business Context

Global water scarcity affects 40% of the world’s population. Smart irrigation systems can reduce water usage by 30-50% while improving crop yields. Your system demonstrates IoT’s role in sustainable agriculture.

1640.4.3 Requirements Specification

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

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

1640.4.5 System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  SMART AGRICULTURE SYSTEM                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    FIELD NODE                         β”‚   β”‚
β”‚  β”‚                                                       β”‚   β”‚
β”‚  β”‚   β˜€οΈ Solar Panel ──> ⚑ Battery ──> ESP32            β”‚   β”‚
β”‚  β”‚                                       β”‚               β”‚   β”‚
β”‚  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€               β”‚   β”‚
β”‚  β”‚   β”‚                 β”‚                 β”‚               β”‚   β”‚
β”‚  β”‚   β–Ό                 β–Ό                 β–Ό               β”‚   β”‚
β”‚  β”‚ 🌑️ Soil         πŸ’§ Soil          🌀️ Weather         β”‚   β”‚
β”‚  β”‚ Temp            Moisture         Sensor             β”‚   β”‚
β”‚  β”‚                                                       β”‚   β”‚
β”‚  β”‚                 ESP32 ───────> 🚰 Pump              β”‚   β”‚
β”‚  β”‚                   β”‚             (Relay)             β”‚   β”‚
β”‚  β”‚                   β”‚                                  β”‚   β”‚
β”‚  β”‚                 LoRa/Wi-Fi                            β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                      β”‚                                       β”‚
β”‚                 Long Range                                   β”‚
β”‚                      β”‚                                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    GATEWAY                            β”‚   β”‚
β”‚  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚   β”‚
β”‚  β”‚   β”‚ LoRa RX β”‚ ──>  β”‚ RPi/ESP β”‚ ──>  β”‚  Wi-Fi   β”‚     β”‚   β”‚
β”‚  β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜     β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                              β”‚               β”‚
β”‚                                         Internet             β”‚
β”‚                                              β”‚               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    CLOUD                              β”‚   β”‚
β”‚  β”‚                                                       β”‚   β”‚
β”‚  β”‚   Weather API ──> Decision Engine ──> Commands       β”‚   β”‚
β”‚  β”‚                         β”‚                            β”‚   β”‚
β”‚  β”‚                    β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”                       β”‚   β”‚
β”‚  β”‚                    β”‚ Databaseβ”‚                       β”‚   β”‚
β”‚  β”‚                    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜                       β”‚   β”‚
β”‚  β”‚                         β”‚                            β”‚   β”‚
β”‚  β”‚                    Dashboard                         β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

1640.4.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)
NoteKnowledge Check: Smart Watering Algorithm

1640.4.7 Implementation Milestones

1640.4.7.1 Week 1-2: Sensor Integration

1640.4.7.2 Week 3-4: Actuation & Control

1640.4.7.3 Week 5-6: Connectivity & Power

NoteKnowledge Check: Connectivity Protocol Selection

1640.4.7.4 Week 7-8: Intelligence & Dashboard

1640.4.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
NoteKnowledge Check: Security for Outdoor Deployments

1640.5 Capstone Project 3: Fleet Tracking System

NoteProject Overview

Domain: Logistics / Asset Tracking

Difficulty: ⭐⭐⭐ Advanced

Duration: 6-8 weeks

Team Size: 2-3 people

1640.5.1 Project Description

Design a GPS-based asset tracking system for vehicles or valuable equipment. The system should provide real-time location tracking, geofence alerts, movement history, and battery-efficient operation for long deployment without charging.

1640.5.2 Business Context

Fleet management is a $31 billion market growing at 15% annually. Businesses lose $164 billion annually to fleet inefficiency. GPS tracking reduces fuel costs by 15% and improves asset utilization by 20%.

1640.5.3 Requirements Specification

1640.5.3.1 Functional Requirements

ID Requirement Priority
F1 GPS location tracking (< 10m accuracy) Must Have
F2 Cellular connectivity (4G LTE-M/NB-IoT) Must Have
F3 Real-time location on map Must Have
F4 Historical route playback Must Have
F5 Geofence entry/exit alerts Must Have
F6 Speed monitoring and alerts Should Have
F7 Movement/tamper detection Should Have
F8 Battery level monitoring Must Have
F9 Multi-device fleet view Should Have
F10 Trip reports and analytics Could Have

1640.5.3.2 Non-Functional Requirements

ID Requirement Target
NF1 Battery life (1 update/hour) > 30 days
NF2 Location accuracy < 5m (clear sky)
NF3 Update latency < 30 seconds
NF4 Device cost < $100
NF5 Monthly connectivity < $5/device

1640.5.5 System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    FLEET TRACKING SYSTEM                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚  β”‚           TRACKING DEVICE             β”‚                  β”‚
β”‚  β”‚                                        β”‚                  β”‚
β”‚  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”‚                  β”‚
β”‚  β”‚   β”‚  GPS   β”‚  β”‚ Accel  β”‚  β”‚Battery β”‚ β”‚                  β”‚
β”‚  β”‚   β”‚NEO-M8N β”‚  β”‚MPU6050 β”‚  β”‚Monitor β”‚ β”‚                  β”‚
β”‚  β”‚   β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β”‚                  β”‚
β”‚  β”‚       β”‚           β”‚           β”‚       β”‚                  β”‚
β”‚  β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚                  β”‚
β”‚  β”‚                   β”‚                    β”‚                  β”‚
β”‚  β”‚           β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”           β”‚                  β”‚
β”‚  β”‚           β”‚     MCU       β”‚           β”‚                  β”‚
β”‚  β”‚           β”‚   (ESP32)     β”‚           β”‚                  β”‚
β”‚  β”‚           β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚                  β”‚
β”‚  β”‚                   β”‚                    β”‚                  β”‚
β”‚  β”‚           β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”           β”‚                  β”‚
β”‚  β”‚           β”‚    LTE-M      β”‚           β”‚                  β”‚
β”‚  β”‚           β”‚   SIM7000     β”‚           β”‚                  β”‚
β”‚  β”‚           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚                  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚                      β”‚                                       β”‚
β”‚                  Cellular                                    β”‚
β”‚                   Network                                    β”‚
β”‚                      β”‚                                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚                    BACKEND                             β”‚  β”‚
β”‚  β”‚                                                        β”‚  β”‚
β”‚  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚  β”‚
β”‚  β”‚   β”‚ API      β”‚    β”‚ PostGIS  β”‚    β”‚ Redis    β”‚       β”‚  β”‚
β”‚  β”‚   β”‚ Server   │───>β”‚ Database β”‚    β”‚ (Cache)  β”‚       β”‚  β”‚
β”‚  β”‚   β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚  β”‚
β”‚  β”‚        β”‚                                              β”‚  β”‚
β”‚  β”‚        β”‚          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                       β”‚  β”‚
β”‚  β”‚        └─────────>β”‚ Geofence │───> Alerts            β”‚  β”‚
β”‚  β”‚                   β”‚ Engine   β”‚                       β”‚  β”‚
β”‚  β”‚                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                       β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                           β”‚                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚                    FRONTEND                            β”‚  β”‚
β”‚  β”‚                                                        β”‚  β”‚
β”‚  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚  β”‚   β”‚              Map Dashboard                      β”‚  β”‚  β”‚
β”‚  β”‚   β”‚   β”Œβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”                        β”‚  β”‚  β”‚
β”‚  β”‚   β”‚   β”‚πŸš— β”‚ β”‚πŸš› β”‚ β”‚πŸοΈ β”‚  Real-time fleet       β”‚  β”‚  β”‚
β”‚  β”‚   β”‚   β””β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”˜                        β”‚  β”‚  β”‚
β”‚  β”‚   β”‚                                                β”‚  β”‚  β”‚
β”‚  β”‚   β”‚   Geofences | Routes | Alerts | Reports       β”‚  β”‚  β”‚
β”‚  β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

1640.5.6 Power Optimization Strategy

// Power states for maximum battery life
enum PowerState {
    DEEP_SLEEP,      // GPS off, cellular off, ~10uA
    LIGHT_SLEEP,     // GPS acquiring, cellular off, ~1mA
    ACTIVE_GPS,      // GPS tracking, cellular off, ~30mA
    ACTIVE_TRANSMIT  // GPS + cellular active, ~150mA
};

// Adaptive reporting based on movement
void adaptiveTracking() {
    if (isMoving()) {
        // Vehicle in motion: frequent updates
        reportIntervalSeconds = 60;
        gpsMode = CONTINUOUS;
    } else if (hasMovedRecently(30)) {
        // Recently stopped: medium updates
        reportIntervalSeconds = 300;
        gpsMode = PERIODIC;
    } else {
        // Parked: infrequent updates
        reportIntervalSeconds = 3600;
        gpsMode = ON_DEMAND;
    }
}

// Estimated battery life calculation
// 3000mAh battery
// Moving 4 hours/day: ~35 days
// Parked most of time: ~90+ days
NoteKnowledge Check: Power Optimization Strategy

1640.5.7 Implementation Milestones

1640.5.7.1 Week 1-2: GPS & Basic Firmware

1640.5.7.2 Week 3-4: Cellular Connectivity

1640.5.7.3 Week 5-6: Backend & Storage

1640.5.7.4 Week 7-8: Dashboard & Optimization

1640.5.8 Geofence Implementation

from shapely.geometry import Point, Polygon

class GeofenceEngine:
    def __init__(self):
        self.geofences = {}
        self.device_states = {}  # Track inside/outside state

    def add_geofence(self, name, coordinates, alert_on):
        """
        coordinates: List of (lat, lon) tuples
        alert_on: 'entry', 'exit', or 'both'
        """
        self.geofences[name] = {
            'polygon': Polygon(coordinates),
            'alert_on': alert_on
        }

    def check_position(self, device_id, lat, lon):
        """Check if device triggers any geofence alerts."""
        point = Point(lon, lat)  # Note: Shapely uses (x, y) = (lon, lat)
        alerts = []

        for name, geofence in self.geofences.items():
            was_inside = self.device_states.get((device_id, name), None)
            is_inside = geofence['polygon'].contains(point)

            if was_inside is not None:
                if not was_inside and is_inside and geofence['alert_on'] in ('entry', 'both'):
                    alerts.append({'type': 'entry', 'geofence': name})
                elif was_inside and not is_inside and geofence['alert_on'] in ('exit', 'both'):
                    alerts.append({'type': 'exit', 'geofence': name})

            self.device_states[(device_id, name)] = is_inside

        return alerts
NoteKnowledge Check: Geofence Implementation

1640.5.9 Evaluation Rubric

Criteria Points Description
GPS Accuracy 15 Consistent < 10m accuracy
Cellular Reliability 15 > 99% data delivery
Battery Life 20 Meets 30-day target
Geofencing 15 Accurate entry/exit detection
Dashboard 15 Real-time, historical, usable
Documentation 20 Complete, reproducible
Total 100
NoteKnowledge Check: Database Selection for Location Data

1640.6 Project Submission Guidelines

1640.6.1 Required Deliverables

  1. Technical Report (10-15 pages)
    • Problem statement and requirements
    • Architecture design with diagrams
    • Implementation details
    • Testing results and analysis
    • Lessons learned
  2. Source Code Repository
    • Well-organized, commented code
    • README with setup instructions
    • Dependencies documented
  3. Video Demonstration (5-10 minutes)
    • System overview
    • Live functionality demo
    • Key features walkthrough
  4. Hardware Documentation
    • Bill of materials with costs
    • Wiring diagrams
    • Assembly photos

1640.6.2 Presentation Format

  • 15-minute presentation + 5 minutes Q&A
  • Cover: problem, solution, demo, results, lessons
  • Be prepared to discuss technical trade-offs
NoteKnowledge Check: Documentation Best Practices
NoteKnowledge Check: Technical Trade-offs

1640.7 What’s Next?

After completing a capstone project, consider:

  • Publishing your project on GitHub/Hackster.io
  • Presenting at local IoT meetups
  • Expanding into a startup idea
  • Contributing to open-source IoT projects
  • Pursuing advanced certifications (AWS IoT, Azure IoT)

Return to Design Strategies Overview β†’