viewof cityArea = Inputs.range([1, 200], {
value: 50,
step: 1,
label: "City area (km²)"
})
viewof gatewayRange = Inputs.range([1, 5], {
value: 2,
step: 0.5,
label: "Gateway coverage radius (km)"
})
viewof redundancyFactor = Inputs.range([1, 3], {
value: 1.5,
step: 0.1,
label: "Redundancy factor (overlap multiplier)"
})
viewof gatewayCost = Inputs.range([1000, 5000], {
value: 2400,
step: 100,
label: "Gateway cost ($)"
})
viewof numSensors = Inputs.range([100, 50000], {
value: 10000,
step: 500,
label: "Number of sensors to deploy"
})
viewof sensorCostUnit = Inputs.range([50, 500], {
value: 185,
step: 10,
label: "Sensor cost per unit ($)"
})
// Calculations
gatewayCoverage = Math.PI * gatewayRange * gatewayRange
theoreticalGateways = cityArea / gatewayCoverage
actualGateways = Math.ceil(theoreticalGateways * redundancyFactor)
totalGatewayCost = actualGateways * gatewayCost
totalSensorCost = numSensors * sensorCostUnit
totalInfrastructureCost = totalGatewayCost + totalSensorCost
sensorsPerGateway = Math.round(numSensors / actualGateways)
gatewayPctOfTotal = (totalGatewayCost / totalInfrastructureCost) * 100
html`
<div style="background: linear-gradient(135deg, #E67E22 0%, #E74C3C 100%); padding: 24px; border-radius: 8px; color: white; margin: 20px 0;">
<h3 style="margin: 0 0 20px 0; color: white;">LoRaWAN Network Coverage Analysis</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 20px;">
<div style="background: rgba(255,255,255,0.1); padding: 16px; border-radius: 6px;">
<div style="font-size: 14px; opacity: 0.9;">Coverage per Gateway</div>
<div style="font-size: 28px; font-weight: bold; color: #3498DB;">${gatewayCoverage.toFixed(1)} km²</div>
<div style="font-size: 12px; opacity: 0.8; margin-top: 4px;">πr² = π × ${gatewayRange}² km</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 16px; border-radius: 6px;">
<div style="font-size: 14px; opacity: 0.9;">Gateways Required</div>
<div style="font-size: 28px; font-weight: bold; color: #16A085;">${actualGateways} units</div>
<div style="font-size: 12px; opacity: 0.8; margin-top: 4px;">${redundancyFactor.toFixed(1)}x redundancy factor</div>
</div>
</div>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 20px;">
<div style="background: rgba(255,255,255,0.1); padding: 16px; border-radius: 6px;">
<div style="font-size: 14px; opacity: 0.9;">Gateway Cost</div>
<div style="font-size: 24px; font-weight: bold; color: #E67E22;">$${totalGatewayCost.toLocaleString()}</div>
<div style="font-size: 12px; opacity: 0.8; margin-top: 4px;">${gatewayPctOfTotal.toFixed(1)}% of total</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 16px; border-radius: 6px;">
<div style="font-size: 14px; opacity: 0.9;">Sensor Cost</div>
<div style="font-size: 24px; font-weight: bold; color: #E67E22;">$${totalSensorCost.toLocaleString()}</div>
<div style="font-size: 12px; opacity: 0.8; margin-top: 4px;">${(100-gatewayPctOfTotal).toFixed(1)}% of total</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 16px; border-radius: 6px;">
<div style="font-size: 14px; opacity: 0.9;">Sensors/Gateway</div>
<div style="font-size: 24px; font-weight: bold; color: #3498DB;">${sensorsPerGateway}</div>
<div style="font-size: 12px; opacity: 0.8; margin-top: 4px;">average density</div>
</div>
</div>
<div style="background: rgba(255,255,255,0.15); padding: 20px; border-radius: 6px; border: 2px solid #16A085;">
<div style="font-size: 14px; opacity: 0.9; margin-bottom: 8px;">Total Infrastructure Investment</div>
<div style="font-size: 36px; font-weight: bold; color: #16A085;">$${totalInfrastructureCost.toLocaleString()}</div>
<div style="font-size: 14px; opacity: 0.8; margin-top: 8px;">
${actualGateways} gateways + ${numSensors.toLocaleString()} sensors
</div>
</div>
<div style="margin-top: 20px; padding: 12px; background: rgba(255,255,255,0.1); border-radius: 6px; font-size: 14px;">
<strong>Network Economics:</strong> Gateway infrastructure represents only ${gatewayPctOfTotal.toFixed(0)}% of total cost.
Same gateways can serve multiple sensor types (parking, waste, lighting), amortizing gateway cost across applications.
</div>
</div>
`Sensor Network Coverage
Sensor Network Coverage
animation
applications
smart-cities
Try Change Gateway coverage radius (km), then press Calculate coverage.
Observe After Calculate coverage, watch Coverage per Gateway and Gateways Required.
Explain Describe how the redundancy factor changes Gateways Required after Calculate coverage.
Technical boundaries. Coverage per Gateway uses πr². Gateways Required multiplies city area divided by coverage by the redundancy factor, then rounds up.
Sensor Network Coverage
Calculate the number of LoRaWAN gateways needed for city-wide sensor coverage.
Key Insight: LoRaWAN gateway infrastructure is a small fraction (typically <10%) of total smart city deployment cost, making it economical to deploy redundant coverage (1.5-2x overlap) for reliability. The same gateway network can simultaneously support parking sensors, waste bins, air quality monitors, and smart lighting, allowing infrastructure costs to be shared across applications. siloed deployments.