# Real-World IoT Applications

# Water Quality and Flood Monitoring Networks

Environmental monitoring is one of the most compelling applications for LoRa mesh networks: sensors can be deployed in remote, power-limited locations that are difficult or expensive to reach with traditional wired or cellular connectivity.

## Water Quality Monitoring

Mesh-connected water quality sensors provide real-time data for rivers, lakes, reservoirs, and municipal water systems:

### Parameters to Monitor

- **pH** - Atlas Scientific EZO pH circuit + probe (~$80). pH outside 6.5-8.5 indicates contamination risk.
- **Turbidity** - Measures water clarity; spikes indicate sediment runoff or contamination events
- **Dissolved Oxygen** - Critical for aquatic life; low DO indicates algal bloom or organic pollution
- **Conductivity/TDS** - Total dissolved solids; elevated levels indicate industrial runoff or saltwater intrusion
- **Water temperature** - DS18B20 waterproof probe (~$5); temperature affects biological and chemical processes
- **Water level** - Ultrasonic or pressure transducer sensor; critical for flood warning systems

### Hardware Architecture

A complete water quality node:

- RAK4631 base (ultra-low power nRF52840)
- Atlas Scientific EZO carrier board (I2C) for multi-parameter sensing
- DS18B20 waterproof temperature probe
- IP68 fiberglass enclosure with cable glands for sensor probes
- 10W solar panel + 10Ah LiFePO4 battery (year-round autonomous operation)
- Transmit interval: 15-30 minutes (low duty cycle saves power and channel bandwidth)

## Flood Early Warning Systems

A creek or river flood warning network can provide 30-120 minutes of advance warning to downstream communities:

1. Deploy water level sensors at upstream monitoring points (2-3 sensors per watershed)
2. Set alert thresholds: "Advisory" at 50% of flood stage, "Warning" at 75%, "Emergency" at 90%
3. Gateway node at the monitoring station forwards alerts to community mesh
4. Room server stores alerts and delivers to all connected community members
5. Integration with community alerting: Telegram bot, email, or siren activation

**Case study framework:** A network of 5 sensors along a 20-mile creek watershed, each transmitting hourly with a gateway node at the nearest road bridge, can provide the downstream community with actionable flood warnings that the National Weather Service may not provide until the event is imminent.

## Data Management and Visualization

```
# Simple data pipeline for water monitoring:
# 1. Sensor node transmits JSON over LoRa mesh
# 2. Gateway node receives and publishes to MQTT
# 3. InfluxDB stores time-series data
# 4. Grafana displays dashboard with:
# - Current readings per sensor
# - Historical trend charts
# - Alert status indicators
# - Map overlay with sensor locations

# Sample InfluxDB query for flood alert:
# SELECT last("level_cm") FROM water_sensors
# WHERE "location" = 'upstream_north'
# AND "level_cm" > 180 # alert threshold
```

# Air Quality and Environmental Monitoring Networks

Urban air quality monitoring is an underserved application for community mesh networks. Low-cost sensor nodes can build hyperlocal air quality maps that government monitoring stations - typically spaced miles apart - cannot provide.

## Why Low-Cost Sensors Matter

The EPA and state agencies typically maintain one air quality monitoring station per 100+ square miles in urban areas. These stations are highly accurate but expensive (~$100K per station) and capture only regional averages. Community mesh nodes with low-cost sensors ($50-200 per node) can provide neighborhood-level data that reveals hotspots, traffic corridors, and industrial emission events invisible to the regional monitoring network.

## Sensor Options for Air Quality

<table id="bkmrk-parametersensorcosta"><thead><tr><th>Parameter</th><th>Sensor</th><th>Cost</th><th>Accuracy</th><th>Notes</th></tr></thead><tbody><tr><td>PM2.5 / PM10</td><td>Plantower PMS5003 or SDS011</td><td>$15-25</td><td>±10 µg/m³</td><td>Most important for health; needs temperature correction</td></tr><tr><td>CO₂</td><td>Sensirion SCD40 or SCD41</td><td>$35-50</td><td>±50 ppm</td><td>True NDIR sensor; accurate without calibration</td></tr><tr><td>VOCs</td><td>SGP30 or SGP41</td><td>$15-20</td><td>Semi-quantitative</td><td>Good for trend and event detection; not precise absolute levels</td></tr><tr><td>NO₂ / O₃</td><td>Spec Sensors electrochemical</td><td>$50-100 each</td><td>±20 ppb</td><td>Higher cost; good for near-road monitoring</td></tr><tr><td>Temp + Humidity</td><td>BME280 or SHT31</td><td>$3-8</td><td>±0.5°C, ±3% RH</td><td>Essential for correcting PM sensor readings</td></tr></tbody></table>

## Building a PM2.5 Monitoring Node

```
# Hardware: RAK4631 + RAK1906 (BME680) + external PMS5003
# Connect PMS5003 to UART on RAK19007 base board
# RAK1906 provides temperature/humidity for PM correction

# MeshCore SENSOR firmware sends telemetry packets
# Meshtastic: use Telemetry module with custom I2C sensor support
# Or: use ESP32 (T-Beam) running custom Arduino firmware that
# packages PMS5003 + BME280 data into Meshtastic environment telemetry format

# Meshtastic custom telemetry (advanced):
# Modify device firmware to include PMS5003 data in telemetry packets
# Or: use a Raspberry Pi co-processor that reads PMS5003 via UART
# and injects formatted messages into the mesh via Python API
```

## Community Air Quality Network Design

For a neighborhood-scale (10-50 node) air quality network:

- **Spatial coverage:** 1 node per 0.5-1 km² in residential areas; denser near industrial sources and major roads
- **Transmission interval:** 5-15 minutes (PM sensors need averaging to reduce noise)
- **Data aggregation:** Central room server or MQTT gateway with InfluxDB backend
- **Public dashboard:** Grafana public dashboard showing real-time map (use Leaflet.js for geographic visualization)
- **Calibration:** Collocate 2-3 nodes with nearest EPA monitoring station for 2-4 weeks to develop calibration coefficients

## Community Value and Partnerships

- Share data with PurpleAir, AirNow, or OpenAQ platforms for broader visibility
- Partner with local universities for calibration studies and data analysis
- Provide data to neighborhood environmental justice organizations
- Submit findings to local air quality district as citizen science data