Remote Environmental Monitoring System Using DHT11
Remote Environmental Monitoring System Using DHT11
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
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 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.
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,
#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.
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.