Share this

Design of a Distributed Monitoring System Based on CAN Bus

2026-04-06 03:14:27 · · #1
Introduction Boilers are crucial equipment that provides thermal energy by burning heating media. They are also special devices that are pressurized, exposed to fire, and pose an explosion hazard, yet are widely used across various industries. Therefore, real-time monitoring of boiler operation and timely and accurate detection of accidents during boiler operation are essential. Traditional boiler monitoring systems have significant shortcomings in terms of measurement methods and sensors. Taking temperature detection as an example, the early thermocouple bridge method was complex; while using integrated semiconductor analog temperature sensors requires numerous transmission cables, resulting in high costs and difficult maintenance. The CAN bus is a multi-master control standard with physical layer and data link layer protocols, multiple master nodes, lossless arbitration, high reliability, and good scalability; it effectively supports serial communication networks for distributed control systems. On the one hand, its communication methods are flexible, enabling multi-master operation and point-to-point and point-to-multipoint data transmission and reception; on the other hand, it can perform high-bit-rate data communication over relatively large distances. This system uses a host computer to control and manage multiple parallel pressurized boiler monitoring units, requiring rapid data transmission between these units. The CAN bus perfectly meets the requirements of this system. 1. System Overall Structure As shown in Figure 1, the system consists of a host monitoring computer, CAN node 0, and other CAN nodes. The host monitoring computer is a PC, and each CAN node uses an STC89LE54RD+ microcontroller. The STC89LE54RD+ is connected to an external CAN controller SJA1000, and the main external devices are a one-wire digital thermometer DS1822 and a pressure sensor. The host monitoring computer (PC) is an IBM-PC compatible machine, mainly responsible for receiving and managing monitoring data from each node, sending control commands, and displaying the dynamic parameters and device status of each control unit in real time. CAN node 0 is a crucial node with two main functions: first, it acts as the interface between the host computer (PC) and the CAN bus, converting CAN bus data to RS-232 data, buffering data transmitted from intelligent nodes, and issuing alarms to notify maintenance personnel; second, it coordinates communication between the host computer and each CAN node to ensure that monitoring data from each node can be transmitted to the host computer quickly and accurately. The monitoring CAN node is an intelligent monitoring module with a microcontroller at its core. It is primarily responsible for monitoring environmental parameters and equipment status, packaging and processing the collected data, and sending the processed digital signals to the CAN bus via the SJA1000 CAN communication controller. It also measures the pressure and temperature of each pressure boiler in the system. Generally, the intelligent monitoring node stores the monitoring data, periodically uploads it to the host computer, and can accept polling from the host computer. If the data exceeds the normal operating range, an alarm is triggered, and the data is reported to the host computer in real time. 2. Hardware Structure Design As shown in Figure 2, the monitoring CAN node uses the STC89LE54RD+ as the microcontroller. Peripheral modules include a CAN bus interface module, a temperature acquisition module, a pressure acquisition module, and an alarm module. To fully utilize the interface resources of the STC89LE54RD+, all modules except the CAN interface module use serial interface devices. This reduces the circuit size and lowers the hardware cost. The STC89LE54RD+ is a high-speed, low-power microcontroller compatible with the Philips 51MX core. It can be repeatedly set to 12 clock/machine cycles or 6 clock/machine cycles and integrates a dedicated MX810 reset circuit. Its instruction execution speed is 12 times that of the standard 8051, and it supports in-system programming (ISP) and in-application programming (IAP). 2.1 CAN Bus Interface Module In the module shown in Figure 3, the SJA1000 is selected as the CAN controller, and the PCA82C250 is selected as the CAN controller interface chip. The SJA1000 integrates the physical layer and data link layer functions of the CAN protocol and can perform frame processing of communication data. The PCA82C250 is the interface between the CAN protocol controller and the physical bus, providing differential transmission capability to the bus and differential reception capability to the CAN controller; it increases communication distance, improves the system's instantaneous anti-interference capability, protects the bus, reduces radio frequency interference, and achieves thermal protection. Connecting the ALE, RD, and WR pins of the STC89LE54RD+ to the ALE, RD, and WR pins of the SJA1000 forms a minimum system node, which is accessed by reading and writing to the external data memory. The TX1 pin of the SJA1000 is left floating, and the RX1 pin is grounded, forming the logic level required by the CAN protocol. To further improve the system's anti-interference capability, a 6N137 opto-isolator chip is added between the CAN controller SJA1000 and the CAN controller interface PCA82C250, and a DC-DC converter is used for power isolation. Communication signals are reflected when they reach the ends of the wires, and the reflected signals can interfere with the transmission of normal signals. Therefore, the two 124W resistors at the two ends of the bus (see Figure 1) play a crucial role in matching the bus impedance; ignoring them will greatly reduce the anti-interference capability and reliability of data communication, and may even prevent communication altogether. The resistor RS between pin 8 of the PCA82C250 and ground is called the "slope resistor," and its value determines whether the system is in high-speed operation mode or slope control mode. Connecting this pin directly to ground will put the system into high-speed operation mode. In this mode, shielded cables are used as the bus to avoid radio frequency interference; when the baud rate is low and the bus is short, a slope control method is generally used, and the rise and fall slopes depend on the resistance value of RS. Typically, the ideal power range for RS is 15 kW to 200 kW. In this mode, parallel or twisted-pair cables are used as the bus. 2.2 Temperature Measurement Module The temperature measurement module uses the DS1822 digital thermometer chip based on single-bus technology from Dalis Corporation, USA. Its connection circuit is simple and requires no external components, as shown in Figure 4. The DS1822 uses a clock counting method that directly converts temperature into frequency. The counting clock is generated by an oscillator with a very low temperature coefficient, so it is very stable; while the counting gate period is determined by an oscillator with a very high temperature coefficient (i.e., very sensitive to temperature). 2.3 Pressure Measurement Module The pressure measurement module uses the precision intelligent pressure sensor PPT-R. The PPT-R is a high-quality pressure sensor manufactured by Honeywell, featuring a stainless steel diaphragm and suitable for measuring high-temperature and corrosive media. The PPT-R intelligent pressure sensor boasts excellent performance and flexible configuration. It integrates the pressure signal from each measurement, with an integration time selectable between 8 ms and 12 s. This enhances the adaptability and anti-interference capability of the digital control system under different environmental conditions. The PPT sensor exhibits excellent repeatability and stability; its pressure signal can be configured by the microcontroller to either digital or analog output mode. In this system, it is configured as a digital output. 3. Software Design The system software design adopts a modular approach, mainly divided into a host computer program module, a data acquisition and processing module, and a CAN communication module. This section primarily introduces the design of the host computer software module and the CAN communication module. 3.1 Host Computer Software Design The host computer software uses Borland's C++Builder6 as the development platform and features functions such as system parameter setting, monitoring status setting, data transmission and reception, node status query, and interrupt data reception management. The host computer first initializes the CAN bus and itself, then sends commands to specific nodes to send data onto the CAN bus. The data is then uploaded to the host computer for processing. The host computer sends commands to each node using a timed polling method and receives data using an interrupt method. First, the communication serial port is opened using `CreateFile()`, with the function reference format: `CreateFile(lpFileName, dwDesiredAccess, dwShare-Mode, lpSecurityAttributes, dwCreationDistribution, dw-FlagsAndAttributes, hTemplateFile)`. Then, the `BuildCommDCB()` and `SetCommState()` functions are used to set the serial communication parameters, such as baud rate, stop bits, data bits, and parity bits, through the Device Control Block (DCB). When a communication event occurs, the functions `ReadFile()` and `WriteFile()` can be used to directly read and write to the serial port buffer. The reference formats are as follows: WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped); ReadFile(hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped). Other functions of the host computer software can be implemented by calling the properties of the corresponding components. The final software interface is shown in Figure 5. 3.2 CAN Communication Module Design The CAN communication program sends the collected data to the CAN controller, which then sends the data to the CAN bus. For receiving data, the system uses an interrupt method. Once an interrupt occurs, the received data is automatically loaded into the corresponding message register. At this time, a masking filter can also be used. The masking filter register is used to selectively compare the identifier of the received message with the identifier set during the initialization of the receive buffer, bit by bit. Only messages with matching identifiers can enter the receive buffer; those that do not meet the requirements will be masked out of the receive buffer, thereby reducing the CPU's burden in processing messages. Furthermore, different data should be placed in different message registers, and the program flow is shown in Figure 6. Conclusion This system uses an IBM-PC compatible machine, a microcontroller, and an SJA1000 to form a two-level control system. It achieves integrated operation and solves the long-standing problem in monitoring pressurized boilers. The system has a simple structure, is easy to operate, safe and reliable, low cost, and stable and reliable operation.
Read next

Discussion on DCS Field Reliability Applications

1. Introduction The main function of a Distributed Control System (DCS) is to control, monitor, manage, and make decisio...

Articles 2026-02-22