Home > Industry Application >Other Industry Circuits > Smart Farm Design Solution Based on LoRa

Smart Farm Design Solution Based on LoRa

Source: InternetPublisher:念念Brown Keywords: LoRa Smart Agriculture Updated: 2024/08/02

When we talk about “farm automation” or “smart agriculture”, soil condition monitoring and irrigation are considered the most basic requirements for a farm.

Farm soil condition monitoring and irrigation require the following functions:

1. Multi-point soil status monitoring. Soil conditions, basically moisture and temperature, as well as soil quality data such as PH/nitrogen/phosphorus/potassium, need to be monitored at multiple points based on farm characteristics and plant needs.

2. Multi-point irrigation, or some other actuators, such as fans, to control/regulate multi-point environment, including humidity/temperature.

3. Easy to install. On farms, it is difficult to install wires due to the humid environment and potential insects and rats. Therefore, remote wireless monitoring and control is needed so that sensors/irrigation can be easily installed.

With these needs in mind, I demonstrated this soil monitoring and irrigation using LoRa to address the above requirements in a farm or home garden.

1. Lora

Lora stands for Long Range Radio, which is flexible for rural or indoor use cases, such as smart agriculture and smart cities, mainly for M2M. In theory, LoRa can reach several kilometers in urban areas and more than 10 kilometers in rural areas (but I didn't test it that long, the maximum distance tested was about 3 kilometers).

LoRaWAN is a software protocol that handles LoRa messages and communication to and from the internet. LoRaWAN requires a stronger controller to handle the protocol and a LoRaWAN router to connect to the internet.

In my demo, LoRaWAN is needed. So we use LoRa directly without internet connection.

2. Instrument Introduction

2.1 Soil monitoring

For soil monitors, core specifications:

Soil specs check, primarily: moisture/temperature; if necessary, advanced specs: PH/nitrogen/phosphorus/potassium.

Wireless data transmission, long service life

Anti-corrosion

Makerfabs LoRa Soil Moisture Sensor and Industrial Grade Soil Remote Monitor:

The Makerfabs Soil Moisture Sensor measures soil moisture (using a capacitive mechanism, details) and temperature, and sends the data via LoRa every 1 hour. It is anti-corrosion coated. It uses 2 AAA batteries and has a lifespan of up to 2 years. It comes with pre-programmed firmware, and the user can install the batteries and use it directly. For more details, check out the Wiki. But note that for humidity, its output is "Relative Humidity", which is not "true humidity" but a numerical value that reflects changes in humidity. For example, a value of <500 means the soil is soaked, while >800 means it is very dry. Also, depending on how the sensor is mounted, it will be slightly different.

Industrial-grade soil remote monitoring instrument is more professional, it can detect the real parameters of temperature, moisture, PH value, nitrogen/phosphorus/potassium, it can be used to analyze the environment and plants, mainly used for research or field applications in these fields where specifications are important and needed. The sensor is waterproof, it monitors the specifications and transmits them to the controller board via RS485, and then the controller (ESP32) board can display it locally on the 0.93-inch OLED, or transmit it remotely via LoRa or Wifi (if there is a Wifi network).

But please note that this module does not have any pre-programming when it leaves the factory, and requires users to code it themselves. It is mainly used for maker development.

2.2LoRa Actuator

This cheap and easy to use LoRaMOSFET can be used to control multiple actuators, such as fans/valves/electromagnetic locks/motors... with a maximum current of 2A. It comes with Makerfabs default firmware (code available on GitHub) and users can use it without any coding/programming. It receives LoRa messages and acts as a command (PWM is 0%~100%) and feeds back its status to other LoRa modules. We can use this module to control up to 4 valves and then control 4 points of irrigation.

2.3ESP32TFTTouch and LoRa expansion

ESP32 3.5 inch display with LoRa extension works as a console, it receives soil status from multiple points and sends commands to LoRa MOSFET to control the opening/closing of the valve.

You also get all the components with this kit: Lora Soil Monitoring and Irrigation Kit.

3. Installation

3.1 Plug the LoRa expansion board into the ESP32 display breakout board and program it using the code on GitHub. Set the Wifi connection parameters in the SD card.

After the ESP32 display is powered on, the logo is displayed for 3 seconds and then the work page is entered. With the correct WiFi settings, ESP32 obtains real-time information from NTP and displays it on the display:

3.2 We use a simple LoRa soil moisture sensor, take the sensor out of the package and power the sensor with 2 AAA batteries. The sensor ID number is on the battery slot (also on the mechanical box),

For example, ID010040:

Press the "Humidify Button" on the ESP32 display to enter the ID.

After the setup is complete, the ESP32 display will receive LoRa messages from the LoRa soil moisture sensor. Since the sensor will output data every 1 hour, to verify the connection, press the "Reset" button to get an instant message:

The ADC data displayed represents the humidity sensor output, the lower the value, the higher the humidity, check the typical output. The sensor data and timestamp are shown on the display and are updated every 1 hour. In fact, it also adds a log in the SD card for further inspection.

Up to 8 LoRa humidity sensors can be added and monitored.

3.3 Connect the valve to the LoRaMOSFET output

The value there, it has a water inlet and an output, connect the input port to your water tank (I use a large mineral water bottle as a water tank), the output to the plant. We use one inlet and four outlet terminals for easy installation.

Press addMOS in the ESP32 display, enter the MOSFET ID, such as ID060000, and power on the LoRaMOSFET:

The LoRaMOSFET will report its status to the ESP32 display and you can now control the valve the MOSFET is connected to.

After pressing MOSX, change it from OFF to ON and press Send.

The connected valve state changes. Try to control other actuators, such as FANS/DC. In fact, you can also send commands via LoRa to change the PWM duty cycle and control the speed of the connected FANS/DC. Up to 2 MOSFETs (8 actuators) can be added.

3.4 Install sensors and valves to your farm/plant

This project uses the basic module to remotely monitor soil status/control irrigation, which can be used for field applications. But due to my poor time management and programming experience, this is just a demonstration of LoRa usage to show how to create a field application.

For manufacturers familiar with coding, further specifications can be added:

1. Remote monitoring via the Internet. Since the ESP32 is connected to Wifi, all sensor data can be rerouted to the Internet or remotely control the valve via MQTT.

2. More LoRa sensors, now supports 8 soil points and 2 MOSFETs supporting 8 valves, theoretically unlimited sensors can be added, but because LoRa unidirectional data transmission is not secure, data loss may be large when the sensor quality is poor. LoRawan can ensure a secure connection, but I didn't do it. And, more actuators.

3. Equipped with industrial-grade humidity sensors for more detailed soil monitoring.

4. Connect the actuator's PWM duty cycle control to control the load speed

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号