How to build a farm monitoring system
Most farm monitoring projects fail in the same way: too many sensors at once, no alerts anyone trusts, and a dashboard nobody opens. Start small and build on what works.
Start with the one failure that would cost you most, and put one sensor and one alert on it. Get that reading to a server, tie it to the right part of the farm, and make sure the alert reaches a phone. Then add the next sensor. A monitoring system is finished when it tells you about a problem before you find it yourself.
Step 1: Choose what to watch first
List what can go wrong and what each costs you. The first sensors go on the top of that list, not on what is easiest to measure.
| If this fails | You lose | Watch it with |
|---|---|---|
| The main pump | Irrigation, or the fish | Pump current and flow |
| The water supply | Everything downstream | Tank level |
| Greenhouse ventilation | A crop, in an afternoon | Air temperature |
| The power | Pumps, fans and the monitoring itself | Voltage, and a “no data” alert |
| Water quality | Fish and roots | Temperature, pH, dissolved oxygen |
Step 2: Choose how each sensor connects
Pick the link by where the sensor is, not by what is fashionable.
MQTT, straight to Urvara
The board joins the Wi-Fi and publishes each reading to the MQTT broker built into the Urvara server. Urvara can write an ESPHome configuration for an ESP32 with the device’s ID already filled in.
- You need
- Wi-Fi at the sensor
- A device ID and token from the app
- It carries
- Readings and on/off commands
MQTT to the Urvara gateway
Put the Urvara gateway on a Raspberry Pi where the farm network reaches. Boards talk MQTT to it with no token of their own, and it forwards the readings and keeps them on disk when the internet is down.
- You need
- A Raspberry Pi or other always-on computer
- A network link from the board to it
- It carries
- Readings and on/off commands
Modbus through the gateway
Energy meters, inverters, pump drives and many industrial sensors speak Modbus. The Urvara gateway reads their registers over RS-485 or the network and sends the values on.
- You need
- The Urvara gateway
- The device’s register list
- An RS-485 adapter for serial devices
- It carries
- Readings only: the gateway never writes to a Modbus device
Zigbee through Zigbee2MQTT
Ready-made Zigbee sensors for temperature, humidity, leaks and doors are cheap and run for a long time on a coin cell. Zigbee2MQTT receives them, and the Urvara gateway listens to it.
- You need
- A Zigbee coordinator stick
- Zigbee2MQTT
- The Urvara gateway
- It carries
- Readings only
LoRaWAN
LoRaWAN sensors reach across a whole farm on a battery that lasts years. A LoRaWAN network server (ChirpStack or The Things Stack) decodes them and passes the values to Urvara.
- You need
- A LoRaWAN gateway in range
- ChirpStack or The Things Stack with a payload decoder
- It carries
- Readings only
Snapshots through the gateway
The Urvara gateway fetches a still picture from the camera’s snapshot address on a timer and uploads it. The pictures can then be checked by the AI plant inspector. With the camera’s video address and ffmpeg on the gateway, you can also watch the camera live.
- You need
- A camera with an HTTP snapshot address
- The Urvara gateway on the same network
- It carries
- Still pictures, at most one every 30 seconds, and a live view
USB, through your browser
Plug the board into your computer and Urvara reads the lines it prints, in Chrome or Edge. It is the quickest way to see a sensor working before you give it a network connection.
- You need
- Chrome or Edge on a computer
- A board printing readings at 115200 baud
- It carries
- Readings only, while the tab is open
Step 3: Get one reading through
- Add a device in the monitoring software and get its token.
- Make the sensor send one value. A board on your desk, on USB or Wi-Fi, is enough for the first try.
- See the value arrive. Give it a clear name and the right unit.
- Tie it to the part of the farm it measures.
In Urvara the reading appears by itself the first time it is sent, and is recognised from its name: a name with “level” in it becomes a water level, “temp” a temperature, and so on.
Step 4: Set the alerts
Watch the reading for a few days first. Then set limits from what it really does, not from a textbook. Give each rule a delay so one odd value does not raise an alarm, and add a “no data” rule so a dead sensor is not mistaken for a healthy one.
Step 5: Make sure alerts arrive
- Send a test to every destination.
- Use two destinations for anything critical.
- Decide who is called at night, and for which severity.
- Pull a sensor’s plug and check that the “no data” alert arrives.
Step 6: Plan for the bad day
| What fails | What to have |
|---|---|
| The internet | A gateway on site that stores readings and sends them later |
| The power | A battery or a small UPS on the gateway and the router |
| A sensor | A “no data” rule, and a spare on the shelf |
| A probe’s accuracy | A calibration date in your calendar |
| Remote control | A float switch or a timer in the device itself |
Step 7: Add, review, repeat
Add the next sensor on your list. Every month, look at which alerts fired. An alert that fires every day and is ignored is worse than none: fix its limit or remove it. In Urvara the AI agent can do this review, and proposes rules to add, tighten, loosen or remove. With AI watch turned on, the AI also reviews the readings on a timer and raises an alert for what your rules miss.
Questions people ask
How much does a farm monitoring system cost?
It ranges widely. A single home-built sensor node with an ESP32 costs little in parts, while industrial sensors, meters and LoRaWAN equipment cost a great deal more each. The larger cost is usually your time to install it and keep it working, so start with few sensors.
What should I monitor first on a farm?
Whatever would cost you most if it failed unnoticed. On most farms with pumped water that is the main pump and the water supply. In a greenhouse it is air temperature. In aquaponics it is water flow, oxygen and temperature.
Do I need internet on the farm for monitoring?
You need a link from the farm to wherever the readings are stored, which may be mobile data. A gateway on site can store readings while the link is down and send them when it returns.
Last checked against the product: .