0% found this document useful (0 votes)
106 views51 pages

Ibrahim Final PDFM

The document describes a project to develop an IoT based coal mine safety monitoring and alerting system. The system will use sensors to monitor parameters like methane gas, temperature, and detect fire accidents in underground mines. It will send alerts to prevent disasters and improve safety in coal mining.

Uploaded by

rudhurusaidharao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views51 pages

Ibrahim Final PDFM

The document describes a project to develop an IoT based coal mine safety monitoring and alerting system. The system will use sensors to monitor parameters like methane gas, temperature, and detect fire accidents in underground mines. It will send alerts to prevent disasters and improve safety in coal mining.

Uploaded by

rudhurusaidharao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

A Project report on

IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM


A Project report submitted in partial fulfilment of the Requirement for the award of the degree
DIPLOMA
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
Submitted by
MD. IBRAHIM 20624-EC-029
M. MADHU SANKAR 20624-EC-026
G. JAYARAJU 20624-EC-013
B. SUBRAMANYAM 20624-EC-002

Under the Esteemed Guidance of


Mr. G. SIVA KUMAR, M. Tech
LECTURER

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

HINDU COLLEGE OF ENGINEERING AND TECHNOLOGY


(Approved by AICTE, New Delhi, Affiliated to APSBTET, Vijayawada)
Amaravati Road, Guntur District -522002, Andhra Pradesh.
2020-2023

i
HINDU COLLEGE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, New Delhi, Affiliated to APSBTET, Vijayawada)
Amaravati Road, Guntur District -522002, Andhra Pradesh.
2020-2023
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CERTIFICATE
This is to certify that the project report entitled, “IoT BASED COAL MINE
SAFETY MONITORING & ALERTING SYSTEM ” that is being submitted by
MD. IBRAHIM (20624-EC-029), M. MADHU SANKAR (20624-EC-026), G. JAYARAJU (20624-
EC-013), B. SUBRAMANYAM (20624-EC-002), in partial fulfilment for the award of Diploma in
ECE to the STATE BOARD OF TECHNICAL EDUCATION AND TRAINING. The results
embodied in this project report have not been submitted to any other Institute for the award of
Diploma.

PROJECT GUIDE HEAD OF THE DEPARTMENT


G. SIVA KUMAR, M. Tech CH. JYOTHIRMAYI, M. Tech
LECTURER HOD
Department of ECE Department of ECE

EXTERNAL EXAMINER

ii
DECLARATION

We here declare that this project entitled “IoT BASED COAL MINE SAFETY
MONITORING & ALERTING SYSTEM ” done under the guidance of Mr G. SIVA KUMAR,
LECTURER of ECE Department, being submitted to the diploma in Electronics and Communication
Engineering, Hindu college of Engineering and Technology is of my own and have not been submitted to
any other educational Institution for any degree or diploma.

SIGNATURE:

1.
2.
3.
4.
NAME:

MD. IBRAHIM 20624-EC-029


M. MADHU SANKAR 20624-EC-026
G. JAYARAJU 20624-EC-013
B. SUBRAMANYAM 20624-EC-002

PLACE: HINDU COLLEGE OF


ENGINEERING AND TECHNOLOGY
(Approved by AICTE, New Delhi,
Affiliated to APSBTET, Vijayawada)
DATE:

iii
ACKNOWLEDGEMENT

We proudly express our gratitude and respect towards our honourable Sri. CHERUVU
RAMAKRISHNA MURTHY, Secretary of HCET for his precious support in the college.

We express our great pleasure to Dr. Ch. SUBBA RAO, Principal, HCET, Guntur, for his support
during and till the completion of the project.

We thankful to Ms. CH. JYOTHIRMAYI, Head of the Department for this encouragement and
support for the completion of project we are inspired a lot through her valuable message.

We are really thankful to our project guide Mr G. SIVA KUMAR, LECTURER HCET, Guntur, for
his/her excellent guidance right from selection of the project and his/her valuable suggestions throughout
the project work.

We thankful to all teaching and non-teaching of Electronics & communication Engineering and
management and my friends for their direct and indirect work provided to use in completing the project.

We own all our success to our family members, classmates, and teachers from our childhood, whose
vision, love and inspiration made us to reach out for these glories.

iv
TABLE OF CONTENTS
Project Report i

Certificate ii

Declaration Acknowledgement iii

Acknowledgement iv

Table of contents v
vi
List of figures

Abstract vii

CHAPTER 1 – INTRODUCTION 1
CHAPTER 2 - LITERATURE SURVEY 4
CHAPTER 3 – DESIGN OF LIVE SMART HELMET 7
3.1 Existing Method 8
3.2 Proposed Project 9
3.3 Working 10
3.4 Hardware tools 10
3.5 Software tools 11
3.6 Advantages 11
3.7 Applications 11
CHAPTER 4 – HARDWARE DESCRIPTION 12
4.1 Node MCU ESP32S 13
4.1.1 Introduction 14
4.1.2 Pin Configuration 15
4.1.3 ESP 32S Features 16
4.1.4 Power 17
4.1.5 On-board Switches & LED Indicator 17
4.1.6 Peripherals and I/O 17
4.1.7 Serial Communication 17
4.1.8 Specifications 18
4.2 NEO GPS 6M 18
4.2.1 Working 19
4.2.2 Specifications 19
4.2.3 APPLICATIONS 19
4.2.4 Uses 20
4.3 DTH 11 SENSOR 21
4.4 Battery Supply 22
4.5.1 2 volts power supply
4.6 MQ -7 SENSOR
4.7 BUZZER
4.8 LEDs

CHAPTER 5 – SOFTWARE DESCRIPTION 27


5.1 Arduino IDE 28
5.1.1 Connecting the Arduino 28
5.1.2 Preparing the Board 29
5.1.3 Loading the Code 29
5.2 Embedded C 30
5.2.1 Embedded Systems Programming 31
5.2.3 Difference between C and Embedded C 32
5.3 Blynk Application Description 33
5.3.1 Introduction 33
5.3.2 Supported Hardware 33
5.3.3 Create a Blynk Project 33
5.3.4 Add Widgets to the Project 33
5.3.5 Upload the Firmware 34
5.3.6 Stand Alone Programming Code 34
5.3.7 Execution 34
5.3.8 Output 34
5.4 IOT BASED SMART HELMET BLOCK FIG 35
5.4.1 Introduction 35
CHAPTER 6 – RESULTS & DISCUSSION 36
CONCLUSION 38
FUTURE SCOPE 39
REFERENCES 40
APPENDIX 41

v
FIGURE CONTENTS

S.NO FIGURE NAMES PAGE NO

1. BLOCK DIAGRAM OF IoT BASED SMART HELMET 3


2. EXISTING METHOD 8
3. PROPOSED METHOD 9
4. ESP 32 S 13
5. NEO GPS 6M 18
6. CIRCUIT DIAGRAM OF NEO GPS 6M 20
7. DHT 11 SENSOR 21
8. BATTERY SUPPLY 22
9. 12V POWER SUPPLY 23
10. MQ 7 SENSOR 24
11. BUZZER 25
12. LED 26
13. SMART HELMET 35
14. CIRCUIT CONNECTION 37
15. SMART HELMET OUTPUT 38

vi
ABSTRACT:

Coal mining is the process of extracting coal from the ground. Steel and cement industries
use coal as a fuel for extraction of iron from iron ore and for cement production. Underground
mining industry comes to the category, WHERE each and every parameter such as methane gas,
high temperature, fire accidents and so on has to be monitored regularly. Safe production level of
coal mine is still low, disasters in coal mine occur frequently, which lead to great loss of possession
and life. The disasters happening in coal mine are due to the complexity of mine environment and
the variety of work carried out in coal mine, so it is very necessary to monitor the working
environment of coal mine. To get over this problem, in this projects we proposed a wireless sensor
network's application in coal mining safety system. In this wireless sensor network's application
system there will, be master controllers and slave controllers. Slave controllers will detect the
danger and give alert through RF to master controller and it will raise the alarm in all tunnels and
also raise message on IOT, which will help to take action as soon as possible. This monitoring and
alerting system is powered by ESP32 microcontroller for master controller and consists of
temperature sensor, water sensor, methane and carbon dioxide sensor and Cloud which collects
temperature, humidity and methane values underground of coal mine.

vii
IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

CHAPTER -1
I INTRODUCTION

DEPARTMENT OF ECE HCET Page 1


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

It is a fact that young generation prefers bikes and motorcycle than four wheelers. A survey
indicates that more than 70% of the riders avoid wearing helmet without any specific reason Speed
driving and drunk driving have become common issues. Due to lack of experience or focus and
violation of traffic rules, result in severe accidents. The Global status report on road safety 2015,
reflecting information from 180 countries, indicates that close to 1.25 million people die every year
as a result of road accidents. Near about one fourth of the people involved in accidents are
motorcyclists. The main cause of death in two- wheeler drivers is over speeding and careless
driving. Number of lives could have been saved if emergency medical service could get accident
information and reach in time to the scene. Up to 75% of all deaths occur within the first one hour
of impact. Thus, in this crucial phase of time, if proper aid reaches the victims, mortality rates can
be reduced.
In this survey we focus on to build an Internet of Things (IoT) application that leverages on
ubiquitous connectivity, sensing and data analytics that are the basis of loT applications. The loT is
made of smart machines communicating and interacting with other machines, objects, environments
and infrastructures. The huge volumes of data thus generated, is processed into useful actions that
can "command and control things, to make: our lives much easier and safer. IoT applications focus
on numerous benefits like the capability to remotely monitor, manage and control devices, and to
get new insights and useful information from massive streams of data. The foundation however lies
on the intelligence of the embedded processor.

DEPARTMENT OF ECE HCET Page 2


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

FIG 1: BLOCK DIAGRAM OF IOT BASED SMART HELMET

DEPARTMENT OF ECE HCET Page 3


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

CHAPTER-2
LITERATURE SURVEY

DEPARTMENT OF ECE HCET Page 4


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

In the process of literature survey, we have found a lot of smart helmets with different
approaches and with different methodologies. C. J. Behr et al [2] had proposed a smart helmet for
mining industry in order to identify hazardous event detection and air quality. This system can
identify the concentration level of the harmful gases such as CO, SO2, NO2, and particulate matter
by using electro chemical sensor and also detects the removal of Helmet by using an IR sensor. It
also identifies an incident when miners are struck by an object in contradiction to their head with a
high force exceeding a value of 1000 by using the Head Injury Criteria. An accelerometer was used
to calculate the acceleration of the head after hit and the HIC was calculated in software. Edna
Elizabeth et al [3] had developed a smart helmet device for detecting and reporting bike accidents.
Smart helmet system comprises of various sensors, and it identify the accident by evaluating uneven
or irregular variations obtained from sensor system, and a trigger will be sent to Pager Duty from
the microcontroller. Pager Duty will then triggers a call to the phone number registered by the
motorist.

If the driver does not respond to it for a period of 5 minutes after the first call is initiated,
then the emergency contacts will be informed with the details about the accident. The emergency
contacts will be alerted through text message, e-mail, and phone call until they acknowledge the
incident. In real time, this system assures a reliable and quick delivery of information relating to the
accident. Rashmi had proposed a methodology which uses Piezo electric buzzer in order to identify
over speeding bike and it also equipped with a feature called velocity limiter, which restricts the
speed limit of the bike. It also has a feature which prevents the drunk and drive scenarios of the
rider called as ALCHOLOCK and an accelerometer to identify accidents, upon detecting accidents
it automatically send a message to concerned person. A fog sensor has been used in this system in
order to improve the visibility for the rider in case of fog or smog. It also features automatic
deduction of required or needed amount from the riders registered virtual wallet in wireless to helps
the rider to stop and do the payment et al [5] had designed a system which automatically detects if
the rider is wearing a helmet and also checks whether the rider has consumed alcohol before starting
the ride. The relay attached to the engine will turn ON if and only if both the conditions are met.

The Microcontroller in the system controls the functioning of relay and thus the ignition.
This system also identifies the bike accident at any place and alerts the concerned person about the
accident. Archana D et al [6] had proposed a system which will not allow driver to start the engine
without wearing the helmet.

DEPARTMENT OF ECE HCET Page 5


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

When rider wore the helmet, helmet will be locked and engine will be switched ON.
This system also identify the approaching vehicle’s speed on both sides of the bike while riding by
using ultrasonic sensor and alert the rider by generating vibrations in bike’s handlebar [7] had
proposed a methodology for smart helmet which can detect whether rider is wearing the helmet or
not, and detect whether the person has over-consumed alcohol and can also detects about the
accident. This system gathers the data generated from the accelerometer and pressure sensors and
the same will be sent to cloud server via an online application programming interface (API) to train
a support vector machine (SVM). SVM can help in detecting accident precisely so in the future
enough data will be gathered and analysed to provide more accuracy about event detection. The
proposed system (smart helmet) can be connected to any smart phone via Bluetooth in order to
communicate with the online API, by using the smart phone internet connection. Advance in
Electronic and Electric Engineering 4: 493-498 In present day scenario we encounter numerous
cases of two wheeler road accidents leading to death.. Despite of the fact that helmets are available
everywhere, people are not wearing them for protection. In this regard, and infer that people
abandon use of helmet primarily

DEPARTMENT OF ECE HCET Page 6


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

CHAPTER-3
DESIGN OF LIVE IOT SMART HELMET

DEPARTMENT OF ECE HCET Page 7


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

3.1 Existing Method:

In Existed systems A smart helmet has been developed which includes various features such
as the two way communication, detection of the hazardous gases, providing notification in the case
of helmet removal, collision (miners are struck by an object), panic switch for emergency situations,
continuous monitoring of the environmental conditions such as temperature and pressure in the
mining industry and GPS is provided to track the location of the miner. Once the poisonous gas is
detected the helmet opening gets closed and the oxygen supply is provided within the helmet for the
miners by the opening of solenoid valve of the oxygen cylinder. Panic switch is provided for the
safety of the miners and it is used to provide alert signal to the control room during any emergency
situations .Temperature and Pressure sensors are used for the continuous monitoring of
environmental conditions .The information are sent to the control room through wireless network.
The layout of the visualization was completed and displayed in the control room with the help of a
Lab VIEW software .This paper presents the undertaken design detailing solutions to issues raised
in previous research.

FIG: 2 EXISTING METHOD

3.2 CONCLUSION & FUTURE SCOPE:


Thus a smart helmet for hazardous event detection, monitoring the surrounding
environmental conditions and updating information like GPS location and sensor data to the central
console for easy tracking and providing oxygen supplements to avoid the inhalation of poisonous
gases is designed.

DEPARTMENT OF ECE HCET Page 8


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

The system can also be further developed with the implementation of Internet of Things
(IOT).The database can be created that monitors the sensor modules continuously.

3.2 Proposed project: This project is one of the important IOT projects. The project
consists of two modules that are the receiver and the transmitter modules. IOT based coal mine
safety monitoring and alerting system project is proposed for the purpose of implementing security
and detection of hazards inside a coal mine. The transmitter module has temperature, smoke, and
methane sensors installed in it. The transmitter module also carries an LCD and an RF transmitter.
The receiver module consists of an RF receiver, an LCD display, and a WiFi module. All the sensor
data is transmitted to the remote IOT server every 2 minutes. The circuit also contains an alarm
buzzer.

FIG 3 : PROPOSED METHOD

DEPARTMENT OF ECE HCET Page 9


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

3.3 WORKING:

 IOT Based Coal Mine Safety Monitoring project consists of two hardware modules, one
transmitter, and one receiver. The main controller in both modules is an Arduino board.

 Transmitter module: It is installed inside the coal mine. The transmitter module contains the
smoke sensor, temperature sensor, and methane sensor. The transmitter module also has an
LCD. All the sensor data is displayed on the LCD display by Arduino. The RF transmitter
present on the transmitter module sends the sensor data to the receiver module.

 Receiver module: It has an Arduino controller, LCD display, and an RF receiver. The RF
receiver receives the sensor values from the RF transmitter on the transmitter module. The
received sensor values are displayed on the LCD screen. The Arduino also sends the sensor
data to the remote IOT server using the WiFi module every two minutes. If any of the sensor
values exceeds a particular threshold level, the buzzer is turned on to notify the concerned
personnel. The remote server has an IOT platform installed on it which displays the relevant
data using the GUI which helps the users in monitoring and system control.

3.4 Tools Required:

Hardware Tools:

 ESP32 MODULE
 NEO GPS 6M
 DHT11 SENSOR
 MQ-7 SENSOR
 BATTERY
 POWER SUPPLY
 LEDS
 BUZZER

DEPARTMENT OF ECE HCET Page 10


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

3.5 Software Tools:

 BLYNK IOT
 ARDUINO IDE SOFTWARE

3.6 ADVANTAGES:

 EASY TO USE
 COST EFFECTIVE
 SIMPLE IN SIZE
 EASY TO CARRY

3.7 Applications:

 USED IN COAL MINES


 USE IN UNDERGROUND

DEPARTMENT OF ECE HCET Page 11


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

CHAPTER-4
HARDWARE DESCRIPTION

DEPARTMENT OF ECE HCET Page 12


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

4.1 ESP32 MCU:

FIG 4: ESP 32 S

DEPARTMENT OF ECE HCET Page 13


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

4.1.1 INTRODUCTION:
ESP32 is the SoC (System on Chip) microcontroller which has gained massive popularity recently.
Whether the popularity of ESP32 grew because of the growth of IoT or whether IoT grew because
of the introduction of ESP32 is debatable. If you know 10 people who have been part of the
firmware development for any IoT device, chances are that 7−8 of them would have worked on
ESP32 at some point. So what is the hype all about? Why has ESP32 become so popular so
quickly? Let's find out.

Before we delve into the actual reasons for the popularity of ESP32, let's take a look at some of its
important specifications. The specs listed below belong to the ESP32 WROOM 32 variant.−

 Integrated Crystal− 40 MHz


 Module Interfaces− UART, SPI, I2C, PWM, ADC, DAC, GPIO, pulse counter, capacitive
touch sensor
 Integrated SPI flash− 4 MB
 ROM− 448 KB (for booting and core functions)
 SRAM− 520 KB
 Integrated Connectivity Protocols− WiFi, Bluetooth, BLE
 On−chip sensor− Hall sensor
 Operating temperature range− −40 − 85 degrees Celsius
 Operating Voltage− 3.3V
 Operating Current− 80 mA (average)

With the above specifications in front of you, it is very easy to decipher the reasons for ESP32's
popularity. Consider the requirements an IoT device would have from its microcontroller (μC). If
you've gone through the previous chapter, you'd have realized that the major operational blocks of
any IoT device are sensing, processing, storage, and transmitting. Therefore, to begin with, the μC
should be able to interface with a variety of sensors. It should support all the common
communication protocols required for sensor interface: UART, I2C, SPI. It should have ADC and
pulse counting capabilities. ESP32 fulfills all of these requirements. On top of that, it also can
interface with capacitive touch sensors. Therefore, most common sensors can interface seamlessly
with ESP32.

Secondly, the μC should be able to perform basic processing of the incoming sensor data,
sometimes at high speeds, and have sufficient memory to store the data.
DEPARTMENT OF ECE HCET Page 14
IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

ESP32 has a max operating frequency of 40 MHz, which is sufficiently high. It has two cores,
allowing parallel processing, which is a further add-on. Finally, its 520 KB SRAM is sufficiently
large for processing a large array of data onboard. Many popular processes and transforms, like
FFT, peak detection, RMS calculation, etc. can be performed onboard ESP32. On the storage front,
ESP32 goes a step ahead of the conventional microcontrollers and provides a file system within the
flash. Out of the 4 MB of onboard flash, by default, 1.5 MB is reserved as SPIFFS (SPI Flash File
System). Think of it as a mini−SD Card that lies within the chip itself. You can not only store data,
but also text files, images, HTML and CSS files, and a lot more within SPIFFS. People have
displayed beautiful Webpages on WiFi servers created using ESP32, by storing HTML files within
SPIFFS.

Finally, for transmitting data, ESP32 has integrated WiFi and Bluetooth stacks, which have proven
to be a game-changer. No need to connect a separate module (like a GSM module or an LTE
module) for testing cloud communication. Just have the ESP32 board and a running WiFi, and you
can get started. ESP32 allows you to use WiFi in Access Point as well as Station Mode. While it
supports TCP/IP, HTTP, MQTT, and other traditional communication protocols, it also supports
HTTPS. Yep, you heard that right. It has a crypto−core or a crypto-accelerator, a dedicated piece of
hardware whose job is to accelerate the encryption process. So you cannot only communicate with
your web server, you can do so securely. BLE support is also critical for several applications. Of
course, you can interface LTE or GSM or LoRa modules with ESP32. Therefore, on the
'transmitting data' front as well, ESP32 exceeds expectations.

With so many features, ESP32 would be costing a fortune, right? That's the best part. ESP32 dev
modules cost in the ballpark of ₹ 500. Not only that, the chip dimensions are quite small (25 mm x
18 mm, including the antenna area), allowing its use in devices requiring a very small form factor.

Finally, ESP32 can be programmed using the Arduino IDE, making the learning curve much less
steep. Isn't that great? Are you excited to get your hands dirty with ESP32? Then let's start by
installing the ESP32 board in the Arduino IDE in the next chapter. See you there.

4.1.2 Pin configuration:


There are totally 39 digital Pins on the ESP32 out of which 34 can be used as GPIO and the
remaining are input only pins.

DEPARTMENT OF ECE HCET Page 15


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

The device supports 18-channels for 12-bit ADC and 2-channel for 8-bit DAC. It also has 16
channels for PWM signal generation and 10 GPIO pins supports capacitive touch features. The
ESP32 has multiplexing feature, this enables the programmer to configure any GPIO pin for PWM
or other serial communication through program. The ESP32 supports 3 SPI Interface, 3 UART
interface, 2 I2C interface, 2 I2S interface and also supports CAN protocol.

 3 UART interface: The ESP32 supports 3 UART interface for TTL communication. This would
require 3 sets of Rx and Tx pins. All the 6 pins are software configurable and hence any GPIO
pin can be programmed to be used for UART.
 External Interrupt: Again since the ESP32 supports multiplexing any GPIO pin can be
programmed to be used as an interrupt pin.
 GPIO23 (MOSI), GPIO19 (MISO), GPIO18 (CLK) and GPIO5 (CS): These pins are used
for SPI communication. ESP32 supports two SPI, this is the first set.
 GPIO13 (MOSI), GPIO12(MISO), GPIO14(CLK) and GPIO15 (CS): These pins are used
for SPI communication. ESP32 supports two SPI, this is the second set.
 GPIO21(SDA), GPIO22(SCL): Used for IIC communication using Wire library.
 Reset Pin: The reset pin for ESP32 is the Enable (EN) pin. Making this pin LOW, resets the
microcontroller.

4.1.3 ESP32S Features:


Low cost, compact and powerful Wi-Fi Module
Power Supply: +5V only
Current Consumption: 100Ma
I/O Voltage: 5v (max)
I/O source current: 12mA (max)

8512kB Flash Memory Can be used as Station or Access Point or both combinedSupports Deep
sleep (<10 uA) Supports serial communication hence compatible with many development
platform like Arduino Can be programmed using Arduino IDE or AT-commands or Lua Script

DEPARTMENT OF ECE HCET Page 16


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

4.1.4 Power:

As the operating voltage range of ESP8266 is 5V , the board comes with a LDO voltageregulator to
keep the voltage steady at 5v. It can reliably supply up to 600mA, which should be more than
enough when ESP8266 pulls as much as 100mA during RF transmissions. The output of the
regulator is also broken out to one of the sides of the board and labeled as 3V3. This pin can be used
to supply power to external components

4.1.5 ON BOARD SWITCHES &LED INDICATOR

The ESP32S NodeMCU features two buttons. One marked as RST located on the top left
corner is the Reset button, used of course to reset the ESP32S chip.The other FLASH
button on the bottom left corner is the download button used while upgrading firmware.

4.1.6 The ESP32S Peripherals and I/O


NodeMCU has total 17 GPIO pins broken out to the pin headers on both sides of the development

board. These pins can be assigned to all sorts of peripheral duties, including :

ADC channel – A 10-bit ADC channel


UART interface – UART interface is used to load code serially

PWM outputs – PWM pins for dimming LEDs or controlling motors.

SPI, I2C & I2S interface – SPI and I2C interface to hook up all sorts of sensors and
peripherals

4.1.7 SERIAL COMMUNICATION

The board includes CP2102 USB-to-UART Bridge Controller from Silicon Labs, which converts
USB signal to serial and allows your computer to program and communicate with the ESP8266
chip

DEPARTMENT OF ECE HCET Page 17


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

4.1.8 Specifications

Developer: ESP8266OpensourceCommunity
Type: Single-board microcontroller Operating
system: XTOS
CPU: ESP832S
Memory: 128kBytes
Storage: 4Mbytes
Power By: USB
Power Voltage: 3v ,5v (used with 3.3v Regulator which inbuilt on Board using Pin VIN)
Code : Arduino App
IDE Used : Arduino IDE
GPIO : 10

4.2 NEO 6M GPS:

FIG 5 : NEO 6M GPS


DEPARTMENT OF ECE HCET Page 18
IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

4.2.1 WORKING:

It can track up to 22 satellites over 50 channels and achieve the industry’s highest level of tracking
sensitivity i.e. -161 dB, while consuming only 45 mA current.

Unlike other GPS modules, it can perform 5 location updates in a second with 2.5m horizontal
position accuracy. The U-blox 6 positioning engine also has a Time-To-First-Fix (TTFF) of less
than 1 second.

4.2.2 SPECIFICATIONS:

Product Name: GPS module NEO-6M


Product Type: Integrated Circuit
Package: Tube, Tape, Trayor Bag
Stock In Stock
Lead Time: 1~3 Days
MOQ: Samples Offering
Shipment Weight 0.028 kg
Shipment Dimensions 9 × 6 × 2 cm

4.2.3 APPLICATIONS:
The NEO-6MV2 is a GPS (Global Positioning System) module and is used for
navigation. The module simply checks its location on earth and provides output data which is
longitude and latitude of its position.It is from a family of stand-alone GPS receivers featuring
the high performance u-blox 6 positioning engine. These flexible and cost effective receivers
offer numerous connectivity options in a miniature (16 x 12.2 x 2.4 mm) package. The
compact architecture, power and memory options make NEO-6 modules ideal for battery
operated mobile devices with very strict cost and space constraints. Its Innovative design
gives NEO-6MV2 excellent navigation performance even in the most challenging
environments.

DEPARTMENT OF ECE HCET Page 19


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

4.2.4 USES:
It can track up to 22 satellites over 50 channels and achieve the industry’s highest level of tracking
sensitivity i.e. -161 dB, while consuming only 45 mA current.

Unlike other GPS modules, it can perform 5 location updates in a second with 2.5m horizontal
position accuracy. The U-blox 6 positioning engine also has a Time-To-First-Fix (TTFF) of less
than 1 second.

FIG 6 : CIRCUIT DIAGRAM OF NEO -6M GPS

DEPARTMENT OF ECE HCET Page 20


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

4.3 DHT11–Temperature and Humidity Sensor:

FIG 7: DHT 11

DHT11 sensor consists of a capacitive humidity sensing element and a thermistor for
sensing temperature. The humidity sensing capacitor has two electrodes with a moisture
holding substrate as a dielectric between them. Change in the capacitance value occurs with
the change in humidity levels. The IC measure, process this changed resistance values and
change them into digital form.
For measuring temperature this sensor uses a Negative Temperature coefficient
thermistor, which causes a decrease in its resistance value with increase in temperature. To
get larger resistance value even for the smallest change in temperature, this sensor is usually
made up of semiconductor ceramics or polymers.

DEPARTMENT OF ECE HCET Page 21


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

The temperature range of DHT11 is from 0 to 50 degree Celsius with a 2-degree


accuracy. Humidity range of this sensor is from 20 to 80% with 5% accuracy. The sampling
rate of this sensor is 1Hz .i.e. it gives one reading for every second. DHT11 is small in size
with operating voltage from 3 to 5 volts. The maximum current used while measuring is
2.5mA.

4.4 BATTERY SUPPLY:

FIG 8 : BATTERY SUPPLY

DEPARTMENT OF ECE HCET Page 22


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

A rechargeable battery, storage battery, or secondary cell (formally a type of energy


accumulator), is a type of electrical battery which can be charged, discharged into a load, and
recharged many times, as opposed to a disposable or primary battery, which is supplied fully
charged and discarded after use. It is composed of one or more electrochemical cells. The term
"accumulator" is used as it accumulates and stores energy through a
reversible electrochemical reaction.

4.5 12V POWER SUPPLY:

FIG 9: 12 V POWER SUPPLY

DEPARTMENT OF ECE HCET Page 23


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

12V power supplies (or 12VDC power supplies) are one of the most common power
supplies in use today. In general, a 12VDC output is obtained from a 120VAC or 240VAC input
using a combination of transformers, diodes and transistors. 12V power supplies can be of two
types: 12V regulated power supplies, and 12V unregulated power supplies.12V regulated power
supplies come in three styles: Switching regulated AC to DC, Linear regulated AC to DC, and
Switching regulated DC to DC.

4.6 MQ-7 SENSOR:

FIG 10 : MQ 7 SENSOR
 This is a simple-to-use Carbon Monoxide (CO) sensor, suitable for sensing CO
concentrations in the air. The MQ-7 can detect CO-gas concentrations anywhere from 10 to
500ppm.

DEPARTMENT OF ECE HCET Page 24


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

 This sensor has a high sensitivity and fast response time. The sensor's output is an analog
resistance. The drive circuit is very simple; all you need to do is power the heater coil with
5V, add a load resistance, and connect the output to an ADC.
 This sensor comes in a package similar to our MQ-3 alcohol sensor, and can be used with
the breakout board below.

4.7 BUZZER:

FIG 11 : BUZZER

A buzzer or beeper is an audio signaling device,[1] which may be mechanical, electromechanical,


or piezoelectric (piezo for short). Typical uses of buzzers and beepers include alarm
devices, timers, train and confirmation of user input such as a mouse click or keystroke.

DEPARTMENT OF ECE HCET Page 25


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

4.8 LEDS:

FIG 12 : LEDS

A light-emittingdiode (LED) is a semiconductor device that emits light when current flows
through it. Electrons in the semiconductor recombine with electron holes, releasing energy in the
form of photons. The color of the light (corresponding to the energy of the photons) is determined
by the energy required for electrons to cross the band gap of the semiconductor.[5] White light is
obtained by using multiple semiconductors or a layer of light-emitting phosphor on the
semiconductor device.[6

DEPARTMENT OF ECE HCET Page 26


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

CHAPTER-5
SOFTWARE DESCRIPTION

DEPARTMENT OF ECE HCET Page 27


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

5.1 ARDUINO IDE

 The Arduino IDE is incredibly minimalistic, yet it provides a near complete environment for
most Arduino-based projects. The top menu bar has the standard options, including “File”
(new, load save, etc.), “Edit” (font, copy, paste, etc.), “Sketch” (for compiling and
programming), “Tools” (useful options for testing projects), and “Help”. The middle section
of the IDE is a simple text editor that where you can enter the program code. The bottom
section of the IDE is dedicated to an output window that is used to see the status of the
compilation, how much memory has been used, any errors that were found in the program,
and various other useful message.

 Projects made using the Arduino are called sketches, and such sketches are usually
written in a cut-down version of C++ (a number of C++ features are not included). Because
programming a microcontroller is somewhat different from programming a computer, there
are a number of device-specific libraries (e.g., changing pin modes, output data on pins,
reading analog values, and timers). This sometimes confuses users who think Arduino is
programmed in an “Arduino language.” However, the Arduino is, in fact, programmed in
C++. It just uses unique libraries for the device.To begin, download the Arduino IDE from
the Arduino website. Make sure to select the right version for your Operating System (OS).
For a full getting started guide for each OS, please refer to the Arduino guide. Once the
arduino.zip file has been downloaded, extract the file to a folder somewhere on your
computer. There is no install - simply open the folderand double click the .exe.
Note: If you are running Windows 8, you will likely see "The driver is not digitally signed"
when installing the driver. To install it, you must first disable driver signature enforcement.

5.1.1 Connecting the Arduino


 Connecting an Arduino board to your PC is quite simple. On Windows. Plug in the USB cable
- one end to the PC, and one end to the Arduino board. When prompted, select "Browse
my computer for driver" and then select the folder to which you extracted your original
Arduino IDE download. You may receive an error that the board is not a Microsoft
certified device - select “Install anyway.”

DEPARTMENT OF ECE HCET Page 28


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

 Your board should now be ready for programming. When programming your Arduino
board, it is important to know what COM port the Arduino is using on your PC. On
Windows, navigate to Start->Devices and Printers, and look for the Arduino. The COM
port will be displayed underneath Alternatively, the message telling you that the Arduino
has been connected successfully in the lower-left hand corner of your screen usually
specifies the COM port is it using.

5.1.1 Preparing the board

 Before loading any code to your Arduino board, you must first open the IDE. Double
click the Arduino .exe file that you downloaded earlier. A blank program, or "sketch,"
should open. The Blink example is the easiest way to test any Arduino board. Within
the Arduino window, it can be found under File->Examples->Basics->Blink. Before
the code can be uploaded to your board, two important steps are required. Select
your Arduino from the list under Tools->Board. The standard board used in
RBE 1001, 2001, and 2002 is the Arduino Mega 2560, so select the "Arduino
Mega 2560 or Mega ADK" option in the dropdown.

 Select the communication port, or COM port, by going to Tools->Serial Port.If you noted
the COM port your Arduino board is using, it should be listed in the dropdown menu. If
not, your board has not finished installing or needs to be reconnected.

5.1.2 Loading the code

The upper left of the Arduino window has two buttons: A checkmark to Verify your code,
and a right-facing arrow to upload it. Press the right arrow button to compile and upload the
Blink example to your Arduino board.The black bar at the bottom of the Arduino window is
reserved for messages indicating the success or failure of code uploading. A "Completed
Successfully" message should appear once the code is done uploading to your board.
If an error message appears instead, check that you selected the correct board and COM port
in the Tools menu, and check your physical connections.

DEPARTMENT OF ECE HCET Page 29


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

If uploaded successfully, the LED on your board should blink on/off once every
second. Most Arduino boards have an LED prewired to pin 13. It is very important that you
do not use pins 0 or 1 while loading code. It is recommended that you do not use those
pins ever.
Arduino code is loaded over a serial port to the controller. Older models use an FTDI chip
which deals with all the USB specifics. Newer models have either a small AVR that mimics
the FTDI chip or a built-in USB-to-serial port on the AVR micro-controller itself.

5.1 EMBEDDED C
5.1.1 Introduction to Embedded C

Looking around, we find ourselves to be surrounded by various types of embedded


systems. Be it a digital camera or a mobile phone or a washing machine, all of them has some
kind of processor functioning inside it. Associated with each processor is the embedded
software. If hardware forms the body of an embedded system, embedded processor acts as
the brain, and embedded software forms its soul. It is the embedded software which primarily
governs the functioning of embedded system.During infancy years of microprocessor based
systems, programs were developed using assemblers and fused into the EPROMs. There
used to be no mechanism to find what the program was doing. LEDs, switches, etc. were
used to check correct execution of the program. Some ‘very fortunate’ developers had In
circuit Simulators (ICEs), but they were too costly and were not quite reliable as well.As
time progressed, use of microprocessor-specific assembly-only as the programming language
reduced and embedded systems moved onto C as the embedded programming language of
choice. C is the most widely used programming language for embedded
processors/controllers. Assembly is also used but mainly to implement those portions of the
code where very high timing accuracy, code size efficiency, etc. are prime
requirements.Initially C was developed by Kernighan and Ritchie to fit into the space of 8K
and to write (portable) operating systems. Originally it was implemented on UNIX
operating systems. As it was intended for operating systems development, it can manipulate
memory addresses. Also, it allowed programmers to write very compact codes. This has
given it the reputation as the language of choice for hackers too.As assembly language
programs are specific to a processor, assembly language didn’t offer portability across
systems.

DEPARTMENT OF ECE HCET Page 30


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

To overcome this disadvantage, several high-level languages, including C, came up.


Some other languages like PLM, Modula-2, Pascal, etc. also came but couldn’t find
wideacceptance. Amongst those, C got wide acceptance for not only embedded systems, but
also for desktop applications. Even though C might have lost its sheen as mainstream
language for general purpose applications, it still is having a strong- hold in embedded
programming. Due to the wide acceptance of C in the embedded systems, various kinds of
support tools like compilers & cross-compilers, ICE, etc. came up and all this facilitated
development of embedded systems using C.Subsequent sections will discuss what is
embedded C, features of C language, similarities and difference between C and embedded C,
and features of embedded C programming.

5.1.1 Embedded systems programming

Embedded systems programming is different from developing applications on a desktop


computer. Key characteristics of an embedded system, when compared to PCs, are as
follows:
Embedded devices have resource constraints (limited ROM, limited RAM, limited
stackspace, less processing power)Components used in embedded system and PCs
are different; embedded systems typically use smaller, less power consuming
components. Embedded systems aremore tied to the hardware.Two salient features of
Embedded Programming are code speed and code size. Code speed is governed by the
processing power, timing constraints, whereas code size is governed by available program
memory and use of programming language. Goal of embedded system programming is to
get maximum features in minimum space and minimum time. Embedded systems are
programmed using different type of languages:

Machine Code
Low level language, i.e., assembly
High level language like C, C++, Java, Adafruit, etc.
Application level language like Visual Basic, scripts, Access, etc.

Assembly language maps mnemonic words with the binary machine codes that the
processor uses to code the instructions. Assembly language seems to be an obvious
choice for programming embedded devices. However, use of assembly language is
DEPARTMENT OF ECE HCET Page 31
IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

restricted to developing efficient codes in terms of size and speed. Also, assembly codes
lead to higher software development costs and code portability is not there.
Developing small codes are not much of a problem, but large programs/projects become
increasingly difficult to manage in assembly language. Finding good assembly
programmers has also become difficult nowadays. Hence high-level languages are
preferred for embedded systems programming.

5.1.1 Difference between C and embedded C

 Though C and embedded C appear different and are used in different contexts, they
have more similarities than the differences. Most of the constructs are same; the
difference lies in their applications.

 C is used for desktop computers, while embedded C is for microcontroller-based


applications. Accordingly, C has the luxury to use resources of a desktop PC like
memory, OS, etc. While programming on desktop systems, we need not bother about
memory. However, embedded C has to use with the limited resources (RAM, ROM,
I/O) on an embedded processor. Thus, program code must fit into the available
program memory. If code exceeds the limit, the system is likely to crash.
 Compilers for C typically generate OS dependent executables. It requires compilers
to create files to be downloaded to the microcontrollers/microprocessors where it
needs to run. Embedded compilers give access to all resources which is not provided
in compilers for desktop computer applications.
 Embedded systems often have the real-time constraints, which is usually not there
with desktop computer applications.
 Embedded systems often do not have a console, which is available in case of desktop
applications.
 So, what basically is different while programming with embedded C is the mindset;
for embedded applications, we need to optimally use the resources, make the
program codeefficient, and satisfy real time constraints, if any. All this is done
using the basic constructs, syntaxes, and function libraries of ‘C’.

DEPARTMENT OF ECE HCET Page 32


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

5.1 BLYNK APP DESCRIPTION

5.1.1 Introduction:
Blynk is a Platform with IOS and Android apps to control Arduino, Raspberry Pi and the
likes over the Internet. It’s a digital dashboard where you can build a graphic interface for
your project by simply dragging and dropping widgets.

5.1.2 Supported Hardware


Blynk App
 Blynk application can be found from the following links –
 Blynkapp

 After downloading the app, create an account and log in.You’ll also need to install the
Blynk Arduino Library, which helps generate the firmwarerunning on your ESP8266.

5.1.3 Create a Blynk Project

Click the “Create New Project” in the app to create a new Blynk app. Give it any name.
Blynk works with hundreds of hardware models and connection types.The Auth Token
is very important – you’ll need to stick it into your ESP8266’s firmware. For now, copy
it down or use the “E-mail” button to send it to yourself.

5.1.4 Add Widgets To The Project

Then you’ll be presented with a blank new project. To open the widget box, click in the
project window to open. We are selecting a button to control Led connected with
NodeMCU.Click on Button. Give name to Button say led. Under OUTPUT tab- Click
pin and select the pin to which led is connected to NodeMCU,here it is digital pin 2,
hence select digital and under pin D2. And Click continue.Under MODE tab- Select
whether you want this button as “push button” or “Switch”. You have successfully
created a GUI for Arduino.

DEPARTMENT OF ECE HCET Page 33


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

5.1.1 Upload The Firmware

Now that your Blynk project is set-up, open Arduino and navigate to the
ESP32S_Standaloneexample in the File > Examples > Blynk > Boards WIFI>
ESP32S_Standalone menu.

5.1.2 Stand Alone Programming Code:

Before uploading, make sure to paste your authorization token into the auth []
variable. Also make sure to load your Wifi network settings into the Blynk.
Begin(auth, “said”, “pass”) function.

5.1.3 Execution
After the app has uploaded, open the serial monitor, setting the baud rate to 9600.
Wait for the “Ready” message. Then click the “Run” button in the top right corner
of the Blynk app. Press the button and watch the LED. Then add more widgets to
the project. They should immediately work on the ESP8266 without uploading any
new firmware.

5.3.8 Output:
The output will be displayed on the phone when we turn on the device. The device is
automatically connected to the blynk iot.the device has automatically connect to the output
.the values are shown in the blynk iot and the readings are changing with seconds.

The output consists of humidity, temperature, location, gas.

DEPARTMENT OF ECE HCET Page 34


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.
IOT BASED SMART HELMET APPLICATIONS
 THIS TYPE OF PRODUCT IS USED IN COAL MINE AND UNDERGROUND
 A smart helmet is a type of protective headgear used by the rider which makes bike
driving safer than before. The main purpose of this helmet is to provide safety for the
rider.
 For accident prevention, smart helmets are responsible for detecting drowsiness,
speed and blinking, and providing warning alerts to prevent accidents. In the rescue
request, the smart helmets detect a traffic accident and make a rescue request through
text or phone calls in the event of an accident.
 There are a lot of things that degrade over time, like the foam and glue used in the
helmet. Your body oils, sweat and UV rays also take a toll on the material, and after
five years, it is for sure compromised and not offering the intended level of protection

FIG 13: SMART HELMET

DEPARTMENT OF ECE HCET Page 35


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

CHAPTER-6
RESULT&DISCUSSION

DEPARTMENT OF ECE HCET Page 36


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.
6.1 RESULT:

FIG 14 : CIRCUIT CONNECTION

DEPARTMENT OF ECE HCET Page 37


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

OUTPUT:

FIG : 15 – SMART HELMET OUTPUT

6.2 CONCLUSION

The Arduino microcontroller is used to create a prototype for a mine safety system
in this proposed method. This device is made from each hardware and software program
factors. The hardware is made from several sensors, while the software program is made of
Android software that connects to the Arduino board and other hardware additives via the
internet of things.

DEPARTMENT OF ECE HCET Page 38


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.
The android-based totally programme consists of signals and a database in which
readings from sensors are presented and inserted the usage of hardware. The use of the
wireless community to growth mine safety is a solution for reaching each protection and
development in mining initiatives. This look at objectives to automate the method of mining
unit monitoring and handing over updates via cell networks. This gadgets hardware
components talk with all the sensors. This project is used to

optimise the utilisation of the mining subject without the intervention of human
beings with the aid of using sensors that screen the environment and a microcontroller that
switches on/off the buzzer routinely in the event of unstable condition maintaining mining
operation these days necessitates ensuring the protection and well-being of employees and
property. The employment of arduino, gasoline sensors, Temperature sensors, and humidity
sensors inside sensors inside the improvement of coal mine security for employees maintains
to screen mining protection and replace data at the IOT websites

6.3 FUTURE SCOPE:

With the developing developments future work of this experimentation may


incorporate, greater improvement of the framework by utilizing other progressed sensors for
checking the underground. Dangers. Likewise, every one of the underground tasks can be
completed from the beginning. New creating correspondence advancements can be utilized
for fast information move in mix with keen sensors for detecting the mine conditions.
Additionally, more IOT empowered frameworks can be created for further developed uses.

DEPARTMENT OF ECE HCET Page 39


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.

REFERENCES;

[1] Deokar, S. R., & Wakode, J. S, Coal mine safety monitoring and alerting system.
International
[2] Research Journal of Engineering and Technology (IRJET), 4(03).2017;
[3] Singh, A., Singh, U. K., & Kumar, D. IoT in mining for sensing, monitoring and
prediction of underground mines roof support. In 2018 4th International Conference on
Recent Advances in Information Technology (RAIT) (pp. 1-5). IEEE.2018;
[4] A. Haldorai and A. Ramu, Security and channel noise management in cognitive radio
networks, Computers & Electrical Engineering, vol. 87, p. 106784, Oct. 2020.
doi:10.1016/j.compeleceng.2020.106784
[5] A. Haldorai and A. Ramu, Canonical Correlation Analysis Based Hyper Basis
Feedforward Neural Network Classification for Urban Sustainability, Neural Processing
Letters,Aug.2020.doi:10.1007/s11063-020-10327-3
[6] System [J]. Computer Measurement & Control, 4.2013
[7] Singh, A., Singh, U. K., & Kumar, D. (2018, March). IoT in mining for sensing,
monitoring and prediction of underground mines roof support. 4th International Conference
on Recent Advances in Information Technology (RAIT) (pp. 1-5). IEEE.2018
[8] Li-min, Y., Anqi, L., Zheng, S., & Hui, L. Design of monitoring system for coal mine
safety based on wireless sensor network. In 2008 IEEE/ASME International Conference on
Mechtronic and Embedded Systems and Applications (pp. 409-414). IEEE.2018
[9] Wei, S., & Li-Li, L. (2009, May). Multi-parameter monitoring system for coal mine based
on wireless sensor network technology. International Conference on Industrial Mechatronics
and Automation (pp. 225-227). IEEE.2009 Retra

DEPARTMENT OF ECE HCET Page 40


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.
APPENDIX

#define BLYNK_TEMPLATE_ID "TMPLUn74g1oD"

#define BLYNK_DEVICE_NAME "Smart Helmet"


#define BLYNK_AUTH_TOKEN "CiPqgtlZACd39ZT_6jYaSg7zn09rKqqB"
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <DHT.h>
TinyGPSPlus gps; // The TinyGPS++ object
WidgetMap myMap(V0); // V0 for virtual pin of Map Widget
unsigned int move_index = 1; // fixed location for now
#define DHTPIN 33
#define gaspin 39
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Robotics";
char pass[] = "makeindia";
double latitude;
double longitude;
int rawgas;
static const int RXPin = 17, TXPin = 16;
static const uint32_t GPSBaud = 9600;
SoftwareSerial ss(RXPin, TXPin);
void setup() {
// put your setup code here, to run once:

DEPARTMENT OF ECE HCET Page 41


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.
Blynk.begin(auth, ssid, pass);
dht.begin();
Serial.begin(115200);
ss.begin(GPSBaud);
}
int h,t,ppm;
void loop() {
// put your main code here, to run repeatedly:
Blynk.run();
h = dht.readHumidity();
t = dht.readTemperature();
rawgas = analogRead(gaspin);
ppm = map(rawgas,0,4095,0,1000);
Serial.print("Gas: ");
Serial.println(ppm);
Blynk.virtualWrite(V0,ppm);
Serial.print("T: ");
Serial.println(t);
Blynk.virtualWrite(V1,t);
Serial.print("H: ");
Serial.println(h);
Blynk.virtualWrite(V2,h);
Serial.print("Lat: ");
Serial.println(latitude,6);
Blynk.virtualWrite(V3,latitude);
Serial.print("Lon: ");
Serial.println(longitude,6);
Blynk.virtualWrite(V4,longitude);
while (ss.available() > 0)
if (gps.encode(ss.read()))
displayInfo();

//myMap.location(move_index, latitude, longitude, "Women_Location");

DEPARTMENT OF ECE HCET Page 42


IoT BASED COAL MINE SAFETY MONITORING & ALERTING SYSTEM.
}

void displayInfo() {

if (gps.location.isValid()) {
latitude = (gps.location.lat());
longitude = (gps.location.lng());

}
}

DEPARTMENT OF ECE HCET Page 43

You might also like