Scientific journal
European Journal of Natural History
ISSN 2073-4972
ИФ РИНЦ = 0,301

DEVELOPMENT OF A SOFTWARE AND HARDWARE SOLUTION FOR MONITORING AND CONTROL OF THE GREENHOUSE MICROCLIMATE BY RS-485 BUS WITH MODBUS RTU INTERFACE

Demchenko V.V. 1 Obukhov P.S. 1 Ivliev E.A. 1
1 Don state technical University
1497 KB
In the life cycle of plants, the important environmental factors are temperature, humidity, light intensity and CO2 density. Temperature and humidity determine the habitat of crops, while illuminance and CO2 density are closely related to productivity. In this system, four environmental factors are artificially controlled. In the microclimate of the greenhouse, all environmental factors are interconnected. For example, the relationship between temperature and humidity is most severe. The CO2 requirement differs at different temperatures and lighting conditions. Climate independence, as well as increased productivity of agricultural crops can be ensured with the help of software and hardware systems. The requirement for this kind of control cannot be met with a traditional control strategy. The networked measurement and control system based on ATmega328 is designed to control greenhouse temperature, humidity, light. The serial Modbus RTU bus is used to control the measuring network of the greenhouse microclimate and collect signals. The controllers have a number of sensors that collect information about the environment and various actuators. The control system can meet production requirements, high reliability, easy operation and maintenance.
tradition
fertility
socio-demographic space
marriage
family
social transformation
nuclear family
social problem
1. Ivliev E., Demchenko V., Obukhov P. (2022) Automatic Monitoring of Smart Greenhouse Parameters and Detection of Plant Diseases by Neural Networks. In: Shamtsyan M., Pasetti M., Beskopylny A. (eds) Robotics, Machinery and Engineering Technology for Precision Agriculture. Smart Innovation, Systems and Technologies, vol. 247. Springer, Singapore. https://doi.org/10.1007/978-981-16-3844-2_4.
2. Demchenko V.V., Obukhov P.S., Ivliev E.A. Features of Interfaces Application in Smart Greenhouses. X All-Russian Scientific Conference «System Synthesis and Applied Synergetics».
3. How machines communicate: Modbus protocol / Advantech corporate blog / Habr [Electronic resource]/ Access mode: https://habr.com (date of access: 03.12.2021).
4. Application of Modbus protocol with transport monitoring devices / Habr [Electronic resource]/ Access mode: https://habr.com (date of access: 03.12.2021).
5. Development of motor-wheel control system [Electronic resource]/ Access mode: http://library.eltech.ru (date of access: 03.12.2021).
6. ATmega328 – Atmel [Electronic resource]– Access mode: http://www.atmel.com/ru/ru/devices/ATMEGA328.aspx (date of access: 03.12.2021).
7. Khakhaev, I.A. Workshop on algorithmization and programming in Python / I.A. Khakhaev M.: Alt Linux, 2010. 126 p.
8. Information about MODBUS [Electronic resource]/ Mode of access: https://pymodbus.readthedocs.io/en/latest/index.html (date of access: 03.12.2021).

The purpose of greenhouse climate control is to manage environmental factors using modern hardware and software solutions in order to increase crop yields and achieve climate-independent crops. In addition, a greenhouse climate control system can reduce manual effort, increase control accuracy and speed of response to changing factors. Up to now, most greenhouse environmental control systems have been within the structure of industrial control. However, the control of greenhouse systems has its own peculiarities. Compared to industry, agricultural production has a longer cycle with a lower profit margin. Consequently, it is required that the system is more stable and costs less to build and operate. Industrial control technology is so advanced that the ‘adaptability problem’ becomes key in greenhouse management [1].

Objective of the study

The aim of the work is to develop a climate control device to which various sensors and controllable devices could be connected. Also, to develop software for a top-level computer that will communicate with the device via RS-485 fieldbus using the Modbus RTU protocol and transfer data to a server via the Internet.

Material and methods of research

The general structure of a greenhouse control system is shown in Figure 1. A main control room is required because a greenhouse control system usually includes several or dozens of subsystems. The top-level computer is responsible for coordination between the subsystems (mainly manual control and parameter setting using the top-level computer). In addition, the upper-level computer also collects environmental factors from the subsystems and makes statistics for queries and analysis in later days. In this way, the upper-level computer mainly monitors and then controls. The upper computer communicates with the controllers distributed in each greenhouse via a differential half-duplex RS485 data bus. The RS-485 interface is the most common interface in industrial automation. Its main advantages are: two-way communication using only one twisted pair of wires; operation with several transceivers connected to the same line, i.e. possibility of networking; long communication line length; rather high transmission speed [2].

missing image file

Fig. 1. Schematic diagram of the greenhouse control system

The system being developed will use Modbus, the most common industrial protocol for M2M communication. It is the de-facto standard and is supported by almost all industrial equipment manufacturers. Due to its versatility and openness, the standard allows the integration of equipment from different manufacturers [3, 4].

Modbus is used to collect sensor readings, control relays and controllers, monitor, etc. In Modbus RTU protocol, data is encoded in binary format and the packet separator is a time interval. This protocol is delay-critical and cannot work on e.g. modem lines. At the same time, the transmission overhead is lower than in Modbus ASCII because the message lengths are shorter [3-5].

The controllers respectively have a number of sensors to collect environmental data (e.g. humidity and temperature sensors) and various actuators (e.g. spraying devices, watering devices, heater and fan, etc.). Because each controller can perform automatic control using its own control algorithm, it does not need the control information from the higher-level computer. The software on the upper-level computer supports remote input. If the top-level computer can connect to the Internet, users will be able to control the greenhouses remotely.

Each device controls one greenhouse. The unit is permanently based on the ATmega328p microcontroller. The ATMega328 microcontroller is a low-power 8-bit CMOS microcontroller based on an advanced AVR RISC architecture and allows most instructions to be executed in a single clock cycle. It has (32KB) programmable memory, (2KB) RAM and (1KB) EEPROM. Peripherals include: two 9-bit timer/counters with module and frequency divider, 16-bit timer/counter with module and frequency divider and write mode, real-time counter with separate oscillator, six PWM channels, 6-channel DAC with integrated temperature sensor, USART serial software port, SPI serial interface, I2C interface, software watchdog timer with separate internal oscillator, internal voltage comparison circuit and wake-up unit, processing and wake-up on change [6].

The controllers can operate independently of a computer, as it has its own data acquisition and monitoring function. In addition, the controllers also have a communication module, an analogue-to-digital conversion module, and a digital input and output module. Fig. 2 shows a schematic diagram of the controller. Figure 4 shows the printed circuit board of the controller.

missing image file

Fig. 2. Controller wiring diagram

missing image file

Fig. 3. Printed circuit board renderer

missing image file

Fig. 4. Controller PCB (Printed Circuit Board)

Results of the study and discussion

In the life cycle of most plants the most important environmental factors are temperature, humidity, light and CO2 density. Temperature and humidity determine the crop environment, while light and CO2 density are closely related to productivity. In this system, the four environmental factors are artificially controlled. It is obvious that traditional single factor control is unsuitable for controlling the greenhouse environment. In a greenhouse microclimate, all environmental factors are interrelated. For example, the relationship between temperature and humidity is the most serious. With different temperatures and lighting, the CO2 demand is not the same. This kind of control requirement cannot be solved with a traditional control strategy.

In this distributed communication system, up to 247 controllers are available and communication distances of up to 1.2 km can be achieved at acceptable data rates. The communication format is request and response mode. The master sends requests and the slave responds. When transmitting a request, the master also waits for a response from the slave. As for the slaves, once a request is received, they will process the request and then return the data. If the slaves do not respond, it means that the order from the master is invalid or a data transmission error has occurred. Each data message between master and slave contains the following information: request type, slave address, command, data and checksum.

During communication, the master first transmits a request and the slave receives the requests and stores the information in its buffer, then calculates the checksum and compares the result with the received one. The slaves will not respond if the two checksums do not match or if the identification fails (e.g. uncoordinated address).

The top-level software is a SCADA system. A better option in this case would be to implement the software independently in Python language. [7] A set of Qt framework bindings and PyQtGraph library of scientific graphs will allow to implement an interface of almost any complexity, and pymodbus modules will provide easy interaction with the controller via Modbus RTU protocol. [8] It should be emphasised that all the above software tools and modules are part of free software and their use requires no financial cost.

Conclusion

In this article, a RS485 bus-based greenhouse monitoring system was developed. The system is a wired controlled network with the ability to display information on a top-level computer and transmit data to a server, allowing you to monitor and control your greenhouse via the Internet. This article describes development of a hardware-software solution for control and management of greenhouse microclimate via rs-485 bus with Modbus RTU interface.

In addition, some of the above-mentioned unsolved problems are being addressed in order to improve the performance of the developed CO2 monitoring system.

This system will allow analysis of the effect of temperature, moisture, soil moisture and oxygen concentration on plant growth rate.

Future research on this system will involve a wireless energy efficient system and optimisation of the control algorithm. Along with the development of Zigbee, a high-performance, low-cost wireless greenhouse remote control system will be realised.