LoRaWAN for smart farming: a field-to-server architecture with Industrial Shields

ESP32 PLC as LoRa field nodes, GateBerry as gateway, Raspberry PLC as edge server — a complete precision agriculture stack
June 16, 2026 by
LoRaWAN for smart farming: a field-to-server architecture with Industrial Shields
Alba Sánchez Honrado

Connecting sensors distributed across hundreds of hectares is one of the core challenges in precision agriculture. WiFi reaches tens of metres. Cellular costs per-device per month. Wired infrastructure is impractical across open fields.

LoRaWAN changes the equation: a single gateway covers 5–15 km in open terrain, nodes run on battery for months, and the protocol is designed for exactly the small, infrequent payloads that field sensors produce.

This post covers how LoRaWAN works, why it suits agricultural deployments, and how to build a complete field-to-server architecture using Industrial Shields hardware — from sensor node to edge server, without cloud dependency.

LoRaWan distributed architecture

Why LoRaWAN fits agriculture

Most field sensors — soil moisture, temperature, CO₂, livestock trackers — send small payloads infrequently. A soil probe might transmit 20 bytes every 15 minutes. LoRaWAN is built for exactly this pattern: low data rate, long range, ultra-low power.

LoRa (the physical layer) uses chirp spread spectrum modulation. Three parameters control the range/throughput trade-off:

  • Spreading Factor (SF 7–12): higher SF = longer range, lower throughput. SF12 at 125 kHz reaches maximum range but limits payload to ~51 bytes at 250 bps.
  • Bandwidth (125 / 250 / 500 kHz): wider = faster, shorter range. 125 kHz is the standard for long-range agricultural use.
  • Coding Rate: higher = more interference resilience, longer packets. CR 4/5 is the default; increase for noisy RF environments.

LoRaWAN (the network layer) adds device addressing, confirmed/unconfirmed uplinks, adaptive data rate, and duty-cycle management — the infrastructure a multi-node deployment needs without requiring a network engineer to build it.

Why LoRaWAN fits agriculture

A complete LoRaWAN architecture with Industrial Shields

End nodes — ESP32 PLC

The ESP32 PLC acts as the LoRa field node. It reads sensor data — soil moisture, temperature, CO₂, flow meters — via its analog and digital I/Os, packages the payload, and transmits over LoRa at configurable SF and bandwidth.

Key advantages in the field: industrial enclosure rated for outdoor conditions, wide power supply range (12–24 VDC), and native WiFi/BLE for local configuration without disconnecting from the LoRa network. Battery operation with deep-sleep between transmissions extends node autonomy to months per charge cycle.

The Industrial Shields LoRa library handles packet framing, frequency hopping, and duty-cycle compliance, keeping the node firmware focused on sensor logic.

ESP32 PLC with LoRa

Gateway — GateBerry

The GateBerry is an industrial LoRaWAN gateway based on Raspberry Pi, housed in a DIN Rail enclosure designed for control cabinet installation. It receives LoRa transmissions from all nodes in range and forwards packets to the network server — in this architecture, the Raspberry PLC on the same local network.

One GateBerry covers a deployment of 250+ nodes across several kilometres of open terrain. Antenna placement is the main range variable: mounted at 3–5 m height with line of sight, the GateBerry reliably covers a radius of 5–10 km in flat agricultural land.

 industrial LoRaWAN gateway based on Raspberry Pi

Edge server — Raspberry PLC

The Raspberry PLC closes the loop locally. Running Linux, it hosts the LoRaWAN network server (ChirpStack), a MQTT broker, and Node-RED flows that process incoming sensor payloads and trigger control outputs.

This means the full automation logic — threshold alerts, irrigation valve control, greenhouse actuators — runs at the edge without any cloud dependency. Internet connectivity becomes optional rather than critical. In areas with intermittent cellular coverage, the system continues operating autonomously and synchronises when connectivity is available.

Onboard I/Os allow direct actuation of relays and digital outputs, closing the loop from field measurement to physical actuation within the same device.

Edge server — Raspberry PLC

Smart farming use cases and applications

  • Soil monitoring: ESP32 PLC nodes read soil moisture and temperature at multiple depths. Raspberry PLC aggregates readings and adjusts irrigation schedules automatically. Growers get per-zone data without running cable across the field.
  • Livestock tracking: GPS+LoRa collar nodes transmit position every few minutes. GateBerry collects all beacons; Raspberry PLC logs positions and triggers alerts when animals leave defined zones.
  • Greenhouse control: CO₂, humidity, and temperature sensors transmit to a local GateBerry. Raspberry PLC closes control loops for ventilation, heating, and irrigation based on real-time readings — no cloud latency in the control path.
  • Water management: Flow meters and tank level sensors distributed across an irrigation network report via LoRaWAN. Raspberry PLC detects anomalies (unexpected flow = leak) and actuates zone valves.

Smart farming use cases

Deployment considerations

  • Spreading factor selection: start with SF10–12 for maximum range in open terrain. If packet delivery rate (PDR) exceeds 95% at shorter distances, reduce SF to increase throughput and reduce air time.
  • Antenna placement: elevate the GateBerry antenna above crop height — even 3 m clears most interference from vegetation. Fresnel zone clearance matters more than raw distance to the node.
  • Duty cycle and capacity: with 250+ nodes and 3 channels, space transmissions to stay within the 1% duty cycle limit per node. At SF10 and 125 kHz, a 20-byte payload takes ~370 ms — well within limits at 15-minute intervals.
  • Uplink vs downlink: LoRaWAN favours uplink. Design sensor payloads to be self-contained. Use confirmed uplinks sparingly — they consume downlink capacity and increase air time for all nodes on the network.
  • Redundancy: for critical deployments, a second GateBerry at a different location improves coverage overlap and eliminates single points of failure in the RF layer.

​Search in our Blog

LoRaWAN for smart farming: a field-to-server architecture with Industrial Shields
Alba Sánchez Honrado June 16, 2026
Share this post
Tags

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.

PLC Comparison