In this project, we will learn how to make Lora soil monitoring and irrigation system, we will use the ESP32 TFT screen to be the monitor, and use LoRa MOSFET to control multiple actuators.

 

When we say "Farm automatic" or "smart agriculture", soil status monitoring& irrigation is the most basic for a farm. A farm soil status monitoring& irrigation need the following features:
1. Soil status monitoring at multiple points. The soil status, basically humidity and temperature, and soil quality data such as PH/Nitrogen/ Phosphorus/Potassium need to be monitored at multiple points depending on the farm characteristic & plant needs.

2. Irrigating at multiple points, or some other actuators such as fans, to control/ adjust the environment, including humidity/ temperature, of multiple points.
3. Easy to Install. In a farm, as the environment moisture and potential insects& mouses, it is hard to install wires. So remote wireless monitoring& controlling are needed, that the sensors/irrigating can be installed easily.

With these demands, I made this soil monitoring& irrigation with LoRa demo, to solve the above requests in a farm or home garden.

1.LoRa
LoRa stands for Long Range Radio, it is flexible for rural or indoor use cases such as smart agriculture, and smart cities, mainly targeted for M2M. Theoretically, LoRa arranges can be up to a few kilometers in urban areas, and more than 10 kilometers in rural areas (but as for me, I do not test it so long, the max distance tested is about 3 kilometers).

LoRaWAN is software protocol, that deals with the LoRa messages and communication back and forth with the Internet. LoRaWAN needs a stronger controller ability to deal with the protocol and also LoRaWAN Router for internet connection.

In my demo, LoRaWAN is not needed, we use direct LoRa, without the necessity of an Internet connection.

2. Instruments Introduction
2.1 Soil monitoring. For soil monitoring instrument, the core spec:
● Soil spec checking, basically: humidity/temperature; and if necessary advanced spec: PH/Nitrogen/ Phosphorus/Potassium.
● Wireless data transmission, and long life-time
● Anti-corrosion
Makerfabs LoRa Soil Moisture Sensor and Industrial-grade Soil Remote Monitor.

The Makerfabs Soil Moisture Sensor measures the soil humidity (with capacitive mechanism, detailed info) & temperature and sends the data via LoRa every 1 hour. It is anti-corrosion coated. With a 2 AAA battery, the lifetime can be up to 2 years. It is shipped with pre-program firmware, which users can install battery and then use directly. For more details, check the wiki. But note that for humidity, its output is “relative humidity”, which is not a “real humidity” but values reflect the humidity changes.  Such as values < 500 means the soil is soaked, while >800 means very dry. Also, it differs a little depending on how the sensor is installed.

The Industrial-grade Soil Remote Monitor is more professional that it detects the real parameter of temperature, moisture, PH, Nitrogen/ Phosphorus/Potassium, that can be used to analyze the environment & plants, mostly used for research, or field applications that these specifications are important& needed. The sensor is water-proof, it monitors the specifications and transmits 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 with LoRa or Wifi (if there Wifi network).

But note that this module shipped without any pre-programming, and need the user to code by himself, mostly for makers’ developments.

2.2 LoRa Actuator.
This cheap& easy to use LoRa MOSFET can be used to control multiple actuators such as fans/valves/electromagnetic lock/ motors…with max current 2A. It is shipped with Makerfabs default firmware(code available on GitHub), and users can use it without any coding/programming. It receives the LoRa messages and acts as the commands (0%~100% by PWM), and feedback on its status to other LoRa modules. We can use this module to control up to 4 valves, and then to control irrigation of 4 points.

2.3 ESP32 TFT Touch with LoRa expansion.

The ESP32 3.5 inch Display with LoRa Expansion work as the control console, that it receive soil status from multiple points, and send commands to the LoRa MOSFET, to control the valve open/ close.

You can also get this kit with all components: Lora Soil Monitoring & Irrigation Kit.

3. Installing
3.1 Plug the LoRa expansion board into the ESP32 display breakout board, and program it with the codes at GitHub. Set the Wifi connection parameters in the SD card.

Power up ESP32 display, after 3 seconds of logo display, it enters the working page. With right Wifi setting, ESP32 gets the real-time from NTP, and shows on the display:

3.2 We use the simple LoRa soil moisture sensor, take the sensor from package, and power the sensor with 2 AAA battery. There the sensor ID number on the battery slot (and also on the mechanic case), such as ID010040:

Press the “add moisture button” in the ESP32 display, then you can input the ID.

As the setting is completed, the ESP32 display will get the LoRa message from the LoRa soil moisture sensor. As the sensor will output data every 1 hour, to validate the connection, press the “reset” button for an instant message:

The shows ADC data means the moisture sensor output, the lower the values are, the higher moisture, check the Typical Output. The sensor data and the time stamp show on the display, it will update every 1 hour. Actually, it will also add a log in the SD card for further checking.

There Max 8 LoRa moisture sensors can be added and monitored.

3.3 Connect the valves to the LoRa MOSFET outputs.

There the for values, it has one water-input port, and one output port, connect the input port to your water tank(I used a big mineral water bottle as a water tank), and the output to plants. We use a one-input-four output terminal for easy installation.

Press the add MOS in the ESP32 display and input MOSFET ID, such as ID060000, and power up the LoRa MOSFET:

The LoRa MOSFET will report its status to the ESP32 display, and you can now control the MOSFET connected valves.

Press the MOSX, to change it from OFF to ON, and press send…

 

The connected valve status changes. Try to control other actuators such as FANS/DC. Actually, you can also send commends via LoRa, to change the PWM duty, to control the connected FANS/DC speed. There max 2 MOSFET(8 actuators ) can be added.

3.4 Install the sensor and valves to your farm/plants.

This demo uses the basic modules to remotely monitor soil status/ control irrigation, which can be used in the filed applications. But as my time schedule and also poor experience on programming, it is just a demo of LoRa usage, to show how to create a field application.

For makers that are familiar with the coding, there much more spec can be added:

1. Remote monitoring/control with the Internet. As the ESP32 is connected to Wifi, all sensor data can be re-routed to the Internet, or remote control the valves, with MQTT.

2. More LoRa sensors, now it supports 8 soil points and 2 MOSFET that support 8 valves, theoretically, there infinite sensors can be added, but as the LoRa unsafe one-way data transmission, there possibility of data lost when the sensor quality is larger. LoRawan can ensure the safe connection, but I have not made that. And also, more actuators.

3. With the industry level moisture sensor, for more detailed soil monitoring.

4. PWM duty controlling of the connected actuators, to control the load speed…

4. Video
Check more details on this video and enjoy~

 


If you have further questions about Lora Soil Monitoring and Irrigation System, or need some Turnkey PCB Assembly Services, please contact service@makerfabs.com