374  WSN Exercises and Resources

Prerequisites: Complete the WSN series

Part of: Wireless Sensor Networks series

374.1 Summary

This chapter introduced the fundamental concepts and architecture of Wireless Sensor Networks (WSNs):

  • WSN Architecture: Networks of resource-constrained sensor nodes that collaboratively monitor physical phenomena through multi-hop mesh communication to sink nodes
  • Design Constraints: WSNs prioritize energy efficiency above all else, as nodes typically operate on batteries for months or years in inaccessible locations
  • Network Components: Sensor nodes (sensing, processing, communication), sink nodes (data collection), and optional gateways for internet connectivity
  • Communication Protocols: Low-power MAC protocols (X-MAC, B-MAC, S-MAC) enable duty cycling where nodes sleep 95%+ of the time
  • Routing Strategies: Data-centric routing, geographic routing, and in-network aggregation minimize transmissions and conserve energy
  • WSN vs. MANET: Unlike mobile ad-hoc networks that prioritize mobility and throughput, WSNs sacrifice performance for extreme energy efficiency
  • Key Trade-offs: The triangle of range, power consumption, and data rate - you can optimize two but not all three simultaneously
  • Modern Integration: WSN principles merge with IoT architectures, with WSN techniques at the sensor tier connecting to cloud platforms for data management

Understanding WSNs provides the foundation for designing energy-efficient IoT systems, particularly for large-scale deployments in remote or difficult-to-access environments.

WSN Deep Dives: - WSN Coverage - Coverage algorithms and strategies - WSN Tracking - Object tracking in WSNs - WSN Overview Review - Comprehensive reference

Wireless Technologies: - Zigbee - WSN protocol stack - 802.15.4 - Physical layer - LoRaWAN - Long-range WSN

Architecture Context: - Edge Fog Computing - Data processing tiers - IoT Reference Models - Architecture layers - Architectural Enablers - Enabling technologies

IoT Products:

Learning Hubs: - Quiz Navigator - WSN quizzes

374.2 Interactive Quiz: Test Your Understanding

Test your knowledge of wireless sensor networks with this interactive auto-grading quiz.


374.3 Practice Exercises

Test your understanding of Wireless Sensor Networks with these hands-on exercises.

Objective: Calculate and compare network lifetime under different duty cycling strategies.

Scenario: You’re deploying a 50-node agricultural WSN. Each node has a 2000 mAh battery and consumes: - Active (sensing + transmitting): 20 mA for 1 second - Idle listening: 15 mA - Sleep mode: 0.01 mA

Tasks: 1. Calculate battery lifetime for a node that transmits every 60 seconds without duty cycling (radio stays in idle listening mode) 2. Calculate lifetime with 1% duty cycle (active 1 second per 100 seconds, sleep otherwise) 3. Determine how long the network maintains 100% coverage (First Node Death metric) 4. Calculate lifetime extension if hotspot nodes near the sink are replaced with solar-powered nodes

Expected Outcome: - Understand the dramatic impact of duty cycling on battery life (days vs years) - Recognize the hotspot problem and its effect on network lifetime - Be able to perform basic WSN energy calculations

Solution Hints: - Without duty cycling: Average current = 15 mA (idle) + (20 mA × 1s / 60s) ≈ 15.3 mA - With duty cycling: Average current = (20 mA × 1s / 100s) + (0.01 mA × 99s / 100s) ≈ 0.21 mA - Lifetime = Battery capacity / Average current - Hotspot nodes relay traffic, consuming ~5-10× more energy than edge nodes

Objective: Design and simulate different WSN topologies for a real-world scenario.

Scenario: Smart building with 100 temperature/humidity sensors across 3 floors (200m × 50m per floor). Sensors have 50m communication range, 10m sensing range. Gateway located on ground floor center.

Tasks: 1. Calculate minimum number of sensors needed for full coverage (every point within 10m of a sensor) 2. Design three topologies: (a) Star with multiple gateways, (b) Mesh network, (c) Cluster-tree 3. For each topology, calculate: average hop count to gateway, number of relay nodes, maximum node degree 4. Use a network simulator (e.g., Cooja, ns-3, or simple Python script) to model packet delivery under 10% link failure rate 5. Compare energy consumption: count total transmissions per data collection round

Expected Outcome: - Understand trade-offs between topologies (complexity vs. reliability vs. energy) - Gain hands-on experience with network simulation tools - Learn to calculate coverage and connectivity metrics

Tools: Python + NetworkX library for graph modeling, or Cooja/Contiki for WSN simulation

Solution Approach: - Coverage: Area / (π × Rs²) with overlap factor ≈ 1.2-1.5 - Star: Simple but limited by gateway range, needs multiple gateways - Mesh: Most reliable but highest energy cost due to route discovery - Cluster-tree: Good balance, 20-30 nodes per cluster recommended

Objective: Compare energy efficiency of different routing protocols through analysis and simulation.

Scenario: 100-node WSN with single sink. Compare flooding, geographic routing, and LEACH clustering.

Tasks: 1. Analyze message overhead for each protocol when 10 nodes simultaneously send data to sink 2. Calculate energy consumption: assume 1 unit energy per transmission, 0.5 units per reception 3. Identify bottleneck nodes (hotspots) in each protocol 4. Simulate 100 rounds of data collection and plot: (a) Total network energy, (b) First node death time, (c) Average latency 5. Propose a hybrid protocol combining best features of each

Expected Outcome: - Understand routing protocol behavior in multi-hop networks - Learn to identify and analyze hotspot problems - Develop protocol comparison and optimization skills

Implementation:

# Pseudocode for routing comparison
def flooding(nodes, source, sink):
    messages = 0
    for node in nodes:
        if node.has_data:
            messages += broadcast_to_neighbors(node)
    return messages

def geographic_routing(nodes, source, sink):
    current = source
    hops = 0
    while current != sink:
        next_node = get_closest_to_sink(current.neighbors, sink)
        transmit(current, next_node)
        current = next_node
        hops += 1
    return hops

# Compare total transmissions and energy

Objective: Design a complete WSN deployment with cost analysis and energy planning.

Scenario: Precision agriculture for 100-hectare vineyard. Monitor soil moisture, temperature, and humidity. Data collection every 10 minutes. 3-year battery lifetime required.

Tasks: 1. Calculate sensor density: nodes per hectare based on 50m sensing range 2. Select hardware: Arduino + LoRa ($35/node) or ESP32 + Wi-Fi ($25/node + gateway costs) 3. Design network topology and calculate infrastructure needs (gateways, routers) 4. Create energy budget: calculate required battery capacity for 3-year lifetime with 1% duty cycle 5. Calculate total deployment cost: sensors, gateways, installation, connectivity (cellular/Wi-Fi), maintenance 6. Create deployment map showing node placement, cluster heads, and gateway positions

Expected Outcome: - Learn to translate requirements into WSN design specifications - Understand cost-performance trade-offs in real deployments - Gain experience with hardware selection and energy planning

Deliverable: 1-page deployment plan with: - Network diagram - Bill of materials (BOM) with costs - Energy budget spreadsheet - Installation timeline


374.4 Academic Resource: Smart Grid Power Distribution WSN

Smart grid power distribution wireless sensor network showing a central power generation facility (factory with smokestacks) connected via high-voltage transmission lines to multiple electrical substations (transmission towers), which then distribute power to residential homes (yellow houses) across the service area - wireless sensor links (white lines) form a mesh network connecting all elements for real-time monitoring of power flow, fault detection, and demand response - illustrating how WSN enables the smart grid vision of bidirectional power and information flow

Smart grid power distribution network showing sensor nodes at substations and homes connected via mesh wireless links

Source: NPTEL Internet of Things Course, IIT Kharagpur

This diagram demonstrates a real-world WSN deployment for smart grid power distribution:

  • Generation Layer: Power plant with environmental monitoring sensors
  • Transmission Layer: High-voltage substations with fault detection sensors
  • Distribution Layer: Residential endpoints with smart meters and demand sensors
  • Communication Mesh: Wireless links providing redundant paths for reliable data delivery

Key WSN Design Considerations Illustrated:

Layer Sensors Communication Data Rate
Generation Temperature, emissions, output Wired/Fiber High (1 kbps+)
Transmission Current, voltage, faults LoRa/Cellular Medium (100 bps)
Distribution Smart meters, demand Zigbee/Wi-SUN Low (10 bps)

374.5 What’s Next?

Having explored these architectural concepts, we now examine Wsn Tracking. The next chapter builds upon these foundations to explore additional architectural patterns and considerations.

Continue to Wsn Tracking →