Professional Documents
Culture Documents
Intelligent_Agriculture_System_Based_on_LoRa_and_Qt_Technology
Intelligent_Agriculture_System_Based_on_LoRa_and_Qt_Technology
Intelligent_Agriculture_System_Based_on_LoRa_and_Qt_Technology
Abstract: In order to solve the problems of low collection efficiency and high labor cost for the growth environment
parameters of traditional agricultural greenhouse crops. And solving the problem of using Zigbee communication
technology to cause short transmission distance and easy interference. This paper integrates commonly used LoRa
wireless network technology and QT technology to design a new intelligent agriculture system. The system uses LoRa
communication module as the communication core, and use the widely used STM32F103 development board as a
controller of the sensors and execution, the host computer program developed by Qt receives the data, visually display
them, and processes them, this system realized timely monitoring and timely decision-making on the agriculture
greenhouse.
Key Words: Intelligent Agriculture System, LoRa, Qt, TDMA
978-1-7281-0106-4/19/$31.00 2019
c IEEE 4755
Authorized licensed use limited to: Indian Institute of Technology Palakkad. Downloaded on May 29,2024 at 04:13:25 UTC from IEEE Xplore. Restrictions apply.
The sensors acquisition control system mainly includes two including two I2C interface, three the UART interface and
parts: acquisition and control (or execution). The two SPI interface[8], can accommodate multiple sensor data
acquisition part is composed of a variety of sensors, such as and access to the LoRa module. Development board shown
a temperature and humidity sensor. The collected in Figure 2:
temperature and humidity data is transmitted to the LoRa
NRF/SPI
module through the serial port or the general IO port. And UART1
the LoRa RF module is directly transmitted to the LoRa
master node through the LoRa network. The control
(execution) part is directly connected to the LoRa module
by the 485 bus-based Modbus salve device, and is USB/POWER
connected to the master node through the LoRa wireless
network.
SWD
LoRa wireless networks are primarily used to convey I2C
information in the system. The sensors transmit data such as
GPIO
temperature and humidity to the STM32F103 control chip
through I2C or general-purpose IO port. The LoRa wireless
network system includes the master node and the sub node.
MCU will package the received data and some protocol Fig 2. Development board.
information specified by the system, through the SPI
3.2 Sensors
interface, call the function (spi write ()) to write the data into
the transmit buffer (FIFO) of the LoRa module. The LoRa In actual agricultural greenhouse, we need a variety of
module sends the data to the master node in the specified sensors to measure environmental parameters.in this paper,
frequency band and the specified time period. Realizing we use light intensity sensors, soil moisture sensors and air
wireless transmission of data from the sub-node to the temperature and humidity sensors to illustrate.
master node. Digital light intensity sensor (BH1750FVI) ˖mainly used to
In order to make the environmental parameters more measure the light intensity in the greenhouse. Using the
intuitive, in this paper, using the Qt crater software to design standard I2C bus transmission mode, the acquisition range
the upper computer operation interface, the machine is 1-65535lx, the connection between BH1750 and STM32
interaction becomes more intuitive and convenient. The is shown in Figure 3.
running process is as follows: the LoRa master node sends VCC
the data to the Qt program interface of the PC. After
receiving the data frame sent by the master node, according VCC
actuator GND
Sub node 1
3.1 STM32F103
STM32F103, produced by STMicroelectronics, a 32-bit
microprocessor with ARM-cortex-m3. It has many
general-purpose IO port and nine communication methods,
4756 The 31th Chinese Control and Decision Conference (2019 CCDC)
Authorized licensed use limited to: Indian Institute of Technology Palakkad. Downloaded on May 29,2024 at 04:13:25 UTC from IEEE Xplore. Restrictions apply.
VCC chooses LoRa wireless network to form information
VCC
transmission system, and establishes information
connection with sensor control system and upper computer
system.
PB5
DO 4.1 LoRa Technology
ADC/PA1
AO LoRa (long range) is a kind of LPWAN communication
STM32F103
XH-M214 technology. It is an ultra-long range wireless transmission
MCU
GND technology based on spread spectrum technology adopted
and promoted by SEMTECH, the original signal of the user
GND
data is XORed with the extended coded bits to generate a
stream of transmitted signals. This modulation allows the
Fig 4. Connection between XH-M214 and STM32. bandwidth of the transmitted signal to be increased, so that
the signal can be transmitted over longer distances, and
Temperature and Humidity sensor (DHT11): mainly used to LoRa operates in an unlicensed spectrum, the working
measure the temperature and humidity of air. Using single frequency band is generally 433,868,915Mhz, and the
bus bidirectional serial communication protocol. the construction of the network can be more flexible and
connection between DHT11 and STM32 is shown in Figure controllable.
5.
VCC 4.2 Nodes and Networking
VCC In this paper, the LoRa module ra-01 produced by AnXinKe
technology. It is selected as the LoRa sub-node and the
master node. the Ra-01 module uses SEMTECH’s sx1278
R1 device. Supply voltage is 3.3v, bandwidth is 125k,
STM32F103
spreading factor is 12, load length is 64 bytes. In the sleep
MCU
DATA DHT11
mode, the FSK modem can switch to the LoRa modem via
the configuration register RegOpmode[10].
GND Considering that the applicable scenario is an outdoor
GND
agricultural greenhouse, the distance of the nodes used
generally does not exceed the transmission distance of LoRa
point to point, so there is no need to use a relay node.
Fig 5. Connection between DHT11 and STM32. Moreover, the environmental parameters of agricultural
3.3 Controller greenhouse will not change much, the number of nodes used
in small and medium-sized agricultural greenhouse is not
The controller part is a variety of devices that can be much. Considering the above applicable scenarios and
configured with the Modbus protocol, such as exhaust fans, combining the cost, this paper only needs to select a typical
hot fans, plant lights and mirrors, to control the water supply star network to meet the requirements, that is, each sub-node
system, temperature and humidity control system and communicates directly with the master node.
auxiliary lighting system in the agriculture greenhouse to LoRa has a low transmission rate, which will lead to long
achieve the purpose of adjusting various environmental channel occupation. In a typical star network composed of
parameters. In this paper, a networked thermostat (VN4013) LoRa, data collision between nodes needs to be considered.
is connected to the device via the RS485 bus. the connection Generally, there are two types of solutions, competition and
between VN4013 and STM32 is shown in Figure 6. LoRa time division multiple address (TDMA). The competition
Module is based on STM32. mode is flexible and simple. Before the nodes sends data, it
L detects whether the current channel is idle, if it is idle, it
N directly sends data, if it is not idle, it will be detected after a
delay, until the channel is detected to be idle, and the
number of detections increases, and the delay time is set to
be longer[11]. In the case where the applicable environment
VN4013 FAN LORA
Module
is an agricultural greenhouse, the competition mode is not
applicable. The agricultural greenhouse uses more network
D+ 485R+ nodes. In the competitive mode, the channel will be very
D- 485R- busy, which will increase the probability of data loss due to
data collision. While long-term channel detection will lead
Fig 6. Connection between VN4013 and STM32. to increased power consumption. TDMA allocates an
4 LORA WIRELESS NETWORK SYSTEM independent time slot for data transmission for each node
within a certain period of time. If the node does not belong
In order to meet the long-distance communication to this time slot, communication is not performed[12].
requirements of intelligent agriculture systems, this paper
The 31th Chinese Control and Decision Conference (2019 CCDC) 4757
Authorized licensed use limited to: Indian Institute of Technology Palakkad. Downloaded on May 29,2024 at 04:13:25 UTC from IEEE Xplore. Restrictions apply.
During other idle times, the node performs periodic Start Start
switching in sleep mode and channel activity detection
(CAD) mode. Sleep in sleep mode. Monitoring the network
Initialize Initialize
in CAD mode, in this mode, the master node needs to add a configuration configuration
long time preamble before the valid data. The duration of
the preamble must be longer than the sleep period of the
node. this will ensure that the data can be received. After the Receive data
MCU write data in FIFO
signal is monitored, if the data is sent to itself, it enters the
working mode. If not, it goes directly to sleep mode and Sava in FIFO
waits for the next wake-up. Combine the time interval of
LORA module
CAD mode with the TDMA timeline, as shown in Figure 7 send data
below. CRC Error
NO
T0 T1(Timesync) T2 (timeslot k) T3 (To Sub node j) T4 (timeslot j)
Host node YES
Sub node j
t DIO0 set high level
DIO0 is high level
NO
Sub node k
MCU read
FIFO YES
End End
Time points CAD preamble Payload
Fig 8. The process of transmitting (left) and receiving (right).
sleep Timeslot Single reception Working mode
5 DESIGN OF QT APPLICATIONS
Fig 7. The time interval of CAD mode with the TDMA timeline.
According to the needs of intelligent agricultural system,
As shown in Figure 7 above, at time T0ˈeach sub-node is in and in order to display the environmental parameters of
sleep node. at time T1. The master node sends time agricultural greenhouse more efficiently and intuitively, this
synchronization data (preamble + payload), at this time, the paper developed a smart agricultural human-computer
node is still in sleep mode. When the master node sends the interaction interface system based on Qt technology.
preamble for the duration of time, each node will enter the Including safe landing system, agricultural greenhouse
CAD mode. At this time, the preamble is monitored, and environmental parameter monitoring, control decision,
each node enters the single receiving mode, and after actuator control.
determining that the data is sent to itself, it enters the
working mode. After the work is completed, each node 5.1 Design of User Interfaces
enters the sleep mode again. At time T2, this time slot is In order to ensure the security and stability of the system,
allocated for node k under TDMA, at this time, the node j before entering the intelligent agricultural monitoring
maintains the original state, and the node k automatically system, a secure landing system was designed. Only the
transmits data (such as temperature) to the master node. personnel in the system database can enter the main
after the transmission is completed, it goes to sleep. At the interface and give them different management operation
time T3, the master node sends an instruction to the node j, rights. For example, only administrators can add or delete
and the node j detects the preamble and knows that the users. The interface design in shown in Figure 9 below.
information is transmitted to itself, so continues to receive
and enters the working mode. The node k detects the
preamble and finds that the information is not sent to itself,
discards the data and enters the sleep mode. At the time T4,
this time slot is allocated for node j under TDMA, at this
time, node k maintains the original state, but node j
automatically transmits data (such as humidity) to the
master node. after the transmission is completed, it goes to
sleep. This system has been circulating in this way.
LoRa needs to use its own data buffer FIFO to transmit and
receive data. The process of transmitting (left) and receiving
(right) is shown in Figure 8 below.
Fig 9. Secure landing system.
4758 The 31th Chinese Control and Decision Conference (2019 CCDC)
Authorized licensed use limited to: Indian Institute of Technology Palakkad. Downloaded on May 29,2024 at 04:13:25 UTC from IEEE Xplore. Restrictions apply.
agricultural greenhouse. The specific interface design is ventilation purposes. Some of the parameters are shown in
shown in Figure 10 below. Table 2 below. T1 is the greenhouse temperature, T0 is the
suitable temperature for the growth of crops. And RH1 is the
humidity in the greenhouse, RH0 is the suitable humidity for
the growth of crops.
Table 2: Ventilation decision experiment parameters.
The 31th Chinese Control and Decision Conference (2019 CCDC) 4759
Authorized licensed use limited to: Indian Institute of Technology Palakkad. Downloaded on May 29,2024 at 04:13:25 UTC from IEEE Xplore. Restrictions apply.
[8] S. Sun, J. Ni and Z. Chen, The design of a DeviceNet - SPI [11] J. Lim and Y. Han, Spreading Factor Allocation for Massive
converter module based on the STM32 MCU,2015 IEEE Connectivity in LoRa Systems, in IEEE Communications
International Conference on Mechatronics and Automation Letters, vol. 22, no. 4, pp. 800-803, 2018.
(ICMA), pp. 843-847, 2015. [12] L. Tessaro, C. Raffaldi, M. Rossi and D. Brunelli,
[9] A. Lavric and V. Popa, Internet of Things and LoRaЯ Lightweight Synchronization Algorithm with
Low-Power Wide-Area Networks: A survey, 2017 Self-Calibration for Industrial LORA Sensor Networks, 2018
International Symposium on Signals, Circuits and Systems Workshop on Metrology for Industry 4.0 and IoT, pp.
(ISSCS), pp. 1-5, 2017. 259-263, 2018.
[10] Z. qin, Y. shenglong, Z. heng, C. xuesheng, Z. shengmao and
D. yang, Design and Implementation of Marine Temperature
Measurement System Based on LoRa,2018 International
Symposium in Sensing and Instrumentation in IoT Era
(ISSI), pp. 1-4, 2018.
4760 The 31th Chinese Control and Decision Conference (2019 CCDC)
Authorized licensed use limited to: Indian Institute of Technology Palakkad. Downloaded on May 29,2024 at 04:13:25 UTC from IEEE Xplore. Restrictions apply.