## 6 Implementation: Case Study  
An underground mine, the Hassan Kishore coal mine situated in the Mahiwal region of the eastern salt range, Punjab Pakistan, was selected for the implementation of the proposed system. This particular coal-mine is positioned at Ara-Basharat, 48 km southeast of Kalar Kahar. The mine portal coordinates are 32\({}^{\circ}\)46\({}^{\prime}\)26\({}^{\prime\prime}\) N and 73\({}^{\circ}\)06\({}^{\prime}\)45\({}^{\prime\prime}\) E, while the portal elevation from sea level is 870 m. The average thickness of the coal bed at this particular coal mine is 0.1-0.5 m at an average depth of 23 m below the surface. The real challenge for the deployment of this system was the topology management. The unstructured architecture, uneven mine opening surfaces, bends/curves in mine opening, and dynamic nature of mine workings reduce the wave propagation. These challenges have been solved by adopting the following procedure. Firstly, the entire mine was divided into three different regions i-e; the incline, the main roadway, and working faces with connected galleries. Secondly, the optimum topology with in-nodes distance (17 m) was determined by a hit and trial method. The following procedural steps have been adopted for setting up the entire network:  
1. BLE shields were installed and programmed using Arduino. Then, the sensor modules for temperature, humidity, CO\({}_{2}\), CH\({}_{4}\), and CO were fabricated with Arduino. The sensing prototype was pre-programmed with the threshold limits of gases, temperature, and humidity, as summarized in Table 1 in Arduino Integrated Development Environment (IDE 1.0.X Arduino AG). 2. The SNs and RNs were installed on the side walls of the mine at different locations shown in Figure 5.
3. Power at 3 V to 5 V was supplied to SNs and RNs using the electrical power of the underground mine. 4. The entire framework of the system was installed on a PC server (Intel Xeon E5420 2.5 GHz with 8G RAM) running on an operating system of Windows 7 (Microsoft, Redmond, WA, USA). 5. The early-warning data was transferred to the main server every second. Initially, the monitored data were compared with commercially available well-known devices for a day. These devices included: Onset HOBO U12-012 (Onset, Bourne, MA, USA) [42] for temperature and humidity, Gas central CH4C 100 (Ventilation Control Products, Brodalsvagen 7, Hus Z, Partille, Sweden) for methane (CH\({}_{4}\)) gas, Telaire 7000 series (Amphenol Thermometrics, Inc., Saint Marys, Pennsylvania, PA, USA) for CO\({}_{2}\) and Fluke CO-220 (Fluke Corporation, Everett, WA, USA) for CO.
6. The RSS-weighted centroid localization algorithm was defined and programmed in the computer for miner tracking. The straight length of the mine entries at this particular mine was approximately 250 m and the width was about 2 m. The entire network of our system consisted of one BS, one gateway, 12 SNs, 4 RNs, and an MN. Moreover, two actuators for controlling ventilation fans and three for alarm devices were also added to the system for noticing the emergency response. All Arduino-based SNs and RNs were installed near the crown level at an approximate height of 1.8 m to avoid human interruption. Gases being monitored by our system are lighter than air, so they tend to accumulate near the roof of the mine. SNs and RNs were installed in a zigzagging manner, where each RN was followed by two SNs. The average distance between BLE nodes was approximately 17-18 m, and this was selected by considering the mine opening surface conditions, as uneven surfaces greatly influence the WSN range. The chosen distance allows for the overlapping of a single node with at least three consecutive nodes. Thus, in the case that one or two nodes fail, our system can reconfigure itself with a node within range. This gives a high density of locations of each of SNs and RNs inside the mine.