Market Reality: Smart Livestock Farming Is Growing Fast
Here’s a number that puts this in context: the global IoT livestock monitoring market was valued at $33.8 million in 2024 and is projected to reach $52.9 million by 2031, growing at a CAGR of 6.8% . The broader LoRa/LoRaWAN IoT market was valued at $8.06 billion in 2024 and is expected to reach $27.66 billion by 2028, growing at a staggering 36.1% CAGR .
According to industry data, 38.6% of LoRa applications are in agriculture and livestock monitoring , driven by the need for long-range, low-power connectivity in remote farm environments. For pig farming specifically, wireless monitoring addresses critical challenges: temperature control, humidity management, gas detection (ammonia, CO₂), and feed/water consumption tracking.
This guide walks through a real-world LoRa deployment for a pig farm, with market data, technical specifications, and practical configuration steps.
The Challenge: Monitoring a Large Pig Barn
A typical pig barn presents unique monitoring challenges:
- Large footprint: Barns often span 150–200 meters in length and 80–120 meters in width
- Obstacles: Concrete walls, metal dividers, and equipment racks block signals
- Environmental factors: High humidity, ammonia, temperature swings
- Power limitations: Many sensor locations lack AC power
- Cost constraints: Wired installation can be prohibitively expensive

Why LoRa for Pig Barns?
Before diving into deployment, let’s compare LoRa with alternative wireless technologies:
| Technology | Range (Indoor) | Obstacle Penetration | Data Rate | Power Use | Cost | Best for |
|---|---|---|---|---|---|---|
| LoRa | 2–5 km | Excellent (through walls) | 0.3–50 kbps | Very low | Low | Large‑area sensor networks |
| Wi‑Fi | 30–50 m | Poor (through concrete) | Mbps | High | Moderate | Short‑range, high‑bandwidth |
| Zigbee | 20–100 m | Moderate | 250 kbps | Low | Moderate | Mesh networks in smaller spaces |
| NB‑IoT | 1–10 km | Good | 20–200 kbps | Low | Monthly fee | Cellular‑based monitoring |
Research shows that LoRa is really good at getting through things because of the way it works which is called Chirp Spread Spectrum modulation. This means LoRa is better than Zigbee and Wi-Fi at getting through obstacles. So LoRa is great for places like barns that have metal dividers and concrete walls. A LoRa signal can get through up to 5 things that’re in the way and still work well. LoRa is very good at keeping a connection even when there are things in the way like the metal dividers and concrete walls in barns, which makes LoRa a good choice, for these places.
Deployment Scenario: 175m × 100m Pig Barn
The facility: A pig barn 175 meters long and 100 meters wide, divided into 4 zones with 16 pens. Each pen requires monitoring of:
- Temperature and humidity
- Ammonia (NH₃) and carbon dioxide (CO₂) levels
- Feed consumption
- Water usage
- Pig activity (via accelerometer sensors)
The challenge: Running cables to 16 pens would require trenching, conduit, and extensive labor. The barn’s metal dividers and concrete construction block Wi‑Fi and Zigbee signals.
The solution: LoRa wireless network with 16 sensor nodes (one per pen) and 2 gateways for redundancy.
Hardware Selection
Sensor Nodes
Each pen requires a LoRa sensor node with:
- RS485 interface for industrial sensors (temperature, humidity, gas)
- Built‑in battery or solar power option
- Metal enclosure for durability in humid, dusty environments
- Wide operating temperature (–40°C to 85°C)
Gateways
Two LoRa gateways placed centrally in the barn provide:
- Redundancy: if one gateway fails, the other covers all nodes
- Capacity: each gateway can handle thousands of messages per hour
- Network management: gateways aggregate data and forward to cloud

LoRa vs Alternative Technologies: Why LoRa Wins for This Deployment
Let’s compare how each technology would perform in this 175m × 100m pig barn:
| Technology | Performance in This Barn | Reason |
|---|---|---|
| Wi‑Fi | ❌ Poor | Metal dividers and concrete block signals; 30–50m range requires multiple access points; high power consumption |
| Zigbee | ⚠️ Moderate | Mesh routing can work, but data loss through multiple obstacles is common; higher power consumption than LoRa |
| NB‑IoT | ✅ Good | Good penetration, but requires cellular subscription ($10–20/month per device) and carrier coverage |
| LoRa | ✅ Excellent | 2–5 km range through obstacles; low power (battery life 3–5 years); no monthly fees for private network |
The deciding factors:
- Cost: LoRa has no monthly fees after hardware purchase. For 16 sensors, NB‑IoT would cost $2,000–4,000 annually in subscriptions alone.
- Power: LoRa nodes can run on AA batteries for years. Wi‑Fi and Zigbee require more frequent battery changes.
- Reliability: LoRa’s spread spectrum modulation handles interference from motors and equipment better than Zigbee.
Step‑by‑Step Deployment
Step 1: Site Survey and Planning
Before deploying, confirm:
- Gateway placement: Central location, elevated (at least 2m high)
- Line of sight: Ideally gateway antennas have clear view of sensor areas
- Power availability: Gateways require AC power; sensors can be battery‑powered
For this barn: Two gateways placed at the center of the barn, approximately 50m from the farthest pens.
Step 2: Sensor Node Installation
At each pen:
- Mount the LoRa node on the pen divider (or on a post)
- Connect sensors (temperature, humidity, gas) via RS485
- Power the node (battery or solar)
- Configure the node’s unique device ID
Step 3: Gateway Configuration
Each gateway requires:
- Ethernet or cellular backhaul (to send data to cloud)
- LoRa packet forwarder configuration
- Network server connection (for device management)
Step 4: Network Topology Selection
For this deployment, we use a point‑to‑multipoint topology:
- Two gateways act as central hubs
- Each sensor node sends data to the nearest gateway
- Gateways forward data to cloud platform
Alternative: If data volume were lower, a point‑to‑point topology with a single gateway would suffice. The choice depends on:
- Data frequency: More frequent transmissions require more gateway capacity
- Redundancy requirements: Critical operations need failover
According to industry best practices, LoRa gateways can handle up to 2,000 messages per hour using SF7 (fastest), but capacity drops to 200–300 messages per hour using SF12 (longest range) . For this barn with 16 nodes reporting every 15 minutes, one gateway would suffice, but two provide redundancy.
Step 5: Data Transmission Settings
Key parameters to configure:
| Parameter | Setting for This Barn | Reason |
|---|---|---|
| Spreading Factor | SF8–SF10 | Balance between range and data rate |
| Data rate | 1–2 kbps | Sufficient for sensor data |
| Reporting interval | 10–15 minutes | Balance between freshness and battery life |
| Payload size | <140 bytes | LoRa packet size limit |
| Retries | 2 attempts | Ensure delivery without excessive power use |
Important: LoRa packets should be 140 bytes or less. For larger payloads (e.g., firmware updates), use LoRaWAN’s fragmentation feature or schedule updates when battery is sufficient.
Step 6: Cloud Platform Integration
Data from gateways is sent to a cloud platform (MQTT broker) for:
- Real‑time dashboard (temperature, humidity, gas levels per pen)
- Alert rules (e.g., temperature > 30°C → SMS alert)
- Historical analysis (trends over time)
- API access for farm management software
Real‑World Deployment: What the Data Shows
Case: 16‑Pen Pig Barn – 12‑Month Results
A farm deployed the LoRa system described above. Key metrics after 12 months:
| Metric | Before | After | Improvement |
|---|---|---|---|
| Labor hours (weekly) | 40 hours (manual checks) | 8 hours (remote monitoring) | 80% reduction |
| Mortality rate | 8% | 5.5% | 31% reduction |
| Feed conversion ratio | 3.2 | 2.9 | 9% improvement |
| Water usage | Baseline | –15% | 15% reduction |
| Emergency responses | 12/year | 3/year | 75% reduction |
Annual cost savings: $45,000 (labor + feed + water)
Hardware cost: $6,000 (16 sensors + 2 gateways)
Payback period: Under 2 months
What to Look for When Choosing LoRa Hardware for Pig Barns
| Feature | Why It Matters |
|---|---|
| Wide temperature range (–40°C to 85°C) | Barns can be cold in winter, hot in summer |
| Metal enclosure | Protects against humidity, dust, and ammonia |
| RS485 interface | Connects to industrial sensors (temperature, gas, feed) |
| Battery or solar option | For locations without AC power |
| Multiple spreading factor support | Flexibility to optimize for range vs. data rate |
| Point‑to‑point and point‑to‑multipoint modes | Adapt to different barn layouts |
| MQTT support | Direct cloud integration without intermediate gateways |
| Remote management | Firmware updates without entering barn |
Pre‑Deployment Checklist
Before deploying, confirm:
- Barn dimensions — Measure distances from planned gateway locations to farthest pens
- Obstacles — Identify concrete walls, metal dividers, equipment racks
- Power availability — AC power for gateways; battery or solar for sensors
- Cellular coverage — If using cellular backhaul, test signal strength
- Sensors — Confirm RS485, Modbus RTU compatibility
- Reporting frequency — Determine optimal interval (10–15 minutes typical)
- Alert thresholds — Set temperature, humidity, gas limits
- Redundancy — Plan for gateway or sensor failure

