Search
2026 Volume 6
Article Contents
ARTICLE   Open Access    

Research on grid-based fire warning and positioning system for ancient buildings

More Information
  • A grid system for warning and positioning functions was designed by a ZigBee wireless sensor network to solve the difficulties in early warning and fault area positioning of ancient building fire detectors. The system includes the design of a ZigBee wireless sensor network and an abnormal area positioning algorithm, where the terminal node collects data and transmits it to the upper computer for warning and positioning. Taking residual current electrical fire detectors as an example, experiments were conducted, and the experimental results showed that the system could achieve residual current warning and abnormal area positioning in ancient buildings.
  • 加载中
  • [1] Perilla FS, Villanueva GR Jr, Cacanindin NM, Palaoag TD. 2018. Fire safety and alert system using arduino sensors with IoT integration. Proceedings of the 2018 7th International Conference on Software and Computer Applications, Pahang, Malaysia, 8–10 February, 2018. New York, USA: Association for Computing Machinery. pp. 199−203 doi: 10.1145/3185089.3185121
    [2] Somov A, Spirjakin D, Ivanov M, Khromushin I, Passerone R, et al. 2010. Combustible gases and early fire detection: an autonomous system for wireless sensor networks. Proceedings of the 1st International Conference on Energy-Efficient Computing and Networking, Passau, Germany, 13–15 April, 2010. New York, USA: Association for Computing Machinery. pp. 85−93 doi: 10.1145/1791314.1791327
    [3] Hoshino Y, Sakakura A, Kamei K. 2006. A proposal of the learning system using the recordable multi-layer type rule base and its application for the fire panic problem. Proceedings of the 2006 international conference on Game research and development, Perth, Australia, 4–6 December, 2006. Australia: Muedoch University. pp. 137−140 doi: 10.5555/1234341.1234364
    [4] Lai W, Wang X. 2021. Design and implementation of a scenic fire detection system based on wireless network control. Proceedings of the 2021 4th International Conference on E-Business, Information Management and Computer Science, Hong Kong, SAR, China, 29–31 December, 2021. New York, USA: Association for Computing Machinery. pp. 17−27 doi: 10.1145/3511716.3511720
    [5] Karaduman B, Aşıcı T, Challenger M, Eslampanah R. 2018. A cloud and contiki based fire detection system using multi-hop wireless sensor networks. Proceedings of the Fourth International Conference on Engineering & MIS, Istanbul, Turkey, 19–20 June, 2018. New York, USA: Association for Computing Machinery. pp. 1−5 doi: 10.1145/3234698.3234764
    [6] Wan L, Zhang G. 2016. 一种改进的无线传感器网络节点定位算法研究[Online monitoring system of residual current in rural power network based on ZigBee and general packet radio service]. 电工电气[Electrotechnics Electric] 5:6−9 (in Chinese) doi: 10.3969/j.issn.1007-3175.2016.05.002

    CrossRef   Google Scholar

    [7] Xu M. 2025. 基于物联网的电气火灾智能预警系统研究 [Research on intelligent early warning system for electrical fire based on internet of things]. Master's Thesis. Zhejiang University of Science and Technology, Hangzhou, China. (in Chinese) doi: 10.27840/d.cnki.gzjkj.2025.000131
    [8] Sun Y. 2023. 基于PLC控制的电气火灾预警系统设计 [Design of electrical fire early warning system based on PLC control]. 工业加热 [Industrial Heating] 52:44−47 (in Chinese) doi: 10.3969/j.issn.1002-1639.2023.03.010

    CrossRef   Google Scholar

    [9] Lu Q, Li Y, Chang S, Li N. 2019. 基于到达时间的无线传感器网络协作定位算法 [Cooperative localization algorithm based on time-of-arrival in wireless senor network]. 电信科学 [Telecommunications Science] 35:62−66 (in Chinese) doi: 10.11959/j.issn.1000-0801.2019004

    CrossRef   Google Scholar

    [10] Luo X, Guo Y, Liu H, Ye J. 2022. 一种基于到达时间差的卡尔曼滤波定位算法 [A algorithm of Kalman filter localization based on arrival time difference]. 北京测绘 [Beijing Surveying and Mapping] 36:789−794 (in Chinese) doi: 10.19580/j.cnki.1007-3000.2022.06.021

    CrossRef   Google Scholar

    [11] Pan ZY, Bu FL. 2023. 基于蜣螂算法优化的 DV-Hop 定位算法 [DV-Hop localization algorithm optimized based on dung beetle optimizer]. 电子测量与仪器学报 [Journal of Electronic Measurement and Instrumentation] 37:33−41 (in Chinese) doi: 10.13382/j.jemi.B2306338

    CrossRef   Google Scholar

    [12] Zhu C, Hua Z, Chen L, Xu H, Mao K. 2019. WSN中基于指纹匹配的室内定位方法 [Indoor localiazation based on fingerprint matching in WSN]. 传感技术学报 [Chinese Journal of sensors and Actuators] 32:451−457 (in Chinese) doi: 10.3969/j.issn.1004-1699.2019.03.022

    CrossRef   Google Scholar

    [13] Du YJ, Gao LB. 2012. 基于最小二乘法的RSSI测距环境参数修正方案 [RSSI parameter calibration method based on the least square algorithm]. 计算机系统应用 [Computer System Applications] 21:221−224 (in Chinese) doi: 10.3969/j.issn.1003-3254.2012.02.052

    CrossRef   Google Scholar

    [14] Jiang R, Yang Z. 2016. 基于质心迭代估计的无线传感器网络节点定位算法 [An improved centroid localization algorithm based on iterative computation for wireless sensor network]. 物理学报 [Acta Physica Sinica]. 65: 030101 (in Chinese) doi: 10.7498/aps.65.030101

    CrossRef   Google Scholar

    [15] Zhou W, Zhang Y, Sun L, Su J. 2021. 一种改进的无线传感器网络节点定位算法研究 [Research on an improved node location algorithm for wireless sensor networks]. 舰船电子工程 [Ship Electronic Engineering] 41:53−57 (in Chinese) doi: 10.3969/j.issn.1672-9730.2021.05.013

    CrossRef   Google Scholar

  • Cite this article

    Wang Z, Tang Z, Liu T, Peng J, Sun Q, et al. 2026. Research on grid-based fire warning and positioning system for ancient buildings. Emergency Management Science and Technology 6: e006 doi: 10.48130/emst-0026-0006
    Wang Z, Tang Z, Liu T, Peng J, Sun Q, et al. 2026. Research on grid-based fire warning and positioning system for ancient buildings. Emergency Management Science and Technology 6: e006 doi: 10.48130/emst-0026-0006

Figures(12)  /  Tables(2)

Article Metrics

Article views(49) PDF downloads(0)

ARTICLE   Open Access    

Research on grid-based fire warning and positioning system for ancient buildings

Emergency Management Science and Technology  6 Article number: e006  (2026)  |  Cite this article

Abstract: A grid system for warning and positioning functions was designed by a ZigBee wireless sensor network to solve the difficulties in early warning and fault area positioning of ancient building fire detectors. The system includes the design of a ZigBee wireless sensor network and an abnormal area positioning algorithm, where the terminal node collects data and transmits it to the upper computer for warning and positioning. Taking residual current electrical fire detectors as an example, experiments were conducted, and the experimental results showed that the system could achieve residual current warning and abnormal area positioning in ancient buildings.

    • In view of the significant harm of fires, fire alarm systems and devices are usually installed in most ancient buildings. However, most existing fire warning systems use bus-based wired communication, which has disadvantages such as poor mobility, difficulty in modification, and complex deployment and construction. Basically, a fixed alarm threshold is used as the alarm algorithm. When the monitored quantity exceeds a pre-set threshold, an alarm is triggered. This alarm method is easily affected by interference from the natural environment and the indoor building environment, resulting in high false alarms and missed alarms. Some fire warning systems use wired connections between fire signal sensors and system controllers; the wiring layout of these systems during an initial deployment is complicated, resulting in a lack of willingness for installation. Especially, when an abnormality occurs, the system cannot accurately locate the abnormal point, which is inconvenient for management personnel to investigate in a timely manner. Therefore, this article conducts research on fire warning and positioning systems.

      Fire warning systems for ancient buildings face distinct challenges compared with modern constructions: most ancient buildings adopt wood structures with low fire resistance, and strict cultural relic protection requirements preclude large-scale wiring. Their enclosed inner spaces with dense beams and columns cause severe wireless signal attenuation, while volatile temperatures and humidities easily lead to false or missing alarms with a fixed threshold warning. Additionally, the courtyard-style layout and concealed circuits make fault location extremely difficult without high-precision positioning functions. Moreover, the scattered electrical loads, such as lighting and monitoring equipment in ancient buildings, tend to generate tiny residual currents, imposing much higher requirements for monitoring accuracy than modern buildings. These unique difficulties necessitate the development of a dedicated fire warning and positioning system for ancient buildings.

      Perilla et al.[1] designed a fire safety and alert system that utilizes Arduino sensors, integrated with IoT technology. The integration of IoT enhances the system's effectiveness and efficiency in fire safety applications. By employing sensors, the system can effectively detect signs of fire such as temperature rise, flame presence, gases, and smoke. In case of a fire emergency, building occupants and firefighting authorities receive real-time notifications through audible and visual alarms, as well as SMS messages sent by the modules incorporated within this system.

      Somov et al.[2] designed an autonomous wireless sensor system for early detection of fire and gas leaks, which comprises a gas sensor module with the principle of pyrolysis product detection, enabling it to detect a fire before ignition occurs. It contains a power management module with the switching algorithm delivered to the sensor node in accordance with an efficient energy supply. Realizing the importance of incorporating interpolation and approximation techniques in threshold handling, Yukinobu et al.[3] proposed a novel reinforcement learning system tailored for heterogeneous multi-agent systems, particularly suited for addressing the fire-panic problem. Their approach could provide more accuracy in identifying and responding to the complexities and uncertainties of fire monitoring systems in fire-panic scenarios.

      Lai et al.[4] proposed a LoRa wireless network-based fire detection system for scenic areas to overcome the limitations of existing fire detection systems, which includes a CNN-BLSTM algorithm model with an attention mechanism for environmental temperature prediction. This model takes into account the different weights of various environmental factors, such as temperature, humidity, smoke concentration, and formaldehyde concentration, to predict the environmental temperature accurately. The system also includes a fire detection feature. The collected data is analyzed by the server, which then uses algorithms to detect abnormal patterns indicating a potential fire. Once a fire is detected, the system will trigger an alarm or send notifications to relevant personnel for a timely response and intervention. Overall, the proposed system utilizes the LoRa wireless network for efficient data transmission and incorporates advanced algorithms and attention mechanisms to improve fire detection accuracy and environmental temperature prediction in scenic areas.

      Karaduman et al.[5] put forward a method to increase throughput using a multi-hop wireless sensor network. They developed an Android application that notifies users in case of an emergency. Additionally, their network can be expanded without the need for extra sink nodes to collect data. The system utilizes the benefits of a multi-hop network, where source nodes can send temperature values via relay nodes to the sink node with low transmission power. To store temperature values of a fire alarm, a Java application is coded to run on Raspberry Pi 3, utilizing Firebase Cloud. In the event of a fire, the Java application sends notification messages to an Android application. Furthermore, to cover wide areas, a multi-hop network is implemented. The entire system can be expanded by utilizing a single sink node.

      Wan & Zhang[6] have implemented an online monitoring system for tracking current residual current in rural power networks using a combination of ZigBee and General Packet Radio Service (GPRS) network technologies. Real-time monitoring of residual current and voltage in rural user locations is achieved through the use of residual current transducers, ZigBee self-networking technology, and GPRS technology. Data transmission between the collector and concentrator is facilitated by a Mesh network, established by ZigBee. Subsequently, data transfer between the concentrator and the Web server is carried out via the GPRS network. The developed system can carry out long-distance wireless monitoring for the residual current in rural power networks effectively.

      Xu[7] conducted a study on an intelligent early warning system for electrical fires based on the Internet of Things. He collected electrical and environmental parameters through on-site monitors, transmitted data to a remote platform via wireless communication, and proposed an intelligent fire warning method optimized by a particle swarm optimization-support vector machine (PSO-SVM), providing a new direction for the research of electrical fire early warning.

      Sun[8] designed an electrical fire early warning system based on PLC control. The system uses Bayesian theory to calculate data characteristic quantities and completes information decision-making by fusing three-dimensional data. It estimates the prior probability and posterior probability of a fire occurrence, and issues an online/offline linked early warning when the threshold flag is triggered. The system achieves accurate fire prediction with low time consumption, high effectiveness, reliability, and strong robustness.

      Existing research and systems have obvious and irreparable defects in the field of fire warning for ancient buildings, with the core shortcomings as follows: all existing systems are designed for general scenarios such as for modern buildings, scenic spots, or rural power grids, without considering the unique constraints of ancient buildings; including low fire resistance of wooden structures, strict prohibition of large-scale wiring, wireless signal attenuation caused by dense beams and columns, and high-precision monitoring requirements for micro-residual current. Most of them rely excessively on fixed-threshold warning mechanisms, which are easily disturbed by the environment, resulting in a high rate of false alarms and missed alarms. Several studies involving algorithm optimization have not developed adaptive warning schemes suitable for the special environment of ancient buildings. In addition, existing systems generally lack high-precision abnormal point positioning and grid-based regional management functions adapted to the courtyard layout of ancient buildings, with large positioning errors and low fault troubleshooting efficiency. Furthermore, existing studies are mostly single-function designs, failing to integrate core modules such as adaptive wireless networking suitable for ancient buildings, dynamic threshold warning, precise positioning and grid-based management into a whole, and cannot realize the whole-process closed-loop management of residual current monitoring, intelligent warning, and hidden danger positioning. Therefore, the overall scenario adaptability and functional integrity are far from meeting the actual needs of fire prevention and control in ancient buildings.

      To fill the above core research gaps, this paper designs a grid-based fire warning and positioning system for ancient buildings based on the ZigBee wireless sensor network, focusing on the research and development of residual current electrical fire detection. Commonly used wireless transmission technologies mainly include Wireless Local Area Network (WiFi), Bluetooth, ZigBee, Narrow Band Internet of Things (NB-IoT), GPRS/GSM, etc. A fire warning system needs to realize multi-nodal distribution monitoring within a building unit, and ZigBee has the advantages of a stable transmission rate, low cost, and high scalability. Considering the actual demands of no large-scale wiring and multi-nodal coverage in ancient buildings, the ZigBee network is finally selected in this system for data transmission and networking of fire warning.

    • In ancient architectural settings, common fire detectors come in various forms, including smoke detectors, temperature detectors, image detectors, and electrical fire detectors. The electrical fire detectors can be further categorized into fault arc detectors, residual current detectors, temperature measurement detectors, and pyrolysis particle detectors. For instance, in the context of residual current leakage monitoring, the entire electrical fire warning and positioning system can be segmented into three layers: the perception layer, network layer, and application layer, as illustrated in Fig. 1. At the terminal node, data such as residual current and line temperature are collected, which are then transmitted by the coordinator to the upper computer management system; subsequently, the upper computer undertakes tasks such as data visualization, storage, and positioning.

      Figure 1. 

      System architecture diagram.

    • In the event of residual current presence in the circuit, the residual current transformer generates a signal, which undergoes filtering, rectification, and amplification before being sampled by the Analog-to-Digital Converter (ADC) module of the microcontroller. The schematic diagram of the detection circuit is depicted in Fig. 2.

      Figure 2. 

      Residual current detection circuit diagram.

      Once the residual current transformer detects the current signal, it enters the detection circuit. Initially, the unwanted noise signal is filtered out by capacitor C19; subsequently, the signal undergoes rectification and amplification facilitated by the LM358 chip. LM358 comprises two operational amplifiers, namely U11.1 and U11.2.

      When the input signal of residual current flows in the forward direction, the diode D12 conducts, while the diode D11 is cut off. The operational amplifier U11.2 inversely amplifies the input signal, subsequently passing through U11.1, where it undergoes inverse amplification by a factor of R28/R25 = 20. Simultaneously, the input signal passes through R5 and enters the U11.1 inverse amplification circuit, with an amplification factor of R28/R5 = 10. Upon combining these two pathways, the output signal of U11.1 becomes 10 times the original residual current input signal.

      Conversely, when the residual current input signal flows in reverse, the diode D11 conducts, while D12 is cut off, resulting in a zero voltage at the left side of R25. On the other side, the input signal passes through R5 and enters the U11.1 inverse amplification circuit, also resulting in an output signal 10 times that of the residual current input signal.

      The input voltage signal undergoes the full-wave rectification via the LM358 operational amplifier, transitioning from the initial bipolar voltage with the positive and negative poles to a unipolar positive voltage amplified by 10 times at the output. The waveforms before and after the signal rectification are depicted in Fig. 3, finally connecting to the ADC interface of the microcontroller through the resistor R29.

      Figure 3. 

      Waveform before and after signal rectification.

    • The alarm thresholds of fixed-threshold alarm algorithms, and the rate-of-change alarm algorithms are both immutable, which can result in false alarms and missed alarms. Since the residual current in the circuit is subject to constant fluctuation, it is imperative that the alarm algorithm thresholds be regularly updated to accommodate these data variations. During normal circuit operation, a certain level of natural residual current is present, influenced by the external and electrical factors, typically exhibiting gradual overall changes. To enhance the reliability of the alarm methodology, a dynamic alarm threshold approach is adopted, enabling adaptive adjustments based on the circuit's residual current signal.

      Initially, the impact of natural residual current is nullified, whereby the alarm threshold adopts a form comprising the natural residual current added to a safety threshold, expressed in Eq. (1):

      $ {I}_{th}={I}_{na}+{I}_{sa} $ (1)

      In the formula, Ith represents the alarm threshold; Ina represents the natural residual current; and Isa represents the security threshold.

      The principle of using a sliding window algorithm is to update the natural residual current in real time, as shown in Fig. 4. Under normal conditions and when the residual current signal does not exceed the set alarm threshold, a residual current signal of a preset time window is collected, and the signal data within this window is statistically analyzed to preliminarily establish the alarm threshold. As the residual current signal is continuously updated, the sampling window will also slide to the right, and the leftmost data in the window will be moved out of the window, while the rightmost data will enter the window. At this time, the signal data in the window will be updated, and the above process will be repeated to continuously update, and the alarm threshold value will also be continuously updated.

      Figure 4. 

      Schematic diagram of sliding window algorithm.

    • Wireless Sensor Networks (WSN) are distributed sensor networks composed of many nodes. WSN localization refers to calculating the coordinate information of unknown nodes by receiving signals from other nodes based on the known coordinates of the nodes. There are generally two types of localization algorithms for wireless sensor networks: one is the localization methods based on distance, including the arrival time-based localization algorithms[9], the arrival time difference-based localization algorithms[10], and the received signal strength indication (RSSI) localization algorithm, etc. The other is based on non-ranging positioning methods, mainly including the geometric centroid positioning algorithm, DV Hop positioning algorithm[11], the position fingerprint method[12], etc. Generally speaking, the non-ranging positioning algorithms' positioning errors are greater, but the hardware dependency and usage costs are lower, making them suitable for use in scenarios of lower-level positioning accuracy and cheaper costs. Compared with other range-based positioning algorithms, RSSI-based positioning algorithms have lower power consumption, cheaper costs, and longer transmission distance. Therefore, this article adopts this algorithm for terminal node positioning.

    • The basic principle of RSSI ranging is that the transmission signal strength is known, and the receiving node calculates the propagation loss of the signal based on the received signal strength. Then, using theoretical and empirical models, the transmission loss is converted into distance, and the unknown node coordinates are calculated. There is a certain relationship model between the signal strength and the distance. Many path loss models have been proposed for the variation of RSSI with distance. In practical environments, the logarithmic–normal distribution loss model[1315] is more in line with the law of wireless signal propagation loss, as shown in Eq. (2):

      $ P(d)=P({d}_{0})-10n\mathrm{\lg }\left(\dfrac{d}{{d}_{0}}\right)+{\lambda }_{\delta } $ (2)

      In the formula, P(d) is the received signal strength at a distance of d from the signal source, in dBm; P(d0) is the signal strength of the reference point at a distance of d0 from the signal source, which the signal strength at 1m from the signal source is usually taken in practical, determined by the power of the transmitting end and the antenna gain, which is less affected by the environment and can be directly measured; N is the path attenuation coefficient, which represents the rate of power attenuation of a signal as the transmission distance increases. Different transmission environments have different values; λδ is a Gaussian random noise with a mean of 0 and δ as the standard deviation.

      Transforming Eq. (2), we can convert the RSSI value received by the receiving node into distance, and obtain the distance d between the unknown node and the receiving node as:

      $ d={d}_{0}\times {10}^{\tfrac{P(d)-P({d}_{0})-{\lambda }_{\delta }}{10n}} $ (3)
    • This article proposes an improved Gaussian filtering method. The basic steps of this method are as follows: Gaussian filtering is first applied to the collected RSSI value set, and the RSSI values of the interval ($\mu $ − 1.28σ, $\mu $ + 1.28σ) are selected. According to the Gaussian distribution model, the probability of RSSI values appearing in the interval is 0.8. After the preliminary interval screening above, a set of RSSI values is obtained.

      Larger RSSI values can achieve more precise positioning accuracy, but in a set of RSSI value sets, the maximum value usually appears at a relatively lower frequency. Choosing the maximum RSSI value as the extraction value can lead to unstable filtering effects and thus unstable positioning accuracy. Therefore, this article chooses to calculate the frequency distribution of the set of RSSI values using the maximum frequency distribution RSSI value as the threshold, removing data smaller than this value from the set, and finally calculating the mean of the remaining RSSI value set. The flowchart of the improved Gaussian filtering method is shown in Fig. 5.

      Figure 5. 

      Flowchart of improved Gaussian filtering method.

    • During the filtering experiment, the grid node periodically sends out RSSI (Received Signal Strength Indicator, measured in dBm—a logarithmic signal power unit relative to 1 milliwatt, with larger values representing stronger signals) signals, while another node receives and records RSSI values, and then performs the filtering process of this method. The original and filtered data are shown in Fig. 6a, b. From Fig. 6, it can be seen that the original RSSI data has significant fluctuations and poor stability. After optimizing 50 sets of data through Gaussian filtering, 33 sets of valid data were retained. The fluctuation amplitude of the RSSI values was significantly reduced without obvious deviation, making them closer to the measured true values. Variance is a typical indicator that reflects the deviation between variables and the mean.

      Figure 6. 

      Raw RSSI data and filtering optimization result.

      Table 1 lists the variance and signal-to-noise ratio (SNR) of the original data and the data after Gaussian filtering optimization. The results show that the optimized RSSI data exhibits a smaller variance (from 5.9311 to 2.0426) and a higher SNR, which verifies that the filtering effect meets the requirements.

      Table 1.  Variance comparison table.

      Processing method Raw data Gaussian optimization
      Variance (m2) 5.9311 2.0426
      SNR (dB) 26.25 30.88
    • In order to achieve the goal of high-precision positioning at a lower cost, this article proposes an improved method based on the maximum likelihood estimation method combined with the centroid positioning, mainly improving two aspects: first, the maximum likelihood estimation method is used to calculate the coordinates of unknown nodes in the first step, and then the improved weighted centroid positioning algorithm is used for the second step of positioning calculation. After the two-step positioning calculation, the positioning error can be reduced to a certain extent. Following are the detailed steps to improve the positioning algorithm:

      (1) In the communication range of unknown nodes, there are generally multiple beacon nodes. Assuming that the communication RSSI values with each beacon node are filtered and arranged in descending order as RSSI1, RSSI2,···, RSSIn. Select the first m RSSI values and use the RSSI ranging model to calculate the distances d1, d2,···, and dm between the unknown node and m beacon nodes.

      (2) Take m−1 of the m distance information obtained and use maximum likelihood estimation to obtain the coordinates of m rough unknown nodes.

      (3) According to the weighted centroid positioning algorithm, it is calculated that the coordinates of the m unknown nodes obtained in the previous step. The weighting factors wixand wiy for the x and y coordinates are calculated using the following formula:

      $ {w}_{ix}=\dfrac{1}{|{x}_{i}-\overline{x}|+\delta } $ (4)
      $ {w}_{iy}=\dfrac{1}{|{y}_{i}-\overline{y}|+\delta } $ (5)

      In the formula, $ \overline{x}=\dfrac{{x}_{1}+{x}_{2}+\cdots+{x}_{m}}{m},\;\overline{y}=\dfrac{{y}_{1}+{y}_{2}+\cdots+{y}_{m}}{m} $; take δ 0.01 to prevent the denominator from being 0.

      The final calculated unknown node coordinates (x, y) are:

      $ \left(x,y\right)=\left(\dfrac{\displaystyle\sum \limits_{i=1}^{m}\left({w}_{ix}{x}_{i}\right)}{\displaystyle\sum \limits_{i=1}^{m}{w}_{ix}},\dfrac{\displaystyle\sum \limits_{i=1}^{m}\left({w}_{iy}{y}_{i}\right)}{\displaystyle\sum \limits_{i=1}^{m}{w}_{iy}}\right) $ (6)
    • In order to verify the positioning effect of the proposed positioning algorithm, the simulation experiments were conducted using Python. The experimental range was a square area of 20 m × 20 m. First, four beacon nodes were generated at the vertices of the 10 m × 10 m square, with coordinates of (0, 0), (0, 10), (10, 10), and (10, 0), respectively. Then, 20 unknown nodes were randomly generated within the experimental range, and their localization was simulated.

      In the experiment, the noise variance in the RSSI ranging model is set to 5, the reference point signal strength is set to −40.55 dBm, and the path attenuation coefficient is set to 1.95. Fifty RSSI values were collected from each unknown node and filtered using a mixed Gaussian filtering method. The processed RSSI values were converted into distances and positioned using a positioning algorithm. The simulation results are shown in Fig. 7.

      Figure 7. 

      Simulation results of positioning algorithm.

      In order to verify the improvement of the proposed hybrid algorithm's localization effect, the maximum likelihood estimation method was used for the simulation experiments under the same conditions, and the simulation results are shown in Fig. 8.

      Figure 8. 

      Simulation results of maximum likelihood estimation method for localization.

      In the simulation experiment, the average positioning error of the maximum likelihood estimation method for 20 unknown nodes was 1.65 m, while the average positioning error of the hybrid positioning algorithm proposed in this article was 0.56 m. It can also be seen from Figs. 7 and 8 that the hybrid positioning algorithm proposed in this article is closer to the actual position of unknown nodes compared to the maximum likelihood estimation method. It can be concluded that the hybrid positioning algorithm proposed in this article has more precise positioning accuracy.

      To investigate the influence of beacon node spacing and RSSI value acquisition frequency on the accuracy of positioning algorithms, the following experimental simulations were conducted: maintaining the distribution of beacon node square vertices and changing the distance between beacon nodes, changing the RSSI value acquisition frequency, and keeping other conditions unchanged. The experimental results are shown in Table 2.

      Table 2.  Positioning experiment errors under different positioning conditions.

      Beacon node spacing (m)Collection number of times
      205080110
      100.970.560.570.35
      150.960.690.530.41
      201.131.060.770.56

      From the table, it can be seen that the spacing between beacon nodes and the collected number of RSSI values will both affect the positioning accuracy of this algorithm. As the spacing increases, the positioning accuracy gradually decreases. The more RSSI values collected, the more accurate the positioning accuracy will be.

    • After the initialization of the ZigBee terminal node, the ADC interface is sampled 24 times within a cycle to calculate the effective value of residual current using the root mean square method. If the residual current value exceeds the threshold, an alarm message is sent to the upper computer. At this moment, the terminal node will send data directly to the upper computer, and the upper computer will use the proposed method for intelligent calculation. If the detected residual current value is still greater than the threshold, the system will give an alarm and display it in the grid management system. The flowchart is shown in Fig. 9.

      Figure 9. 

      Residual current detection flowchart.

    • The terminal node is the lowest level in the ZigBee network. It first needs to join the network through beacon nodes, and cannot forward data from other terminal nodes. Within the monitoring area, it needs to use the system's positioning algorithm to obtain its own location. After the system is started, the terminal node actively scans the communication channel, requests network access from the beacon node, obtains the network ID, and joins the wireless sensor network.

      After joining the network, the localization process begins, and the terminal node sends localization requests to the surrounding broadcast beacon nodes. After obtaining at least three beacon node location information, the RSSI values of the beacon nodes are recorded, and the collected RSSI value set is processed using the improved Gaussian filtering method. Then, the processed RSSI values are sent to the upper computer. The upper computer first updates the parameters of the RSSI ranging model, and then estimates the coordinate position based on the hybrid positioning algorithm proposed in this article. The flowchart is shown in Fig. 10.

      Figure 10. 

      Terminal node positioning flowchart.

    • In ZigBee networking, the coordinator nodes play an important role, and the establishment of the network and data collection are carried out on them. After the system is initialized by powering up, it starts scanning communication channels and selects the optimal channel to create a network. Afterwards, the coordinator node begins monitoring the wireless status. If a node successfully enters the network, the coordinator node will add the node's address to its address table. Next, the network topology is forwarded to the upper computer. Then, a new round of wireless status monitoring will begin, and residual current and temperature data forwarded by other nodes will be collected and forwarded to the upper computer. The workflow diagram is shown in Fig. 11.

      Figure 11. 

      Coordinator workflow diagram.

    • MHMapGIS is a map application based on Geographic Information Systems (GIS), providing functions such as map data visualization, map editing, and data querying. With the help of GIS technology, professional analysis functions can be established to analyze and manage a large amount of data that runs through entire processes of disasters, including their origin, development factors, and impact scope. The advantage of GIS technology lies in its ability to complete complex tasks such as input, management, processing, spatial analysis, and modeling visualization of these different types of data. The upper computer displays the warning information uploaded by the terminal node in the ancient building grid, as shown in Fig. 12.

      Figure 12. 

      Upper computer grid warning display.

    • Taking variable frequency load leakage as an example, this article applies a ZigBee wireless sensor network to a grid monitoring system for ancient buildings. Through the ZigBee terminal node, the residual current in the line is monitored and warned, and the grid management of leakage faults has been achieved in ancient buildings, which has some practical implications as follows:

      (1) The application of ZigBee technology and grid management information technology in the frequency conversion load leakage fault monitoring system has achieved accurate monitoring of residual current.

      (2) Implementation of terminal node positioning function using the RSSI positioning algorithm. Aimed at the error in the ranging stage, an improved Gaussian filtering method was proposed for preprocessing, and then a hybrid positioning algorithm was further proposed. In the simulation experiments, the average positioning error was 0.56 m, and the positioning accuracy of the hybrid algorithm was tested under different numbers, the spacing of beacon nodes, and the different RSSI value acquisition number of times.

      This study has certain limitations: the positioning accuracy is affected by the wall density of ancient buildings, with a slight increase in positioning error when nodes pass through multiple beams/columns; the system only targets residual current-type electrical fires without integrating multi-parameter monitoring such as smoke and flame detection; in addition, field tests were only carried out in a single ancient building courtyard, failing to verify the networking scalability in large-scale ancient building clusters. For further optimization, this system can be improved in three aspects: first, introduce a multipath fading compensation model to correct the RSSI signal attenuation caused by walls for higher positioning accuracy in complex environments; second, integrate smoke, temperature, and flame sensors to construct a multi-parameter fusion-fire warning model, thereby reducing the false alarm rate of single-parameter monitoring; third, combine LoRa and ZigBee for networking to realize wide-area monitoring of large-scale ancient building clusters, and develop a mobile early-warning terminal to enable real-time alarm information reception for on-site personnel.

      • The authors confirm their contributions to the paper as follows: conceived and designed the experiments, wrote and revised the paper: Wang Z; performed the experiments and analyzed the data: Tang Z, Liu T; contributed reagents/materials/analysis tools: Peng J; revised the manuscript critically for important intellectual content: Sun Q; contributed to the supervision and funding acquisition: Di C; contributed to the resources: Zhang Z, Wang Y. All authors reviewed the results and approved the final version of the manuscript.

      • All data generated or analyzed during this study are included in this published article.

      • The research is funded by the National Key Research and Development Program of China (No.: 2021YFC1523500).

      • The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

      • Copyright: © 2026 by the author(s). Published by Maximum Academic Press on behalf of Nanjing Tech University. This article is an open access article distributed under Creative Commons Attribution License (CC BY 4.0), visit https://creativecommons.org/licenses/by/4.0/.
    Figure (12)  Table (2) References (15)
  • About this article
    Cite this article
    Wang Z, Tang Z, Liu T, Peng J, Sun Q, et al. 2026. Research on grid-based fire warning and positioning system for ancient buildings. Emergency Management Science and Technology 6: e006 doi: 10.48130/emst-0026-0006
    Wang Z, Tang Z, Liu T, Peng J, Sun Q, et al. 2026. Research on grid-based fire warning and positioning system for ancient buildings. Emergency Management Science and Technology 6: e006 doi: 10.48130/emst-0026-0006

Catalog

    /

    DownLoad:  Full-Size Img  PowerPoint
    Return
    Return