## 1 Introduction  
Underground coal mine operation has always proved to be a very dangerous and hazardous environment [1] due to the presence of coal dust, methane, and other toxic gases [2; 3]. It has been reported that approximately 33.8% of deaths that happen in the mining sector are a consequence of coal dust or methane gas explosions. During the years 1990 to 2007, 1601 cases of mine fires were reported in the United States (U.S.) alone [4]. Recently, a report by the Inspectorate of Mines, Punjab, Pakistan, showed that a high number (38%) of underground mine accidents were due to gas accumulation in the coal mines of salt-range region [5]. Although the combustible range of methane gas is 5-15%, exposure to even low concentrations of methane can critically damage the human body [6]. In addition to methane gas, other toxic gases exist in underground coal mines, including carbon monoxide (CO), carbon dioxide (CO\({}_{2}\)), and hydrogen sulfide (H\({}_{2}\)S). Short-term exposure to these gases may not have any damaging effects, but long-term exposure always results in severe damage to the body [7]. Therefore, the accurate monitoring of the underground mine environment is of prime importance for the safety of miners and mine property. Over the last decade, the development of control system gateways for the Internet of Things (IoT) in various fields is redefining how the internet extends to everyday life with uniquely identifiable objects in the wireless sensor networks (WSNs) [8]. IoT can be suitably applied to environmental monitoring [9]. Recently, the authors in [10] implemented IoT integrated with cloud computing for real time monitoring of a mine tailing dam. Similarly, IoT-based cloud computing has been used for the spatiotemporal analysis of data, event detection, and real-time information sharing; these are promising steps towards establishing a new era of mine safety. Such systems have rarely been reported for underground mines, and their implementation will be helpful for enhancing the environmental and personnel safety. The objective of this study is to investigate the isolated safety aspects of underground mines, to study their inter-dependencies, to and seamlessly integrate IoT-based separately identifiable systems to build a comprehensive monitoring and safety system specifically for underground mines. In this study, we are interested in the cost-effective integration of technologies, such as standard monitoring, intelligent event detection and identification, miner localization, and real-time information sharing for IoT system development. We have overall goals of better understanding the harsh and real underground application domain and enhancing overall mine safety. The implementation of such a system will bring a revolutionary change in the safety of underground mines in Pakistan. The following are key contributions of this study:  
1. We propose the use of an Arduino-based, scalable, cost effective, reliable, and distributed network for underground environmental monitoring. 2. We propose the seamless integration of key technologies of information systems based on IoT and cloud services for underground mine informatics, in which a cloud server communicates with mobile devices. 3. We originally proposed a single \"Mine Warning Index (MWI)\" for an easy and quick assessment of mine safety. 4. We proposed an outlier detection algorithm for event detection and identification in an underground coal mine. 5. When compared to the conventional receive signal strength (RSS) method, the proposed RSS range-based weighted centroid localization algorithm improved tracking accuracy by 30%. The remainder of the article is organized as follows. Section 2 explains the related work, Section 3 provides a detailed design of the IoT-based integrated event detection and early-warning safety system for underground coal mines. Section 4 deals with the methodology and system design for safety in underground mines.