0% found this document useful (0 votes)
16 views38 pages

Project Lab Group 4

Uploaded by

patidarsheelu2
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)
16 views38 pages

Project Lab Group 4

Uploaded by

patidarsheelu2
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/ 38

Temperature and Humidity Monitoring

System of an Electrical Devices

A Project Report submitted to


Department Of Electrical Engineering,
Maulana Azad National Institute of Technology, Bhopal

Bachelor of Technology, Electrical Engineering

Submitted by

Shashi Shekhar : 2211301162


Sheela Patidar : 2211301163
Rohit Kumar : 2211301164
Bhavesh Tiwari : 2211301165
Naman Vacchani : 2211301166

Department of Electrical Engineering


Maulana Azad National Institute Technology, Bhopal

May 2024

1
ECLARATIONe hereby declare that the Project Report, entitled
“Temperature and Humidity Monitoring system of an Electrical System ”,
submitted to the Department of Electrical Engineering, MANIT Bhopal a record
of original project undergone by us during the period Jan-June 2024, to the Bachelor
of Technology, Electrical Engineering, MANIT, Bhopal, represents my ideas in my
own words and where others’ ideas or words have been included, I have adequately
cited and referenced the original sources.

Place: Signature of the Students


Date:

Shashi Shekhar : 2211301162

Sheela Patidar : 2211301163

Rohit Kumar : 2211301164

Bhavesh Tiwari : 2211301165

Naman Vacchani : 2211301166

2
cknowledgment

We would like to express our sincere gratitude to all those who contributed to the
completion of this project. In particular, we express our heartfelt appreciation to our
esteemed teacher Dr. Narayan Prasad Patidar and Dr. Chaduvula Hemant Sir for
guiding and facilitating our project from inception to completion, invaluable
mentorship, insightful feedback, and unwavering support were instrumental in
shaping the direction and success of our project. Their expertise, encouragement, and
dedication inspired us to strive for excellence and push the boundaries of our
capabilities. Additionally, we are immensely grateful to the various online resources
and websites that provided essential references, guidance, and inspiration throughout
the development of our project. These resources played a pivotal role in our research,
analysis, and implementation efforts, contributing to the depth and breadth of our
final report or prototype. We would also like to express our gratitude to our fellow
team members for their collaborative spirit, hard work, and commitment to
excellence. Together, we navigated challenges, exchanged ideas, and collectively
contributed to the realization of our project goals. In conclusion, we extend our
sincere thanks to all individuals, resources, and entities that have supported us on this
journey. Your contributions, whether direct or indirect, have been invaluable, and we
are truly grateful for the opportunity to learn, grow, and succeed together.
.

3
ontent
Topic Page no

Cover page 1
Declaration 2
Acknowledgement 3
Content 4
List of Abbreviation 5

Chapter 1 Introduction 1 6-8


1.1. introduction
1.2. importance
1.3 scope

Chapter 2 Methodology 9-31


2.1 Hardware required
2.2. Details of Hardware required
2.3. Software required 11
2.4 Details of software required
2.5 Circuit diagram
2.6. Block diagram
2.7. Working
2.8 Blynk Cloud setup
2.9 Google sheet setup
2.10. Arduino IDE Code
2.11 Code Explanation

Chapter 3 Result And Analysis 32-33


3.1 Result obtained in Blynk mobile app
3.2. result recorded in google spreadsheet

Chapter 4 Discussion 34-36


4.1. significance of result
4.2. limitation

Chapter 5 conclusion 37-38


5.1 conclusion
5.2 Reference

4
List of Abbreviation
1) IoT – Internet of Things
2) DHT- Digital Humidity and Temperature
3)Universal Serial Bus
4) LCD – Liquid Crystal Display
5) LED – Light Emitting Diode
6) SDA – Serial Data
7) A.I – Analog Input
8) D.I – Digital Input
9) GND – Ground
10) TX – Transmitting Pin
11) RX – Receiving Pin
12) VCC – Common Collector Voltage

5
Chapter 1
Introduction

6
1.1 Introduction
The Internet of Things (IoT) has emerged as a transformative technology, revolutionizing
the way we interact with our environment and manage critical systems. In today's
interconnected world, the ability to monitor and control devices remotely has become
paramount, particularly in industries where maintaining optimal operating conditions is
crucial. One such application is temperature monitoring in electrical devices, where
deviations from prescribed thresholds can lead to equipment malfunction, safety hazards,
and costly downtime. In response to these challenges, this project presents an IoT-based
temperature monitoring system tailored to the unique requirements of electrical
infrastructure. By leveraging sensor technologies, wireless communication protocols, and
cloud-based analytics, our system aims to provide real-time insights into the thermal
performance of electrical devices, enabling proactive maintenance, risk mitigation, and
enhanced operational efficiency. This report outlines the development, implementation, and
evaluation of our IoT solution, highlighting its potential to revolutionize temperature
monitoring practices and pave the way for a more resilient and connected infrastructure
landscape

1.2 Importance
Ensure Safety: The foremost objective is to ensure the safety of both personnel and
property by detecting and mitigating potential hazards associated with overheating
electrical devices.

Remote Monitoring and Management: Offers remote access to temperature data,


enabling stakeholders to monitor and manage devices from anywhere at any time.
Enables faster response times and improved serviceability through remote
troubleshooting and diagnostics.

Optimize Performance: Temperature monitoring systems also aim to optimize the


performance of electrical devices by ensuring they operate within their designated
temperature ranges.

Prevent Equipment Damage: Temperature monitoring aims to prevent damage to


electrical devices caused by excessive heat. By promptly detecting temperature

7
anomalies, the system can initiate corrective actions to prevent damage and prolong
the lifespan of equipment.

Compliance and Reporting: For industries subject to regulatory requirements or


safety standards, temperature monitoring systems help ensure compliance by
providing accurate, real-time data on temperature levels and adherence to specified
thresholds.

1.3 Scope
Digital temperature monitoring in laboratories: Temperature plays a crucial role in
defining the chemical composition or integrity of volatile compounds and biological
samples respectively. With IoT’s temperature monitoring solution, a laboratory can
conduct tests and store samples in a controlled environment, to determine accurate
results.

Food Safety Compliances: IoT temperature monitoring solution allows the food
industry to monitor the temperature of these chambers allowing them to ensure that
the regulatory compliances are met. They can remotely monitor the temperature of
the items and confirm the quality of their products.

Warehouse and Inventory Management: Some products can be sensitive to humidity


& temperature. Storing them in a normal warehouse can result in their corrosion and
are thus required to be stored in a temperature-controlled environment. By using
heaters/freezers, the temperature and humidity of the warehouses can be maintained
to ensure the quality of a specific type of product.

Goods in Transit: During the distribution phase, the quality of the products being
shipped is affected adversely due to changing environmental conditions.
Hence, companies develop special containers to maintain a suitable environment for
their products while they are shipped from one location to another. Using
temperature monitoring sensors allows companies to track environmental parameters.

8
Chapter 2
Methodology

9
2.1 Hardware Required
1. NODE MCU ESP 8266
2. DHT 11 sensor
3. Breadboard
4. Jumperwire

2.2 Details of Hardware Component


1. NODE MCU ESP 8266

Fig2.1

The ESP8266 is a popular and versatile microcontroller with built-in Wi-Fi


capabilities. It's widely used in IoT (Internet of Things) projects due to its low cost,
low power consumption, and ease of use. Here are some key points about the
ESP8266:

About: The ESP8266 integrates a Tensilica L106 32-bit microcontroller unit (MCU)
with a Wi-Fi stack, making it capable of connecting to Wi-Fi networks and
communicating over the internet.

Variants: There are several variants of the ESP8266, with the ESP-01 being one of
the most common. Other variants include ESP-12, ESP-07, ESP-201, etc., offering
different form factors and pin configurations.

Development: Programming the ESP8266 can be done using various programming


languages and development environments. The most common approach is to use the
Arduino IDE with the ESP8266 board support package or using MicroPython.

10
Applications: The ESP8266 is used in a wide range of applications, including home
automation, sensor networks, smart agriculture, industrial automation, and more. Its
small size and low power consumption make it suitable for battery-powered devices.

Community: There is a large and active community around the ESP8266, providing
libraries, tutorials, and support for developers and hobbyists. This community has
contributed to the widespread adoption of the ESP8266 in DIY electronics projects.

ESP32: Building on the success of the ESP8266, Espressif Systems released the
ESP32, which is a more powerful successor with Bluetooth capabilities, more GPIO
pins, and other enhancements. However, the ESP8266 remains popular for simpler
projects or those that only require Wi-Fi connectivity.

Pinout :

Fig2.2

Some features of ESP8266

1. Low cost, compact and powerful Wi-Fi Module


2. Power Supply: +3.3V only
3. Current Consumption: 100mA
4. I/O Voltage: 3.6V (max)
5. I/O source current: 12mA (max)
6. Built-in low power 32-bit MCU @ 80MHz
7. 512kB Flash Memory

11
8. Can be used as Station or Access Point or both combined0
9. Supports Deep sleep (<10uA)
10. Supports serial communication hence compatible with many development
platform like Arduino
11. Can be programmed using Arduino IDE or AT-commands or Lua Script

Working
USB-to-Serial Converter: The NodeMCU board includes a USB-to-serial converter
chip (usually CH340 or CP2102), which allows it to communicate with a computer
over USB. This converter chip handles the conversion between USB signals from the
computer and serial signals used by the ESP8266, facilitating programming and
debugging.

Voltage Regulator: The NodeMCU board typically includes a voltage regulator that
regulates the input voltage to a stable level required by the ESP8266 and other
components on the board. This ensures that the board operates reliably regardless of
variations in the input voltage.

Wi-Fi Connectivity: One of the key features of the ESP8266 is its built-in Wi-Fi
capability. The NodeMCU leverages this feature, allowing it to connect to Wi-Fi
networks and communicate with other devices or servers over the internet. This
enables a wide range of IoT applications, such as remote monitoring, home
automation, and data logging.

Programming: Like other ESP8266-based boards, the NodeMCU can be


programmed using various programming languages and development environments.
The Arduino IDE is a popular choice, as it provides a familiar programming
environment for many developers and has extensive support for the ESP8266
platform. Additionally, the NodeMCU can be programmed using Lua scripting
language through the NodeMCU firmware.

GPIO Pins: The NodeMCU board exposes the GPIO (General Purpose Input/Output)
pins of the ESP8266, allowing users to interface with external components such as
sensors, actuators, and displays. These pins can be configured as digital inputs or
outputs, analog inputs, or specialized interfaces such as I2C or SPI.

12
2. DHT 11 sensor

Fig 2.3

The DHT11 is a basic, low-cost digital temperature and humidity sensor. It's
commonly used in various electronic projects, particularly those related to
environmental monitoring and home automation. Here's a breakdown of its features
and how it works:

Temperature Measurement: The DHT11 sensor measures temperature within a


range of 0 to 50 degrees Celsius (32 to 122 degrees Fahrenheit) with an accuracy of
±2 degrees Celsius.

Humidity Measurement: In addition to temperature, the DHT11 also measures


relative humidity within a range of 20% to 90% with an accuracy of ±5%.

Sensor Principle: The DHT11 consists of a capacitive humidity sensor and a


thermistor for temperature measurement. These sensors convert the temperature and
humidity into electrical signals, which are then processed by the sensor's built-in
analog-to-digital converter (ADC).

Digital Output: The DHT11 provides a digital output signal, making it easy to
interface with microcontrollers or other digital circuits. It communicates over a
single-wire serial interface, transmitting data in the form of digital pulses.

Communication Protocol: The communication protocol used by the DHT11


involves sending a start signal from the microcontroller to the sensor, followed by the
sensor transmitting a response containing the temperature and humidity data. This

13
data is encoded in a specific format, typically consisting of 40 bits, including the
measured values and checksum bits for error checking.

Usage: The DHT11 sensor is widely used in DIY electronics projects and
prototyping due to its simplicity and affordability. It can be interfaced with popular
development boards like Arduino, Raspberry Pi, and ESP8266. Libraries and
example code are available for various platforms, making it easy to integrate the
DHT11 sensor into projects for monitoring and controlling temperature and
humidity.

DHT11 Specifications

1. Operating Voltage: 3.5V to 5.5V


2. Operating current: 0.3mA (measuring) 60uA (standby)
3. Output: Serial data
4. Temperature Range: 0°C to 50°C
5. Humidity Range: 20% to 90%
6. Resolution: Temperature and Humidity both are 16-bit
7. Accuracy: ±1°C and ±1%

3.Breadboard

Fig2.4

14
A breadboard is a fundamental tool used in electronics prototyping to create
temporary circuits without the need for soldering. It allows you to quickly and easily
connect electronic components together for testing and experimentation.

Features of Breadboard

Grid of Holes: The main feature of a breadboard is its grid of holes, which are used
to insert electronic components and wires.

Connection Strips: The holes in a breadboard are internally connected in rows and
columns. These connections allow components inserted into certain holes to be
electrically connected.

Power Rails: Breadboards often have strips running along the top and bottom edges,
called power rails. These are used for providing power to the circuit, usually through
a power supply or battery.

Versatility: Breadboards can accommodate a wide range of electronic components,


from simple resistors and LEDs to integrated circuits and sensors.

Reusable: Components and wires can be easily inserted and removed from a
breadboard, making it reusable for different projects.

No Soldering Required: Because connections are made by inserting components


into the breadboard, soldering is not necessary for prototyping circuits.

Rapid Prototyping: Breadboards allow for quick and easy experimentation with
circuit designs, enabling rapid prototyping and iteration.

4.Jumperwire

Fig2.5

Jumper wires are essential components used in electronics to create temporary


electrical connections between various points on a circuit. They typically consist of a
flexible wire with pins or connectors on each end, allowing them to be easily inserted
into the holes of a breadboard or connected to other electronic components

15
2.3 Software Required
1. Blynk cloud
2. Google Sheet
3. Arduino IDE

2.4 Details of Software Used


1.Blynk cloud

Blynk Cloud is a service provided by Blynk, a platform designed to simplify the


process of creating Internet of Things (IoT) projects. Blynk Cloud allows users to
securely connect their hardware projects, such as Arduino or Raspberry Pi, to the
internet and control them remotely using a smartphone app.

features

Data Communication: Blynk Cloud acts as a central hub for data exchange between
IoT hardware devices and the Blynk mobile app. It facilitates real-time
communication, allowing users to send commands to their devices and receive data
from them instantly.

Device Management: Blynk Cloud manages the registration and authentication of


IoT devices, ensuring secure and authorized access to the platform. It also handles
device provisioning and configuration, making it easier for users to add new devices
to their Blynk projects.

Remote Access: Blynk Cloud enables users to remotely access and control their IoT
devices from anywhere with an internet connection. This allows for remote
monitoring, management, and interaction with IoT projects using the Blynk mobile
app.

Integration with Third-Party Services: Blynk Cloud supports integration with


various third-party services and platforms, allowing users to extend the functionality
of their IoT projects. This includes integration with popular IoT platforms, cloud
services, and APIs.

16
Scalability and Reliability: Blynk Cloud is designed to be highly scalable and
reliable, capable of handling a large number of connected devices and users
simultaneously. It ensures a seamless and consistent user experience, even under
heavy loads.

2.Google sheet

Google Sheets is a cloud-based spreadsheet application developed by Google. It's


part of the Google Workspace productivity suite and offers similar features to other
spreadsheet software like Microsoft Excel, but with the added benefit of being
accessible online from any device with an internet connection.

features

Collaboration: Multiple users can work on the same spreadsheet simultaneously,


making it easy to collaborate with colleagues or classmates in real-time.

Cloud Storage: Spreadsheets are stored in the cloud, so you don't need to worry
about losing your work if your device malfunctions. Changes are automatically saved
as you work.

Accessibility: Google Sheets can be accessed from any device with an internet
connection, including computers, smartphones, and tablets, making it convenient for
users to work on their spreadsheets on the go.

Integration: Google Sheets integrates seamlessly with other Google Workspace


applications like Google Docs and Google Drive, as well as with third-party apps and
services through add-ons and APIs.

Formulas and Functions: Like Excel, Google Sheets supports a wide range of
formulas and functions for performing calculations, manipulating data, and analyzing
information.

Data Visualization: Google Sheets includes tools for creating charts, graphs, and
pivot tables to visualize data and gain insights from your spreadsheet.

17
3.Arduino IDE

The Arduino IDE (Integrated Development Environment) is a software application


used for programming Arduino microcontroller boards. It provides an easy-to-use
interface for writing, compiling, and uploading code to Arduino-compatible devices.

features

Code Editor: The IDE includes a text editor with syntax highlighting, making it easy
to write and edit Arduino code (which is based on C/C++).

Compiler: The IDE contains a compiler that translates the Arduino code into
machine-readable instructions (known as machine code or binary code) that can be
understood by the microcontroller.

Serial Monitor: This feature allows developers to monitor the serial communication
between the Arduino board and a connected computer, making it useful for
debugging and troubleshooting.

Library Manager: The IDE includes a library manager that allows users to easily
install and manage libraries (collections of pre-written code) for interfacing with
sensors, actuators, displays, and other peripherals.

Board Manager: The IDE supports a wide range of Arduino-compatible boards. The
board manager allows users to easily install support for different types of boards and
microcontrollers.

Upload Functionality: The IDE provides a simple interface for uploading compiled
code to the Arduino board via USB, allowing users to quickly deploy their programs
and test them in real-world applications.

Examples and Tutorials: The IDE comes with a variety of built-in examples and
tutorials to help beginners get started with Arduino programming and electronics
projects.

18
2.5 circuit diagram

Fig2.6

In the circuit diagram the connection is as follow .

 A 5v power supply is given to node mcu through USB cable


 VCC of DHT 11 sensor is connected to 3v3 pin of node mcu.
 DATA of DHT 11 sensor is connected to D4 pin of node mcu.
 GND of DHT 11 sensor is connected to GND pin of node mcu.

19
2.6 Block diagram

Fig2.7

20
2.7 working
This working description provides a detailed overview of how the IoT-based
temperature and humidity monitoring system operates. Each step plays a crucial role
in ensuring the system effectively collects, validates, and transmits sensor data to the
cloud services for visualization and logging

1. Initialization:
The system initializes the hardware components, including the microcontroller (e.g.,
ESP8266/ESP32), temperature and humidity sensor (e.g., DHT22), and establishes a
connection to the Wi-Fi network. Software initialization involves setting up libraries
and variables needed for communication with Blynk Cloud and Google Sheets.

2.Connect to Wi-Fi Network:

The microcontroller connects to the configured Wi-Fi network using the provided
SSID and password.

3.Read Sensor Data:

The temperature and humidity sensor reads environmental data (temperature and
humidity) at regular intervals.The sensor data is then stored in variables for further
processing.

4.Check Data Validity:

The system checks whether the sensor data is valid ( or out of range).If the data is
valid, the flow continues; otherwise, the invalid data is discarded, and the system
waits for the next reading.

5.Send Data to Blynk Cloud:

Valid sensor data is sent to Blynk Cloud using the Blynk library and the provided
authentication token. Blynk widgets (e.g., Value Display) in the Blynk app are
updated with the latest temperature and humidity values.

6.Send Data to Google Sheets:

The system sends valid sensor data to Google Sheets using the Google Sheets API.
Authentication credentials are used to authenticate and authorize access to the

21
Google Sheets document. The data is appended to the designated spreadsheet,
creating a log of temperature and humidity readings over time.

7.End:

The system repeats the process, continuously monitoring temperature and humidity,
sending data to both Blynk Cloud and Google Sheets at regular intervals.

2.8 Blynk cloud setup

Fig2.8 Login in Blynk.io

Fig2.9 Creating new template

22
Fig2.10 Setting web dashboard

Fig2.11 Creating new device

Fig2.12 Getting unique auth token , template id and template name

23
2.9 Google Sheet setup

1. Set up Google Sheets API:

 Go to the Google Developers Console


(https://console.developers.google.com/).

 Create a new project.

 Enable the Google Sheets API for your project.

 Create credentials (API key or OAuth client ID) for accessing the API.

Fig2.13

2. Create a Google Sheet:

 Open Google Sheets (https://sheets.google.com/).

 Create a new spreadsheet.

 Name your spreadsheet and add column headers, such as "Time" and
"Temperature".

Fig2.14

24
2.10 Arduino IDE code

#define BLYNK_TEMPLATE_ID "TMPL3fJyL2dAU"


#define BLYNK_TEMPLATE_NAME "temperature monitoring system"
#define BLYNK_AUTH_TOKEN "2nN4PeSyqFHMZ2ZgtAjN2PXzI4zsagM7"

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include "DHT.h"
#include <BlynkSimpleEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN; // Enter your Blynk auth token here

#define DHTTYPE DHT11 // type of the temperature sensor


const int DHTPin = 2; //--> The pin used for the DHT11 sensor is Pin D1 =
GPIO5
DHT dht(DHTPin, DHTTYPE); //--> Initialize DHT sensor, DHT dht(Pin_used,
Type_of_DHT_Sensor);

#define ON_Board_LED 2 //--> Defining an On Board LED, used for


indicators when the process of connecting to a wifi router

const char* ssid = "MANIT"; //--> Your wifi name or SSID.


const char* password = ""; //--> Your wifi password.

//----------------------------------------Host & httpsPort


const char* host = "script.google.com";
const int httpsPort = 443;

25
//----------------------------------------

WiFiClientSecure client; //--> Create a WiFiClientSecure object.

String GAS_ID =
"AKfycbyNymLr1FTuO7jA7frV07IM6ubjtaiKDi2Qo4jDG8fh7xMIVor2-
_SvYQhErNkDwOEusw"; //--> spreadsheet script ID

void setup() {

// put your setup code here, to run once:


Serial.begin(9600);
Blynk.begin(auth, ssid, password);
delay(500);

dht.begin(); //--> Start reading DHT11 sensors


delay(500);

WiFi.begin(ssid, password); //--> Connect to your WiFi router


Serial.println("");

pinMode(ON_Board_LED,OUTPUT); //--> On Board LED port Direction


output
digitalWrite(ON_Board_LED, HIGH); //--> Turn off Led On Board

//----------------------------------------Wait for connection


Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
//----------------------------------------Make the On Board Flashing LED on the
process of connecting to the wifi router.
digitalWrite(ON_Board_LED, LOW);
delay(250);
digitalWrite(ON_Board_LED, HIGH);

26
delay(250);
//----------------------------------------
}
//----------------------------------------
digitalWrite(ON_Board_LED, HIGH); //--> Turn off the On Board LED when
it is connected to the wifi router.
Serial.println("");
Serial.print("Successfully connected to : ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
Serial.println();
//----------------------------------------

client.setInsecure();
}

void loop() {
Blynk.run();
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
int h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();

// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor !");
delay(500);
return;
}

Blynk.virtualWrite(V0, t); // Send temperature value to Blynk App


Blynk.virtualWrite(V1, h); // Send humidity value to Blynk App

27
String Temp = "Temperature : " + String(t) + " °C";
String Humi = "Humidity : " + String(h) + " %";
Serial.println(Temp);
Serial.println(Humi);

sendData(t, h); //--> Calls the sendData Subroutine


}

// Subroutine for sending data to Google Sheets


void sendData(float tem, int hum) {
Serial.println("==========");
Serial.print("connecting to ");
Serial.println(host);

//----------------------------------------Connect to Google host


if (!client.connect(host, httpsPort)) {
Serial.println("connection failed");
return;
}
//----------------------------------------

//----------------------------------------Processing data and sending data


String string_temperature = String(tem);
// String string_temperature = String(tem, DEC);
String string_humidity = String(hum, DEC);
String url = "/macros/s/" + GAS_ID + "/exec?temperature=" +
string_temperature + "&humidity=" + string_humidity;
Serial.print("requesting URL: ");
Serial.println(url);

client.print(String("GET ") + url + " HTTP/1.1\r\n" +


"Host: " + host + "\r\n" +

28
"User-Agent: BuildFailureDetectorESP8266\r\n" +
"Connection: close\r\n\r\n");

Serial.println("request sent");
//----------------------------------------

//----------------------------------------Checking whether the data was sent


successfully or not
while (client.connected()) {
String line = client.readStringUntil('\n');
if (line == "\r") {
Serial.println("headers received");
break;
}
}
String line = client.readStringUntil('\n');
if (line.startsWith("{\"state\":\"success\"")) {
Serial.println("esp8266/Arduino CI successfull!");
} else {
Serial.println("esp8266/Arduino CI has failed");
}
Serial.print("reply was : ");
Serial.println(line);
Serial.println("closing connection");
Serial.println("==========");
Serial.println();
//----------------------------------------
}

29
2.11 Code explanation

This code is for a temperature monitoring system using an ESP8266 microcontroller,


a DHT11 temperature and humidity sensor, Blynk for remote monitoring, and Google
Sheets for data logging.

1.Library Inclusions and Definitions:

The code starts by including necessary libraries like ESP8266WiFi,


WiFiClientSecure, DHT, and BlynkSimpleEsp8266.

Then, it defines Blynk template ID, template name, and authentication token.

2.Variable Declarations:

It declares variables like the authentication token, sensor type (DHT11), pin for DHT
sensor, WiFi credentials, host for Google Sheets script, port for HTTPS
communication, and a Google Sheets script ID.

3.Setup Function:

Initializes serial communication for debugging purposes.

Connects to Blynk server using the authentication token and WiFi credentials.

Initializes the DHT sensor and connects to the WiFi network.

Flashes an onboard LED as an indication of the connection process.

Sets up a secure WiFi client.

4.Loop Function:

Runs the Blynk loop.

Reads temperature and humidity from the DHT sensor.

Sends the temperature and humidity values to the Blynk app for remote monitoring.

Prepares strings containing temperature and humidity data.

Calls the sendData() function to send the data to Google Sheets.

30
5.send Data Function:

Establishes a secure connection to the Google Sheets script using HTTPS.

Constructs a URL with the temperature and humidity values.

Sends an HTTP GET request with the data to the Google Sheets script.

Checks if the request was successful or not.

Logs the response from the Google Sheets script.

Overall, this code allows you to monitor temperature and humidity remotely via the
Blynk app and log the data to Google Sheets for further analysis.

31
Chapter 3
Result and analysis

3.1 Result obtained in Blynk Cloud mobile app

32
Through the Blynk app's intuitive interface, users can conveniently view real-time
temperature data, enabling them to monitor environmental conditions from anywhere
with an internet connection.

3.2 Result recorded Google spreadsheet

33
Chapter 4
Discussion

4.1 Significance of the result


The significance of implementing an IoT-based temperature monitoring system for
electrical devices lies in its capacity to revolutionize maintenance practices, bolster
safety protocols, and optimize operational efficiency. By providing real-time insights
34
into temperature fluctuations, the system empowers organizations to adopt a
proactive approach to maintenance, preventing potential damage and prolonging the
lifespan of critical equipment. This proactive stance not only minimizes costly repairs
and replacements but also enhances the overall reliability and safety of electrical
devices by swiftly identifying and addressing anomalies that could lead to hazardous
situations such as overheating or short circuits. Moreover, by ensuring compliance
with industry standards and regulations, the system instills confidence in stakeholders
while mitigating legal and financial risks. Additionally, the data-driven nature of the
system facilitates informed decision-making, enabling organizations to identify
opportunities for performance optimization and resource allocation. Scalable and
adaptable, the system offers flexibility to accommodate evolving needs and
technologies, ensuring its long-term relevance and effectiveness in safeguarding
electrical devices and maximizing operational efficiency.

4.2 limitation
Accuracy: Sensor accuracy may vary, especially in extreme temperature conditions or
over extended periods of use. It's essential to understand the sensor's specifications and
limitations regarding accuracy and precision.

Dependency on Internet Connectivity: Since the system relies on the Blynk cloud
platform, uninterrupted internet connectivity is essential for real-time monitoring.
Any disruption in internet service could affect the system's functionality.

Response Time: The sensor's response time, or the time it takes to detect and report
changes in temperature, could affect the system's ability to provide real-time
monitoring. Slow response times may result in delayed notifications or actions.

Power Requirements: ESP8266 modules require power to operate, which might be


a limitation in scenarios where continuous monitoring is required in remote locations
or areas with limited power supply.

Environmental Sensitivity: External factors such as humidity, electromagnetic


interference, and physical obstructions can affect sensor performance. Understanding
these environmental factors and their potential impact on sensor readings is crucial
for accurate temperature monitoring.

35
Cost: While ESP8266 modules are relatively inexpensive, the overall cost of
implementing the system, including sensors, networking equipment, and cloud
services, could be a limiting factor for some applications or budgets.

Maintenance and Support: Regular maintenance and updates may be necessary to


ensure the system's reliability and security. Additionally, ongoing technical support
may be required to address any issues or troubleshooting needs that arise.

36
Chapter 5
Conclusion

5.1 Conclusion

37
the implementation of our IoT-based temperature monitoring system for electrical
devices represents a significant step towards ensuring the safety and reliability of
critical infrastructure. Through our project, we have successfully demonstrated the
feasibility and effectiveness of real-time temperature monitoring in mitigating the
risk of overheating and potential damage to electrical equipment. Our system has
shown promising results in terms of accuracy, reliability, and scalability, providing
valuable insights into the operational status of monitored devices. While we have
encountered challenges such as sensor calibration and data transmission latency, our
findings underscore the importance of continuous refinement and optimization in IoT
deployment. Looking ahead, we envision further enhancements to our system,
including the integration of predictive analytics and remote control functionalities, to
enable proactive maintenance and optimize energy consumption. Overall, our project
contributes to the growing body of research in IoT-enabled infrastructure monitoring
and lays the foundation for future advancements in this field.

38

You might also like