# Design and Implementation of Electrical Parameter Monitoring System Based on ZigBee Wireless Communication

Authors: Xiangbin Meng
Journal: Mobile Information Systems
 (2022)

---

## Abstract

In order to solve the problems of many lines, troublesome movement and redundant management of traditional electrical parameter monitoring system, a design and implementation of electrical parameter monitoring system based on ZigBee wireless communication is proposed. Taking the monitor as an example, this paper briefly introduces the application status of the monitor monitoring system and electrical safety detection. According to the comparison of wireless communication technology and the analysis of actual demand, this paper expounds the advantages of ZigBee wireless technology. Based on the combination of received signal strength indication (RSSI) ranging algorithm and trilateral positioning algorithm, the wireless positioning of mobile targets is realized. Then, the sparse correlation matrix of signal attenuation coefficient between base stations is established in the upper computer to optimize the positioning by using the look-up table method. The relevant test results show that through the serial port test software 2000 times of data transmission and reception, 1866 times of communication are successful, and the success rate is 93.3%, which basically meets the requirements of data transmission stability; After data transmission time detection, it takes about 1.4 seconds to send data from the monitor to the client for reception. The client sends the module query command, and the time when the command reaches the monitor is 1.6 seconds. The data transmission speed can basically meet the requirements of real-time monitoring. The design and implementation of the monitoring system can not only help to reduce the workload of medical staff in hospital nurse stations and improve their work efficiency, but also provide the possibility of practical significance for developing into an application tool for patient family members or personal health management in the future.


---

## Body

## 1. Introduction

Since the end of last century, wireless communication technology has gradually penetrated into people’s daily life. Especially with the rapid development of sensor technology, distributed information processing technology, network technology, embedded computer technology, RF technology, MEMS technology and integrated circuit technology, wireless communication technology, especially short-range wireless communication technology, has made great strides, The implementation cost of wireless communication is gradually reduced, the data transmission rate is greatly improved, the robustness is getting better and better, and it is gradually comparable to the wired cable network (see Figure1). The rapid development of computer technology and communication means has promoted and innovated various technologies to be flexibly applied in all aspects of life, which not only brings convenience to people, but also provides more imagination space and possibilities for the combination of science and technology and human beings [1, 2]. Telemedicine, as a new medical service model rising in recent years across many fields such as modern medicine, computer science and communication engineering, applies all kinds of advanced science and technology to the medical field, and realizes the control and treatment of various diseases through the timely understanding of human health, so as to ensure people’s health. Telemedicine monitoring is an important part of telemedicine. It can be defined as a technical means to transmit remote physiological parameter information and medical signals to the monitoring center for analysis and give diagnostic opinions by means of communication [3]. As a short-range communication wireless technology, ZigBee has many advantages such as low power consumption, low cost and low rate. At present, wireless sensor network technology based on ZigBee has been more and more applied in military, environment, large industrial parks, security monitoring and other fields [4, 5].Figure 1
ZigBee wireless communication technology.The monitoring system based on ZigBee monitor uses ZigBee module to build a wireless network, and collects the operation status and electrical parameter information of the monitor through the sensor as the information acquisition interface. The collected information is uploaded to the client of the monitoring center by ZigBee wireless network, so as to realize the timely display and alarm of the operation status information of the monitor. Compared with the traditional wired monitoring system, the wireless monitoring system not only gives patients greater freedom of movement, so that patients can not be limited by time and place. When patients move and ward transfer, the monitor can move conveniently, avoiding the lack of information loss caused by the need to plug and unplug lines when the traditional wired monitor moves. Moreover, the wireless monitoring system will bring great convenience to the hospital management equipment. The hospital can find the operation status of any monitor in time, find the location of the monitor through wireless positioning, and use the label information management to call, match and supervise the monitor in time and efficiently, so as to greatly improve the use efficiency and safety of the monitor. As a frequently used equipment in the hospital, medical staff and patients often need to contact it. If the monitor has potential electrical safety hazards, once the prevention is improper, the performance of the monitor will be affected at least, and it will bring life danger to patients and medical staff [6, 7]. Therefore, it is of great significance to quickly and timely find the potential electrical safety hazards of the monitor. Monitoring electrical safety parameters mainly refer to voltage, leakage current and grounding resistance, of which the most important are leakage current and grounding impedance. Taking the electrical parameters of the monitor as an example, this paper studies the design and implementation of the electrical parameter monitoring system based on ZigBee wireless communication. Through the design, the leakage current and grounding impedance detection circuit are embedded in the monitor to realize the rapid query of the electrical parameters of the monitor [8].


## 2. Literature Review

With the maturity of wired communication technology, its market application scope and application depth tend to be saturated gradually. As an emerging communication technology, wireless communication shows good convenience compared with wired communication, and its capital investment is less. Oscullo and others realize the connection between the monitor and the positioning base station through wireless sensor network, and monitor the “equipment safety information” of bedside monitors scattered in all corners of the hospital in real time. The equipment safety information includes equipment geographical location, equipment serial number, equipment fault alarm information, etc. [9]. Eltamaly and others developed portable medical equipment for emergency call and remote monitoring, and sent monitoring data through satellite. Finkelstein uses WLAN technology to carry out home remote monitoring [10]. Tifour and others believe that the monitor is one of the most basic medical equipment in the hospital, with huge number, long working hours and strong mobility [11]. Vargas and others proposed that ZigBee is a standardized wireless technology and an ideal solution for wireless networking such as factory automation, medical equipment and sensor networks [12]. Cao and others realized the transmission of monitor information parameters through the newly emerging long-distance wireless communication technology. Although this method overcomes the shortcomings of the traditional wired monitoring system, its communication needs to be charged. If the number of monitors is large and the working time is long, the communication cost is very high [13]. Dost and others believe that although ZigBee has the function of ad hoc network, it has been successfully applied in various industries. Especially in the industry of Internet of things [14]. Dameshghi and others studied a physiological parameter monitoring system based on ZigBee, transmitted the physiological parameter data collected by the sensor through the establishment of ZigBee wireless sensor network, and checked the real-time health status of patients by operating the human-computer interaction application designed based on Android platform. If the physiological parameter data is abnormal, such as hyperthermia or tachycardia, the medical staff can quickly get this information [15]. Lee and others believe that the monitor mainly realizes the monitoring of six parameters of patients’ respiration, pulse, blood pressure, body temperature and ECG. The monitoring of these parameters mainly depends on respiratory acquisition module, blood pressure acquisition module, body temperature acquisition module, ECG acquisition module and blood oxygen acquisition module. Therefore, whether the acquisition module can operate normally determines whether the monitor can correctly monitor the correct life parameters. The quality of the acquisition module is an important indicator of the performance of the monitor [16].Based on this research, this paper proposes the design and implementation of an electrical parameter monitoring system based on ZigBee wireless communication. Firstly, the application status of the monitor monitoring system and electrical safety detection are briefly introduced. At the same time, the ZigBee network topology and ZigBee protocol stack are introduced in detail. Secondly, the hardware design of ZigBee base station module is carried out by using CC2_530 chip, and then the embedded principle design scheme for the detection of the electrical safety part of the monitor is given. Then, this paper designs the client software by using C sharp language, and designs a simple and fast man-machine interface for windows such as equipment management, map loading, alarm information statistical query and dynamic real-time monitoring. Realize the requirements of real-time monitoring on the client. Finally, after relevant tests, the alarm information such as electrical safety and the positioning of the monitor have obtained satisfactory results, and its communication can basically meet the requirements of real-time, fast, stable and safe.


## 3. Research Methods

### 3.1. ZigBee Technology

#### 3.1.1. Demand Analysis

ZigBee, also known as Purple Bee, is a low-speed wireless online protocol for low speed and short distance transmission, underlying the media access layer and physical layer using the IEEE 802.15.4 standard specification.The main features are low speed, low power consumption, low cost, support for a large number of online nodes, support for a variety of online topology, low complexity, fast, reliable and safe.This paper proposes wireless technology to realize the operation status and electrical parameter monitoring of the monitor. The main function is to build a short-distance communication network through relevant wireless technology, and then the medical staff use the PC client to remotely monitor the operation status of each monitor in real time through the wireless network. Its contents include electrical safety, geographical location information, lead status at all levels and human physiological parameters. It is required that once the monitor fails, it will generate an alarm and upload it to the client through the wireless network to achieve the purpose of real-time monitoring [16]. According to the requirements and taking into account the actual problems of the hospital and the constraints of relevant technical level, the following requirements are put forward for the monitoring system network.(1)
Real time. The monitor monitors human body parameters for a long time, which needs to provide diagnosis and treatment basis for medical staff in real time, If the failure of the monitor is not found and eliminated in time, the normal operation of the equipment will be affected, and even life-threatening to patients and medical staff. Therefore, it is specially required to upload the information to the client host computer in time once the monitor fails.(2)
Reliability, reliability mainly includes: the reliability of data detection. When monitoring the operation status and electrical parameters of the monitor, it is necessary to detect the data reliably and truly. Reliable data upload over wireless networks. The alarm information is uploaded to the client through the wireless network. Therefore, reliable and stable data transmission and low packet loss rate are required in the wireless network.(3)
Safety, the electrical parameter monitoring of the monitor needs to design a special detection circuit, in which some detection circuit interfaces are connected with the power grid and the Earth. Therefore, it is necessary to detect the grounding impedance, ground leakage current and shell leakage current of the monitor. Other parts need to contact the human body, which will produce patient leakage current and patient auxiliary leakage current. Therefore, electrical isolation and relevant voltage and current detection should be done well in the design to minimize medical accidents caused by potential electrical safety hazards.(4)
The monitoring system for the operation status and electrical parameters of the monitor is to facilitate the management and monitoring of the monitor in the hospital. The convenient, simple and effective operating system can not only make the medical staff quickly master the use method of the system, but also improve the work efficiency of the hospital. Therefore, the system design needs to ensure its operability and universality, and facilitate the operation and management of hospital equipment managers.


#### 3.1.2. Comparison of Communication Capabilities of Several Short-Range Wireless Technologies

Short distance wireless communication technology has broad market prospects and application fields, and has been valued by many companies. At present, common short-range wireless communication technologies include b1uetooth, Wi Fi, ZigBee, UWB, IrDA and other technologies. The following makes a simple comparison on their transmission distance, power consumption, cost, communication speed and so on. Figure2 below shows the relationship between the above short-range wireless communication rate and distance.Figure 2
Relationship between rate and transmission distance.In comparing the communication distance and communication speed, we can get:(1)
Bluetooth is mainly used to connect mobile devices in a small space. It uses frequency hopping technology for communication, so it has good anti-interference ability and security. The maximum communication rate is 1 MB/s. The transmission distance is 10 m at the power of 0 dbm and 100 m at the power of 20 dbm.(2)
The coverage of Wi Fi network is very wide, up to 100 m. However, indoor transmission is vulnerable to interference, and the communication distance will decrease rapidly. Its communication rate can reach 11-ssmb/s.(3)
UWB technology is a new short-range wireless high-speed communication technology. It mainly uses nanosecond non sine wave pulses for information and data transmission. Its communication speed is 1 GB/s, but the communication distance is less than 13 m.(4)
Infrared data communication IrDA transmits data through infrared. At present, the communication distance is 3–45 m and the communication speed reaches 4 MB/s.(5)
ZigBee’s communication distance is similar to b1uetooth Bluetooth, at 10–75 m. Its communication rate is about 200 KB/s.According to the analysis, IrDA and Wi-Fi have the greatest advantage after the comparison of communication distance and communication rate, followed by ZigBee technology. However, IrDA communication conditions are relatively harsh, which can only realize point-to-point single straight-line communication, and there can be no obstacles within the communication straight-line distance. Although Wi-Fi has great advantages in communication speed and distance, it has major defects in power consumption [17].Compared with wireless communication technology, not only the transmission distance and data transmission speed are considered, but also the complexity, power consumption and cost of wireless network are analyzed. Table1 lists the comparison of five communication technologies in complexity, power consumption and cost.Table 1
Performance comparison.
TechnologyPower wasteCostComplexityUWBLowMiddleHighWi-fiHighHighMiddleIrDAMiddleMiddleLowBlue toothHighMiddleHighZigbeeMost power efficientLowestLowFrom the above data analysis, it can be concluded that although b1uetooth communication technology is relatively mature, its communication distance is short and the module power consumption is relatively high; IrDA communication technology has relatively low power consumption and complexity, but it uses infrared straight-line point-to-point communication, which is not suitable for the requirements of Hospital Indoor complex environment communication; Wi-Fi communication technology has great advantages in speed and distance. At present, many indoor wireless technologies use this method, but Wi-Fi power consumption is relatively large and is not suitable for the installation of battery power supply, so it is not suitable for the construction of a large number of hospital base stations; UWB communication technology has great bandwidth and speed, but its communication distance is too short [18, 19].Through the above analysis of communication rate and distance, cost, power consumption and complexity, combined with the requirements of the electrical parameter monitoring system of the monitor, it can be seen that ZigBee technology has great advantages when meeting the communication rate, distance and taking into account the cost, power consumption and complexity.


#### 3.1.3. ZigBee Network Topology

ZigBee is an IEEE802.1 5.4 protocol standard. Its communication characteristics are low power consumption, low cost and low transmission rate. Its name comes from that bees send signals to their companions through the shaking and friction (Zig) of their wings when foraging, so as to transmit the specific location information of food source to the bee colony. This is the way of signal transmission between bee colonies. According to the characteristics of bees transmitting information and ZigBee networking mode, ZigBee network structure can be divided into star, mesh and tree, and its structure is shown in Figure3 below.Figure 3
ZigBee network structure.


#### 3.1.4. ZigBee Protocol Stack Structure

ZigBee protocol stack is composed of physical layer (PHY), media access control layer (MAC), network layer (NWK) and application layer (APL). PHY layer and MAC layer protocols are defined by IEEE 802.15.4, and network layer and application layer protocols are defined by ZigBee alliance. The application layer also includes application support sublayer (APS), application framework (AF), ZigBee device object (ZDO) and application object formulated by the manufacturer. The protocol architecture is shown in Figure4 below.Figure 4
ZigBee protocol model.


### 3.2. Overall Hardware Structure

In this paper, the wireless network is mainly composed of three hardware modules: coordinator, ZigBee base station group and RF interface of monitor. The ZigBee base station group is mainly responsible for communicating with the monitor through the internal ZigBee RF module; The coordinator is mainly responsible for receiving the information sent by the ZigBee base station group and uploading the data information to the server through the serial port module; The RF interface module of the monitor is mainly responsible for the communication between ZigBee base station and the monitor [20, 21]. If the coordinator is far away from the ZigBee base station and beyond the wireless communication range, a router base station can be opened in a far place with the same function as the coordinator, but the wireless router does not directly communicate with the server. In this paper, 470 MHz network is established to build the communication between router and coordinator. The connection between the hardware modules is shown in Figure 5 below.Figure 5
Hardware module connection.


### 3.3. Electrical Parameter Monitoring Module

In the national standard GB9706.1–2007 general requirements for electrical safety, four performance specifications are proposed for the safety performance test of medical electrical equipment, which are grounding impedance, equipment insulation resistance, equipment leakage current and dielectric strength. In these four specifications, grounding resistance and equipment leakage current can best reflect the safety performance of electrical equipment. The leakage current of medical electrical equipment mainly includes: shell leakage current, ground leakage current, patient leakage current and patient auxiliary leakage current. Other instruments are used to detect the leakage current and grounding resistance of the monitor [22]. Through research, the leakage current and grounding resistance detection circuit of the monitor are embedded into the monitor to realize the real-time electrical parameter detection of the monitor. The following leakage current detection design is carried out under the normal state of the equipment, zero line open circuit and reverse polarity.


#### 3.3.1. Detection of Ground Leakage Current

The current flowing from the grid power supply through or across the insulation protection and isolation into the grounding protection conductor is called: ground leakage current. As shown in Figure6, switches S1 and S2 are closed and switch S4 is disconnected. The current between the internal protective grounding of the equipment and the two ends of the power protective grounding is detected through the current detection sensor. This current is the value detected under normal conditions. If the equipment power line is a double hole plug, it is necessary to exchange the plug position and measure again, in which the maximum measured value is taken as the ground leakage current. As shown in Figure 6, switches S2 and S4 are disconnected, and the current between the internal protection grounding of the equipment and the two ends of the power protection grounding is detected by the current detection sensor. This current is the equipment to ground leakage current under the single fault state: zero line open circuit [23].Figure 6
Detection of floor leakage current.


#### 3.3.2. Shell Leakage Current Detection

During normal use of medical equipment, part of the current flows from the shell that can be touched by medical personnel or patients to the Earth or other equipment parts through other lines instead of grounding protection lines. We call this part of current as shell leakage current. As shown in Figure7, the switches S1 and S2 are closed to connect the exposed part of the equipment shell with the grounding protection line inside the equipment, and measure the current between the exposed shell and the power grounding protection. This current is the shell leakage current of the equipment under normal operation. As shown in Figure 7, switch S1 is disconnected and S3 is closed, so that the exposed part on the equipment shell is connected with the grounding protection line inside the equipment, and the current between the exposed shell and the power grounding protection is measured. This current is the shell leakage current in single fault state, also known as the equipment shell leakage current under zero line open circuit. As shown in the figure, switch S2 is closed and S4 is disconnected, so that the exposed part on the equipment shell is connected with the grounding protection line inside the equipment, and the current between the exposed shell and the power grounding protection is measured. This current is the shell leakage current in single fault state, also known as the equipment shell leakage current under ground wire open circuit.Figure 7
Shell leakage current detection.


#### 3.3.3. Patient Leakage Current Detection

In medical electrical equipment, some current flows from the application module to the Earth through the patient’s body, or an unexpected voltage from an external power supply appears on the patient and flows from the patient to the Earth. This current is called patient leakage current. As shown in Figure8, switch S2 is closed and switch S4 is closed, and the current from the application part of the current module to the power protection grounding is detected through the ammeter, which is the patient leakage current under the normal operation of the equipment. As shown in Figure 8, switch S2 is open and S4 is closed, and the current applied by the current module to the power protection grounding is detected through the ammeter. This current is the leakage current of patients with zero line open circuit in a single fault state. As shown in the figure, switch S2 is closed and S4 is disconnected, and the current from the application part of the current module to the power protection grounding is detected through the ammeter. This current is the leakage current of the patient with open circuit of the ground wire under the single fault state.Figure 8
Patient leakage current detection.


#### 3.3.4. Patient Auxiliary Leakage Current Detection

Patient auxiliary current refers to the current flowing into the human body through the modules when multiple modules of electrical equipment are used at the same time. This current generally does not produce physiological effects, but the size of the current will affect the authenticity of the detection data. As shown in Figure9, switch S2 is closed and switch S4 is closed. The current detection sensors are connected to the currently used functional modules. The detected current is the patient auxiliary current under normal conditions. As shown in the figure, switch S2 is disconnected and S4 is closed, and the current detection sensors are used to connect the currently used functional modules in pairs. The detected current is the leakage current of patients with zero line open circuit in a single fault state. As shown in Figure 9, the switch S2 is closed and S4 is disconnected. The current detection sensors are used to connect the currently used functional modules in pairs. The detected current is the ground wire open circuit patient leakage current in a single fault state [24]. As shown in Figure 9, the switch S2 is closed, S4 is closed, S3 changes the switch position, and uses current detection sensors to connect the currently used functional modules in pairs. The detected current is the polarity reverse patient leakage current in a single fault state.Figure 9
Patient auxiliary leakage current detection.


### 3.4. Wireless Positioning

#### 3.4.1. RSSI Algorithm

With the progress of technology and technology, the accuracy of distance measurement based on the strength of received signal strength indication (RSSI) algorithm is getting higher and higher. It is characterized by:(1)
Because the signal energy is taken as the detection object, it has certain diffraction to small and medium-sized obstacles, so it is suitable for distance measurement in complex terrain. This feature is not possessed by other distance algorithms.(2)
The implementation is simple. It only needs the transmission power of fixed base station and mobile tag, and does not need the support of other devices.(3)
In a space that is not too complex, as long as the base station works stably, its positioning is more accurate. The following is the principle of RSSI algorithm:In the transmission of radio signal in space, the attenuation relationship between its transmission distance and signal power is shown in formula (1):(1)Wr=WtLα.In the formula,Wr is the signal transmission power, Wr is the signal reception power, and their units should be the same. L is the distance between the base station and the mobile tag, α Is the signal attenuation coefficient. If in a wireless network, the transmission power Wr and the spatial attenuation coefficient are known α, Then the location of the mobile tag and the base station can be obtained by combining the received power Wr of the base station. But in practice, it is difficult to measure its power Wr.Therefore, the detection is carried out at the position of 1 m from the base station to eliminateWr. Then the formula at 1 m is shown in formula (2):(2)Wr0=WtL0α.Where L0 is 1, then. Wr0=WtFormula (3) can be obtained by bringing formula (2) into (1):(3)Wr=Wr0Lα.Take pairs on both sides of (3), as shown in (4): (4)WRL=WR0−10α1gL.In the formula,Wr is the received power and Wr0 is the reference received power at 1 m of the base station. a is the attenuation coefficient, whose value depends on the formula algorithm and the structural and material properties of obstacles in cyberspace.The value of attenuation coefficienta can be calculated by linear regression by testing the transmission power of multiple base stations at different distances. The formula is shown in formula (5):(5)α=WTNNTN,Wherein, formulas (6) and (7):(6)W=WR1−W0,WR2−W0,⋯,WRn−W0T,(7)N=−101gL1L0,−101gL2L0,⋯,−101gLnL0T.Holda Bring in equation (4) to obtain equation (8):(8)L=10WR0−WR/10α.However, in the actual environment, the measurement ofWr is easily affected by the surrounding air humidity, obstacle diffraction, wall reflection and other factors. There will also be error fluctuations in the measured value of Wr. This error is unintentionally caused by natural factors, and its error has the characteristics of normal distribution. Therefore, Wr is optimized by Gaussian filter in this paper.A large number of tests are carried out onWr, and its data has Gaussian distribution (also known as normal distribution). Its formula is shown in formula (9):(9)fx=12πσe−x−θ2/2σ2.In the formula,e is the average value of Wr and 6 is the standard deviation of Wr.The mean value of test samples is shown in equation (10):(10)X¯=1n∑i=1nWRi.The standard deviation of the sample is shown in equation (11):(11)S1n−1∑i=1nWRi−X¯2.According to the actual engineering experience and the actual site environment, the confidence interval ofE is set as 0.6.Therefore, according to the fact thatWr conforms to the positive distribution, equation (12) can be obtained:(12)X¯−θS/n∼N0,1.According to 1−θ The confidence interval of can also be obtained by equation (13):(13)X¯−Snz1−θ2,X¯+Snz1−θ2.The confidence interval obtained by querying the normal distribution table is equation (14):(14)X¯−0.734Sn,X¯+0.734Sn.Calculate allWr by the above formula, and the mean value of Wra can be obtained, as shown in formula (15):(15)WRα=1k∑j=1kWRj.Therefore, bringWr into formula (7) and calculate the distance L, as shown in formula (16):(16)L=10WR0−WR/10α.Therefore, as long as the receiving powerWr of the mobile tag is obtained, the distance between the mobile tag and the fixed base station can be calculated.


## 3.1. ZigBee Technology

### 3.1.1. Demand Analysis

ZigBee, also known as Purple Bee, is a low-speed wireless online protocol for low speed and short distance transmission, underlying the media access layer and physical layer using the IEEE 802.15.4 standard specification.The main features are low speed, low power consumption, low cost, support for a large number of online nodes, support for a variety of online topology, low complexity, fast, reliable and safe.This paper proposes wireless technology to realize the operation status and electrical parameter monitoring of the monitor. The main function is to build a short-distance communication network through relevant wireless technology, and then the medical staff use the PC client to remotely monitor the operation status of each monitor in real time through the wireless network. Its contents include electrical safety, geographical location information, lead status at all levels and human physiological parameters. It is required that once the monitor fails, it will generate an alarm and upload it to the client through the wireless network to achieve the purpose of real-time monitoring [16]. According to the requirements and taking into account the actual problems of the hospital and the constraints of relevant technical level, the following requirements are put forward for the monitoring system network.(1)
Real time. The monitor monitors human body parameters for a long time, which needs to provide diagnosis and treatment basis for medical staff in real time, If the failure of the monitor is not found and eliminated in time, the normal operation of the equipment will be affected, and even life-threatening to patients and medical staff. Therefore, it is specially required to upload the information to the client host computer in time once the monitor fails.(2)
Reliability, reliability mainly includes: the reliability of data detection. When monitoring the operation status and electrical parameters of the monitor, it is necessary to detect the data reliably and truly. Reliable data upload over wireless networks. The alarm information is uploaded to the client through the wireless network. Therefore, reliable and stable data transmission and low packet loss rate are required in the wireless network.(3)
Safety, the electrical parameter monitoring of the monitor needs to design a special detection circuit, in which some detection circuit interfaces are connected with the power grid and the Earth. Therefore, it is necessary to detect the grounding impedance, ground leakage current and shell leakage current of the monitor. Other parts need to contact the human body, which will produce patient leakage current and patient auxiliary leakage current. Therefore, electrical isolation and relevant voltage and current detection should be done well in the design to minimize medical accidents caused by potential electrical safety hazards.(4)
The monitoring system for the operation status and electrical parameters of the monitor is to facilitate the management and monitoring of the monitor in the hospital. The convenient, simple and effective operating system can not only make the medical staff quickly master the use method of the system, but also improve the work efficiency of the hospital. Therefore, the system design needs to ensure its operability and universality, and facilitate the operation and management of hospital equipment managers.


### 3.1.2. Comparison of Communication Capabilities of Several Short-Range Wireless Technologies

Short distance wireless communication technology has broad market prospects and application fields, and has been valued by many companies. At present, common short-range wireless communication technologies include b1uetooth, Wi Fi, ZigBee, UWB, IrDA and other technologies. The following makes a simple comparison on their transmission distance, power consumption, cost, communication speed and so on. Figure2 below shows the relationship between the above short-range wireless communication rate and distance.Figure 2
Relationship between rate and transmission distance.In comparing the communication distance and communication speed, we can get:(1)
Bluetooth is mainly used to connect mobile devices in a small space. It uses frequency hopping technology for communication, so it has good anti-interference ability and security. The maximum communication rate is 1 MB/s. The transmission distance is 10 m at the power of 0 dbm and 100 m at the power of 20 dbm.(2)
The coverage of Wi Fi network is very wide, up to 100 m. However, indoor transmission is vulnerable to interference, and the communication distance will decrease rapidly. Its communication rate can reach 11-ssmb/s.(3)
UWB technology is a new short-range wireless high-speed communication technology. It mainly uses nanosecond non sine wave pulses for information and data transmission. Its communication speed is 1 GB/s, but the communication distance is less than 13 m.(4)
Infrared data communication IrDA transmits data through infrared. At present, the communication distance is 3–45 m and the communication speed reaches 4 MB/s.(5)
ZigBee’s communication distance is similar to b1uetooth Bluetooth, at 10–75 m. Its communication rate is about 200 KB/s.According to the analysis, IrDA and Wi-Fi have the greatest advantage after the comparison of communication distance and communication rate, followed by ZigBee technology. However, IrDA communication conditions are relatively harsh, which can only realize point-to-point single straight-line communication, and there can be no obstacles within the communication straight-line distance. Although Wi-Fi has great advantages in communication speed and distance, it has major defects in power consumption [17].Compared with wireless communication technology, not only the transmission distance and data transmission speed are considered, but also the complexity, power consumption and cost of wireless network are analyzed. Table1 lists the comparison of five communication technologies in complexity, power consumption and cost.Table 1
Performance comparison.
TechnologyPower wasteCostComplexityUWBLowMiddleHighWi-fiHighHighMiddleIrDAMiddleMiddleLowBlue toothHighMiddleHighZigbeeMost power efficientLowestLowFrom the above data analysis, it can be concluded that although b1uetooth communication technology is relatively mature, its communication distance is short and the module power consumption is relatively high; IrDA communication technology has relatively low power consumption and complexity, but it uses infrared straight-line point-to-point communication, which is not suitable for the requirements of Hospital Indoor complex environment communication; Wi-Fi communication technology has great advantages in speed and distance. At present, many indoor wireless technologies use this method, but Wi-Fi power consumption is relatively large and is not suitable for the installation of battery power supply, so it is not suitable for the construction of a large number of hospital base stations; UWB communication technology has great bandwidth and speed, but its communication distance is too short [18, 19].Through the above analysis of communication rate and distance, cost, power consumption and complexity, combined with the requirements of the electrical parameter monitoring system of the monitor, it can be seen that ZigBee technology has great advantages when meeting the communication rate, distance and taking into account the cost, power consumption and complexity.


### 3.1.3. ZigBee Network Topology

ZigBee is an IEEE802.1 5.4 protocol standard. Its communication characteristics are low power consumption, low cost and low transmission rate. Its name comes from that bees send signals to their companions through the shaking and friction (Zig) of their wings when foraging, so as to transmit the specific location information of food source to the bee colony. This is the way of signal transmission between bee colonies. According to the characteristics of bees transmitting information and ZigBee networking mode, ZigBee network structure can be divided into star, mesh and tree, and its structure is shown in Figure3 below.Figure 3
ZigBee network structure.


### 3.1.4. ZigBee Protocol Stack Structure

ZigBee protocol stack is composed of physical layer (PHY), media access control layer (MAC), network layer (NWK) and application layer (APL). PHY layer and MAC layer protocols are defined by IEEE 802.15.4, and network layer and application layer protocols are defined by ZigBee alliance. The application layer also includes application support sublayer (APS), application framework (AF), ZigBee device object (ZDO) and application object formulated by the manufacturer. The protocol architecture is shown in Figure4 below.Figure 4
ZigBee protocol model.


## 3.1.1. Demand Analysis

ZigBee, also known as Purple Bee, is a low-speed wireless online protocol for low speed and short distance transmission, underlying the media access layer and physical layer using the IEEE 802.15.4 standard specification.The main features are low speed, low power consumption, low cost, support for a large number of online nodes, support for a variety of online topology, low complexity, fast, reliable and safe.This paper proposes wireless technology to realize the operation status and electrical parameter monitoring of the monitor. The main function is to build a short-distance communication network through relevant wireless technology, and then the medical staff use the PC client to remotely monitor the operation status of each monitor in real time through the wireless network. Its contents include electrical safety, geographical location information, lead status at all levels and human physiological parameters. It is required that once the monitor fails, it will generate an alarm and upload it to the client through the wireless network to achieve the purpose of real-time monitoring [16]. According to the requirements and taking into account the actual problems of the hospital and the constraints of relevant technical level, the following requirements are put forward for the monitoring system network.(1)
Real time. The monitor monitors human body parameters for a long time, which needs to provide diagnosis and treatment basis for medical staff in real time, If the failure of the monitor is not found and eliminated in time, the normal operation of the equipment will be affected, and even life-threatening to patients and medical staff. Therefore, it is specially required to upload the information to the client host computer in time once the monitor fails.(2)
Reliability, reliability mainly includes: the reliability of data detection. When monitoring the operation status and electrical parameters of the monitor, it is necessary to detect the data reliably and truly. Reliable data upload over wireless networks. The alarm information is uploaded to the client through the wireless network. Therefore, reliable and stable data transmission and low packet loss rate are required in the wireless network.(3)
Safety, the electrical parameter monitoring of the monitor needs to design a special detection circuit, in which some detection circuit interfaces are connected with the power grid and the Earth. Therefore, it is necessary to detect the grounding impedance, ground leakage current and shell leakage current of the monitor. Other parts need to contact the human body, which will produce patient leakage current and patient auxiliary leakage current. Therefore, electrical isolation and relevant voltage and current detection should be done well in the design to minimize medical accidents caused by potential electrical safety hazards.(4)
The monitoring system for the operation status and electrical parameters of the monitor is to facilitate the management and monitoring of the monitor in the hospital. The convenient, simple and effective operating system can not only make the medical staff quickly master the use method of the system, but also improve the work efficiency of the hospital. Therefore, the system design needs to ensure its operability and universality, and facilitate the operation and management of hospital equipment managers.


## 3.1.2. Comparison of Communication Capabilities of Several Short-Range Wireless Technologies

Short distance wireless communication technology has broad market prospects and application fields, and has been valued by many companies. At present, common short-range wireless communication technologies include b1uetooth, Wi Fi, ZigBee, UWB, IrDA and other technologies. The following makes a simple comparison on their transmission distance, power consumption, cost, communication speed and so on. Figure2 below shows the relationship between the above short-range wireless communication rate and distance.Figure 2
Relationship between rate and transmission distance.In comparing the communication distance and communication speed, we can get:(1)
Bluetooth is mainly used to connect mobile devices in a small space. It uses frequency hopping technology for communication, so it has good anti-interference ability and security. The maximum communication rate is 1 MB/s. The transmission distance is 10 m at the power of 0 dbm and 100 m at the power of 20 dbm.(2)
The coverage of Wi Fi network is very wide, up to 100 m. However, indoor transmission is vulnerable to interference, and the communication distance will decrease rapidly. Its communication rate can reach 11-ssmb/s.(3)
UWB technology is a new short-range wireless high-speed communication technology. It mainly uses nanosecond non sine wave pulses for information and data transmission. Its communication speed is 1 GB/s, but the communication distance is less than 13 m.(4)
Infrared data communication IrDA transmits data through infrared. At present, the communication distance is 3–45 m and the communication speed reaches 4 MB/s.(5)
ZigBee’s communication distance is similar to b1uetooth Bluetooth, at 10–75 m. Its communication rate is about 200 KB/s.According to the analysis, IrDA and Wi-Fi have the greatest advantage after the comparison of communication distance and communication rate, followed by ZigBee technology. However, IrDA communication conditions are relatively harsh, which can only realize point-to-point single straight-line communication, and there can be no obstacles within the communication straight-line distance. Although Wi-Fi has great advantages in communication speed and distance, it has major defects in power consumption [17].Compared with wireless communication technology, not only the transmission distance and data transmission speed are considered, but also the complexity, power consumption and cost of wireless network are analyzed. Table1 lists the comparison of five communication technologies in complexity, power consumption and cost.Table 1
Performance comparison.
TechnologyPower wasteCostComplexityUWBLowMiddleHighWi-fiHighHighMiddleIrDAMiddleMiddleLowBlue toothHighMiddleHighZigbeeMost power efficientLowestLowFrom the above data analysis, it can be concluded that although b1uetooth communication technology is relatively mature, its communication distance is short and the module power consumption is relatively high; IrDA communication technology has relatively low power consumption and complexity, but it uses infrared straight-line point-to-point communication, which is not suitable for the requirements of Hospital Indoor complex environment communication; Wi-Fi communication technology has great advantages in speed and distance. At present, many indoor wireless technologies use this method, but Wi-Fi power consumption is relatively large and is not suitable for the installation of battery power supply, so it is not suitable for the construction of a large number of hospital base stations; UWB communication technology has great bandwidth and speed, but its communication distance is too short [18, 19].Through the above analysis of communication rate and distance, cost, power consumption and complexity, combined with the requirements of the electrical parameter monitoring system of the monitor, it can be seen that ZigBee technology has great advantages when meeting the communication rate, distance and taking into account the cost, power consumption and complexity.


## 3.1.3. ZigBee Network Topology

ZigBee is an IEEE802.1 5.4 protocol standard. Its communication characteristics are low power consumption, low cost and low transmission rate. Its name comes from that bees send signals to their companions through the shaking and friction (Zig) of their wings when foraging, so as to transmit the specific location information of food source to the bee colony. This is the way of signal transmission between bee colonies. According to the characteristics of bees transmitting information and ZigBee networking mode, ZigBee network structure can be divided into star, mesh and tree, and its structure is shown in Figure3 below.Figure 3
ZigBee network structure.


## 3.1.4. ZigBee Protocol Stack Structure

ZigBee protocol stack is composed of physical layer (PHY), media access control layer (MAC), network layer (NWK) and application layer (APL). PHY layer and MAC layer protocols are defined by IEEE 802.15.4, and network layer and application layer protocols are defined by ZigBee alliance. The application layer also includes application support sublayer (APS), application framework (AF), ZigBee device object (ZDO) and application object formulated by the manufacturer. The protocol architecture is shown in Figure4 below.Figure 4
ZigBee protocol model.


## 3.2. Overall Hardware Structure

In this paper, the wireless network is mainly composed of three hardware modules: coordinator, ZigBee base station group and RF interface of monitor. The ZigBee base station group is mainly responsible for communicating with the monitor through the internal ZigBee RF module; The coordinator is mainly responsible for receiving the information sent by the ZigBee base station group and uploading the data information to the server through the serial port module; The RF interface module of the monitor is mainly responsible for the communication between ZigBee base station and the monitor [20, 21]. If the coordinator is far away from the ZigBee base station and beyond the wireless communication range, a router base station can be opened in a far place with the same function as the coordinator, but the wireless router does not directly communicate with the server. In this paper, 470 MHz network is established to build the communication between router and coordinator. The connection between the hardware modules is shown in Figure 5 below.Figure 5
Hardware module connection.


## 3.3. Electrical Parameter Monitoring Module

In the national standard GB9706.1–2007 general requirements for electrical safety, four performance specifications are proposed for the safety performance test of medical electrical equipment, which are grounding impedance, equipment insulation resistance, equipment leakage current and dielectric strength. In these four specifications, grounding resistance and equipment leakage current can best reflect the safety performance of electrical equipment. The leakage current of medical electrical equipment mainly includes: shell leakage current, ground leakage current, patient leakage current and patient auxiliary leakage current. Other instruments are used to detect the leakage current and grounding resistance of the monitor [22]. Through research, the leakage current and grounding resistance detection circuit of the monitor are embedded into the monitor to realize the real-time electrical parameter detection of the monitor. The following leakage current detection design is carried out under the normal state of the equipment, zero line open circuit and reverse polarity.


### 3.3.1. Detection of Ground Leakage Current

The current flowing from the grid power supply through or across the insulation protection and isolation into the grounding protection conductor is called: ground leakage current. As shown in Figure6, switches S1 and S2 are closed and switch S4 is disconnected. The current between the internal protective grounding of the equipment and the two ends of the power protective grounding is detected through the current detection sensor. This current is the value detected under normal conditions. If the equipment power line is a double hole plug, it is necessary to exchange the plug position and measure again, in which the maximum measured value is taken as the ground leakage current. As shown in Figure 6, switches S2 and S4 are disconnected, and the current between the internal protection grounding of the equipment and the two ends of the power protection grounding is detected by the current detection sensor. This current is the equipment to ground leakage current under the single fault state: zero line open circuit [23].Figure 6
Detection of floor leakage current.


### 3.3.2. Shell Leakage Current Detection

During normal use of medical equipment, part of the current flows from the shell that can be touched by medical personnel or patients to the Earth or other equipment parts through other lines instead of grounding protection lines. We call this part of current as shell leakage current. As shown in Figure7, the switches S1 and S2 are closed to connect the exposed part of the equipment shell with the grounding protection line inside the equipment, and measure the current between the exposed shell and the power grounding protection. This current is the shell leakage current of the equipment under normal operation. As shown in Figure 7, switch S1 is disconnected and S3 is closed, so that the exposed part on the equipment shell is connected with the grounding protection line inside the equipment, and the current between the exposed shell and the power grounding protection is measured. This current is the shell leakage current in single fault state, also known as the equipment shell leakage current under zero line open circuit. As shown in the figure, switch S2 is closed and S4 is disconnected, so that the exposed part on the equipment shell is connected with the grounding protection line inside the equipment, and the current between the exposed shell and the power grounding protection is measured. This current is the shell leakage current in single fault state, also known as the equipment shell leakage current under ground wire open circuit.Figure 7
Shell leakage current detection.


### 3.3.3. Patient Leakage Current Detection

In medical electrical equipment, some current flows from the application module to the Earth through the patient’s body, or an unexpected voltage from an external power supply appears on the patient and flows from the patient to the Earth. This current is called patient leakage current. As shown in Figure8, switch S2 is closed and switch S4 is closed, and the current from the application part of the current module to the power protection grounding is detected through the ammeter, which is the patient leakage current under the normal operation of the equipment. As shown in Figure 8, switch S2 is open and S4 is closed, and the current applied by the current module to the power protection grounding is detected through the ammeter. This current is the leakage current of patients with zero line open circuit in a single fault state. As shown in the figure, switch S2 is closed and S4 is disconnected, and the current from the application part of the current module to the power protection grounding is detected through the ammeter. This current is the leakage current of the patient with open circuit of the ground wire under the single fault state.Figure 8
Patient leakage current detection.


### 3.3.4. Patient Auxiliary Leakage Current Detection

Patient auxiliary current refers to the current flowing into the human body through the modules when multiple modules of electrical equipment are used at the same time. This current generally does not produce physiological effects, but the size of the current will affect the authenticity of the detection data. As shown in Figure9, switch S2 is closed and switch S4 is closed. The current detection sensors are connected to the currently used functional modules. The detected current is the patient auxiliary current under normal conditions. As shown in the figure, switch S2 is disconnected and S4 is closed, and the current detection sensors are used to connect the currently used functional modules in pairs. The detected current is the leakage current of patients with zero line open circuit in a single fault state. As shown in Figure 9, the switch S2 is closed and S4 is disconnected. The current detection sensors are used to connect the currently used functional modules in pairs. The detected current is the ground wire open circuit patient leakage current in a single fault state [24]. As shown in Figure 9, the switch S2 is closed, S4 is closed, S3 changes the switch position, and uses current detection sensors to connect the currently used functional modules in pairs. The detected current is the polarity reverse patient leakage current in a single fault state.Figure 9
Patient auxiliary leakage current detection.


## 3.3.1. Detection of Ground Leakage Current

The current flowing from the grid power supply through or across the insulation protection and isolation into the grounding protection conductor is called: ground leakage current. As shown in Figure6, switches S1 and S2 are closed and switch S4 is disconnected. The current between the internal protective grounding of the equipment and the two ends of the power protective grounding is detected through the current detection sensor. This current is the value detected under normal conditions. If the equipment power line is a double hole plug, it is necessary to exchange the plug position and measure again, in which the maximum measured value is taken as the ground leakage current. As shown in Figure 6, switches S2 and S4 are disconnected, and the current between the internal protection grounding of the equipment and the two ends of the power protection grounding is detected by the current detection sensor. This current is the equipment to ground leakage current under the single fault state: zero line open circuit [23].Figure 6
Detection of floor leakage current.


## 3.3.2. Shell Leakage Current Detection

During normal use of medical equipment, part of the current flows from the shell that can be touched by medical personnel or patients to the Earth or other equipment parts through other lines instead of grounding protection lines. We call this part of current as shell leakage current. As shown in Figure7, the switches S1 and S2 are closed to connect the exposed part of the equipment shell with the grounding protection line inside the equipment, and measure the current between the exposed shell and the power grounding protection. This current is the shell leakage current of the equipment under normal operation. As shown in Figure 7, switch S1 is disconnected and S3 is closed, so that the exposed part on the equipment shell is connected with the grounding protection line inside the equipment, and the current between the exposed shell and the power grounding protection is measured. This current is the shell leakage current in single fault state, also known as the equipment shell leakage current under zero line open circuit. As shown in the figure, switch S2 is closed and S4 is disconnected, so that the exposed part on the equipment shell is connected with the grounding protection line inside the equipment, and the current between the exposed shell and the power grounding protection is measured. This current is the shell leakage current in single fault state, also known as the equipment shell leakage current under ground wire open circuit.Figure 7
Shell leakage current detection.


## 3.3.3. Patient Leakage Current Detection

In medical electrical equipment, some current flows from the application module to the Earth through the patient’s body, or an unexpected voltage from an external power supply appears on the patient and flows from the patient to the Earth. This current is called patient leakage current. As shown in Figure8, switch S2 is closed and switch S4 is closed, and the current from the application part of the current module to the power protection grounding is detected through the ammeter, which is the patient leakage current under the normal operation of the equipment. As shown in Figure 8, switch S2 is open and S4 is closed, and the current applied by the current module to the power protection grounding is detected through the ammeter. This current is the leakage current of patients with zero line open circuit in a single fault state. As shown in the figure, switch S2 is closed and S4 is disconnected, and the current from the application part of the current module to the power protection grounding is detected through the ammeter. This current is the leakage current of the patient with open circuit of the ground wire under the single fault state.Figure 8
Patient leakage current detection.


## 3.3.4. Patient Auxiliary Leakage Current Detection

Patient auxiliary current refers to the current flowing into the human body through the modules when multiple modules of electrical equipment are used at the same time. This current generally does not produce physiological effects, but the size of the current will affect the authenticity of the detection data. As shown in Figure9, switch S2 is closed and switch S4 is closed. The current detection sensors are connected to the currently used functional modules. The detected current is the patient auxiliary current under normal conditions. As shown in the figure, switch S2 is disconnected and S4 is closed, and the current detection sensors are used to connect the currently used functional modules in pairs. The detected current is the leakage current of patients with zero line open circuit in a single fault state. As shown in Figure 9, the switch S2 is closed and S4 is disconnected. The current detection sensors are used to connect the currently used functional modules in pairs. The detected current is the ground wire open circuit patient leakage current in a single fault state [24]. As shown in Figure 9, the switch S2 is closed, S4 is closed, S3 changes the switch position, and uses current detection sensors to connect the currently used functional modules in pairs. The detected current is the polarity reverse patient leakage current in a single fault state.Figure 9
Patient auxiliary leakage current detection.


## 3.4. Wireless Positioning

### 3.4.1. RSSI Algorithm

With the progress of technology and technology, the accuracy of distance measurement based on the strength of received signal strength indication (RSSI) algorithm is getting higher and higher. It is characterized by:(1)
Because the signal energy is taken as the detection object, it has certain diffraction to small and medium-sized obstacles, so it is suitable for distance measurement in complex terrain. This feature is not possessed by other distance algorithms.(2)
The implementation is simple. It only needs the transmission power of fixed base station and mobile tag, and does not need the support of other devices.(3)
In a space that is not too complex, as long as the base station works stably, its positioning is more accurate. The following is the principle of RSSI algorithm:In the transmission of radio signal in space, the attenuation relationship between its transmission distance and signal power is shown in formula (1):(1)Wr=WtLα.In the formula,Wr is the signal transmission power, Wr is the signal reception power, and their units should be the same. L is the distance between the base station and the mobile tag, α Is the signal attenuation coefficient. If in a wireless network, the transmission power Wr and the spatial attenuation coefficient are known α, Then the location of the mobile tag and the base station can be obtained by combining the received power Wr of the base station. But in practice, it is difficult to measure its power Wr.Therefore, the detection is carried out at the position of 1 m from the base station to eliminateWr. Then the formula at 1 m is shown in formula (2):(2)Wr0=WtL0α.Where L0 is 1, then. Wr0=WtFormula (3) can be obtained by bringing formula (2) into (1):(3)Wr=Wr0Lα.Take pairs on both sides of (3), as shown in (4): (4)WRL=WR0−10α1gL.In the formula,Wr is the received power and Wr0 is the reference received power at 1 m of the base station. a is the attenuation coefficient, whose value depends on the formula algorithm and the structural and material properties of obstacles in cyberspace.The value of attenuation coefficienta can be calculated by linear regression by testing the transmission power of multiple base stations at different distances. The formula is shown in formula (5):(5)α=WTNNTN,Wherein, formulas (6) and (7):(6)W=WR1−W0,WR2−W0,⋯,WRn−W0T,(7)N=−101gL1L0,−101gL2L0,⋯,−101gLnL0T.Holda Bring in equation (4) to obtain equation (8):(8)L=10WR0−WR/10α.However, in the actual environment, the measurement ofWr is easily affected by the surrounding air humidity, obstacle diffraction, wall reflection and other factors. There will also be error fluctuations in the measured value of Wr. This error is unintentionally caused by natural factors, and its error has the characteristics of normal distribution. Therefore, Wr is optimized by Gaussian filter in this paper.A large number of tests are carried out onWr, and its data has Gaussian distribution (also known as normal distribution). Its formula is shown in formula (9):(9)fx=12πσe−x−θ2/2σ2.In the formula,e is the average value of Wr and 6 is the standard deviation of Wr.The mean value of test samples is shown in equation (10):(10)X¯=1n∑i=1nWRi.The standard deviation of the sample is shown in equation (11):(11)S1n−1∑i=1nWRi−X¯2.According to the actual engineering experience and the actual site environment, the confidence interval ofE is set as 0.6.Therefore, according to the fact thatWr conforms to the positive distribution, equation (12) can be obtained:(12)X¯−θS/n∼N0,1.According to 1−θ The confidence interval of can also be obtained by equation (13):(13)X¯−Snz1−θ2,X¯+Snz1−θ2.The confidence interval obtained by querying the normal distribution table is equation (14):(14)X¯−0.734Sn,X¯+0.734Sn.Calculate allWr by the above formula, and the mean value of Wra can be obtained, as shown in formula (15):(15)WRα=1k∑j=1kWRj.Therefore, bringWr into formula (7) and calculate the distance L, as shown in formula (16):(16)L=10WR0−WR/10α.Therefore, as long as the receiving powerWr of the mobile tag is obtained, the distance between the mobile tag and the fixed base station can be calculated.


## 3.4.1. RSSI Algorithm

With the progress of technology and technology, the accuracy of distance measurement based on the strength of received signal strength indication (RSSI) algorithm is getting higher and higher. It is characterized by:(1)
Because the signal energy is taken as the detection object, it has certain diffraction to small and medium-sized obstacles, so it is suitable for distance measurement in complex terrain. This feature is not possessed by other distance algorithms.(2)
The implementation is simple. It only needs the transmission power of fixed base station and mobile tag, and does not need the support of other devices.(3)
In a space that is not too complex, as long as the base station works stably, its positioning is more accurate. The following is the principle of RSSI algorithm:In the transmission of radio signal in space, the attenuation relationship between its transmission distance and signal power is shown in formula (1):(1)Wr=WtLα.In the formula,Wr is the signal transmission power, Wr is the signal reception power, and their units should be the same. L is the distance between the base station and the mobile tag, α Is the signal attenuation coefficient. If in a wireless network, the transmission power Wr and the spatial attenuation coefficient are known α, Then the location of the mobile tag and the base station can be obtained by combining the received power Wr of the base station. But in practice, it is difficult to measure its power Wr.Therefore, the detection is carried out at the position of 1 m from the base station to eliminateWr. Then the formula at 1 m is shown in formula (2):(2)Wr0=WtL0α.Where L0 is 1, then. Wr0=WtFormula (3) can be obtained by bringing formula (2) into (1):(3)Wr=Wr0Lα.Take pairs on both sides of (3), as shown in (4): (4)WRL=WR0−10α1gL.In the formula,Wr is the received power and Wr0 is the reference received power at 1 m of the base station. a is the attenuation coefficient, whose value depends on the formula algorithm and the structural and material properties of obstacles in cyberspace.The value of attenuation coefficienta can be calculated by linear regression by testing the transmission power of multiple base stations at different distances. The formula is shown in formula (5):(5)α=WTNNTN,Wherein, formulas (6) and (7):(6)W=WR1−W0,WR2−W0,⋯,WRn−W0T,(7)N=−101gL1L0,−101gL2L0,⋯,−101gLnL0T.Holda Bring in equation (4) to obtain equation (8):(8)L=10WR0−WR/10α.However, in the actual environment, the measurement ofWr is easily affected by the surrounding air humidity, obstacle diffraction, wall reflection and other factors. There will also be error fluctuations in the measured value of Wr. This error is unintentionally caused by natural factors, and its error has the characteristics of normal distribution. Therefore, Wr is optimized by Gaussian filter in this paper.A large number of tests are carried out onWr, and its data has Gaussian distribution (also known as normal distribution). Its formula is shown in formula (9):(9)fx=12πσe−x−θ2/2σ2.In the formula,e is the average value of Wr and 6 is the standard deviation of Wr.The mean value of test samples is shown in equation (10):(10)X¯=1n∑i=1nWRi.The standard deviation of the sample is shown in equation (11):(11)S1n−1∑i=1nWRi−X¯2.According to the actual engineering experience and the actual site environment, the confidence interval ofE is set as 0.6.Therefore, according to the fact thatWr conforms to the positive distribution, equation (12) can be obtained:(12)X¯−θS/n∼N0,1.According to 1−θ The confidence interval of can also be obtained by equation (13):(13)X¯−Snz1−θ2,X¯+Snz1−θ2.The confidence interval obtained by querying the normal distribution table is equation (14):(14)X¯−0.734Sn,X¯+0.734Sn.Calculate allWr by the above formula, and the mean value of Wra can be obtained, as shown in formula (15):(15)WRα=1k∑j=1kWRj.Therefore, bringWr into formula (7) and calculate the distance L, as shown in formula (16):(16)L=10WR0−WR/10α.Therefore, as long as the receiving powerWr of the mobile tag is obtained, the distance between the mobile tag and the fixed base station can be calculated.


## 4. Result Discussion

### 4.1. ZigBee Network Communication Test

The upper computer of the server receives the information uploaded by ZigBee wireless network and transmits the information to the client terminal through the Internet network. Because the communication function test takes a long time and heavy workload, this paper uses the serial port test program to simulate the serial port transmission of the monitor to test whether the communication is successful. The serial port test program is a debugging program written in combination with the design content, which mainly realizes the sending and receiving of hexadecimal data within the range of 115200 baud rate [25].The monitor tag is connected to the serial port of the computer where the serial port test program is installed, and the sending and receiving of the tag is controlled through the serial port test program. For example, if it is necessary to verify whether the 000082 tag can be authenticated by the client, enter the data frame 00 42 00 10d7 1D DF O1 00 00 82 in the serial port, and then click send. When it passes the verification, the result can be displayed on the client. After a large number of data communication tests, the following results are obtained (Figure10):(1)
ZigBee wireless network communication can be fully realized;(2)
Through the serial port test software 2000 times of data transmission and reception, 1866 of them succeeded in communication, with a success rate of 93.3%, which basically meets the requirements of data transmission stability;(3)
After data transmission time detection, it takes about 1.4 seconds to send data from the monitor to the client for reception. The client sends the module query command, and the time when the command reaches the monitor is 1.6 seconds. The data transmission speed can basically meet the requirements of real-time monitoring.Figure 10
Comparison of client display results.


### 4.2. Monitor Operation State Test

The operation status of the monitor to be monitored in this paper includes power on status, ECG module status, blood oxygen module status, blood pressure module status and respiratory module status. Firstly, it is necessary to determine the contents of the running state of the ECG module, and then test through the contents to be monitored [26]. The following takes the operation status monitoring of ECG module as an example. The structure of ECG module status data frame is shown in Table 2.Table 2
ECG module data frame structure.
Header 1Header 2Data type runningStatusChecksum55AA0 × 010 × 00/0 × 01FF/FE55AA0 × 010 × 02/0 × 03FD/FC55AA0 × 010 × 04/0 × 05FB/FA55AA0 × 010 × 06/0 × 07F9/F855AA0 × 010 × 08/0 × 09F7/F655AA0 × 010 × 0 A/0 × 0BF5/F455AA0 × 010 × 0 C/0 × 0DF3/F2In the data frame structure, the “data type” is used to determine the status data of what module the data frame is. The data types of power-on status, ECG module status, blood oxygen module status, blood pressure module status, and respiratory module status are 0 × 00, 0 × 01, 0 × 02, 0 × 03, and 0 × 04, respectively. In Table2, the “running state” is used to distinguish the monitored content. The information content that the ECG module needs to monitor is shown in Table 3. Manually control the running status of the ECG module of the monitor to make it fail accordingly.Table 3
ECG module monitoring content.
0 × 00/0 × 01The communication between ECG module and mainboard is intact 0 × 00, and the communication between ECG module and mainboard is interrupted 0 × 010 × 02/0 × 03Lead connection information (lead falling off 0 × 02, connection normal 0 × 03)0 × 04/0 × 05Lead connection information (lead falling off 0 × 04, connection normal 0 × 04)0 × 06/0 × 07Lead connection information (lead falling off 0 × 06, connection normal 0 × 07)0 × 08/0 × 09Lead connection information (lead falling off 0 × 08, connection normal 0 × 09)0 × 0 A/0 × 0BECG channel 1 overload information: (normal 0 × 0a, overload 0 × 0b)0 × 0 C/0 × 0DECG channel 2 overload information: (normal 0 × 0c, overload 0 × 0D)0 × 0FECG module works normallyFinally, other operating states of the monitor are verified one by one, which proves that the ZigBee based wireless monitoring system has great advantages in monitoring the operating state of the monitor.


### 4.3. Electrical Parameter Test

After verifying that ZigBee wireless network has normal communication ability, real-time detection of electrical parameters can be realized through client module query. During the test, if the monitor is in normal operation, only the leakage current under normal operation can be checked. If it is in the sleep state, you can query the leakage current under zero line open circuit and reverse polarity. Through the query results, it can be seen that the client can monitor the electrical parameters of the monitor in real time, which verifies the feasibility of the embedded design of the electrical parameter detection of the monitor. Compared with the traditional electrical parameter detection method of monitor, the embedded electrical parameter detection method based on ZigBee wireless network is faster and more convenient in electrical parameter detection performance.


## 4.1. ZigBee Network Communication Test

The upper computer of the server receives the information uploaded by ZigBee wireless network and transmits the information to the client terminal through the Internet network. Because the communication function test takes a long time and heavy workload, this paper uses the serial port test program to simulate the serial port transmission of the monitor to test whether the communication is successful. The serial port test program is a debugging program written in combination with the design content, which mainly realizes the sending and receiving of hexadecimal data within the range of 115200 baud rate [25].The monitor tag is connected to the serial port of the computer where the serial port test program is installed, and the sending and receiving of the tag is controlled through the serial port test program. For example, if it is necessary to verify whether the 000082 tag can be authenticated by the client, enter the data frame 00 42 00 10d7 1D DF O1 00 00 82 in the serial port, and then click send. When it passes the verification, the result can be displayed on the client. After a large number of data communication tests, the following results are obtained (Figure10):(1)
ZigBee wireless network communication can be fully realized;(2)
Through the serial port test software 2000 times of data transmission and reception, 1866 of them succeeded in communication, with a success rate of 93.3%, which basically meets the requirements of data transmission stability;(3)
After data transmission time detection, it takes about 1.4 seconds to send data from the monitor to the client for reception. The client sends the module query command, and the time when the command reaches the monitor is 1.6 seconds. The data transmission speed can basically meet the requirements of real-time monitoring.Figure 10
Comparison of client display results.


## 4.2. Monitor Operation State Test

The operation status of the monitor to be monitored in this paper includes power on status, ECG module status, blood oxygen module status, blood pressure module status and respiratory module status. Firstly, it is necessary to determine the contents of the running state of the ECG module, and then test through the contents to be monitored [26]. The following takes the operation status monitoring of ECG module as an example. The structure of ECG module status data frame is shown in Table 2.Table 2
ECG module data frame structure.
Header 1Header 2Data type runningStatusChecksum55AA0 × 010 × 00/0 × 01FF/FE55AA0 × 010 × 02/0 × 03FD/FC55AA0 × 010 × 04/0 × 05FB/FA55AA0 × 010 × 06/0 × 07F9/F855AA0 × 010 × 08/0 × 09F7/F655AA0 × 010 × 0 A/0 × 0BF5/F455AA0 × 010 × 0 C/0 × 0DF3/F2In the data frame structure, the “data type” is used to determine the status data of what module the data frame is. The data types of power-on status, ECG module status, blood oxygen module status, blood pressure module status, and respiratory module status are 0 × 00, 0 × 01, 0 × 02, 0 × 03, and 0 × 04, respectively. In Table2, the “running state” is used to distinguish the monitored content. The information content that the ECG module needs to monitor is shown in Table 3. Manually control the running status of the ECG module of the monitor to make it fail accordingly.Table 3
ECG module monitoring content.
0 × 00/0 × 01The communication between ECG module and mainboard is intact 0 × 00, and the communication between ECG module and mainboard is interrupted 0 × 010 × 02/0 × 03Lead connection information (lead falling off 0 × 02, connection normal 0 × 03)0 × 04/0 × 05Lead connection information (lead falling off 0 × 04, connection normal 0 × 04)0 × 06/0 × 07Lead connection information (lead falling off 0 × 06, connection normal 0 × 07)0 × 08/0 × 09Lead connection information (lead falling off 0 × 08, connection normal 0 × 09)0 × 0 A/0 × 0BECG channel 1 overload information: (normal 0 × 0a, overload 0 × 0b)0 × 0 C/0 × 0DECG channel 2 overload information: (normal 0 × 0c, overload 0 × 0D)0 × 0FECG module works normallyFinally, other operating states of the monitor are verified one by one, which proves that the ZigBee based wireless monitoring system has great advantages in monitoring the operating state of the monitor.


## 4.3. Electrical Parameter Test

After verifying that ZigBee wireless network has normal communication ability, real-time detection of electrical parameters can be realized through client module query. During the test, if the monitor is in normal operation, only the leakage current under normal operation can be checked. If it is in the sleep state, you can query the leakage current under zero line open circuit and reverse polarity. Through the query results, it can be seen that the client can monitor the electrical parameters of the monitor in real time, which verifies the feasibility of the embedded design of the electrical parameter detection of the monitor. Compared with the traditional electrical parameter detection method of monitor, the embedded electrical parameter detection method based on ZigBee wireless network is faster and more convenient in electrical parameter detection performance.


## 5. Conclusion

With the continuous development of science and technology, various distinctive wireless communication technologies have penetrated into all fields of people’s life. Through the integration and collocation of a number of technologies, many fields closely related to us, such as education, medical treatment and entertainment, are gradually woven into a large network around human beings all over the world. Combined with the characteristics of the current instrument monitoring system and the shortcomings of the electrical safety detection of the monitor, this paper designs an electrical parameter monitoring system based on ZigBee wireless communication, and puts forward a solution to the electrical safety detection. ZigBee, a short-range wireless sensor technology with low power consumption, low transmission rate, low cost and excellent network topology, is selected in the experiment, which preliminarily realizes the purpose of transmitting physiological parameter data by using this technology, which can indeed change the current manual monitoring method adopted by most hospitals, so as to reduce the working pressure of medical staff, In addition, it can also change “wired” into “wireless,” which will have a certain positive impact on the hospital in terms of pattern.



---

*Source: 4189774-2022-03-19.xml*