# IoT Applications

# Introduction to LoRa Mesh for IoT

LoRa mesh networks provide a compelling platform for IoT sensor deployments, especially where WiFi doesn't reach, cellular is too expensive, and wired connections are impractical.

## When LoRa mesh is the right choice for IoT

<table id="bkmrk-scenariolora-mesh-ad"><thead><tr><th>Scenario</th><th>LoRa mesh advantage</th></tr></thead><tbody><tr><td>Remote sensors (field, barn, remote cabin)</td><td>No cellular or WiFi needed; solar-powered nodes transmit data back to base</td></tr><tr><td>Large properties (farms, ranches, campuses)</td><td>Single gateway + relay nodes covers miles; WiFi would require many access points</td></tr><tr><td>Emergency/event temporary deployment</td><td>No infrastructure setup; nodes self-organize; deploy in minutes</td></tr><tr><td>Low-bandwidth telemetry (weather, soil, water)</td><td>LoRa's low data rate matches sensor data volumes perfectly</td></tr><tr><td>Deep sleep battery operation</td><td>Sensors sleep between readings; nRF52 nodes at 12 µA sleep current last years on a battery</td></tr></tbody></table>

## LoRa mesh vs. standalone LoRaWAN for IoT

LoRaWAN (The Things Network, Helium) requires fixed gateways with internet uplinks. LoRa mesh (MeshCore, Meshtastic) self-organizes and works in areas with no internet or gateway infrastructure. Tradeoffs:

<table id="bkmrk-lorawanlora-mesh-%28me"><thead><tr><th></th><th>LoRaWAN</th><th>LoRa Mesh (MeshCore)</th></tr></thead><tbody><tr><td>**Infrastructure required**</td><td>Yes - gateway needed</td><td>No - self-organizing</td></tr><tr><td>**Range extension**</td><td>Gateway-only (no repeating)</td><td>Multi-hop relay through mesh</td></tr><tr><td>**Data rate**</td><td>Higher (ADR)</td><td>Lower (fixed preset)</td></tr><tr><td>**Cloud integration**</td><td>Built-in (TTN, Helium)</td><td>Manual (MQTT bridge)</td></tr><tr><td>**Best for**</td><td>Fixed sensor fields near gateways</td><td>Remote, no-infrastructure, or mobile IoT</td></tr></tbody></table>

## Typical IoT payload sizes

LoRa mesh is suitable for low-bandwidth sensor data. Typical packet sizes:

- Temperature + humidity: ~10 - 20 bytes
- GPS position: ~20 - 30 bytes
- Multi-sensor (temp + humidity + pressure + battery): ~40 bytes
- Short text alert: ~50 - 100 bytes

Even at Long Fast preset (1.07 kbps), a 40-byte sensor reading transmits in under 500ms. At Medium Slow, under 250ms. IoT use cases are generally not limited by data rate.

## Battery life for IoT sensor nodes

With the Heltec T096 (nRF52840, 12 µA deep sleep, $29.90) and a 1000 mAh LiFePO4 cell:

```
Sleep current: 12 µA
Wake + measure + transmit: ~25 mA for ~0.5 seconds every 15 minutes

Average current ≈ 12 µA + (25,000 µA × 0.5s / 900s) ≈ 26 µA average

Battery life = 1000 mAh / 0.026 mA = ~38,000 hours = ~4.3 years
```

With a small solar cell (even 0.5W), the battery stays topped up indefinitely. This makes truly maintenance-free 5+ year deployments practical.

# Remote Sensor Deployment Guide

A practical guide for deploying LoRa mesh sensor nodes in the field for environmental monitoring, agriculture, and infrastructure monitoring.

## Example use cases from the community

### Weather station network

Multiple BME280-equipped nodes reporting temperature, humidity, and pressure at regular intervals. A gateway node (with internet uplink) receives all reports and logs them to a database. The mesh provides coverage even when nodes are miles apart across a farm or forest.

### Soil moisture monitoring

Capacitive soil moisture sensors (e.g. STEMMA Soil Sensor) connected to a RAK4631 WisBlock. Node wakes every 30 minutes, reads moisture level, transmits if below threshold (irrigation alert), returns to sleep. Battery lasts 12+ months on a single charge with occasional solar topping.

### Water level monitoring

Ultrasonic or pressure transducer water level sensors for creek gauging, tank monitoring, or flood early warning. The mesh allows data to reach a gateway even when the sensor is in a remote canyon without cellular coverage.

### Gate and door alerts

Reed switch or Hall effect sensor triggers a mesh message when a gate, shed door, or access point is opened. Uses a latching trigger architecture (interrupt-driven, not polling) for maximum battery life.

## Choosing hardware for IoT sensor nodes

<table id="bkmrk-boardmcusleep-curren"><thead><tr><th>Board</th><th>MCU</th><th>Sleep current</th><th>Sensor interfaces</th><th>Best for</th></tr></thead><tbody><tr><td>Heltec T096</td><td>nRF52840</td><td>12 µA</td><td>I²C, SPI, UART, ADC</td><td>Ultra-low power remote sensors</td></tr><tr><td>RAK4631 WisBlock</td><td>nRF52840</td><td>~2 µA (MCU only)</td><td>WisBlock sensor slot ecosystem</td><td>Modular sensor builds with WisBlock sensors</td></tr><tr><td>Heltec V4</td><td>ESP32-S3</td><td>~10 µA (deep sleep)</td><td>I²C, SPI, UART, ADC, WiFi</td><td>Gateway nodes that also serve WiFi</td></tr><tr><td>XIAO nRF52840</td><td>nRF52840</td><td>~5 µA</td><td>I²C, SPI, UART</td><td>Compact DIY sensor builds</td></tr></tbody></table>

## The RAK WisBlock sensor ecosystem

RAKwireless produces a modular ecosystem (WisBlock) where sensor modules snap directly onto the RAK4631 base board without soldering:

- RAK1901: Temperature + humidity (SHTC3)
- RAK1902: Barometric pressure (LPS22HB)
- RAK1904: 3-axis accelerometer (LIS3DH) - vibration / motion detection
- RAK12010: Ambient light sensor
- RAK12019: UV index sensor
- RAK12500: GPS module (u-blox ZOE-M8Q)
- RAK13010: SDI-12 interface (agricultural soil/water sensors)

This ecosystem significantly reduces build complexity - no custom PCB or wiring required for common sensor types.

## Deployment checklist

- Enclosure rated IP65+ with UV-resistant housing
- Cable glands on all penetrations (sensor cable, antenna, power)
- Desiccant pack inside enclosure; replace annually
- Solar panel and MPPT charge controller for remote sites
- LiFePO4 battery (not LiPo) for any outdoor or temperature-variable deployment
- Antenna mounted outside enclosure (even 1 meter above the enclosure adds range)
- GPS coordinates recorded and logged - for the network map and maintenance records
- Label the enclosure with node name and maintainer contact

## Getting data off the mesh

Sensor data on the mesh is useful only if someone can read it. Options for data collection:

1. **Manual retrieval:** A person with a phone and the app periodically reads nodes. Simple but not real-time.
2. **Room server + MQTT:** A MeshCore Room Server (running on dedicated nRF52840 or ESP32 hardware)
3. **Python API script:** A script running on a server-connected node logs all incoming telemetry to a database. See the [MeshCore Python API](https://wiki.meshamerica.com/books/meshcore/page/meshcore-python-api) page.
4. **Internet-bridged gateway:** A MeshCore node with WiFi (Heltec V4) connected to a home network; the Python library reads data and forwards to any cloud service.