802  Design Considerations and Hands-On Labs

802.1 Introduction

This chapter provides practical frameworks for frequency band selection and hands-on labs for RF spectrum analysis. You’ll learn how to make informed wireless technology choices based on range, data rate, power, and environment requirements, then apply these concepts through hands-on experimentation.

NoteLearning Objectives

By the end of this chapter, you will be able to:

  • Apply a systematic frequency band selection framework for IoT applications
  • Evaluate trade-offs between range, data rate, power, and environment
  • Perform RF spectrum analysis using Wi-Fi scanners and SDR tools
  • Identify interference sources and select optimal channels
  • Implement practical Wi-Fi channel scanning and RSSI measurement

802.2 Prerequisites

Before diving into this chapter, you should be familiar with:

802.3 Design Considerations for IoT

⏱️ ~15 min | ⭐⭐⭐ Advanced | πŸ“‹ P08.C18.U07

802.3.1 Frequency Band Selection Framework

%% fig-cap: "Decision flowchart for IoT frequency band selection"
%% fig-alt: "Flowchart guiding frequency band selection for IoT applications based on range requirements (indoor/outdoor/rural), data rate needs (sensor data/multimedia/video), power constraints (battery life), deployment environment (urban/industrial/residential), and regulatory compliance, leading to recommended band choices: sub-GHz for long-range/low-power, 2.4 GHz for balanced, or 5 GHz for high-bandwidth applications"
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#2C3E50', 'primaryTextColor': '#2C3E50', 'primaryBorderColor': '#16A085', 'lineColor': '#16A085', 'secondaryColor': '#E67E22', 'tertiaryColor': '#ECF0F1'}}}%%
graph TD
    A["IoT Frequency<br/>Selection"] --> B{Range<br/>Requirement?}

    B -->|Indoor < 100m| C["2.4 or 5 GHz"]
    B -->|Outdoor < 1km| D["2.4 GHz or sub-GHz"]
    B -->|Rural > 1km| E["Sub-GHz LPWAN"]

    C --> F{Data Rate?}
    D --> F
    E --> G["Sub-GHz<br/>LoRa/Sigfox"]

    F -->|High > 1 Mbps| H["5 GHz Wi-Fi"]
    F -->|Medium 100k-1M| I["2.4 GHz Wi-Fi/BLE"]
    F -->|Low < 100k| J["2.4 GHz mesh<br/>or sub-GHz"]

    H --> K{Power Budget?}
    I --> K
    J --> K
    G --> L["βœ“ Sub-GHz<br/>10+ year battery"]

    K -->|Mains powered| M["Any suitable"]
    K -->|Battery 1-5 yr| N["2.4 GHz BLE/mesh"]
    K -->|Battery > 5 yr| O["Sub-GHz LPWAN"]

    style A fill:#2C3E50,stroke:#16A085,stroke-width:3px,color:#fff
    style E fill:#16A085,stroke:#2C3E50,stroke-width:2px,color:#fff
    style G fill:#16A085,stroke:#2C3E50,stroke-width:2px,color:#fff
    style H fill:#E67E22,stroke:#16A085,stroke-width:2px
    style L fill:#16A085,stroke:#2C3E50,stroke-width:2px,color:#fff
    style O fill:#16A085,stroke:#2C3E50,stroke-width:2px,color:#fff

Figure 802.1: Flowchart guiding frequency band selection for IoT applications based on range requirements (indoor/outdoor/rural), data rate needs (sensor data/mu…

802.3.2 Key Selection Criteria

When choosing a wireless frequency band for your IoT application, consider:

  1. Range Requirements
    • Indoor: 2.4 GHz or 5 GHz typically sufficient
    • Outdoor urban: 2.4 GHz or sub-GHz
    • Rural/wide area: Sub-GHz or cellular
  2. Data Rate Needs
    • Video streaming: 5 GHz Wi-Fi
    • Sensor data: 2.4 GHz mesh or sub-GHz
    • Occasional updates: Sub-GHz LPWAN
  3. Power Constraints
    • Battery-powered, multi-year: Sub-GHz LPWAN
    • Mains-powered: Any band suitable
    • Coin cell: BLE or LPWAN
  4. Deployment Environment
    • Dense urban: Expect 2.4 GHz congestion
    • Industrial: Consider sub-GHz for penetration
    • Residential: 2.4 GHz or 5 GHz viable
  5. Regulatory Compliance
    • Check regional spectrum allocation
    • Verify power limits
    • Confirm duty cycle restrictions

802.4 Hands-On Lab: RF Spectrum Analysis

802.4.1 Lab Objective

Use software-defined radio (SDR) or Wi-Fi scanner tools to analyze the wireless environment and identify interference sources.

802.4.2 Equipment Needed

  • ESP32 development board (built-in Wi-Fi)
  • Arduino IDE
  • Computer with USB connection

802.4.3 Lab Tasks

Task 1: Wi-Fi Channel Scanner

Create a tool to scan all 2.4 GHz Wi-Fi channels and identify the least congested channel:

#include <Wi-Fi.h>

void setup() {
    Serial.begin(115200);
    Wi-Fi.mode(WIFI_STA);
    Wi-Fi.disconnect();
    delay(100);
    Serial.println("\n\nWi-Fi Channel Scanner");
    Serial.println("=====================");
}

void loop() {
    Serial.println("\nScanning Wi-Fi networks...");

    // Scan for networks
    int n = Wi-Fi.scanNetworks();

    // Create channel usage array
    int channelCount[14] = {0};

    if (n == 0) {
        Serial.println("No networks found");
    } else {
        Serial.printf("Found %d networks:\n\n", n);
        Serial.println("SSID                             | RSSI | Ch | Encryption");
        Serial.println("-----------------------------------------------------------------");

        for (int i = 0; i < n; i++) {
            int channel = Wi-Fi.channel(i);
            channelCount[channel]++;

            Serial.printf("%-32s | %4d | %2d | %s\n",
                Wi-Fi.SSID(i).c_str(),
                Wi-Fi.RSSI(i),
                channel,
                getEncryptionType(Wi-Fi.encryptionType(i)));
        }

        // Analyze channel congestion
        Serial.println("\n\nChannel Congestion Analysis:");
        Serial.println("============================");
        for (int ch = 1; ch <= 13; ch++) {
            Serial.printf("Channel %2d: ", ch);
            for (int i = 0; i < channelCount[ch]; i++) {
                Serial.print("β–ˆ");
            }
            Serial.printf(" (%d networks)\n", channelCount[ch]);
        }

        // Find least congested channel (from 1, 6, 11)
        int channels[] = {1, 6, 11};
        int minCount = 999;
        int bestChannel = 1;

        for (int i = 0; i < 3; i++) {
            if (channelCount[channels[i]] < minCount) {
                minCount = channelCount[channels[i]];
                bestChannel = channels[i];
            }
        }

        Serial.printf("\nRecommended channel: %d (%d networks)\n",
                      bestChannel, minCount);
    }

    delay(10000);  // Scan every 10 seconds
}

String getEncryptionType(wifi_auth_mode_t encryptionType) {
    switch (encryptionType) {
        case WIFI_AUTH_OPEN:
            return "Open";
        case WIFI_AUTH_WEP:
            return "WEP";
        case WIFI_AUTH_WPA_PSK:
            return "WPA-PSK";
        case WIFI_AUTH_WPA2_PSK:
            return "WPA2-PSK";
        case WIFI_AUTH_WPA_WPA2_PSK:
            return "WPA/WPA2-PSK";
        case WIFI_AUTH_WPA2_ENTERPRISE:
            return "WPA2-Enterprise";
        default:
            return "Unknown";
    }
}

Task 2: Signal Strength Mapping

Modify the scanner to create a heat map of signal strength at different locations:

  1. Take measurements at 5-10 locations in your environment
  2. Record RSSI for each channel
  3. Create a simple visualization showing signal strength patterns
  4. Identify dead zones and interference sources

Task 3: Path Loss Measurements

  1. Set up two ESP32 boards (one as AP, one as client)
  2. Measure RSSI at distances: 1m, 5m, 10m, 20m
  3. Calculate observed path loss
  4. Compare with theoretical free space path loss
  5. Identify factors causing deviation (walls, furniture, interference)

802.4.4 Analysis Questions

  1. Which 2.4 GHz channels are most congested in your environment?
  2. What is the RSSI difference between 1m and 10m measurements?
  3. How does the observed path loss compare to the theoretical value?
  4. Can you identify specific interference sources (e.g., microwave ovens)?

Question 5: An industrial IoT system needs to transmit sensor data across a 500-meter factory floor with metal machinery and RF interference. The data rate requirement is only 10 kbps per sensor. Which frequency band is most appropriate?

πŸ’‘ Explanation: Sub-GHz bands (868/915 MHz) are optimal for this industrial scenario:

Why sub-GHz wins: - Range: ~10 dB less path loss vs 2.4 GHz means 3Γ— greater range or 10Γ— less power - Penetration: Longer wavelengths diffract around metal obstacles better - Interference resistance: Less crowded than 2.4 GHz ISM band - Sufficient bandwidth: 10 kbps easily supported (sub-GHz supports 50-300 kbps)

Why other options fail: - 5 GHz: Extremely poor for 500m range; typical max range 50-100m indoor - 2.4 GHz: Better than 5 GHz but ~9 dB more path loss than 868 MHz; congested band - 60 GHz: Millimeter wave has massive path loss (100+ dB at 500m); line-of-sight only

Real-world calculation at 500m: - Sub-GHz FSPL β‰ˆ 91 dB + wall/machinery losses β‰ˆ 110 dB total - 2.4 GHz FSPL β‰ˆ 100 dB + higher wall losses β‰ˆ 125 dB total - 5 GHz FSPL β‰ˆ 106 dB + severe losses β‰ˆ 135+ dB total

With typical industrial sensors transmitting at +10 dBm and receivers needing -110 dBm, only sub-GHz provides sufficient link budget (120 dB available vs 110 dB needed).

802.5 Python Implementations

802.5.1 Implementation 1: Wave Property Calculator

This implementation provides comprehensive calculations for electromagnetic wave properties, including frequency/wavelength relationships, energy calculations, and path loss analysis.

Expected Output:

=== Electromagnetic Wave Properties ===

433 MHz ISM:
Frequency: 433.00 MHz (4.33e+08 Hz)
Wavelength: 0.6924 m (69.24 cm)
Energy: 2.87e-25 Joules

868 MHz (Europe):
Frequency: 868.00 MHz (8.68e+08 Hz)
Wavelength: 0.3454 m (34.54 cm)
Energy: 5.75e-25 Joules

2.4 GHz ISM:
Frequency: 2400.00 MHz (2.40e+09 Hz)
Wavelength: 0.1249 m (12.49 cm)
Energy: 1.59e-24 Joules

=== Path Loss Comparison at 100m ===

868 MHz (Europe): 71.21 dB
2.4 GHz ISM: 80.05 dB
5 GHz: 86.44 dB

Path loss advantage of 868 MHz over 2.4 GHz: 8.84 dB

=== Range Calculation ===

868 MHz (Europe): 15.77 km range
2.4 GHz ISM: 5.70 km range

=== Fresnel Zone Analysis ===

First Fresnel zone radius at midpoint of 1 km link (2.4 GHz): 3.97 m
Required clearance (60% of first Fresnel zone): 2.38 m

802.5.2 Implementation 2: Spectrum Analyzer and Channel Planner

This implementation analyzes spectrum usage, identifies interference, and recommends optimal channel allocation strategies.

Expected Output (example):

Simulating wireless network scan...

============================================================
SPECTRUM ANALYSIS REPORT
============================================================

Total networks detected: 20

Networks by protocol:
  Wi-Fi: 15
  Zigbee: 3
  Bluetooth: 2

============================================================
CHANNEL ANALYSIS (2.4 GHz Non-Overlapping Channels)
============================================================

Channel 1 (2412 MHz):
  Networks: 4
  Interference Score: 245.0
  Max RSSI: -35 dBm
  Assessment: Fair - Moderate interference

Channel 6 (2437 MHz):
  Networks: 6
  Interference Score: 312.0
  Max RSSI: -28 dBm
  Assessment: Poor - High interference

Channel 11 (2462 MHz):
  Networks: 3
  Interference Score: 178.0
  Max RSSI: -42 dBm
  Assessment: Good - Acceptable interference

============================================================
RECOMMENDED CHANNEL: 11
Interference Score: 178.0
Assessment: Good - Acceptable interference
============================================================

802.6 Additional Hands-On Labs

802.6.1 Lab 2: ESP32 Real-Time Spectrum Monitor with Data Logging

This advanced lab creates a continuous spectrum monitoring system with data logging and web interface.

802.6.1.1 Hardware Required

  • ESP32 development board
  • MicroSD card module
  • SD card (formatted FAT32)
  • Breadboard and jumper wires
  • Optional: OLED display (128x64, I2C)

802.6.1.2 Wiring Diagram

ESP32          SD Card Module
-----          --------------
GPIO 5    -->  CS
GPIO 18   -->  SCK
GPIO 19   -->  MISO
GPIO 23   -->  MOSI
3.3V      -->  VCC
GND       -->  GND

Optional OLED:
GPIO 21   -->  SDA
GPIO 22   -->  SCL

802.6.1.3 Complete Code

#include <Wi-Fi.h>
#include <WebServer.h>
#include <SD.h>
#include <SPI.h>
#include <time.h>

// SD Card pins
#define SD_CS 5

// Web server
WebServer server(80);

// Scan configuration
#define SCAN_INTERVAL_MS 30000  // 30 seconds
#define MAX_NETWORKS 50

struct NetworkScan {
    char ssid[33];
    int channel;
    int rssi;
    char encryption[20];
    unsigned long timestamp;
};

NetworkScan scanHistory[MAX_NETWORKS];
int scanCount = 0;
unsigned long lastScanTime = 0;

// Statistics
int channelCounts[14] = {0};
float channelAvgRSSI[14] = {0};
int totalScans = 0;

void setup() {
    Serial.begin(115200);
    delay(1000);

    Serial.println("\n\n================================");
    Serial.println("ESP32 Spectrum Monitor");
    Serial.println("================================\n");

    // Initialize SD card
    if (!SD.begin(SD_CS)) {
        Serial.println("SD Card initialization failed!");
    } else {
        Serial.println("SD Card initialized successfully");

        // Create header in log file if new
        if (!SD.exists("/spectrum_log.csv")) {
            File logFile = SD.open("/spectrum_log.csv", FILE_WRITE);
            if (logFile) {
                logFile.println("Timestamp,SSID,Channel,RSSI,Encryption");
                logFile.close();
                Serial.println("Created new log file");
            }
        }
    }

    // Set Wi-Fi mode
    Wi-Fi.mode(WIFI_STA);
    Wi-Fi.disconnect();

    // Start access point for web interface
    Wi-Fi.softAP("ESP32-SpectrumMonitor", "spectrum123");
    IPAddress IP = Wi-Fi.softAPIP();
    Serial.print("AP IP address: ");
    Serial.println(IP);

    // Setup web server routes
    server.on("/", handleRoot);
    server.on("/scan", handleScan);
    server.on("/data", handleData);
    server.on("/download", handleDownload);
    server.begin();

    Serial.println("Web server started");
    Serial.println("Connect to 'ESP32-SpectrumMonitor' and navigate to " + IP.toString());
    Serial.println("\nStarting continuous monitoring...\n");
}

void loop() {
    server.handleClient();

    // Periodic scan
    if (millis() - lastScanTime >= SCAN_INTERVAL_MS) {
        performScan();
        lastScanTime = millis();
    }
}

void performScan() {
    Serial.println("Scanning networks...");

    int n = Wi-Fi.scanNetworks();
    totalScans++;

    // Reset channel statistics
    for (int i = 0; i < 14; i++) {
        channelCounts[i] = 0;
        channelAvgRSSI[i] = 0;
    }

    Serial.printf("Found %d networks\n\n", n);

    if (n > 0) {
        // Clear previous scan
        scanCount = 0;

        // Open log file for appending
        File logFile = SD.open("/spectrum_log.csv", FILE_APPEND);

        for (int i = 0; i < n && i < MAX_NETWORKS; i++) {
            // Store in memory
            strncpy(scanHistory[scanCount].ssid, Wi-Fi.SSID(i).c_str(), 32);
            scanHistory[scanCount].channel = Wi-Fi.channel(i);
            scanHistory[scanCount].rssi = Wi-Fi.RSSI(i);
            strncpy(scanHistory[scanCount].encryption,
                   getEncryptionType(Wi-Fi.encryptionType(i)), 19);
            scanHistory[scanCount].timestamp = millis();

            // Update channel statistics
            int ch = Wi-Fi.channel(i);
            if (ch >= 1 && ch <= 13) {
                channelCounts[ch]++;
                channelAvgRSSI[ch] += Wi-Fi.RSSI(i);
            }

            // Log to SD card
            if (logFile) {
                logFile.printf("%lu,%s,%d,%d,%s\n",
                              millis(),
                              Wi-Fi.SSID(i).c_str(),
                              Wi-Fi.channel(i),
                              Wi-Fi.RSSI(i),
                              getEncryptionType(Wi-Fi.encryptionType(i)));
            }

            scanCount++;
        }

        if (logFile) {
            logFile.close();
        }

        // Calculate average RSSI per channel
        for (int ch = 1; ch <= 13; ch++) {
            if (channelCounts[ch] > 0) {
                channelAvgRSSI[ch] /= channelCounts[ch];
            }
        }

        // Print summary
        printChannelSummary();
    }

    Serial.println("\n" + String("=").substring(0, 60) + "\n");
}

void printChannelSummary() {
    Serial.println("\nChannel Summary:");
    Serial.println("Ch | Networks | Avg RSSI | Bar Chart");
    Serial.println("---|----------|----------|" + String("-").substring(0, 30));

    for (int ch = 1; ch <= 13; ch++) {
        Serial.printf("%2d | %8d | %8.1f | ",
                     ch, channelCounts[ch], channelAvgRSSI[ch]);

        for (int i = 0; i < channelCounts[ch]; i++) {
            Serial.print("β–ˆ");
        }
        Serial.println();
    }

    // Find best channel
    int bestChannel = 1;
    int minCount = 999;
    for (int ch : {1, 6, 11}) {
        if (channelCounts[ch] < minCount) {
            minCount = channelCounts[ch];
            bestChannel = ch;
        }
    }

    Serial.printf("\nRecommended channel: %d (%d networks)\n",
                 bestChannel, minCount);
}

void handleRoot() {
    String html = R"(
<!DOCTYPE html>
<html>
<head>
    <title>ESP32 Spectrum Monitor</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        body { font-family: Arial; margin: 20px; background: #f0f0f0; }
        .container { max-width: 1000px; margin: 0 auto; background: white; padding: 20px; border-radius: 10px; }
        h1 { color: #333; }
        button { background: #4CAF50; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; margin: 5px; }
        button:hover { background: #45a049; }
        table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        th, td { padding: 10px; text-align: left; border-bottom: 1px solid #ddd; }
        th { background: #4CAF50; color: white; }
        .channel-viz { margin-top: 20px; }
        .bar { background: #2196F3; color: white; padding: 5px; margin: 2px 0; }
    </style>
    <script>
        function refreshData() {
            fetch('/data')
                .then(response => response.json())
                .then(data => updateDisplay(data));
        }

        function updateDisplay(data) {
            document.getElementById('scanCount').innerText = data.totalScans;
            document.getElementById('networkCount').innerText = data.currentNetworks;

            let table = '<table><tr><th>SSID</th><th>Channel</th><th>RSSI</th><th>Security</th></tr>';
            data.networks.forEach(net => {
                table += `<tr><td>${net.ssid}</td><td>${net.channel}</td><td>${net.rssi} dBm</td><td>${net.encryption}</td></tr>`;
            });
            table += '</table>';
            document.getElementById('networkTable').innerHTML = table;

            let viz = '';
            for (let ch = 1; ch <= 13; ch++) {
                let count = data.channelCounts[ch] || 0;
                let width = (count * 30) + 'px';
                viz += `<div class="bar" style="width: ${width}">Ch ${ch}: ${count} networks</div>`;
            }
            document.getElementById('channelViz').innerHTML = viz;
        }

        setInterval(refreshData, 5000);
        window.onload = refreshData;
    </script>
</head>
<body>
    <div class="container">
        <h1>ESP32 Spectrum Monitor</h1>
        <p>Total Scans: <strong id="scanCount">0</strong> |
           Current Networks: <strong id="networkCount">0</strong></p>

        <button onclick="fetch('/scan').then(() => setTimeout(refreshData, 2000))">Scan Now</button>
        <button onclick="refreshData()">Refresh</button>
        <button onclick="window.location='/download'">Download Log</button>

        <div class="channel-viz">
            <h2>Channel Distribution</h2>
            <div id="channelViz"></div>
        </div>

        <div id="networkTable"></div>
    </div>
</body>
</html>
    )";

    server.send(200, "text/html", html);
}

void handleScan() {
    performScan();
    server.send(200, "text/plain", "Scan initiated");
}

void handleData() {
    String json = "{";
    json += "\"totalScans\":" + String(totalScans) + ",";
    json += "\"currentNetworks\":" + String(scanCount) + ",";
    json += "\"networks\":[";

    for (int i = 0; i < scanCount; i++) {
        if (i > 0) json += ",";
        json += "{";
        json += "\"ssid\":\"" + String(scanHistory[i].ssid) + "\",";
        json += "\"channel\":" + String(scanHistory[i].channel) + ",";
        json += "\"rssi\":" + String(scanHistory[i].rssi) + ",";
        json += "\"encryption\":\"" + String(scanHistory[i].encryption) + "\"";
        json += "}";
    }
    json += "],";

    json += "\"channelCounts\":{";
    for (int ch = 1; ch <= 13; ch++) {
        if (ch > 1) json += ",";
        json += "\"" + String(ch) + "\":" + String(channelCounts[ch]);
    }
    json += "}}";

    server.send(200, "application/json", json);
}

void handleDownload() {
    File logFile = SD.open("/spectrum_log.csv");
    if (!logFile) {
        server.send(404, "text/plain", "Log file not found");
        return;
    }

    server.sendHeader("Content-Disposition", "attachment; filename=spectrum_log.csv");
    server.streamFile(logFile, "text/csv");
    logFile.close();
}

const char* getEncryptionType(wifi_auth_mode_t encryptionType) {
    switch (encryptionType) {
        case WIFI_AUTH_OPEN: return "Open";
        case WIFI_AUTH_WEP: return "WEP";
        case WIFI_AUTH_WPA_PSK: return "WPA-PSK";
        case WIFI_AUTH_WPA2_PSK: return "WPA2-PSK";
        case WIFI_AUTH_WPA_WPA2_PSK: return "WPA/WPA2";
        case WIFI_AUTH_WPA2_ENTERPRISE: return "WPA2-Enterprise";
        default: return "Unknown";
    }
}

802.6.1.4 Expected Output

Serial Monitor:

================================
ESP32 Spectrum Monitor
================================

SD Card initialized successfully
Created new log file
AP IP address: 192.168.4.1
Web server started
Connect to 'ESP32-SpectrumMonitor' and navigate to 192.168.4.1

Starting continuous monitoring...

Scanning networks...
Found 12 networks

Channel Summary:
Ch | Networks | Avg RSSI | Bar Chart
---|----------|----------|------------------------------
 1 |        3 |    -68.3 | β–ˆβ–ˆβ–ˆ
 2 |        0 |      0.0 |
 3 |        1 |    -72.0 | β–ˆ
 4 |        0 |      0.0 |
 5 |        0 |      0.0 |
 6 |        5 |    -65.2 | β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
 7 |        1 |    -81.0 | β–ˆ
 8 |        0 |      0.0 |
 9 |        0 |      0.0 |
10 |        0 |      0.0 |
11 |        2 |    -70.5 | β–ˆβ–ˆ
12 |        0 |      0.0 |
13 |        0 |      0.0 |

Recommended channel: 11 (2 networks)

============================================================

802.6.1.5 Lab Tasks

  1. Deploy the monitor in your environment and let it run for 1 hour
  2. Access the web interface at 192.168.4.1 from your phone or laptop
  3. Download the CSV log and analyze temporal patterns in Excel/Python
  4. Identify the busiest times for network activity
  5. Test channel switching: Change your Wi-Fi router to the recommended channel and measure performance improvement

802.6.2 Lab 3: Python RF Network Coverage Planner

This lab creates a tool to plan IoT network deployments with coverage analysis.

802.6.2.1 Installation

pip install numpy matplotlib scipy

802.6.2.2 Complete Code

802.6.2.3 Expected Output

============================================================
RF NETWORK COVERAGE PLANNER
============================================================

Area: 50m x 30m
Access Points: 2
  AP1: (10m, 15m), 20 dBm
  AP2: (40m, 15m), 20 dBm

Calculating coverage map...

============================================================
COVERAGE ANALYSIS
============================================================
Sensitivity threshold: -85 dBm
Overall coverage: 94.3%
Mean RSSI: -64.2 dBm
Minimum RSSI: -97.5 dBm

Signal Quality Distribution:
  Excellent (β‰₯-50 dBm): 15.2%
  Good (-50 to -65 dBm): 42.8%
  Fair (-65 to -75 dBm): 28.1%
  Poor (-75 to -85 dBm): 8.2%
  Dead Zone (<-85 dBm): 5.7%

Dead zone locations: 342 points

Generating visualization...

Visualization saved as 'coverage_map.png'

Recommendations:
  - Coverage is below 95%. Consider adding more access points.
  - Focus on dead zone areas identified in the visualization.

The visualization will show: 1. Left plot: Continuous RSSI heatmap with AP locations marked 2. Right plot: Discrete coverage quality zones (color-coded from dead zone to excellent)

802.7 Summary

This chapter covered practical wireless design considerations and hands-on labs:

Frequency Band Selection Framework: 1. Range Requirements: Indoor (<100m) β†’ 2.4/5 GHz; Outdoor (<1km) β†’ 2.4 GHz/sub-GHz; Rural (>1km) β†’ sub-GHz LPWAN 2. Data Rate Needs: High (>1 Mbps) β†’ 5 GHz; Medium (100k-1M) β†’ 2.4 GHz; Low (<100k) β†’ sub-GHz 3. Power Constraints: Mains β†’ any; Battery 1-5yr β†’ 2.4 GHz BLE/mesh; Battery >5yr β†’ sub-GHz LPWAN 4. Deployment Environment: Dense urban β†’ expect 2.4 GHz congestion; Industrial β†’ sub-GHz penetration; Residential β†’ 2.4/5 GHz viable 5. Regulatory Compliance: Verify regional spectrum allocation, power limits, duty cycle restrictions

Hands-On Labs Completed: - Lab 1: Wi-Fi Channel Scanner - ESP32-based 2.4 GHz spectrum analyzer identifying network congestion - Lab 2: Channel Congestion Analyzer - RSSI measurement and optimal channel selection - Lab 3: Python Data Analysis - Statistical analysis of spectrum usage patterns - Lab 4: SDR Spectrum Analysis - Wide-band RF visualization (optional) - Lab 5: Interference Source Identification - Detecting microwave ovens, Bluetooth, USB 3.0 EMI

Key Insights: - Spectrum analysis BEFORE deployment prevents 90% of interference issues - Non-overlapping Wi-Fi channels (1, 6, 11) reduce collisions - Zigbee channels 15, 20, 25, 26 coexist best with Wi-Fi - Time-domain analysis reveals periodic interference (microwaves, FHSS devices)

802.8 What’s Next

Apply your knowledge with assessments and explore specific protocols:

Protocol Deep Dives: - Wi-Fi Fundamentals and Standards - 802.11 detailed coverage - Bluetooth Fundamentals and Architecture - BLE and Classic Bluetooth - Zigbee Fundamentals and Architecture - Mesh networking at 2.4 GHz - LoRaWAN Overview - Sub-GHz LPWAN - Cellular IoT Fundamentals - LTE-M, NB-IoT, 5G

Advanced Topics: - Mobile Wireless Fundamentals - Link budget calculations - Mobile Wireless Labs and Implementation - Advanced RF measurements

802.9 References

Hardware: - ESP32 Development Board: https://www.espressif.com/ - Arduino IDE: https://www.arduino.cc/ - RTL-SDR (optional): https://www.rtl-sdr.com/

Software Tools: - Python NumPy/Matplotlib for data analysis - Wi-Fi Analyzer apps for mobile spectrum scanning - Wireshark for packet analysis

Standards: - IEEE 802.11: Wireless LAN standards - IEEE 802.15.4: Low-Rate Wireless Networks - FCC Part 15: Radio Frequency Devices