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

Remote Environmental Monitoring System Using DHT11

This document proposes the implementation of a remote environmental monitoring system using the DHT11 sensor, NodeMCU microcontroller, and ThingSpeak IoT analytics platform. It emphasizes the importance of temperature and humidity measurements in industrial applications and the value of real-time monitoring for safety and process optimization.
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)
29 views

Remote Environmental Monitoring System Using DHT11

This document proposes the implementation of a remote environmental monitoring system using the DHT11 sensor, NodeMCU microcontroller, and ThingSpeak IoT analytics platform. It emphasizes the importance of temperature and humidity measurements in industrial applications and the value of real-time monitoring for safety and process optimization.
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/ 7

Volume 9, Issue 11, November– 2024 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165 https://doi.org/10.38124/ijisrt/IJISRT24NOV200

Remote Environmental Monitoring


System Using DHT11
Hajar Zrioual1; Isogun Toluwalase Adewale2*; Cherkaoui Bahaa Eddine3
1
School of Electronic and Information Engineering, Nanjing University of Information Science & Technology,
Nanjing 210044, China
2
Jiangsu Key Laboratory of Meteorological Observation and Information Processing, School of Electronic and Information
Engineering, Nanjing University of Information Science & Technology, Nanjing 210044, China

Abstract:- This document proposes the implementation To harness the capabilities of the DHT11 sensor for
of a remote environmental monitoring system using the remote monitoring, a system centered around the NodeMCU
DHT11 sensor, NodeMCU microcontroller, and microcontroller has been proposed. The NodeMCU, built on
ThingSpeak IoT analytics platform. It emphasizes the the ESP8266 Wi-Fi chip, serves as the control center of the
importance of temperature and humidity measurements system, interfacing with the DHT11 sensor and managing
in industrial applications and the value of real-time the transmission of collected data. This microcontroller is
monitoring for safety and process optimization. The particularly well-suited for Internet of Things (IoT)
proposed system leverages the DHT11 sensor's applications due to its Wi-Fi connectivity, which allows for
capabilities to provide precise and continuous data, seamless data transfer over the internet.
which is transmitted to ThingSpeak for visualization and
analysis. The methodology section details the system's The proposed system leverages the ThingSpeak IoT
structural design, analytical approach, and code analysis, analytics platform to log and visualize the data collected by
highlighting its adherence to IoT principles. The results the DHT11 sensor. ThingSpeak provides a robust
and discussion section presents the system's performance, infrastructure for aggregating, visualizing, and analyzing
demonstrating its accuracy and potential for data-driven live data streams in the cloud, making it an excellent choice
decision-making. However, it also acknowledges the for real-time monitoring applications. By integrating
limitations of the DHT11 sensor and suggests areas for ThingSpeak into the system, users can easily access and
further analysis and improvement. Overall, the analyze temperature and humidity data from anywhere in
document provides a comprehensive overview of the the world, enabling them to make informed decisions and
system's architecture, methodology, and results, take necessary actions promptly.
showcasing its potential for environmental monitoring in
industrial and IoT applications. The system's architecture involves the creation of a
ThingSpeak channel dedicated to storing the temperature
Keywords:- DHT11, NodeMcu, IOT, Wireless and humidity data. The NodeMCU, programmed using the
Communication. Arduino IDE, reads the sensor data and sends it to the
ThingSpeak channel over a Wi-Fi network. The ThingSpeak
I. INTRODUCTION channel then displays the data in real-time, allowing users to
monitor environmental conditions and set up alerts or
In the realm of environmental monitoring, the accurate automated responses based on predefined thresholds.
measurement and analysis of temperature and humidity are
paramount. These two variables are critical in determining This innovative approach to remote monitoring not
the state and condition of substances or objects, making only enhances the safety and efficiency of industrial
their monitoring essential in various sectors, particularly in processes but also opens up possibilities for data-driven
industrial applications. The ability to track changes in decision-making. By integrating the DHT11 sensor with the
temperature and humidity remotely not only enhances safety NodeMCU and ThingSpeak, the system offers a cost-
but also provides valuable insights for process optimization effective and reliable solution for real-time environmental
and decision-making. monitoring, making it a valuable tool in various industrial
and environmental applications.
One of the key tools for achieving remote monitoring
of these environmental conditions is the DHT11 sensor. This II. LITERATURE REVIEW
compact and sensitive device is capable of detecting minute
changes in temperature and humidity levels, providing real- Monitoring is an essential practice across many fields,
time data that can be crucial for timely interventions and involving the continuous collection of data to evaluate
adjustments. The DHT11's ability to offer precise readings environmental or operational conditions and ensure
every second makes it an ideal choice for applications where adherence to desired standards. In environmental science
continuous and immediate data updates are necessary. and industrial management, especially within IoT (Internet
of Things) applications, monitoring allows for real-time

IJISRT24NOV200 www.ijisrt.com 386


Volume 9, Issue 11, November– 2024 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165 https://doi.org/10.38124/ijisrt/IJISRT24NOV200

oversight, which is crucial for maintaining safety, NodeMCU, ThingSpeak facilitates seamless data collection
optimizing processes, and ensuring timely interventions. and enhances the IoT system’s ability to analyze and react to
Effective monitoring requires high-frequency data collection environmental changes remotely[5].
and analysis, helping stakeholders identify trends, detect
anomalies, and assess the performance of systems over time III. METHODOLOGY
[1]. In IoT-based environmental monitoring, real-time data
can lead to actionable insights, particularly in remote and  Structural Design and Analytical Approach
resource-constrained environments where manual checks are
impractical.

The NodeMCU ESP8266 module, an IoT-friendly


microcontroller platform, is known for its Wi-Fi capabilities,
which make it suitable for remote data transmission.
Developed around the ESP8266 chip, NodeMCU integrates
a range of I/O pins and can be programmed through the
Arduino IDE, thus making it accessible and highly flexible
for IoT projects. This module is particularly valuable for
applications requiring wireless connectivity, where data
needs to be communicated to cloud-based systems for
further processing and analysis. Unlike traditional
microcontrollers such as Arduino, the NodeMCU’s built-in
Wi-Fi facilitates seamless internet integration, enabling
efficient and scalable IoT applications [2].

Sensors are critical components of IoT systems,


particularly in environmental monitoring and robotics,
where they serve as the primary sources of data. By
translating physical conditions, such as temperature,
humidity, and pressure, into digital signals, sensors provide
real-time inputs to the microcontroller, which then processes
and transmits the data for analysis. In control systems and
robotics, sensors enable automation by providing feedback
that informs decision-making processes [3]. Environmental
sensors, such as those used in IoT applications, must deliver
consistent, reliable data to support accurate environmental
analysis and timely responses.

The DHT11 is a commonly used digital sensor for


measuring temperature and humidity, known for its
affordability and ease of integration with microcontrollers
like the NodeMCU. The DHT11 sensor provides stable
readings, which makes it useful in non-critical applications,
including indoor environmental monitoring. The sensor’s
one-time programmable (OTP) memory enables calibrated
measurements, enhancing its accuracy and stability.
However, it is limited by a lower precision compared to
advanced sensors, which should be considered when
applying it in contexts that demand higher accuracy. This
limitation positions the DHT11 as more suited to IoT
projects where relative rather than absolute accuracy
suffices.

ThingSpeak is a cloud-based IoT analytics platform


that allows users to aggregate, visualize, and analyze real-
time data. With support for MATLAB, ThingSpeak enables
advanced data processing and custom visualizations, which
are essential for drawing insights from continuous data
streams. ThingSpeak’s capability to create custom channels
for data logging and trigger actions based on specified
conditions adds to its appeal for remote monitoring
applications [4]. By integrating with devices such as the Fig 1 FlowChart

IJISRT24NOV200 www.ijisrt.com 387


Volume 9, Issue 11, November– 2024 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165 https://doi.org/10.38124/ijisrt/IJISRT24NOV200

The provided flowchart details the operations of a the NodeMCU device to the Wi-Fi network. The flowchart
NodeMCU DHT11 temperature and humidity monitoring highlights that this is not always a one-time process; if the
system, illustrating the entire process from initialization to pairing fails, the system will retry until a successful
data transmission and repetition. This flowchart serves as a connection is established. This iterative process is vital for
blueprint for understanding how the system operates in a ensuring a reliable connection to the network which is
sequential manner to ensure continuous monitoring and data necessary for subsequent data transmission. Following a
handling. successful Wi-Fi pairing, the system proceeds to read data
from the NodeMCU device. The NodeMCU, equipped with
The process begins with the system being initialized, a DHT11 sensor, collects temperature and humidity data.
as indicated by the "Start" node. Immediately, the system This data is then prepared for transmission to the
checks for the availability of Wi-Fi, a crucial component for ThingSpeak platform, a cloud-based service that allows for
data transmission to the cloud. If the Wi-Fi is found to be the storage, analysis, and visualization of sensor data.
unavailable, the system loops back, continually checking
until a connection is established. This loop ensures that the The flowchart indicates that the next step involves
system does not proceed without a stable internet connection. sending the collected data to ThingSpeak. This step is
crucial as it enables remote monitoring and analysis. Once
Upon confirming that Wi-Fi is available, the system the data is successfully sent, ThingSpeak reads, displays,
then verifies whether the Wi-Fi is turned on. This step is and saves the data. This ensures that the collected data is not
critical as it prevents the system from attempting to pair only stored but also readily accessible for real-time
with a network that is not active. If the Wi-Fi is not turned monitoring and historical analysis.
on, the system rechecks the Wi-Fi status, creating a cycle
that ensures the system only proceeds under optimal Finally, the system is designed to repeat this entire
conditions. sequence, starting again with checking the Wi-Fi status.
This repetition ensures continuous monitoring, making the
Once the Wi-Fi is confirmed to be on, the system system robust and reliable for long-term data collection and
initiates the pairing process. This step involves connecting analysis.

Fig 2 Circuit Block Diagram

In the design phase, a block diagram of the system is the DHT11 temperature and humidity sensor is utilized,
created, which can be viewed in the accompanying figure. which provides an analog voltage output that can be further
Hardware design is crucial in tool creation, as it involves processed by the NodeMCU microcontroller development
analyzing the components to ensure the tool functions as board. This sensor is known for its accurate calibration of
intended. To achieve optimal performance, it's essential to temperature and humidity readings. The circuit diagram and
start with a solid design that considers the properties and pictorial diagram for the NodeMCU with the DHT11 sensor
characteristics of each component, thus preventing damage is depicted in the figure below.
and facilitating the work process. In this particular design,

IJISRT24NOV200 www.ijisrt.com 388


Volume 9, Issue 11, November– 2024 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165 https://doi.org/10.38124/ijisrt/IJISRT24NOV200

Fig 3 Circuit Schematic Diagram

The provided Arduino code is designed to read }


temperature and humidity data from a DHT11 sensor and Serial.println("");
send this data to a ThingSpeak channel for remote Serial.println("WiFi connected");
monitoring and data logging. This code is particularly suited }
for IoT applications due to its use of Wi-Fi connectivity and void loop()
cloud-based data storage. {
float h = dht.readHumidity();
#include <DHT.h> // Including library for dht float t = dht.readTemperature();
#include <ESP8266WiFi.h> if (isnan(h) || isnan(t))
String apiKey = "C1BL6C6EW2TXRJD2"; // Enter your {
Write API key from ThingSpeak Serial.println("Failed to read from DHT sensor!");
const char *ssid = "MDT"; // replace with your wifi ssid return;
and wpa2 key }
const char *pass = "mdtolu306"; if (client.connect(server,80)) // "184.106.153.149" or
const char* server = "api.thingspeak.com"; api.thingspeak.com
#define DHTPIN D3 //pin where the dht11 is {
connected String postStr = apiKey;
DHT dht(DHTPIN, DHT11); postStr +="&field1=";
WiFiClient client; postStr += String(t);
void setup() postStr +="&field2=";
{ postStr += String(h);
Serial.begin(115200); postStr += "\r\n\r\n";
delay(10);
dht.begin(); client.print("POST /update HTTP/1.1\n");
Serial.println("Connecting to "); client.print("Host: api.thingspeak.com\n");
Serial.println(ssid); client.print("Connection: close\n");
WiFi.begin(ssid, pass); client.print("X-THINGSPEAKAPIKEY: "+apiKey+"\n");
while (WiFi.status() != WL_CONNECTED) client.print("Content-Type: application/x-www-form-
{ urlencoded\n");
delay(500); client.print("Content-Length: ");
Serial.print("."); client.print(postStr.length());

IJISRT24NOV200 www.ijisrt.com 389


Volume 9, Issue 11, November– 2024 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165 https://doi.org/10.38124/ijisrt/IJISRT24NOV200

client.print("\n\n"); If the readings are valid, it attempts to connect to the


client.print(postStr); ThingSpeak server.
Serial.print("Temperature: ");
Serial.print(t); Upon successful connection, it prepares a POST
Serial.print(" degrees Celcius, Humidity: "); request to send the data to ThingSpeak. The request includes
Serial.print(h); the API key, temperature (field1), and humidity (field2)
Serial.println("%. Send to Thingspeak."); values.
}
client.stop(); The data is sent in the form of a URL-encoded HTTP
Serial.println("Waiting..."); body, and the length of the data is also specified in the
// thingspeak needs minimum 15 sec delay between updates request headers.
delay(1000);
} After sending the data, the client connection is closed,
and the function prints a confirmation message to the serial
Let's break down the code and its underlying principles: monitor.

#include <DHT.h>: This library is necessary for The loop includes a delay to comply with ThingSpeak's
interfacing with the DHT11 sensor. It handles the API rate limits (15 seconds minimum between updates).
communication protocol required to read data from the
sensor. Connectivity: The code leverages Wi-Fi connectivity
to send data to the cloud, which is a fundamental aspect of
#include <ESP8266WiFi.h>: This library is used for IoT.
connecting the NodeMCU (based on ESP8266) to a Wi-Fi
network. It's essential for enabling the IoT functionality of Data Logging: By using ThingSpeak, the code enables
the device. real-time data logging and monitoring, which is valuable for
analyzing environmental conditions over time.
String apiKey = "C1BL6C6EW2TXRJD2";: This is
the Write API key from ThingSpeak, which is used to Scalability: ThingSpeak supports multiple devices and
authenticate and send data to a specific ThingSpeak channel. can scale to accommodate large amounts of data, making
this approach suitable for expanding IoT networks.
const char *ssid = "MDT"; and const char *pass =
"mdtolu306";: These are the credentials for the Wi-Fi Accessibility: The data is stored in the cloud, making it
network that the NodeMCU will connect to. accessible from anywhere, which is beneficial for remote
monitoring and global access.
const char* server = "api.thingspeak.com";: This is
the server address for ThingSpeak's API. Ease of Use: The Arduino IDE and the libraries used in
#define DHTPIN D3: This defines the pin on the NodeMCU the code are well-documented and widely used, making the
where the DHT11 sensor is connected. development process relatively straightforward for
developers familiar with the Arduino ecosystem.
DHT dht(DHTPIN, DHT11);: This creates an instance
of the DHT class, specifying the pin and the type of sensor Overall, this code exemplifies the core principles of
(DHT11). IoT and Wireless communication by integrating sensors,
connectivity, and cloud services to create a functional
The setup() function initializes the serial remote monitoring system.
communication, sets up the DHT11 sensor, and connects the
NodeMCU to the specified Wi-Fi network. It prints IV. RESULTS AND DISCUSSION
feedback to the serial monitor during the connection process.
The figure in question appears to display the output of
The loop() function reads the temperature and a temperature and humidity monitoring system based on a
humidity values from the DHT11 sensor. DHT11 sensor interfaced with a NodeMCU board, with data
being transmitted to ThingSpeak for visualization and
It checks if the readings are valid (not NaN, which Arduino IDE's serial monitor for debugging and immediate
stands for "Not a Number", indicating an error). feedback.

IJISRT24NOV200 www.ijisrt.com 390


Volume 9, Issue 11, November– 2024 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165 https://doi.org/10.38124/ijisrt/IJISRT24NOV200

Fig 4 Thingspeak and Arduino IDE Live Interface

On the left side of the figure, we can see the On the right side of the figure, the Arduino IDE's serial
ThingSpeak web interface, which is displaying two main monitor is open, displaying a log of operations performed by
types of visual data representation: line charts and gauges the NodeMCU board. The code snippet above the serial
for temperature and humidity. The temperature line chart monitor shows a portion of the Arduino sketch used to read
shows a small increase over a short period of time, with the data from the DHT11 sensor and then send it to ThingSpeak
temperature rising from approximately 26.5 degrees to 27 using Wi-Fi. We can observe the repetitive log entries on the
degrees Celsius. The corresponding gauge below the line serial monitor confirming the temperature and humidity
chart reflects the latest temperature reading, which is 27.1 values, 27.10 degrees Celsius and 56.00% humidity, which
degrees Celsius, labeled as "a few seconds ago," indicating a are successfully being sent to ThingSpeak. The log
near real-time update of the data. messages indicate that the system is operating as expected,
consistently reading from the sensor and transmitting the
The humidity data is similarly represented, with its data.
own line chart and gauge. The humidity chart shows a slight
decrease over the same period, dropping from about 57.5% The consistency between the readings on the serial
to just below 56%. The gauge for humidity indicates a monitor and the ThingSpeak visualizations suggests that the
current reading of 56%, consistent with the latest data point system is accurately capturing and relaying the sensor data.
on the line chart. The slight variations in temperature and humidity over the
brief time window displayed on ThingSpeak's charts suggest
normal fluctuations in environmental conditions.

IJISRT24NOV200 www.ijisrt.com 391


Volume 9, Issue 11, November– 2024 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165 https://doi.org/10.38124/ijisrt/IJISRT24NOV200

Fig 5 Thingspeak Live Data Interface

In discussing the results, it is important to note that the REFERENCES


DHT11 sensor has certain accuracy limitations and is
generally considered suitable for hobbyist projects or non- [1]. Leigh, C., Alsibai, O., Hyndman, R.,
critical applications. The sensor's performance and the Kandanaarachchi, S., King, O., McGree, J.,
system's reliability can be influenced by factors such as Neelamraju, C., Strauss, J., Talagala, P., Turner, R.,
sensor placement, ambient conditions, and the stability of Mengersen, K., & Peterson, E. (2018). A framework
the Wi-Fi connection used for data transmission. for automated anomaly detection in high frequency
water-quality data from in situ sensors.. The Science
This monitoring system provides a useful example of of the total environment, 664, 885-898 .
how IoT devices can be used for environmental monitoring, https://doi.org/10.1016/j.scitotenv.2019.02.085.
with the ability to remotely track and analyze data over time. [2]. Shakthidhar, S., Srikrishnan, P., Santhosh, S., &
For further analysis, one could look at longer-term data Sandhya, M. (2019). Arduino and NodeMcu based
trends, examine data from multiple sensors for comparison, Ingenious Household Objects Monitoring and
or explore the use of alerts or triggers based on certain Control Environment. 2019 Fifth International
thresholds or conditions detected by the system. Conference on Science Technology Engineering and
Mathematics (ICONSTEM), 1, 119-124.
V. CONCLUSION https://doi.org/10.1109/ICONSTEM.2019.8918730.
[3]. Kondratenko, Y., Atamanyuk, I., Sidenko, I.,
The document presents a comprehensive exploration of Kondratenko, G., & Sichevskyi, S. (2022). Machine
remote environmental monitoring using the DHT11 sensor, Learning Techniques for Increasing Efficiency of the
NodeMCU microcontroller, and ThingSpeak IoT analytics Robot’s Sensor and Control Information
platform. It emphasizes the significance of temperature and Processing. Sensors (Basel, Switzerland), 22.
humidity measurements in various industrial applications https://doi.org/10.3390/s22031062.
and the critical role of monitoring in decision-making and [4]. Susheela, K., Harshitha, E., Rohitha, M., & Reddy, S.
process optimization. The proposed system's architecture, (2019). Home Automation and E-Monitoring Over
methodology, and results demonstrate the successful ThingSpeak and Android App. Lecture Notes in
integration of these technologies to enable real-time data Networks and Systems. https://doi.org/10.1007/978-
collection, visualization, and analysis. The code analysis and 981-13-3765-9_14.
IoT principles highlight the system's adherence to [5]. Lin J-Y, Tu H-L, Lee W-H. An Integrated Wireless
fundamental IoT concepts, making it a valuable tool for Multi-Sensor System for Monitoring the Water
environmental monitoring in industrial and IoT applications. Quality of Aquaculture. Sensors. 2021;21(12):4038.
The results and discussion section provides insights into the doi:10.3390/s21124038
system's performance, emphasizing its accuracy and
potential for data-driven decision-making. However, it also
acknowledges the limitations of the DHT11 sensor and
suggests areas for further analysis and improvement.

IJISRT24NOV200 www.ijisrt.com 392

You might also like