## 2 Materials and Methods
### Sensor Node Components  
The WWPM system used for monitoring the laboratory WDN was composed of two sensor nodes S1 and S2, which were placed before and after the leak valve, respectively, in the direction of water flow (left to right) as shown in Figure 1. The main components of the sensor nodes comprised an ESP32 as the processing unit, a nRF24L01+ transceiver as the communication unit, a LSM9 DS1 as the sensing unit, and a 3.7 V 2000 mAh Li-Po rechargeable battery as the power source, as depicted in Figure 2. Depending on the specific scenario under investigation, as discussed in Section 3, the connection or disconnection of an ADXL344 accelerometer may be optional, contingent upon the implementation of hierarchical sensing. For the processing unit, the ESP32 was used because it is a powerful, low-cost, and low-power MCU. It incorporates a double-core 32-bit Xtensa LX6 microprocessor and an ultra-low-power coprocessor (ULP). The architecture of the ESP32 frequently renders it a popular choice for deployment in intermediate-level devices within the context of IoT/WSN applications [2]. The ULP coprocessor consumes minimal current (between 10 \(\upmu\)A and 150 \(\upmu\)A) when the core is sleeping and can be used for simple control. This ULP feature makes the ESP32 a suitable processing unit for a sensor node that will be battery-powered. Thus, the ESP32 can be used to implement duty cycling via an interrupt-driven sleep/wakeup, where the low-power ULP coprocessor is needed for control during deep sleep mode when no leak event is detected while the high-power dual-core processor is a needed in the active mode to perform powerful computations when a leak event is detected. Moreover, the ESP32 has a feature that permits the remaining charge of its battery supply to be estimated by reading the battery voltage from one of its analogue pins. This feature makes the ESP32 suitable for energy-aware applications as it can compute its energy consumption online and thus regulate its operations. Another advantage of the ESP32 is its lower cost, which is an attractive feature for sensor nodes that are to be deployed in a developing country's WWPM system. In addition, the ESP32 also incorporates Wi-Fi and Bluetooth modules, which makes it IoT-compatible. In our experiments, the core of the ESP32 MCU on each  
Figure 1: Laboratory testbed setup. (**a**) Position of sensor node’s S1 and S2 (**b**) water distribution pipeline. sensor node was configured to operate at a speed of 80 MHz and in the modem sleep mode (ESP32's Wi-Fi transceiver turned off). The nRF24L01+ was used as the communication unit and not the ESP32's Wi-Fi or Bluetooth transceiver because it exhibits current peaks in RX/TX modes lower than 14 mA (one of the lowest consumptions on the market), a sub-\(\upmu\)A power-down mode, and advanced power management. The nRF24L01+ is hence a true ultra-low power solution enabling months to years of battery life from coin cell or AA/AAA batteries. In addition, compared to other IEEE 802.15.4-based radio chips, the nRF24L01+ transceiver is low-cost. Finally, the enhanced ShockBurst feature of the nRF24L01+ enables it to achieve high data rates (up to 2 Mbps) at lower power consumption. The burst mode is particularly interesting for distributed computing, which involves only short-distance communications between neighbouring nodes. For the sensing unit, we selected the LSM9 DS1 because of its low cost, high sensitivity, and availability. To reduce the power consumption of the sensor node, we also selected a low-power accelerometer to compensate for the high-power consumption of the more sensitive LSM9 DS1 accelerometer by implementing hierarchical sensing. The low-power accelerometer is less sensitive and is continuously used to monitor the pipeline. Once it detects an acceleration larger than a defined threshold, it triggers an interrupt to wake up the more sensitive accelerometer from sleep to collect more accurate measurements that will be used for leak detection.