Smart Agriculture IoT Sensor Network for Precision Farming
Discuss a Similar Engineering Problem
Project Overview
EmbedCrest engineered a precision farming IoT platform for an agritech operator managing farmland across multiple regions. The project involved designing custom solar powered sensor nodes using STM32WL microcontrollers, each integrating capacitive soil moisture probes, NPK nutrient sensors and environmental monitors. A LoRaWAN network connected these nodes to 24 hardened edge gateways running TinyML models built with TensorFlow Lite Micro for real time anomaly detection and automated irrigation control. The gateways relayed aggregated telemetry to AWS IoT Core over LTE M backhaul, feeding a centralized dashboard for fleet management and predictive analytics. Processing critical decisions at the edge means time sensitive irrigation triggers do not wait on the cloud. The project was delivered by our embedded hardware engineering team from our engineering office in Kalyan.
Business Problem
The client, an agritech operator, managed large farmland holdings across multiple regions and relied on manual soil sampling and weather observation for irrigation and fertilization decisions. This labor intensive process led to water waste, inconsistent crop yields and an inability to respond to microclimatic variations in real time. The client needed one engineering partner who could deliver the complete system, from sensor hardware to cloud analytics.
Technical Constraints
- STM32WL microcontrollers on the sensor nodes, running FreeRTOS and switching between Run, Low Power Run and Stop Mode states
- Capacitive soil moisture, temperature, humidity and NPK nutrient sensors on every node
- LoRaWAN Class A links with adaptive data rate, LTE M backhaul from gateways to the cloud
- Solar harvesting with MPPT and a 10 farad supercapacitor bank, no mains power in the field
- Design targets of 12 microamps average sleep current and 72 hours without sunlight for monsoon conditions
- IP67 enclosures for minus 10 to 60 degrees Celsius, heavy rain and UV exposure
- Sub second local response to soil moisture drops without a cloud round trip
Solar sensor nodes to edge gateways to cloud
Solar powered sensor nodes sample soil and climate data and send it over LoRaWAN to ruggedized gateways, which run local inference for irrigation decisions and forward aggregated telemetry over LTE M to AWS IoT Core and a fleet dashboard.
Step 1
Sensor nodes
Solar powered nodes with soil moisture, temperature, humidity and NPK sensors
Step 2
Node firmware
FreeRTOS scheduler with three priority levels and an STM32WL power state machine
Step 3
LoRaWAN network
Class A uplinks with adaptive data rate and OTAA provisioning through the field gateways
Step 4
Edge gateways
Ruggedized gateways running TinyML anomaly detection with TensorFlow Lite Micro and irrigation scheduling
Step 5
Cloud backhaul
LTE M backhaul carrying aggregated telemetry to AWS IoT Core
Step 6
Analytics dashboard
Centralized dashboard for fleet management and predictive analytics built on Python cloud analytics
What Our Team Delivered
- Designed the solar powered sensor node hardware with MPPT harvesting and supercapacitor storage
- Developed FreeRTOS firmware with prioritized sampling, LoRaWAN transmission and self test tasks
- Implemented the STM32WL power state machine and power gated sensor excitation circuits
- Built the TensorFlow Lite Micro anomaly detection and irrigation scheduling pipeline on the gateways
- Integrated gateway telemetry with AWS IoT Core over LTE M and the analytics dashboard
- Defined the factory and field calibration process for soil sensors across terrain types
Engineering Approach
EmbedCrest designed and deployed a distributed IoT sensor network of solar powered sensor nodes, each equipped with capacitive soil moisture, temperature, humidity and NPK nutrient sensors. The nodes communicated over a LoRaWAN network to 24 ruggedized edge gateways, which aggregated data and forwarded it to AWS IoT Core via LTE M backhaul. TinyML on the edge gateways, built with TensorFlow Lite Micro, performed local anomaly detection and irrigation scheduling, reducing cloud dependency and designed for sub second response to sudden soil moisture drops. On the sensor nodes, our embedded developers implemented a custom task scheduler on FreeRTOS with three priority levels: critical sensor sampling at the highest priority, LoRaWAN transmission at medium priority, and diagnostic self test routines at idle priority. Power optimized node firmware used a state machine that transitioned the STM32WL between Run, Low Power Run, Stop Mode 1 and Stop Mode 2 based on the current task phase, with a design target of 12 microamps average current draw during sleep intervals. The solar energy harvesting subsystem used a maximum power point tracking circuit paired with a 10 farad supercapacitor bank, sized for a design target of 72 hours of operation without sunlight as a buffer against monsoon conditions. The entire solution was engineered and delivered from our engineering office in Kalyan, India.
Phases, Testing and Handover
Node and gateway design
Sensor node hardware and solar harvesting were defined around STM32WL microcontrollers and LoRaWAN links, and the edge gateway architecture around LTE M backhaul to AWS IoT Core.
Firmware and edge AI
FreeRTOS task priorities, the low power state machine and the TensorFlow Lite Micro anomaly detection and irrigation scheduling pipeline were developed and integrated on the target hardware.
Sensor calibration
Factory calibration built baseline curves across five soil types, then field calibration with laboratory analyzed soil cores generated per node correction coefficients stored in flash.
Deployment and handover
Nodes joined the network through OTAA provisioning and gateways forwarded telemetry to the cloud dashboard, with a modular design that accepts new nodes and gateways without reconfiguration.
Acceptance criteria
- Per node soil sensor correction coefficients from field calibration against laboratory analyzed soil cores, stored in flash
- Irrigation decisions made locally on the gateways, designed for sub second response without a cloud round trip
- Energy storage sized for the design target of 72 hours without sunlight in monsoon conditions
- New nodes and gateways joining through OTAA provisioning without reconfiguring existing infrastructure
Dependencies
- Local soil cores collected during installation and analyzed in a laboratory for field calibration
- LTE M cellular backhaul from the field gateways to AWS IoT Core
- Solar exposure at the field sites, with no mains power available
Measured Results
Measured results are published only after the client approves the figures together with their baseline, test conditions and measurement method. Ask us about outcomes during a call.
Engineering Evidence
- System block diagram (shown on this page)
Lessons and Limitations
- Making irrigation decisions on the gateways keeps time sensitive triggers working without waiting on a cloud round trip.
- Factory calibration alone does not cover local soil variation, so per node field calibration and temperature compensation were needed.
- Energy storage was sized for monsoon conditions rather than typical sunlight, which drove the supercapacitor bank design.
Technologies Used
- STM32WL
- LoRaWAN
- LTE M
- AWS IoT Core
- TensorFlow Lite Micro
- FreeRTOS
- MQTT
- Capacitive soil sensors
- Solar energy harvesting
- Python (cloud analytics)
Have a similar engineering problem?
Share a short brief; an engineer replies within one business day. How engagements work
Frequently Asked Questions
How do the sensor nodes survive harsh outdoor conditions?
Each sensor node is housed in an IP67 rated enclosure with conformal coated PCBs, designed for temperatures from minus 10 to 60 degrees Celsius, heavy rain and UV exposure. Solar energy harvesting with supercapacitor backup is designed to keep nodes running through extended periods without sunlight.
What wireless protocol was used and why?
LoRaWAN was selected for its long range capability of up to 10 kilometers in open fields, ultra low power consumption and robust performance in rural environments with minimal infrastructure. LTE M was used as a backhaul from gateways to the cloud for cellular connectivity.
Can the system scale to additional farmland?
Yes, the architecture is modular. New sensor nodes join the LoRaWAN network via OTAA provisioning, and additional gateways can be deployed without reconfiguring existing infrastructure. The AWS IoT backend scales with device count.
How was power consumption optimized for long battery life?
Our firmware team implemented a multi tier sleep strategy on the STM32WL sensor nodes. Between sampling intervals, the MCU enters Stop Mode 2 with a design target under 2 microamps. The LoRaWAN radio uses Class A operation with adaptive data rate to minimize transmit time. A custom power management IC coordinates solar panel charging with supercapacitor storage, and a hardware watchdog recovers the system from any unexpected wake state. Sensor excitation circuits are only powered during active measurement windows, typically lasting 120 milliseconds per cycle.
What calibration process was used for soil sensors across different terrain types?
Each sensor node underwent a two phase calibration process. Factory calibration established baseline curves using standardized soil samples across five soil types including clay, loam, sandy, silt and peat. Field calibration was performed during installation using local soil core samples analyzed in a laboratory, generating per node correction coefficients stored in on chip flash. The firmware applies temperature compensation algorithms to account for dielectric constant variations caused by soil temperature changes throughout the day.
Related Case Studies
Facing a Similar Engineering Problem?
Share a short brief; an engineer replies with questions, a suggested approach and next steps.
Discuss a Similar Engineering Problem

