1. System Overview
The environmental monitoring system mainly completes the environmental condition monitoring of the material warehouse, automatic data collection, data transmission and processing, and obtains environmental information data in real time and accurately, so that the system can take corresponding measures in a timely manner.
The system consists of three parts: a monitoring center, field monitoring and control nodes, and a communication network. The monitoring center is equipped with a monitoring host and a large equipment operation status display screen. The field monitoring and control nodes consist of control modules and sensor groups, whose data acquisition sensors mainly include: temperature sensors, humidity sensors, combustible and harmful gas sensors, air pollution monitors, smoke detectors, and water immersion switches. The system communication network can be composed of various communication media supported by Lonworks fieldbus (such as twisted pair, power line, fiber optic, wireless, infrared, etc.) and routing equipment. The system works as follows: the data acquisition sensor group converts the acquired environmental information into electrical signals, which are then converted from digital to analog or level to digital signal and transmitted by the control module as network variables to the control nodes on the Lonworks bus network. Processing commands are then transmitted to the control nodes of the air conditioning and fire protection systems. The monitoring center realizes the monitoring, management, and maintenance of the system, as well as information interaction with other computer systems, thereby achieving the integration of control and management information. The system network topology diagram is shown in Figure 1.
System network topology diagram
2. Control Node Hardware Design The control node was developed using a hardware design approach based on control modules. The Lonworks control module integrates a neural chip, a communication transceiver, memory, and a crystal oscillator. A complete node is formed by adding only a power supply, peripheral circuit interfaces, and an application program running on the neural chip. The control module establishes connections with the application sensors and the Lonworks bus through two connector ports, P1 and P2. The structure diagram of the control node based on the control module is shown in Figure 2.
The data acquisition scheme based on Lonworks bus technology is as follows: Acquisition nodes collect field data, convert the signals, and send them to the node control module. The control module then sends the data to the Lonworks bus as network variables. The host computer reads the data via the network as needed and displays it on the control interface. The data acquisition hardware design is divided into analog signal acquisition and digital signal acquisition based on the type of sensor output signal.
2.1 Analog Signal Data Acquisition Circuit Ordinary environmental monitoring sensors often exhibit uncertain, nonlinear relationships between voltage, current, and temperature/humidity signals due to inherent differences in their thermistors and humidity sensors. Furthermore, analog signals like voltage and current inevitably suffer losses during long-distance transmission, leading to decreased measurement accuracy and affecting the precision of on-site monitoring information in the environmental monitoring system. In severe cases, this loss can directly result in data loss. Therefore, in the control node design, the electrical signals generated by ordinary temperature and humidity sensors are converted from analog to digital and transmitted directly to the Lonworks bus as digital quantities via network variables. This avoids the losses caused by analog transmission and improves the accuracy of on-site measurements.
The main function of the analog signal data acquisition circuit is to convert the analog signal output from the sensor into a digital signal through opto-isolation, filtering, amplification, and A/D conversion, input it to the control module, and then transmit it to the Lonworks bus. The process is shown in Figure 3. Specifically: the opto-isolation relay is used to select the sensor input signal to be measured; the isolation filter circuit is used to filter out high-frequency interference in the analog input signal; the isolation amplifier circuit is used for internal analog signal isolation; and the A/D conversion typically performs 12-bit A/D conversion before sending the data to the Lonworks control module.
2.2 Switch Signal Data Acquisition Circuit Environmental monitoring systems contain many switch signal sensors, such as water immersion switches. The main function of the switch signal data acquisition circuit is to convert the switch signals into serial signals via level conversion, using a shift register to convert parallel signals into serial signals. After processing by the control module, the signals are sent to the Lonworks bus. The flowchart is shown in Figure 4.
3. Environmental Monitoring System Software Design The environmental monitoring system software consists of two parts: system management software and control node software. The environmental monitoring system is part of the automated warehouse management information system. Based on a client/server (C/S) and browser/server (B/S) architecture, it establishes upper-level monitoring applications through DDE services to integrate control and management information. The control node software design is the core of the environmental monitoring system software design. Its Neuron chip uses Neuron C, a programming language based on ANSI C specifically designed for neural chips, and extended to directly support Neuron chip firmware routines. The main content of the control node software design includes the data input interface and communication between the control node and the monitoring center or other control nodes.
3.1 Input Interface Design The MAX186 serial A/D converter converts analog signals into digital signals and transmits them to the control module. The writing of the control word and the data output of the A/D conversion are completed through serial data lines. Each input channel is selected by the control word. The input interface program is as follows:
IO_8 Neurowire master select(IO_1)MAX186 // Define the I/O object as neurowire, IO_8 is the clock output, IO_10 is the serial input, IO_9...
For serial data output, select master control mode. The MAX186 chip select signal is output from IO_1. IO_1 output bit MAX186_CS=1 // Initialize MAX186 chip select to invalid. When (time_expires (clock_1)) // Timer/counter Clock_1, the event is true when the timer ends. { io_out (MAX186_CS ,0) // Make the MAX186 chip select signal valid. io_out (,10001111) // Send controller word to MAX186: Channel 0, unipolar, single-ended input, external clock mode. input=io_in (MAX186,&input,16) // Input conversion result input=input>.>4;
io_out(MAX186_CS, 1); //MAX186 chip select is invalid, signal acquisition ends}
3.2 Communication between Control Nodes Communication between control nodes can be achieved using network variables, which are divided into input and output types. If a node sets one of its variables as an output network variable, the value of that variable will be transmitted to all control nodes on the Lonworks bus network associated with that variable. The connection between input and output variables can be implemented using data binding.
3.3 Communication between Control Nodes and Monitoring Center The monitoring host can communicate using various technologies and the Lonworks bus. LonManager DDE, LNS DDE, and LNS API have independently developed various driver software, enabling connections with various industrial configuration software and LON networks, facilitating rapid user interface development. It also supports development in languages such as Delphi, VB, and VC.
4. Conclusion
Lonworks bus technology, characterized by high reliability, openness, interoperability, and ease of implementation, has been widely applied in the field of distributed control systems both domestically and internationally, and has broad development prospects. Environmental monitoring systems based on Lonworks bus technology offer advantages such as convenient networking, simple and easy communication, high signal transmission reliability, and easy node expansion, facilitating centralized monitoring of geographically dispersed warehouses. Practice has proven the feasibility of this solution.
References:
[1] Ma Li. Intelligent Control and Lon Network Development Technology [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2003.
[2] Yang Xianhui. Fieldbus Technology and Its Applications [M]. Beijing: Tsinghua University Press, 1999.
[3] Yan Jun, Chen Xiping. Remote monitoring system for liquid level based on Lonworks fieldbus [J]. Control Engineering, 2004(5):44-47.
[4] Gao Jinfeng, et al. Design of a computer room environment monitoring system based on fieldbus [J]. Journal of Nanjing Institute of Technology: Natural Science Edition, 2004(3):22-26.
[5] Wang Yufeng, et al. Distributed temperature measurement system based on Lonworks fieldbus [J]. Journal of Liaoning University of Engineering and Technology, 2006(2):84-87.