0% found this document useful (0 votes)
3 views16 pages

Project Task

The project report details the development of an IoT-based LED control system using a DHT11 sensor to monitor temperature and humidity. The system automatically turns the LED on or off based on a predefined temperature threshold and includes a web interface for remote monitoring. The report outlines the components used, circuit layout, working principles, and code implementation for the project.

Uploaded by

45 Aarnav Xhj
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)
3 views16 pages

Project Task

The project report details the development of an IoT-based LED control system using a DHT11 sensor to monitor temperature and humidity. The system automatically turns the LED on or off based on a predefined temperature threshold and includes a web interface for remote monitoring. The report outlines the components used, circuit layout, working principles, and code implementation for the project.

Uploaded by

45 Aarnav Xhj
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

Project report on

IoT-Based Threshold-Controlled LED Using DHT11


Sensor

Submitted by:
Group Name: Mark-51

Group Members:
Name: Aarnav Bharti BT26ECI043
Name: Kushal Kumar BT26ECI047
Name: Rathlavath Nithin BT26ECI058
Name: Sai Krishna BT26ECI048

A report submitted for the partial fulfilment of the


requirements of the course ECL 108
IoT Workshop – I

Submission Date: 03/02/2026

Task Number # 3

Under the guidance of:


Dr. Mayank B. Thacker
Department of Electronics and Communication Engineering
Table of Contents:

Chapter No. Particular Page No.


1 Introduction 2
2 Components Involved 3
3 Circuit connection& layout 5
4 code 7
5 Conclusion 8
6 References 9

PAGE 1
Chapter 1: Introduction:
The Internet of Things (IoT) enables smart devices to sense, process,
and respond to real-world conditions automatically. By integrating
sensors with microcontrollers and internet connectivity, IoT systems
allow real-time monitoring and control of devices from anywhere.
Such automation improves efficiency, reduces manual effort, and
enhances system reliability.
In this experiment, an IoT-based LED control system is developed using a
DHT11 temperature and humidity sensor. The DHT11 continuously
monitors environmental conditions, and when the temperature exceeds a
predefined threshold value, the LED is automatically switched ON or
OFF. This threshold-based operation demonstrates automatic decision-
making based on sensor input.
Additionally, a web-based interface is implemented to display live
temperature and humidity data and the LED status. The system highlights
the practical use of IoT in applications such as smart homes, environmental
monitoring, and energy-efficient automation systems.
Task of the Experiment
• To interface the DHT11 temperature and humidity sensor with
the microcontroller.
• To read and process real-time temperature data from the DHT11
sensor.
• To set a predefined temperature threshold value for LED control.
• To automatically turn the LED ON/OFF based on the threshold
condition.
• To establish Wi-Fi communication between the microcontroller
and the web server.
• To design a web page for displaying temperature, humidity, and
LED status.
• To monitor the system remotely using a web browser.
• To verify the working of an IoT-based automated control system.

PAGE 2
Board Used
• ESP32(#Fig1.1)
The ESP32 serves as the main processing unit of the system. It reads
analog signals from the potentiometer, processes the data, and
generates PWM output signals to control the LED brightness. Its
integrated features make it suitable for IoT-based applications.

Fig1.1: ESP32 board

Chapter 2: Components Involved:


1. ESP32 Microcontroller
The ESP32 microcontroller is the core component of the experiment.
It is responsible for reading the analog input signal from the
potentiometer through its Analog-to-Digital Converter (ADC).
Based on this input, the ESP32 generates a Pulse Width Modulation
(PWM) signal to control the brightness of the LED. The ESP32 is
widely used in IoT applications due to its high processing capability
and built-in wireless communication features.

PAGE 3
2. DHT11 Temperature and Humidity Sensor(#fig1.2):
The DHT11 sensor is used to measure the ambient temperature and
humidity. It continuously senses the surrounding environmental
conditions and sends the data in digital format to the microcontroller.
The temperature value obtained from this sensor is used for
threshold-based decision making.

Fig1.2: DHT 11

3. LED (Light Emitting Diode)


The LED acts as the output device in the system. Its brightness
changes according to the PWM signal generated by the ESP32. A
higher duty cycle increases the brightness, while a lower duty cycle
reduces it, allowing smooth intensity control.

4. Breadboard
The breadboard is used to assemble and connect the components of
the circuit without soldering. It provides a convenient platform for
testing and modifying the circuit during the experiment.

5. Wi-Fi Network
The Wi-Fi network enables communication between the
microcontroller and the user’s web browser. It allows the sensor data
and LED status to be accessed remotely through the web interface.

PAGE 4
6. Web Page(Web Interface)
The web page is created using embedded HTML code in the
microcontroller program. It displays real-time temperature and
humidity values along with the current LED status. This interface
allows remote monitoring of the system through any standard web
browser.

Chapter 3: Circuit Connection & Layout:

1. The ESP32/ESP8266 microcontroller is placed at the center of the


breadboard for easy access to all GPIO pins.
2. The breadboard is used to make temporary connections without
soldering.
3. The DHT11 temperature and humidity sensor is placed on the
breadboard near the microcontroller.
4. The VCC and GND pins of the DHT11 are connected to the 3.3V
and GND pins of the microcontroller.
5. The data pin of the DHT11 is connected to a digital GPIO pin of the
microcontroller.
6. The LED is placed on the breadboard as the output device.
7. A current-limiting resistor is connected in series with the LED.
8. The LED–resistor combination is connected to a digital GPIO pin of
the microcontroller.
9. All ground connections of the components are connected to a
common ground.
10. The microcontroller is powered using a USB cable connected to a
computer or power supply.

PAGE 5
Fig1.4
Working Principle :

1. The DHT11 sensor continuously senses the ambient temperature and


humidity.
2. The sensor sends the measured data in digital form to the
microcontroller.
3. The microcontroller reads the temperature value and compares it
with a predefined threshold value.
4. If the temperature exceeds the threshold value, the microcontroller
turns the LED ON.
5. If the temperature falls below the threshold value, the
microcontroller turns the LED OFF.
6. Simultaneously, the microcontroller connects to a Wi-Fi network.
7. A web server running on the microcontroller displays real-time
temperature, humidity, and LED status.
8. The user can monitor the system remotely using a web browser.

PAGE 6
Chapter 4: Code:
#include <WiFi.h>
#include <WebServer.h>
#include "DHT.h"

// PIN DEFINITIONS
#define DHTPIN 4
#define DHTTYPE DHT11

#define INT_LED_PIN 2 // Internal LED


#define EXT_LED_PIN 5 // External LED

// LED LOGIC
// Note: Internal LED on many ESP32s is Active LOW
#define INT_LED_ON LOW
#define INT_LED_OFF HIGH

#define EXT_LED_ON HIGH


#define EXT_LED_OFF LOW

// OBJECTS
DHT dht(DHTPIN, DHTTYPE);
WebServer server(80);

// WIFI CREDENTIALS
const char* ssid = "Airtel_Zerotouch";
const char* password = "Airtel@123";

PAGE 7
// GLOBAL VARIABLES
float thresholdTemp = 30.0;
bool ledStatus = false;
float currentTemp = 0.0;
float currentHum = 0.0;

// WEBPAGE HANDLER
void handleRoot() {
currentTemp = [Link]();
currentHum = [Link]();

// -------- LED CONTROL LOGIC --------


if (!isnan(currentTemp)) {
if (currentTemp > thresholdTemp) {
digitalWrite(INT_LED_PIN, INT_LED_ON);
digitalWrite(EXT_LED_PIN, EXT_LED_ON);
ledStatus = true;
} else {
digitalWrite(INT_LED_PIN, INT_LED_OFF);
digitalWrite(EXT_LED_PIN, EXT_LED_OFF);
ledStatus = false;
}
}

// -------- FANCY HTML PAGE --------


String html = "<!DOCTYPE html><html>";
html += "<head><meta name='viewport' content='width=device-width,
initial-scale=1'>";
// Google Fonts: Orbitron for headers, Rajdhani for data

PAGE 8
html += "<link
href='[Link]
&family=Rajdhani:wght@500;700&display=swap' rel='stylesheet'>";
html += "<title>NEON CORE V2</title>";

html += "<style>";
html += "body { background: #0b0e14; color: #00d4ff; font-family:
'Rajdhani', sans-serif; margin: 0; display: flex; align-items: center; justify-
content: center; min-height: 100vh; overflow-x: hidden; }";

// Background Animation
html += "body::before { content: ''; position: absolute; width: 200%;
height: 200%; background: radial-gradient(circle, #1a1f35 0%, #0b0e14
70%); z-index: -1; }";

// Glass Container
html += ".panel { background: rgba(255, 255, 255, 0.03); backdrop-
filter: blur(15px); border: 1px solid rgba(0, 212, 255, 0.2);";
html += "padding: 40px; border-radius: 30px; box-shadow: 0 0 50px
rgba(0,0,0,0.5), inset 0 0 20px rgba(0, 212, 255, 0.05); width: 90%; max-
width: 450px; position: relative; }";

html += "h1 { font-family: 'Orbitron', sans-serif; font-size: 1.5rem;


letter-spacing: 4px; color: #fff; text-shadow: 0 0 15px #00d4ff; margin-
bottom: 40px; }";

// Glowing Temp Display

PAGE 9
html += ".temp-display { position: relative; width: 180px; height: 180px;
border-radius: 50%; border: 2px solid rgba(0, 212, 255, 0.3); margin: 0
auto 30px;";
html += "display: flex; flex-direction: column; align-items: center;
justify-content: center; box-shadow: 0 0 30px rgba(0, 212, 255, 0.1); }";
html += ".temp-val { font-family: 'Orbitron', sans-serif; font-size: 3.5rem;
font-weight: 700; color: #fff; line-height: 1; }";
html += ".temp-unit { font-size: 1rem; color: #00d4ff; letter-spacing: 2px;
}";

// Forms and Buttons


html += ".controls { background: rgba(0,0,0,0.3); padding: 20px; border-
radius: 15px; margin: 20px 0; border: 1px solid rgba(255,255,255,0.05);
}";
html += "input[type=number] { background: transparent; border: none;
border-bottom: 2px solid #00d4ff; color: #fff; font-size: 1.5rem; width:
80px; text-align: center; font-family: 'Orbitron'; outline: none; }";
html += "input[type=submit] { margin-top: 15px; background: #00d4ff;
color: #000; border: none; padding: 12px 30px; border-radius: 50px; font-
weight: bold; cursor: pointer; transition: 0.4s; font-family: 'Orbitron'; font-
size: 0.8rem; }";
html += "input[type=submit]:hover { background: #fff; box-shadow: 0 0
20px #fff; transform: scale(1.05); }";

// Status Labels
html += ".status-grid { display: grid; grid-template-columns: 1fr 1fr;
gap: 15px; margin-top: 20px; }";
html += ".stat-card { background: rgba(255,255,255,0.05); padding:
15px; border-radius: 12px; }";

PAGE 10
html += ".label { font-size: 0.7rem; color: rgba(0, 212, 255, 0.6); text-
transform: uppercase; letter-spacing: 1px; }";
html += ".value { font-size: 1.1rem; font-weight: bold; margin-top: 5px;
}";
html += ".led-dot { height: 10px; width: 10px; border-radius: 50%;
display: inline-block; margin-right: 8px; }";
html += ".active { color: #00ff88; text-shadow: 0 0 10px #00ff88; }";
html += ".inactive { color: #ff3e3e; text-shadow: 0 0 10px #ff3e3e; }";

html += "</style></head><body>";

html += "<div class='panel'>";


html += "<h1>SYSTEM CORE</h1>";

html += "<div class='temp-display'>";


html += "<div class='temp-val'>" + (isnan(currentTemp) ? "--" :
String((int)currentTemp)) + "&deg;</div>";
html += "<div class='temp-unit'>CELSIUS</div>";
html += "</div>";

html += "<div class='controls'>";


html += "<form action='/set'>";
html += "<div class='label'>Threshold Trigger</div>";
html += "<input type='number' step='0.1' name='temp' value='" +
String(thresholdTemp, 1) + "'>";
html += "<br><input type='submit' value='UPDATE CORE'>";
html += "</form></div>";

html += "<div class='status-grid'>";

PAGE 11
html += "<div class='stat-card'><div class='label'>Humidity</div><div
class='value'>" + (isnan(currentHum) ? "0" : String(currentHum, 1)) +
"%</div></div>";
html += "<div class='stat-card'><div class='label'>Status</div><div
class='value " + String(ledStatus ? "active" : "inactive") + "'>" +
(ledStatus ? "CRITICAL" : "STABLE") + "</div></div>";
html += "</div>";

html += "<div class='status-grid'>";


html += "<div class='stat-card'><div class='label'>Internal
LED</div><div class='value " + String(ledStatus ? "active" : "inactive")
+ "'>" + (ledStatus ? "ON" : "OFF") + "</div></div>";
html += "<div class='stat-card'><div class='label'>External
LED</div><div class='value " + String(ledStatus ? "active" : "inactive")
+ "'>" + (ledStatus ? "ON" : "OFF") + "</div></div>";
html += "</div>";

html += "<p style='font-size: 0.6rem; opacity: 0.3; margin-top: 25px;


letter-spacing: 2px;'>AUTO-SYNC: 5.0S</p>";
html += "</div>";

html += "<script>setTimeout(function(){ [Link](); },


5000);</script>";
html += "</body></html>";

[Link](200, "text/html", html);


}

PAGE 12
// SET THRESHOLD
void handleSet() {
if ([Link]("temp")) {
thresholdTemp = [Link]("temp").toFloat();
[Link]("Threshold Updated: " + String(thresholdTemp));
}
[Link]("Location", "/");
[Link](303);
}

// SETUP
void setup() {
[Link](115200);

pinMode(INT_LED_PIN, OUTPUT);
digitalWrite(INT_LED_PIN, INT_LED_OFF);

pinMode(EXT_LED_PIN, OUTPUT);
digitalWrite(EXT_LED_PIN, EXT_LED_OFF);

[Link]();

[Link](ssid, password);
[Link]("Connecting to WiFi");

while ([Link]() != WL_CONNECTED) {


delay(500);
[Link](".");

PAGE 13
}

[Link]("\nSystem Ready.");
[Link]("Access Link: [Link]
[Link]([Link]());

[Link]("/", handleRoot);
[Link]("/set", handleSet);
[Link]();
}

// LOOP
void loop() {
[Link]();
}

Chapter 5: Conclusion :
1. The IoT-based LED control system using the DHT11 sensor was
successfully implemented.
2. Real-time temperature data was monitored and compared with a
predefined threshold value.
3. The LED was automatically turned ON or OFF based on the
threshold condition.
4. A web interface was created to display temperature, humidity, and
LED status.
5. Remote monitoring was achieved using a web browser through Wi-
Fi connectivity.
6. The experiment demonstrated the practical application of IoT in
automation and monitoring systems.

PAGE 14
Chapter 6: References:
arXiv
IoT system using ESP8266 + DHT11 + LED control
→ Shows real-world IoT architecture & monitoring system
IoT environmental monitoring research
→ Explains real-time sensing + data transmission concepts

PAGE 15

You might also like