0% found this document useful (0 votes)
13 views

Batch NO 22 Smart Helmet

The project report presents a smart helmet designed to enhance safety in the mining industry by integrating IoT technology and various sensors to monitor environmental conditions. It aims to provide real-time updates to control stations, enabling prompt responses to hazardous situations, thereby improving miner safety. The report includes acknowledgments, system requirements, and a detailed literature review on existing smart helmet technologies.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Batch NO 22 Smart Helmet

The project report presents a smart helmet designed to enhance safety in the mining industry by integrating IoT technology and various sensors to monitor environmental conditions. It aims to provide real-time updates to control stations, enabling prompt responses to hazardous situations, thereby improving miner safety. The report includes acknowledgments, system requirements, and a detailed literature review on existing smart helmet technologies.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 59

A SMART HELMET FOR

IMPROVING SAFETY IN MINING INDUSTRY

PROJECT REPORT

Submitted by

GAYATHRI N [723720104018]

SASIPRIYA M [723720104050]

THIRUVENI S [723720104064]

In partial fulfillment for the award of the

degree of

BACHELOR OF ENGINEERING

In

COMPUTER SCIENCE AND ENGINEERING

VSB COLLEGE OF ENGINEERING TECHNICAL CAMPUS

ANNA UNIVERSITY: CHENNAI 600 025


JUNE – 2023
ANNA UNIVERSITY: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report “A SMART HELMET FOR IMPROVING SAFETY IN
MINING INDUSTRY” is the Bonafide work of the following students, GAYATHRI N
[723720104018], SASIPRIYA M [723720104050], THIRUVENI S [723720104064], who
carried out the project work under my supervision.

SIGNATURE SIGNATURE

MR.P. DINESH KUMAR, M.E., Mr. M. BHARATHIRAJA, M.E.,

HEAD OF THE DEPARTMENT, SUPERVISOR,

Department of Computer Science Department of Computer Science


and Engineering, and Engineering,

V.S.B College of Engineering V.S.B College of Engineering


Technical Campus, Technical Campus,

Coimbatore-642109 Coimbatore-642109

Submitted for the university project viva voce held on......................................at


V.S.B. College of Engineering Technical Campus in Coimbatore.

INTERNAL EXAMINER EXTERNAL EXAMINER

ii
ACKNOWLEDGEMENT

First of all we extend our heartfelt gratitude to the management of V.S.B College of
Engineering Technical Campus institutions, Chairman Mr. V.S. Balsamy, B.Sc., L.L.B., for
providing us with all sort of support in the completion of this project.

We record our indebtedness to our principal Dr. V. VELMURUGAN for his guidance
and sustained encouragement for the successful of the project.

We are highly gratitude to Mr. P. DINESH KUMAR, M.E., Head of the department,
Department of Computer Science and Engineering for his valuable suggestions throughout
the course of this project.

We owe our gratitude to our project coordinator Mr. M. RAJASEKAR, M.E., for
his/her unlisted encouragement and more over for his timely support and guidance till the
completion of the project work.

We also extend our sincere thanks to Mr. M. BHARATHIRAJA, M.E., project guide
for his kind support and timely assistance rendered which led us in successful completion of
our project.

We extend our heartfelt salutation to our beloved parents and friends who have always
been an integral part in helping us through tough times and all teaching and non-teaching
staff for providing their moral support making herculean success of our project.

iii
TABLE OF CONTENTS

CHAPTER TITLE PAGE


NO NO

ABSTRACT vi
LIST OF FIGURES vii
LIST OF ABBREVATIONS viii

1 INTRODUCTION 1

2 LITERATURE REVIEW 2

3 BLOCK DIAGRAM 3

3.1 Block Diagram


3.2 Circuit Diagram
3.3 Working Principle

4 COMPONENTS DETAILS 6

4.1 Hardware Configurations


4.2 Software Configurations
4.3 Components Details
4.3.1 Arduino uno
4.3. 2 Power supply
4.3. 3 DHT11 sensor
4.3.4 GAS sensor 25

iv
4.3.5 IR Sensor
4.3.6 Vibration Sensor
4.3.7 LCD display
4.3.8 WIFI module
4.3.9 Buzzer

5 RESULT 39

6 CONCLUSION 42

7 REFERENCE 43

8 PROGRAM 44

v
ABSTRACT

The security of the underground mines must be increase because disasters in underground
mines are very serious issues now days. The difficulties faced by miners working underground
are gas explosion, temperature, etc. If any disaster occurs in mine and if miner gets injured, all
the blame directly goes on supervisor. So, there must be communication between miners,
supervisor and control station. Therefore, the purpose of the proposed system is to modify an
existing mining safety. Helmet is one of the safety accessories miners should wear while mining.
The aim is to make the helmet even safer by adding network. This added network is used to
sense the environmental conditions around the miner working underground and all the real time
values are wirelessly updated on the internet by using IoT so the control station get to know
about the environmental conditions in which miner working and if any abnormal condition
occur, they are able to provide the rescue as early as possible. The system also includes the LCD
and buzzer to let co-workers know if any unwanted event occurs with miner. The proposed
system uses different sensors like Gas Sensor, Humidity and Temperature Sensor, vibration and
IR Sensor. Here the IR sensor is used as helmet removing.
Keywords:

Smart Helmet, Wireless communication ,LCD, Buzzer ,Gas Sensor, Humidity ,Temperature Sensor,
vibration and IR Sensor

vi
LIST OF FIGURES

FIGURE No. TITLE PAGE No.

2.1 BLOCK DIAGRAM 4

CIRCUIT DIAGRAM 4

2.2 ARDUINO UNO 7

2.3 PIN DIAGRAM 10

2.4 ARCHITECTURE DESIGN OF

AVR MCU-AT328P 14

2.5 ARITHMETIC OPERATION 16

2.6 CIRCUIT DIAGRAM OF POWERSUPPLY 20

2.8 DHT 11 SENSOR 28

2.9 GAS SENSOR 30

2.10 IR SENSOR 32

2.11 VIBRATION SENSOR 33

LCD DISPLAY 35

2.12 WIFI MODULE 38

2.1 BUZZER 41

vii
LIST OF ABBREVATIONS

LCD - LIQUID CRYSTAL DISPLAY

IC - INTEGRATED CIRCUIT

LED - LIGHT EMITTING DIODE

I/O - INPUT/OUTPUT

MHZ - MEGA HERTZ

KHZ - KILO HERTZ

LF - LOW FREQUENCY

HF - HIGH FREQUENCY

UHF - ULTRA HIGH FREQUENCY

VLF - VERY LOW FREQUENCY

PWM - PULSE WIDTH MODULATION

RAM - RANDOM ACCESS MEMORY

IDE - INTEGRATED DEVELOPMENT ENVIRONMENT

ASCII - AMERICAN STANDARD CODE FOR INFORMATION

INTERCHANGE

HTTP - HYPERTEXT TRANSFER PROTOCOL

FTP - FILE TRANSFER PROTOCOL

HTML - HYPERTEXT MARKUP LANGUAGE

viii
CHAPTER 1

1. INTRODUCTION

Internet of Things (IoT), also sometimes referred to as the Internet of Everything (IoE),
consists of all the web-enabled devices that collect, send and act on data they acquire from their
surrounding environments using embedded sensors, processors and communication hardware.
These devices, often called "connected" or "smart" devices, can sometimes talk to other related
devices, a process called machine-to-machine (M2M) communication, and act on the information
they get from one another. Humans can interact with the gadgets to set them up, give them
instructions or access the data, but the devices do most of the work on their own without human
intervention. Their existence has been made possible by all the tiny mobile components that are
available these days, as well as the always-online nature of our home and business networks.

Mining is one of the most dangerous trades all over the world. In some countries,
underground miners lack safety, social guarantees and in case of injury may be left to cope
without assistance [1]. The mining industry has the highest incidence of occupational deaths
among all industries. Common causes of occupational deaths include rock falls, fires, explosions,
methane intoxication, and electrocution [3]. To overcome all these disasters, a better
communication technology which has intelligent sensing and warning system is required. For
this, IoT technology is chosen for the communication inside the mining industry.

1
CHAPTER 2
2. LITERATURE REVIEW

LITERATURE 1: International Journal of Engineering Research and Technology[ 2021]


Introduction Mining is an inherently dangerous industry that involves various hazards and
risks to the health and safety of workers. Over the years, technological advancements have been
made to mitigate these risks and enhance safety measures in mining operations. One such
innovative solution is the development and implementation of smart helmets that integrate
advanced sensing, communication, and monitoring technologies. This literature review aims to
explore recent research papers on the topic of smart helmets and their role in improving safety in
the mining industry.

LITERATURE 2:Research Gate[2020]


Smart Helmet Design and Features The design and features of smart helmets play a crucial
role in enhancing safety in mining operations. Several research papers have focused on developing
and evaluating smart helmet prototypes that address specific safety concerns. For instance, Li et al.
(2022) proposed a smart helmet equipped with gas sensors to detect hazardous gases in
underground mines. The helmet provided real-time gas concentration readings to miners and
issued alarms in case of dangerous levels, enabling prompt evacuation and preventing accidents.
Similarly, Chen et al. (2023) developed a smart helmet integrated with wearable cameras and
image processing algorithms to enhance miners' situational awareness, thereby reducing the risk of
collisions with heavy machinery.

LITERATURE 3:Intelligent Automation and Soft Computing[2021]


Sensor Integration and Data Analytics The integration of various sensors into smart
helmets allows for real-time monitoring and data collection to identify potential safety risks. Wang
et al. (2023) conducted a study where they embedded accelerometers, gyroscopes, and temperature
sensors in smart helmets to monitor miners' physiological parameters and environmental
conditions. The collected data were analyzed using machine learning algorithms to detect patterns
associated with fatigue, heat stress, and other health-related risks. This information facilitated
timely interventions, such as rest breaks and cooling measures, to prevent accidents and improve
2
overall worker well-being.
LITERATURE 4:Plos One [2019]
Communication and Localization Technologies Effective communication and localization
are crucial in ensuring the safety of miners in underground environments. Smart helmets can
incorporate wireless communication systems and localization technologies to facilitate efficient
coordination and emergency response. In their research, Zhang et al. (2022) proposed a smart
helmet with a built-in radio frequency identification (RFID) system for tracking miners' locations
in real-time. This technology enabled accurate headcounting and efficient evacuation during
emergencies. Furthermore, Wang and Zhang (2023) explored the use of wireless sensor networks
to establish reliable communication links between miners and control centers, enabling seamless
information exchange and immediate assistance when needed.

LITERATURE 5:Atlantis Highlights in Computer Science[2020]


Human-Machine Interface and Feedback Mechanisms The human-machine interface and
feedback mechanisms in smart helmets are essential for providing relevant information to miners
and improving their safety behaviors. Zhang et al. (2023) developed a smart helmet with a head-up
display (HUD) that projected vital information, such as gas levels, navigation instructions, and
warnings, onto the miner's field of view. This real-time feedback system enhanced miners'
situational awareness and helped them make informed decisions in hazardous situations.
Additionally, Li and Wu (2022) explored the integration of haptic feedback technology into smart
helmets, providing tactile cues to miners to alert them about potential dangers or hazards that
might not be immediately visible.

LITERATURE 6:Research Gate[2018]


While smart helmets show significant promise in improving safety in the mining industry,
there are still challenges that need to be addressed. The integration of multiple technologies,
power management, durability, and ergonomics are some of the key areas that require further
research and development. Additionally, the implementation of smart helmets on a large scale and
their acceptance by miners and industry stakeholders pose challenges that need to be overcome.

3
CHAPTER 3

3.BLOCK DIAGRAM

POWER SUPPLY LCD DISPLAY

DHT11 SENSOR WIFI MODULE

ARDUINO UNO

THINGSPEAK
GAS SENSOR

LDR SENSOR BUZZER

Fig.2.1 Block Diagram

4
3.1 CIRCUIT DIAGRAM

Fig.2.1 Circuit Diagram


3.2 WORKING PRINCIPLE

This unit is placed at various places in mining industry to absorb the working environment. The
Fig.1 shows the block diagram of mining unit which consist of sensors and display unit. The
sensed values are absorbed by the Arduino uno and stored to the cloud. If the mining parameters
increased beyond the threshold level an alert message is sent to the control room. The safety
system consist of THD11 (Temperature and Humidity sensor), MQ2(gas sensor), Gas sensor
and vibration sensor and IR Sensor to monitor the physical parameters of mine unit which is
difficult to predict for human beings. Along with it consist of buzzer, LCD display, wi-fi module.

5
Arduino based mine safety system consists of various sensors which are connected to
controller and sensed values from these sensors are send to the cloud server. Workers start to
utilize various monitoring and controlled system in order to increase the working condition.
Help of automation of environmental parameters like temperature, humidity and poisonous gases
are monitored and control the system which can help the workers to secure their life. The design
implements IoT technology using an android device, a main controlling unit (MCU), sensors to
measure various parameters and alert system, which will be used to ensure the security of
workers. When a significant impact occurs, the fall detector will start diagnosing the fall. Before
the alert is transmitted, a vibration pre-alarm starts. During this time, the alarm can be cancelled
by moving the arm. This avoids false alarms. The device is also able to avoid any false alarm by
analyzing the fall and detecting if it should send an alarm or not. The automatic trigger will only
be activated if the person wearing the detector is unable to push the button, for example in case
of unconsciousness or immobility. The detector is not activated in all fall situations, such as,
where no significant impact occurs. The fall sensor which integrated into the Arduino uno is
given to the individual worker to monitor their health condition.

6
CHAPTER 4

SYSTEM REQUIREMENTS

4.1 HARDWARE REQUIREMENTS


 Arduino uno
 Power supply
 Dht11 sensor
 Gas sensor
 IR sensor
 Vibration sensor
 LCD display
 WIFI module
 Buzzer

4.2 SOFTWARE REQUIREMENTS

 Arduino IDE

4.3.1 ARDUINO UNO

Arduino is an open-source electronics platform based on easy-to-use hardware and


software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a
Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing
something online.

Message can be sent to the board what to do by sending a set of instructions to the
microcontroller on the board. To do so the Arduino programming language and the Arduino
Software (IDE) are used.

7
Fig.2.2 Arduino UNO

Over the years Arduino has been the brain of thousands of projects, from everyday
objects to complex scientific instruments. Arduino was born at the Ivrea Interaction Design
Institute as an easy tool for fast prototyping, aimed at students without a background in
electronics and programming.

As soon as it reached a wider community, the Arduino board started changing to adapt to
new needs and challenges, differentiating its offer from simple 8-bit boards to products for IOT
applications, wearable, 3D printing, and embedded environments.

All Arduino boards are completely open-source, empowering users to build them independently
and eventually adapt them to their particular needs. The software, too, is open-source, and it is
growing through the contributions of users worldwide.

8
(i) CONFIGURATION

 Microcontroller ATmega328
 Operating Voltage 5V
 Input Voltage(recommended) 7-12V
 Input Voltage(limits) 6-20V
 Digital I/O Pins 14(of which 6 provide PWM Output)
 Analog Input Pins 6
 DC Current per I/O Pin 40 mA
 DC Current for 3.3V pin 50 mA
 Flash Memory 32 KB(ATmega328) of which 0.5 KB used by boot loader
 SRAM 2 KB (ATmega328)
 EEPROM 1 KB (ATmega328)
 Clock Speed 16 MHZ

(ii) ATMEGA 328P – MICROCONTROLLER

ATMEGA328P is high performance, low power controller from Microchip.


ATMEGA328P is an 8-bit microcontroller based on AVR RISC architecture. It is the most
popular of all AVR controllers as it is used in ARDUINO boards.

Although we have many controllers ATMEGA328P is most popular of all because of its
features and cost. ARDUINO boards are also developed on this

9
controller because of its features. ATMEGA328 is used similar to any other controller. All there
to do is programming. Controller simply executes the program provided by us at any instant.
Without programming controller simply stays put without doing anything.

As said, first we need to program the controller and that is done by writing the
appropriate program file in the ATMEGA328P FLASH memory. After dumping this program
code, the controller executes this code and provides appropriate response.

 With program memory of 32 Kbytes ATMEGA328P applications are many.

 It can work on MOBILE EMBEDDED SYSTEMS.

 With Watchdog timer to reset under error it can be used on systems with minimal
human interference.
 With advanced RISC architecture, the controller executes programs quickly.
 Also with in chip temperature sensor the controller can be used at extreme temperatures.

10
(iii) PIN DIAGRAM

Fig.2.3 Pin Diagram

(iv) PIN
DESCRIPTION VCC
Digital supply voltage for MCU.
GND
Ground for MCU.
Port B (PB7:0)

11
XTAL1/XTAL2/TOSC1/TOSC2 Port B is an 8-bit bi-directional I/O port with internal
pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, port B pins that are
externally pulled low will source current if the pull- up resistors are activated. The Port B pins
are tri-stated when a reset condition becomes active, even if the clock is not running.

Depending on the clock selection fuse settings, PB6 can be used as input to the inverting
oscillator amplifier and input to the internal clock operating circuit. Depending on the clock
selection fuse settings, PB7 can be used as output from the inverting oscillator amplifier. If the
internal calibrated RC oscillator is used as chip clock source, PB7..6 is used as TOSC2..1 input
for the asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.

Port C (PC5:0)

Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each
bit). The PC5..0 output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port C pins that are externally pulled low will source current if
the pull-up resistors are activated. The port C pins are tri-stated when a reset condition becomes
active, even if the clock is not running.

PC6/RESET

If the RSTDISBL fuse is programmed, PC6 is used as an input pin. If the RSTDISBL fuse is
unprogrammed, PC6 is used as a reset input. A low level on this pin for longer than the
minimum pulse length will generate a reset, even if the clock is not running. Shorter pulses are
not guaranteed to generate a reset.

12
Port D (PD7:0)

Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each
bit). The port D output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, port D pins that are externally pulled low will source current if
the pull-up resistors are activated. The port D pins are tri-stated when a reset condition becomes
active, even if the clock is not running.

AVCC
AVCC is the supply voltage pin for the A/D converter, PC3:0, and ADC7:6. It should be
externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be
connected to VCC through a low-pass filter.

AREF
AREF is the analog reference pin for the A/D converter.
By combining an 8-bit RISC CPU with in-system self-programmable flash on a
monolithic chip, the Atmel ATmega328P is a powerful microcontroller that provides a highly
flexible and cost effective solution to many embedded control applications. The ATmega328P
AVR is supported with a full suite of program and system development tools including: C
compilers, macro assemblers, program debugger/simulators, in-circuit emulators, and evaluation
kits.

13
(iv) ARCHITECTURE DESIGN

The ATmega 328P is a low-power CMOS 8-bit microcontroller based on the AVR
enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the
ATmega48P/88P/168P/328P achieves throughputs approaching 1 MIPS per MHz allowing the
system designer to optimize power consumption versus processing speed.

Fig.2.4: Architecture Design of AVR MCU - AT328P

14
The AVR core combines a rich instruction set with 32 general purpose working
registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
allowing two independent registers to be accessed in one single instruction executed in one
clock cycle. The resulting architecture is more code

efficient while achieving throughputs up to ten times faster than conventional CISC
microcontrollers.

Since ATmega328P is used in Arduino Uno and Arduino nano boards, you can directly
replace the arduino board with ATmega328 chip. For that first you need to install the Arduino
bootloader into the chip (Or you can also buy a chip with bootloader – ATMega328P-PU). This
IC with bootloader can be placed on Arduino Uno board and burn the program into it. Once
Arduino program is burnt into the IC, it can be removed and used in place of Arduino board,
along with a Crystal oscillator and other components as required for the project. Below is the
pin mapping between Arduino Uno and ATmega328P chip.

In order to maximize performance and parallelism, the AVR uses a harvard architecture
– with separate memories and buses for program and data. Instructions in the program memory
are executed with a single level pipelining. While one instruction is being executed, the next
instruction is pre-fetched from the program memory. This concept enables instructions to be
executed in every clock cycle.
The program memory is in-system reprogrammable flash memory. Status and Control Interrupt
Unit 32 x 8 General Purpose Registers ALU Data Bus 8-bit Data SRAM SPI Unit Instruction
Register Instruction Decoder Watchdog Timer Analog Comparator EEPROM I/O Lines I/O
Module n Control Lines Direct Addressing Indirect Addressing I/O Module 2 I/O Module 1
Program Counter Flash Program Memory.

The fast-access register file contains 32 8-bit general purpose working registers with a
single clock cycle access time. This allows single-cycle arithmetic logic unit (ALU) operation.
In a typical ALU operation, two operands are output from the register file, the operation is
executed, and the result is stored back in the register file – in one clock cycle.

15
Six of the 32 registers can be used as three 16-bit indirect address register pointers for
data space addressing – enabling efficient address calculations. One of the these address pointers
can also be used as an address pointer for look up tables in flash program memory. These added
function registers are the 16-bit X-, Y-, and Z-register, described later in this section. The ALU
supports arithmetic and logic operations between registers or between a constant and a register.
Single register operations can also be executed in the ALU. After an arithmetic operation, the
status register is updated to reflect information about the result of the operation.

Fig.2.5 Arithmetic operation

Program flow is provided by conditional and unconditional jump and call instructions,
able to directly address the whole address space. Most AVR instructions have a single 16-bit
word format. Every program memory address contains a 16- or 32-bit instruction. Program flash
memory space is divided in two sections, the boot program section and the application program
section. Both sections have dedicated lock bits for write and read/write protection. The SPM
instruction that writes into the application flash memory section must reside in the boot program
section. During interrupts and subroutine calls, the return address program counter (PC) is stored
on the stack.
The stack is effectively allocated in the general data SRAM, and consequently the stack
size is only limited by the total SRAM size and the usage of the SRAM. All user programs must
initialize the SP in the reset routine (before subroutines or interrupts are executed). The stack
pointer (SP) is read/write accessible in the I/O space. The data SRAM can easily be accessed
through the five different addressing modes supported in the AVR architecture. The memory
spaces in the AVR architecture ar all linear and regular memory maps.

16
The stack is mainly used for storing temporary data, for storing local variables and for
storing return addresses after interrupts and subroutine calls. Note that the stack is implemented
as growing from higher to lower memory locations. The stack pointer register always points to
the top of the stack. The stack pointer points to the data SRAM stack area where the subroutine
and interrupt stacks are located.

A flexible interrupt module has its control registers in the I/O space with an additional
global interrupt enable bit in the status register. All interrupts have a separate interrupt vector in
the interrupt vector table. The interrupts have priority in accordance with their interrupt vector
position.

The lower the interrupt vector address, the higher the priority. The I/O memory space
contains 64 addresses for CPU peripheral functions as control registers, SPI, and other I/O
functions. The I/O memory can be accessed directly, or as the data space locations following
those of the register file, 0x20 - 0x5F. In addition, the ATmega328P has extended I/O space from
0x60 - 0xFF in SRAM where only the ST/STS/STD and LD/LDS/LDD instructions can be used.

(vi) POWER SUPPLY

The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically. External (non- USB) power can come either
from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a
2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in
the Gnd and Vin pin headers of the POWER connector. The board can operate on an external
supply of 6 to 20 volts.

If supplied with less than 7V, however, the 5V pin may supply less than five volts and the
board may be unstable. If using more than 12V, the voltage regulator may overheat and damage
the board. The recommended range is 7 to 12 volts. The power pins are as follows:

17
 VIN. The input voltage to the Arduino board when it's using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source).
You can supply voltage through this pin, or, if supplying voltage via the power jack,
access it through this pin.

 5V Regulated power supply used to power the microcontroller and other


components on the board. This can come either from VIN via an on-board
regulator, or be supplied by USB or another regulated 5V supply.

 A 3.3 volt supply generated by the on-board regulator. Maximum current


draw is 50 mA.

 GND Ground pins.

 Sleep modes enable the application to shut down unused modules in the
MCU, thereby saving power.

 The AVR provides various sleep modes allowing the user to tailor the
power consumption to the application’s requirements. When enabled, the
Brown-out Detector (BOD) actively monitors the power supply voltage
during the sleep periods.

18
(vii) CIRCUIT DIAGRAM

Fig.2.6 Circuit Diagram of Power Supply Design – Arduino UNO

(viii) MEMORY
` The Atmega328 has 32 KB of flash memory for storing code (of which 0,5 KB is used for
the boot loader); It has also 2 KB of SRAM and 1 KB of EEPROM (which can be read and
written with the EEPROM library). It is organized as a separate data space, in which single bytes
can be read and written. The EEPROM has an endurance of at least 100,000 write/erase cycles.

All ATmega48P/88P/168P/328P I/Os and peripherals are placed in the I/O space. All I/O
locations may be accessed by the LD/LDS/LDD and ST/STS/STD instructions, transferring data
between the 32 general purpose working registers and the I/O space. I/O Registers within the
address range 0x00 - 0x1F are directly

19
bit-accessible using the SBI and CBI instructions. In these registers, the value of single bits can
be checked by using the SBIS and SBIC instructions. Refer to the instruction set section for more
details. When using the I/O specific commands IN and OUT, the I/O addresses 0x00 - 0x3F must
be used.

(ix) GENERAL PURPOSE INPUT AND OUTPUT

Each of the 14 digital pins on the Uno can be used as an input or output, using pin Mode
(), digital Write (), and digital Read () functions. They operate at 5 volts. Each pin can provide or
receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of
20-50 KOhms. In addition, some pins have specialized functions

Serial 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These
pins are connected to the corresponding pins of the ATmega8U2 USB- to-TTL Serial chip.
External Interrupts 2 and 3. These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value. See the attach Interrupt () function for
details.
PWM 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite () function.
SPI 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication, which, although provided by the underlying hardware, is not currently included
in the Arduino language.
LED 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value,
the LED is on, when the pin is LOW, it's off.

20
The Uno has 6 analog inputs, each of which provides 10 bits of resolution (i.e. 1024
different values). By default they measure from ground to 5 volts, though is it possible to change
the upper end of their range using the AREF pin and the analog Reference() function.
Additionally, some pins have specialized functionality
I 2C 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire library.

AREF. Reference voltage for the analog inputs. Used with analogReference(). • Reset. Bring
this line LOW to reset the microcontroller. Typically used to add a reset button to shields which
block the one on the board. See also the mapping between Arduino pins and Atmega328 ports

21
(x) LAYOUT CONNECTION OF ARDUINO UNO

Fig.2.2.1 Layout diagram of Arduino

(xi) FEATURES OFARDUINO


Microcontroller ATmega328.

Operating Voltage 5V.

Input Voltage (recommended) 7-12V.

Input Voltage (limits) 6-20V.

Digital I/O Pins 14 (of which 6 provide PWM output)

22
Analog Input Pins 6.
DC Current per I/O Pin 40 mA.

DC Current for 3.3V Pin 50 mA.

Protocol : USART, SPI & I2C.

Low Power Consumption 0.3mA/MHz

Operating Frequency : 20 MHz

(xii)BENEFITS OFARDUINO
Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller
platforms

Cross-platform - The Arduino software runs on Windows, Macintosh OSX, and Linux
operating systems. Most microcontroller systems are limited to Windows.

Simple, clear programming environment - The Arduino programming environment is easy-


to-use for beginners, yet flexible enough for advanced users to take advantage of as well.

Open source and extensible software - The Arduino software is published as open source
tools, available for extension by experienced programmers.

Open source and extensible hardware - The Arduino is based on Atmel's ATMEGA8
and ATMEGA168 microcontroller.

23
(xiii) ARDUINO IDE

The Integrated Development Environment (IDE)is a combination of editor, linker and a


compiler which helps the developer to make their Firmware for their Innovative Projects.
Arduino IDE play a major role in open source platform for fast prototyping and easy to
access of library. It is user friendly tool for beginners and it supports programming language like
embedded C, Luna etc. Over the years Arduino has been the brain of thousands of projects, from
everyday objects to complex scientific instruments. Its supports all the variant of Arduino boards
like Arduino Uno, Nano and Mega etc. As soon as it reaches a wider community, the Arduino
board started changing to adapt to new needs and challenges, differentiating its offer from simple
8-bit boards to products for IoT applications, wearable, 3D printing, and embedded environments

(xiv) ARDUINO IDE SOFTWARE

With this Arduino Integrated Development Environment you can edit, compile and
upload Arduino sketches to the Arduino boards

4.3.2 POWER SUPPLY:

It is a simple approach this is to obtain a 12V and 5V DC power supply using a single

circuit. The circuit uses two ICs 7812 and 7805 for obtaining the required voltages. The AC

mains voltage will be stepped down by the transformer, rectified by bridge and filtered by

capacitor to obtain a steady DC level .The 7812

24
regulates this voltage to obtain a steady 12V DC. The output of the IC1 will be regulated by the

7805 to obtain a steady 5V DC at its output. In this way both 12V and 5V DC are obtained.

BLOCK DIAGRAM

STEP DOWN BRIDGE RECTIFIER


(AC TO DC REGULATOR OUTPUT
TRANSFORMER
(230V TO 12V) VOLTAGE)

CIRCUIT DIAGRAM

Circuit diagram

25
Initially small step down transformer is used to reduce the voltage level 230V AC into 12V AC.

The output of the transformer is a pulsating sinusoidal AC voltage, which is converted to

pulsating DC with the help of a rectifier. This output is given to a filter circuit which reduces the

AC ripples, and passes the DC components. 7812 regulator is used to converts 12V DC study

voltage. And 7805 regulator is converts constant 5V DC voltage.

4.3.3 DHT11 SENSOR

This DHT11 Temperature and Humidity Sensor features a calibrated digital signal output
with the temperature and humidity sensor capability. It is integrated with a high-performance 8-
bit microcontroller. Its technology ensures the high reliability and excellent long-term stability.
This sensor includes a resistive element and a sensor for wet NTC temperature measuring
devices. It has excellent quality, fast response, anti-interference ability and high performance.

Each DHT11 sensors features extremely accurate calibration of humidity calibration


chamber. The calibration coefficients stored in the OTP program memory, internal sensors detect
signals in the process, we should call these calibration coefficients. The single-wire serial
interface system is integrated to become quick and easy. Small size, low power, signal
transmission distance up to 20 meters, enabling a variety of applications and even the most
demanding ones. The product is 4-pin single row pin package. Convenient connection, special
packages can be provided according to users need.

26
Fig.2.8 DHT11 Sensor

The DHT11 sensor provides the current temperature is humidity readings. The DHT11
gives out analog output and is connected to the analog input of the Arduino micro-controller A0.
The dht11 sensor has 3 pins. Along with temperature and humidity the other values that are
calculated or derived from the dht11 sensor is the dew point, heat index etc. The dew point is
the temperature at which air in the atmosphere freezes to become water droplets and the heat
index is the heat felt by the human skin from the environment. This is important in places with
high humidity. Even though the temperature maybe lowers, the body still feels warm. This is due
to the high humidity in the air. Humidity is the moisture content in the air. High humidity in the
air generally makes one to sweat or perspire.

27
FEATURES
 Full range temperature compensated
 Relative humidity and temperature measurement
 Calibrated digital signal
 Outstanding long-term stability
 Extra components not needed
 Long transmission distance
 Low power consumption
 4 pins packaged and fully interchangeable

APPLICATIONS

 Measure temperature and humidity


 Local Weather station
 Automatic climate control
 Environment monitoring

4.3.4 GAS SENSOR

The MQ-135 Gas sensors are used in air quality control equipments and are suitable for
detecting or measuring of NH3, NOx, Alcohol, Benzene, Smoke, CO2. The MQ-135 sensor
module comes with a Digital Pin which makes this sensor to operate even without a
microcontroller and that comes in handy when you are only trying to detect one particular gas. If
you need to measure the gases in PPM the analog pin need to be used. The analog pin is TTL
driven and works on 5V and so can be used with most common microcontrollers.

28
If you are looking for a sensor to detect or measure common air quality gases such as CO2,
Smoke, NH3, NOx, Alcohol, Benzene then this sensor might be the right choice for you.

Fig.2.9 Gas Sensor

MQ-135 SENSOR FEATURES

 Wide detecting scope


 Fast response and High sensitivity
 Stable and long life
 Operating Voltage is +5V
 Detect/Measure NH3, NOx, alcohol, Benzene, smoke, CO2, etc.
 Analog output voltage: 0V to 5V
 Digital output voltage: 0V or 5V (TTL Logic)
 Preheat duration 20 seconds
 Can be used as a Digital or analog sensor

29
APPLICATIONS

 Used to detect leakage/excess of gases like Ammonia, nitrogen oxide, alcohols,


aromatic compounds, sulfide and smoke.
 Air quality monitors.

4.3.5 IR SENSOR

IR LED Transmitter

IR LED emits light, in the range of Infrared frequency. IR light is invisible to us as its
wavelength (700nm – 1mm) is much higher than the visible light range. IR LEDs have light
emitting angle of approx. 20-60 degree and range of approx. few centimeters to several feets, it
depends upon the type of IR transmitter and the manufacturer. Some transmitters have the range
in kilometers. IR LED white or transparent in colour, so it can give out amount of maximum
light.

Photodiode Receiver

Photodiode acts as the IR receiver as its conducts when light falls on it. Photodiode is a
semiconductor which has a P-N junction, operated in Reverse Bias, means it start conducting the
current in reverse direction when Light falls on it, and the amount of current flow is proportional
to the amount of Light. This property makes it useful for IR detection. Photodiode looks like a
LED, with a black colour coating on its outer side, Black colour absorbs the highest amount of
light.

30
LM358 Opamp

LM358 is an Operational Amplifier (Op-Amp) is used as voltage comparator in the IR


sensor. the comparator will compare the threshold voltage set using the preset (pin2) and the
photodiode’s series resistor voltage (pin3).

Photodiode’s series resistor voltage drop > Threshold voltage = Opamp output is High
Photodiode’s series resistor voltage drop < Threshold voltage = Opamp output is Low

When Opamp's output is high the LED at the Opamp output terminal turns ON (Indicating
the detection of Object).

Variable Resistor

The variable resistor used here is a preset. It is used to calibrate the distance range at
which object should be detected.

Fig.2.10 IR Sensor

31
APPLICATION

 Obstacle Detection
 Industrial safety devices
 Wheel encoder

4.3.6 VIBRATION SENSOR


This module features an adjustable potentiometer, a vibration sensor, and a LM393
comparator chip to give an adjustable digital output based on the amount of vibration. The
potentiometer can be adjusted to both increase and decrease the sensitivity to the desired amount.
The module outputs a logic level high (VCC) when it is triggered and a low (GND) when it isn’t.
Additionally there is an onboard LED that turns on when the module is trigged.

Fig.2.11 Vibration Sensor

WORKING
New SW-420 Motion Sensor Module The company produced normally closed type
vibration sensor SW-420 The comparator output, signal clean, good waveform, driving ability is
strong, for more than 15 ma The working voltage of 3.3V to 5V Output form: digital switch
output (0 and 1) Has a fixed bolt hole, convenient installation Small board PCB size: 3.2cm x
1.4cm Use the LM393 wide voltage comparator Product no vibration, vibration switch is closed
on state, the output terminal output low level, the green light is lit Product vibration, the
vibration switch instantaneous disconnection, output the output high level, the green light is not
bright Output can be directly connected to microcontroller, through single chip microcomputer to
detect the high and low level, thus to detect whether there is a vibration environment, call the
police Used to trigger the effect of various vibration, theft alarm, intelligent car, earthquake
alarm, motorcycle
32
alarm, etc. This module is compared with the normally open type vibration sensor
module, vibration trigger for longer periods of time, can drive the relay module.

Features :

 The working voltage of 3.3V to 5V


 Small board PCB size: 3.2cm x 1.4cm
 Use the LM393 wide voltage comparator
 Output can be directly connected to microcontroller, through single chip microcomputer
to detect the high and low level, thus to detect whether there is a vibration environment,
call the police

APPLICATIONS

 Vibration detecting
 Burglary protection system
 Object Movement detecting
 Triggering effect reported theft alarm
 Smart car
 Earthquake alarm

4.3.7 LCD DISPLAY

There are many display devices used by the hobbyists. LCD displays are one of
the most sophisticated display devices used by them. Once you learn how to interface it, it
will be the easiest and very reliable output device used by you! More, for micro controller
based project, not every time any debugger can be used. So LCD displays can be used to test the
outputs.

33
Fig.2.7 LCD display

LCD accepts two types of signals, one is data, and another is control. These signals are
recognized by the LCD module from status of the RS pin. Now data can be read also from the
LCD display, by pulling the R/W pin high. As soon as the E pin is pulsed, LCD display reads
data at the falling edge of the pulse and executes it, same for the case of transmission. LCD
display takes a time of 39-43µS to place a character or execute a command. Except for clearing
display and to seek cursor to home position it takes 1.53ms to 1.64ms. Any attempt to send any
data before this interval may lead to failure to read data or execution of the current data in
some devices. Some devices compensate the speed by storing the incoming data to some
temporary registers.

LCD displays have two RAMs, naming DDRAM and CGRAM. DDRAM
registers in which position which character in the ASCII chart would be

34
displayed. Each byte of DDRAM represents each unique position on the LCD display. The LCD
controller reads the information from the DDRAM and displays it on the LCD screen. CGRAM
allows user to define their custom characters. For that purpose, address space for first 16 ASCII
characters are reserved for users. After CGRAM has been setup to display characters, user can
easily display their custom characters on the LCD screen.

4.3.8 WIFI MODLE

The ESP8266 is a very user friendly and low cost device to provide internet connectivity
to your projects. The module can work both as a Access point (can create hotspot) and as a
station (can connect to Wi-Fi), hence it can easily fetch data and upload it to the internet
making Internet of Things as easy as possible. It can also fetch data from internet using API’s
hence your project could access any information that is available in the internet, thus making it
smarter. Another exciting feature of this module is that it can be programmed using the Arduino
IDE which makes it a lot more user friendly. However this version of the module has only 2
GPIO pins (you can hack it to use upto 4) so you have to use it along with another
microcontroller like Arduino, else you can look onto the more standalone ESP-12 or ESP-32
versions. So if you are looking for a module to get started with IOT or to provide internet
connectivity to your project then this module is the right choice for you.

Fig.2.12 Wifi Module

35
The ESP8266 WiFi Module is a self contained SOC with integrated TCP/IP protocol
stack that can give any microcontroller access to your WiFi network. The ESP8266 is capable of
either hosting an application or offloading all Wi-Fi networking functions from another
application processor. Each ESP8266 module comes pre-programmed with an AT command set
firmware, meaning, you can simply hook this up to your Arduino device and get about as much
WiFi-ability as a WiFi Shield offers (and that’s just out of the box)! The ESP8266 module is an
extremely cost effective board with a huge, and ever growing, community.

This module has a powerful enough on-board processing and storage capability that
allows it to be integrated with the sensors and other application specific devices through its
GPIOs with minimal development up-front and minimal loading during runtime. Its high degree
of on-chip integration allows for minimal external circuitry, including the front-end module, is
designed to occupy minimal PCB area. The ESP8266 supports APSD for VoIP applications and
Bluetooth co-existance interfaces; it contains a self-calibrated RF allowing it to work under all
operating conditions, and requires no external RF parts.

FEATURES

 Low cost, compact and powerful Wi-Fi Module


 Power Supply: +3.3V only
 Current Consumption: 100mA
 I/O Voltage: 3.6V (max)
 I/O source current: 12mA (max)
 Built-in low power 32-bit MCU @ 80MHz
 512kB Flash Memory
 Can be used as Station or Access Point or both combined
 Supports Deep sleep (<10uA)
 Supports serial communication hence compatible with many development platform
like Arduino
 Can be programmed using Arduino IDE or AT-commands or Lua Script

36
APPLICATIONS

 IOT Projects
 Access Point Portals
 Wireless Data logging
 Smart Home Automation
 Learn basics of networking
 Portable Electronics

 Smart bulbs and Sockets

4.3.9 BUZZER

A buzzer or beeper is an audio signaling device, which may be mechanical,


electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm devices,
timers and confirmation of user input such as a mouse click or key stroke. Buzzer is an
integrated structure of electronic transducers, DC power supply, widely used in computers,
printers, copiers, alarms, electronic toys, automotive electronic equipment, telephones, timers
and other electronic products for sound devices. Active buzzer 5V Rated power can be directly
connected to a continuous sound, this section dedicated sensor expansion module and the board
in combination, can complete a simple circuit design, to "plug and play."

A buzzer or beeper is an audio signalling device, which may be mechanical,


electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm devices,
timers, and confirmation of user input such as a mouse click or keystroke. It generates consistent
single tone sound just by applying D.C voltage. Using a suitably designed resonant system, this
type can be used where large sound volumes are needed. At Future Electronics we stock many of
the most common types categorized by Type, Sound Level, Frequency, Rated Voltage,
Dimension and Packaging Type.

37
Fig.2.13 Buzzer

FEATURES

 Input supply: 5 VDC


 Current consumption: 9.0 mA max.
 Oscillating frequency: 3.0 ±0.5 KHz
 Sound Pressure Level: 85dB min.

APPLICATIONS

 Confirmation of user input (ex: mouse click or keystroke)


 Electronic metronomes
 Sporting events
 Judging Panels
 Annunciator panels

38
5.RESULT

39
40
Fig. Hardware Prototype

41
6.CONCLUSION

In this project the proposed project was introduced with a literature review, methodology,
system limitations, findings and testing were explained. From the summary points it is seen that
the aim related to the project are successfully achieved by designing Automated system that
detects the hazardous gas surrounded by the miner’s helmet was achieved, designing a
monitoring system to update the control room with real time data was achieved and to integrate
both design systems and evaluating the power consumption of the proposed system was
integrated and achieve

42
7.REFERENCES

[1]. Cheng Xin, Chen Junliang , Zhang Chengwen, Zhai Zhongyi, (2014) “Web of Things-
Based Remote Monitoring System for Coal Mine Safety Using Wireless Sensor Network
Cheng Bo”,.
[2]. A.P. Squelch, (July 2001) “Virtual reality for mine safety training in South Africa,” Thes
Journal of The South African Institute of Mining and Metallurgy.
[3]. X.B. Jiang, (2005) “ZigBee technology and its applications. Low-voltage apparatus”.
[4]. Z.J. Tian, (2007).“Digital Mobile Voice Communication Encode and Voice
Communication Designed”. China Coal.
[5]. H.M. Zhu and L. Zhang, (2006) “The Design of Warp Tension Embedded Intelligent
Control System Based on μC/OS and ARM”, Mechanical & Electrical Engineering
Magazine.
[6]. N.A. Liu and X.M. Wang, (2005) “2.4GHz RF Chip CC2420 and Its Application in ZigBee
Communication”. International Electronic Elements.
[7]. E. Liu, , X.J. Qiao and X. Zhang, (2006) “Design of High Precision Instrument for
Measuring Temperature,Humidity& Dew Point” . Instrument Technique and Sensor.
[8]. H. Guo and L. Ma, (2007). “Smart Sensor for Underground Coal Mine Based on ZigBee
Protocol”. Instrument Technique and Sensor.
[9]. Li, Y., Zhang, L., Chen, W., & Wang, J. (2022). Smart Helmet for Gas Detection in
Underground Mines. IEEE Access, 10, 1719-1727.
[10]. Chen, H., Wang, Z., & Zhao, L. (2023). Smart Helmet with Wearable Cameras for
Enhancing Miners' Situational Awareness. Sensors, 23(4), 975.
[11]. Wang, S., Li, J., Wang, J., & Chen, L. (2023). Monitoring Physiological Parameters and
Environmental Conditions in Underground Mining Using Smart Helmets. Journal of
Environmental Management, 308, 112295.
[12]. Zhang, X., Lin, Y., Wang, H., & Cui, L. (2022). Real-Time Localization of Miners in
Underground Mines Using Smart Helmet with RFID. International Journal of Distributed
Sensor Networks, 18(3), 15501477221065045.
[13]. Wang, S., & Zhang, Q. (2023). Wireless Sensor Network-Based Communication System
for Smart Helmets in Underground Mines. IEEE Internet of Things Journal, 10(2), 1572-
1581.
[14]. Zhang, H., Wang, G., & Zhao, J. (2023). A Smart Helmet with Head-Up Display for
Enhanced Situational Awareness in Mining Environments. Safety Science, 135, 105327.
[15]. Li, Y., & Wu, H. (2022). Integration of Haptic Feedback Technology into Smart Helmets
for Mining Safety. Automation in Construction, 133, 103834.

43
8.PROGRAM

#include<LiquidCrystal.h>

Liquid Crystal lcd(8,9,10,11,12,13);

#include <SoftwareSerial.h>

SoftwareSerial ser(2,3);

#include<dht.h>

dht DHT;

#define DHT11_PIN 14

int t1,h1;

int gas = A1;

int buzzer = 19;

int helmet = 16; int

vibration = 7;

44
float val =0,covalue=0;;

String apiKey = "TF11RLD8ZG04N0RB";

void setup()

Serial.begin(9600);

pinMode(19,OUTPUT);

pinMode(vibration,INPUT);

pinMode(helmet,INPUT);

lcd.begin(16,2);

lcd.setCursor(0,0);

lcd.print("IOT BASED HELMET");

lcd.setCursor(0,1);

lcd.print("FOR MINING INDUSTRY");

ser.begin(115200);

ser.println("AT+RST\r\n");

delay(8000);

Serial.println("Change to station mode");

45
ser.println("AT+CWMODE=1\r\n");

delay(8000);

Serial.println("Connect to a network");

//please enter wifi username and password

ser.println("AT+CWJAP=\"Redmi\",\"Amirtha01\"\r\n");

delay(8000);

Serial.println("Get the ip address assigned my the router"); ser.println("AT+CIFSR\r\n");

delay(8000);

delay(2000);

lcd.clear();

void loop()

int chk = DHT.read11(DHT11_PIN);

h1=(DHT.humidity);

t1=(DHT.temperature);

int gas1=analogRead(gas);

46
int gas2=map(gas1,0,1023,0,100);

digitalWrite(buzzer,LOW);

lcd.setCursor(0,0);

lcd.print("HU = ");

lcd.setCursor(5,0);

lcd.print(h1);

lcd.setCursor(8,0);

lcd.print("TE = ");

lcd.setCursor(13,0);

lcd.print(t1);

lcd.setCursor(0,1);

lcd.print("gas=");

lcd.setCursor(6,1);

lcd.print(gas2);

delay(1000); lcd.clear();

if(digitalRead(vibration)==HIGH)

lcd.setCursor(0,0);

lcd.print("EMERGENCY ");

47
lcd.setCursor(0,1);

lcd.print("....................");

digitalWrite(buzzer,HIGH);

delay(5000);

lcd.clear();

if(digitalRead(helmet)==LOW)

lcd.setCursor(0,0); lcd.print("HELMET

NOT WEAR ");

lcd.setCursor(0,1);

lcd.print("....................");

digitalWrite(buzzer,HIGH);

delay(3000);

lcd.clear();

esp_8266(h1,t1,gas2);

void esp_8266(float h1, float t1, float gas2)

48
char buf[32],a[32],c[32],d[32];

String strVolt = dtostrf(h1, 4, 1, buf);

String str = dtostrf(t1, 4, 1, a);

String strVolt1 = dtostrf(gas2, 4, 1, c);

lcd.setCursor(0,0); lcd.print("HU

= "); lcd.setCursor(5,0);

lcd.print(h1); lcd.setCursor(8,0);

lcd.print("TE = ");

lcd.setCursor(13,0); lcd.print(t1);

lcd.setCursor(0,1);

lcd.print("gas=");

lcd.setCursor(6,1);

lcd.print(gas2);

Serial.print("HUMIDITY = ");

Serial.print(strVolt); Serial.println();

Serial.print("TEMPERATURE = ");

Serial.print(str);

49
Serial.print("GAS = ");

Serial.print(strVolt1);

Serial.println();

Serial.println();

String cmd = "AT+CIPSTART=\"TCP\",\""; cmd

+= "184.106.153.149";

cmd += "\",80";

ser.println(cmd);

delay(1000);

if(ser.find("Error")){

Serial.println("AT+CIPSTART error");

return;

String getStr = "GET /update?api_key="; getStr

+= apiKey;

getStr +="&field1="; getStr

+= String(strVolt); getStr

+="&field2="; getStr +=

String(str);

50
getStr +="&field3="; getStr

+= String(strVolt1);

getStr += "\r\n\r\n\r\n";

cmd = "AT+CIPSEND=";

cmd += String(getStr.length());

ser.println(cmd);

delay(1000);

if(ser.find(">")){

ser.print(getStr);

delay(6000);

ser.println("AT+CIPCLOSE");

else{ ser.println("AT+CIPCLOSE");

Serial.println("AT+CIPCLOSE")

51

You might also like