Tài liệu hệ thống Smart Farm

Smart Farm System Documentation

1. Introduction

  • Smart Farm system Also known as a smart farm system, the modern equipment on this farm is seamlessly connected to each other.
  • It supports the entire agricultural monitoring process, allowing for remote control and operation of the farm system via computer and potentially smartphone.
  • This system allows the farm owner or operator to monitor all farm information anytime, anywhere.
  • Smart farm Based on agricultural practices that utilize sensors and modern equipment, precise work processes can be implemented to improve farm efficiency.
Tài liệu hệ thống Smart Farm
Figure 1: Description of Smart Farm

2. Smart Farm System

2.1 System

Tài liệu hệ thống Smart Farm

Figure 2: System structure including Modbus RTU and LoRa

  • The system consists of four main parts: IoT Server, User Interface, Communication, and Controller/End Device.
  • Built on two different communication methods that can be selected to suit each installation location: Modbus RTU, Lora.
  • The server processes and stores data, and sends commands to controllers via RTU or LORA. It reads sensor signals directly from the sensor if RTU is supported, or indirectly through microcontrollers that convert them to RTU and LORA formats.

2.1.1 Server IOT

  • One server IoT (Internet of Things) An IoT (Internet of Things) is an online system or service used to manage and control connected IoT devices. The IoT server acts as the central hub of the IoT system by collecting, storing, processing, and sharing data from IoT devices, and typically provides management, monitoring, and control functions.
  • To ensure the IoT server functions accurately and quickly, the system can utilize a mini-computer or embedded computer running Linux or Windows. Depending on the needs, a device can be chosen to build an IoT server for the system.
  • The current system uses Intel NUC mini-computers to run the IoT server, communicating with other devices via USB ports.
  • High storage capacity, fast processing, and accurate information. Multiple machine models can be chosen as replacements, or office computers can be used as IoT servers.
  • Intel NUC series

+ Computers with support for multiple USB ports, Ethernet, HDMI, etc., allow us to create multiple functions on the same server.

+Compact size, easy to install in areas with limited space.

+ Performance depends on the machine's configuration, but it performs well as a server for the system, can handle additional tasks, and is easily expandable and upgradeable to meet future system development needs.

Tài liệu hệ thống Smart Farm
Figure 3: IoT server on Intel NUC

2.1.2 Controller

a. Processor

  • The system receives information from the server, processes and controls the outputs to turn devices on and off as desired, and provides device status feedback to the user interface.
  • The processing unit uses a Raspberry Pi embedded computer with the (zero w, 2, 3, 4) series, and the Python language, making it easy to modify and write control logic programs as desired.
  • The processor combines a Raspberry Pi (Pi3) and several ICs and electronic components:
Tài liệu hệ thống Smart Farm
Figure 4: Raspberry processor and controller circuit
  • ControlerIncludes a Raspberry Pi combined with a USB R-S485, mounted on an I/O signal controller board:

      + Communication: RS485, LoRa, TCP/IP over Ethernet…

      + Input: 8 24VDC digital input ports.

      + Output: 8 output relay ports, usable with 24V DC/10A or 220V AC/10A.

      + The header connects to the I/O expansion module.

b. Expansion module

  • Expansion module increases the number of output devices for the controller.
  • An 8-I/O or 16-I/O expansion module is available.
  • Input: digital 24V DC
  • Output: relay 24VDC /10A or 220V AC /10A
Tài liệu hệ thống Smart Farm
Figure 5: Expansion Module

2.1.3 Sensor

  • A sensor is a device or part of a system used to detect, measure, or record information about changes in the environment.
  • Cảm biến có nhiều loại sử dụng cho nhiều mục đích khác nhau: đo nhiệt độ, độ ẩm, ánh sáng, gió, pH, …
  • Information read from the sensor will be converted into various forms: pulse (PWM), analog (0-10V DC, 0-20mA, 4-20mA, ...), Modbus RTU, I2C, ...
  • Depending on the application, select the sensor's features to record the desired information.

+ Temperature and humidity measurement: Modbus RTU signals are usually chosen for direct integration into the system without the need for signal conversion.

  • Air temperature and humidity: reliable with Modbus RTU RS485 SHT20 sensor (Code XY-MD02) or choose sensors with a wider operating range of 0-100°C. 0Temperature and humidity ranges from 0-100%. Depending on the needs, various types of temperature and humidity sensors can be selected.
  • Soil temperature and humidity: The market offers many types of sensors to record soil temperature and humidity; depending on needs and working environment, choose the appropriate sensor probe.

+ Light measurement: records the intensity of light supplied to plants. Light sensors come in various types with different output signals. For systems prioritizing RTU (Remote Unit) output sensors, direct connection to the system without a microcontroller is preferred, resulting in lower error rates.

+ Wind: Sensors are used to measure and record the speed and direction of wind in the environment. This helps in warning about wind speeds that could affect the farm's physical assets... Wind speed is usually measured in m/s or km/h.

+ pH: Measures the pH level in water or fertilizer solutions, ensuring the pH is suitable for plant growth. The pH range is 0-14.

+ In addition, there are many different types of sensors, serving various purposes. They help record and measure environmental information, providing specific data, warnings, and assessments to technicians so they can propose solutions.

Tài liệu hệ thống Smart Farm
Figure 6: Wind speed sensor
Tài liệu hệ thống Smart Farm
Figure 7: Light sensor

 

 

 

 

 

 

 

 

 

 

Tài liệu hệ thống Smart Farm
Figure 8: Temperature and humidity sensor
Tài liệu hệ thống Smart Farm
Figure 9: pH sensor

 

 

 

 

 

 

 

 

 

 

2.1.4 Mobifone Communications

  • Modbus is a widely used communication protocol for connecting and transmitting data between electronic devices in industrial automation systems.
  • Modbus typically uses communication via RS-232 or RS-485 interfaces (Modbus RTU) or over Ethernet (Modbus TCP/IP).
  • The system uses Modbus RTU RS-485 communication for communication between slaves and the master (communication from the controller to the IoT server).
  • A master can communicate with a large number of slaves, with up to 32 slave devices connected in series, a significant advantage of RS-485 over other communication methods.
  • Modbus's function is to transmit signals from the Master, instructing the Slaves to turn devices on and off, and to read sensor data back to the Master.
  • To communicate via Modbus RTU, use:

+ Master: Waveshare Industrial USB To RS485 Converter, …

Tài liệu hệ thống Smart Farm
Figure 10: USB to RS485 with Modbus RTU support for IoT Server

+ Slave (controller): Waveshare Industrial USB to RS485 Converter or UART TTL to RS485 V3 (XY-K485) Interface Converter, ...

Tài liệu hệ thống Smart Farm
Figure 11: USB to RS485 at Slave
Tài liệu hệ thống Smart Farm
Figure 12: UART to RS485 module at the Slave

 

 

 

 

 

 

 

 

 

+ Sensor: Some types of sensors have an RS-485 output signal that can be read directly, or a microcontroller can be used to read and convert it to RS-485.

2.1.5 Lora Communications

  • LoRa (Long Range) is a wireless communication technology designed to provide energy-efficient, easy-to-deploy remote networking connectivity for various applications. Internet of Things (IoT) and M2M (Machine-to-Machine).
  • LoRadio technology offers long-distance wireless communication, energy efficiency, and easy installation.
  • LoRadio can handle up to several hundred devices per channel.
  • For systems using LoRa as a replacement for areas where wired transmission is difficult… wireless transmission is the appropriate choice.
  • The current system uses LoRa E32-UART combined with USB-UART to connect to the server and controller (Raspberry) via the USB communication port.
Tài liệu hệ thống Smart Farm
Figure 13: Lora Slave using E32 connected to Raspberry Pi for communication between server and slave.

2.2 Web

  • The website is designed to manage farm processes and control equipment.
  • Web Includes: Production schedule, production records, irrigation management, farm management, hardware equipment, user management.
  • Production schedule: Records planting dates, condition, plant variety, etc.
  • Production records: managing production records, inventory, machinery logs, etc.
  • Irrigation management: Irrigation schedules tailored to different crop types and different timetable patterns. Irrigation pattern management for each crop type.
  • Farm management: where you store farm information, crop varieties, planting schedules, products, and inventory management.
  • Hardware devices: Information on each device, sensor, etc.
  • User management: Create and assign management permissions to each user for different purposes.
Tài liệu hệ thống Smart Farm
Figure 14: Web management function table

2.3 App (Mobile application)

  • App: Control equipment and monitor farms in designated areas. Provide support for equipment configuration, protocols, etc., for technical staff.
  • Installable on all Android phones
  • The user interface is easy to use, and operations on items with recognizable images are simple.
  • Displays device operating status and environmental monitoring indicators from sensors in each area.
  • Remote control is available via app, and in case of connection loss, it can be controlled via local network…
  • Login interface
  • Log in using the username and password provided to each person.
Tài liệu hệ thống Smart Farm
Figure 15: Login interface on the app

 

  • Directory This includes: Selecting farms for growers, configuring for technical and maintenance staff.
Tài liệu hệ thống Smart Farm
Figure 16: Functional folders in the Smart Farm app
  • Control interface and sensors:

+ Control and status settings Thiết bị (đánh dấu vòng cam)

+ Trạng thái, chỉ số cảm biến ở Sensor (marked with a pink circle)

Tài liệu hệ thống Smart Farm
Figure 17: Control panel and display of device and sensor status

3. Development

  • A server is a mini-computer capable of handling multiple functions simultaneously and easily upgraded and developed.
  • The controller easily integrates expansion modules, increasing the number of devices that can be connected (up to 200 I/O points per controller with additional modules).
  • The choice is to keep the two forms of communication.
  • Modbus:

+ RS-485 RTU: Fast, accurate information, 32 slaves per master, sufficient to control multiple devices, 32 stations, and electrical cabinets.

+ TCP/IP: Connects to each other via an IP network, 256 IP addresses equivalent to 256 slaves. Provides fast and accurate feedback, minimizing information interference.

  • LoRa: A wireless communication network that supports long-distance transmission (2-8 km), consumes less energy, and minimizes the need for cables.
  • Modbus can be integrated to control the device, and LoRa can be used to measure and record information from the sensor. This optimizes the control process and ensures accurate device response in a short time. It also ensures aesthetic appeal in the farming area by installing sensors with a wireless LoRa communication network.