Networked Intelligent Monitoring System Based on Embedded Microcontroller
2026-04-06 07:38:40··#1
Abstract: This paper introduces a networked intelligent monitoring system with an embedded microprocessor as the core. The system uses RS-485 data bus to transmit data. The schematic diagram of the control circuit and the flowchart of the software design are given. The stability analysis and network security protection measures of the system are also described. The system operation results verify that the system has the advantages of low cost, high precision, simple circuit and good anti-interference. Keywords: monitoring system; embedded microprocessor; networked; RS-485 communication I. Introduction With the rapid development of microelectronics technology, control technology, network technology and computer technology, the application of multi-sensor control system to realize multi-parameter measurement and multi-object control has become the mainstream of modern control technology. Higher requirements are also put forward for control system, namely, high precision, long digital transmission distance, good reliability, easy networking, less data bus usage, saving equipment and power, and having information processing and storage functions. Thus, the development and design of a networked intelligent control system with high reliability and full functions has become the current focus. [1] II. Hardware Design of Networked Intelligent Monitoring System 2.1 Composition of Networked Intelligent Monitoring System The block diagram of the networked intelligent monitoring system is shown in Figure 1. The system's hardware circuit mainly consists of three parts: a sensor measurement and control unit, a data transmission node, and a data acquisition center. The sensor measurement and control unit is responsible for monitoring the data information of each sensor. The data transmission node is responsible for receiving and storing the data uploaded by the sensor measurement and control unit, and for setting it through the human-machine interface control module. It also accepts access from the data acquisition center. The data acquisition center is responsible for collecting data from each data transmission node and exchanging data with the host computer monitoring system. [align=center] Figure 1. Block diagram of the networked intelligent monitoring system[/align] 2.2 Sensor Detection and Control Unit The sensor detection and control unit consists of an embedded PIC16F676 microcontroller, a humidity sensor, a temperature sensor, a flow sensor, a signal conditioning circuit, and a network interface. The sensor's function is to convert the measured signal into an electrical signal. The signal conditioning circuit performs preprocessing operations such as signal shaping, filtering, and amplification. After processing by the microcontroller, the signal is converted into a corresponding digital result and sent to the main controller via the RS-485 bus network interface. Its block diagram is shown in Figure 2. [align=center] Figure 2 Block diagram of sensor detection control unit[/align] 2.3 PIC16F676 microcontroller [2.3] PIC16F676 microcontroller is a high-performance microcontroller launched by Microchip Technology Ltd. in the United States. It is a powerful microcontroller that can provide highly flexible and effective solutions for embedded control systems. As the control core in the system, it mainly realizes the conversion between analog and digital quantities, and completes the acquisition, processing and transmission of acquisition results. Its main features are as follows: (1) 1K bytes of reprogrammable program memory and 128 bytes of data memory; (2) 12 I/O lines that can directly drive LEDs; (3) 2 8-bit timers/counters with 8-bit prescalers and watchdogs; (4) 5 channels of 10-bit A/D conversion; (5) Low power consumption and wide operating voltage range: 2.5~5.5V 2.4 Network interface unit [4] The network interface unit is the bridge between the sensor control system and the main controller. The RS-485 serial interface bus is widely used, employing a half-duplex transmission method with a pair of balanced differential signal lines, making it very convenient for multi-site interconnection. Communication interfaces can use chips such as MAX485 and SN75LBC184. In this system, the network interface chip for the sensor control system is the MAX485, with a set data transmission rate of 2400 b/s, a data transmission distance of 1200 m, and a data transmission format of 1 start bit, 8 data bits, 1 stop bit, no parity bit, and communication error detection using cumulative checksum. The interface circuit with the microcontroller is shown in Figure 3. [align=center] Figure 3 Interface circuit between MAX485 and microcontroller[/align] In the RS-485 communication network, each module on the bus is assigned a unique address. First, each front-end machine enables interrupt waiting (SM2=1), the main controller sends an address frame, all front-end machines generate serial port interrupts for the address frame, compare the address with the local address, the front-end machine being addressed clears SM2 to 0 and sets TB8 to 1, and sends the local address code back to the main controller for verification. After verification, the selected front-end machine sends the acquired data to the main controller in a data frame. After sending, SM2 is set to 1 and TB8 is cleared to 0; the front-end machine not being addressed keeps SM2 at 1 and enables interrupt waiting. Software Design of the Networked Intelligent Monitoring System 3.1 Sensor Data Acquisition Filtering Algorithm [5] Since the input temperature and humidity signal is nonlinear, it must be linearized by software measures. Average value filtering method: Arithmetic average filtering aims to find a Y(k) that minimizes the sum of squares of the errors between this value and each sampled value, i.e.: S = ΣY[sub]i[/sub] where Yi represents each sampled value (i = 1 ~ n) Y(k) = S/n The essence of arithmetic average filtering is to add the n sampled values within a sampling period and then divide by the number of samplings n to obtain the sampled value for that period. To improve the accuracy and reliability of arithmetic average filtering, considering the rate of change of the measured analog signal, a calculation period of 10 times is used. After sampling 10 times, the maximum and minimum values are removed, and the arithmetic average of the remaining 8 values is performed to obtain the sampled value for this calculation period. 3.2 Software implementation of the networked intelligent monitoring system The software of the networked intelligent monitoring system adopts a modular design, which facilitates program debugging and saves memory space, and also facilitates later maintenance and product upgrades. The main control system program includes communication processing subroutines, data processing subroutines, human-machine dialogue subroutines, data output subroutines, etc. The sensor measurement and control unit program includes an A/D conversion subroutine, an arithmetic mean filtering subroutine, a D/A output control subroutine, and a communication processing subroutine. The program flowchart is shown in Figure 4. [align=center]Figure 4 Sensor Measurement and Control Unit Program Flowchart[/align] The network interface unit control program uses multi-machine communication and interrupt-driven methods to achieve data network transmission between the data acquisition center and each data transmission node. The program flowchart is shown in Figure 5. [align=center]Figure 5 Network Interface Unit Host Program Flowchart[/align] IV. System Stability Analysis and Network Security Protection In specific applications, reliability and communication efficiency should be given special attention. Reliability can be improved by properly handling communication line matching, power supply and isolation, and hardware and software redundancy. Communication distance can be addressed by adding repeaters, using data compression, and data processing techniques. In practical application environments, high-frequency transient interference can damage the RS-485 communication interface if not properly protected. Isolation or bypass methods can be used to protect against this transient interference. 1. Isolation Protection Method. This scheme effectively transfers transient high voltage to the electrical isolation layer in the isolation interface. Due to the high insulation resistance of the isolation layer, no damaging surge current is generated, thus protecting the interface. 2. Bypass protection method. This scheme uses transient suppression elements (such as TVS, MOV, gas discharge tube, etc.) to bypass harmful transient energy to ground. In practical applications, the above two schemes are combined and used flexibly. The isolation interface isolates large-amplitude transient interference, while the bypass element protects the isolation interface from being broken down by excessively high transient voltage. V. Conclusion The hospital ward remote monitoring system designed using this scheme is convenient, flexible, and economical in terms of networking. The system has been operating normally and effectively since its inception. Based on an embedded microcontroller and RS-485 bus network, this networked intelligent monitoring system is simple to implement, has reliable communication, and strong portability. Since the RS-485 bus can connect multiple nodes, it can realize a distributed control system with multiple sensors and one PC for monitoring, showing broad application prospects. References [1] Zhang Gang, Research on Networked Intelligent Sensors Based on Fieldbus [J], Sensor Technology, 2002, 21(9) [2] PIC16F676/630 Data Sheet [M], Microchip Technology Inc., 2003 [3] Liu Heping (translator), Practical Software and Interface Technology of PIC16F87X Microcontroller [M], Beijing: Beijing University of Aeronautics and Astronautics Press, 2001 [4] MAX485 Data Sheet [M], Maxim Technology Inc., 2003 [5] Dou Zhenzhong, Principles and Programming of PIC Series Microcontrollers [M], Beijing: Beijing University of Aeronautics and Astronautics Press, 1998