Skip to main content

WiFi-based Temperature Monitoring System using ESP8266 and DHT11

๐Ÿ”ง Project Title: WiFi-based Temperature Monitoring System using ESP8266 and DHT11

๐Ÿง  Objective:

The goal of this project is to measure temperature and humidity using the DHT11 sensor and display the data in real-time over WiFi using the ESP8266 microcontroller.

๐Ÿ“ฆ Components Required:

Serial Component Quantity
1 ESP8266 NodeMCU 1
2 DHT11 Temperature Sensor 1
3 Jumper Wires As Needed
4 Breadboard 1

๐Ÿ”— Circuit Diagram:



๐Ÿ’ป Arduino Source Code:

#include <ESP8266WiFi.h>
#include <DHT.h>

#define DHTPIN D4    
#define DHTTYPE DHT11  
DHT dht(DHTPIN, DHTTYPE);

const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASSWORD";

WiFiServer server(80);

void setup() {
  Serial.begin(115200);
  dht.begin();
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting...");
  }
  Serial.println("WiFi connected");
  server.begin();
}

void loop() {
  WiFiClient client = server.available();
  if (client) {
    float t = dht.readTemperature();
    float h = dht.readHumidity();
    
    String response = "<h1>Temperature: " + String(t) + " *C</h1>";
    response += "<h2>Humidity: " + String(h) + " %</h2>";
    
    client.print("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n");
    client.print(response);
    delay(1000);
  }
}

๐ŸŒ Output:

  • Open your browser and go to the IP address of the ESP8266 module (e.g., http://192.168.0.103)
  • You will see temperature and humidity readings in real-time.

๐Ÿ“˜ Learnings:

  • How to use the DHT11 sensor with ESP8266
  • How to create a simple ESP8266-based web server
  • How to handle HTTP responses and serve live data

๐ŸŽฏ Future Enhancements:

  • Log sensor data to Google Sheets or a cloud server
  • Display readings on OLED or LCD
  • Control alerts using mobile app or MQTT

๐Ÿ”— GitHub Link:

๐Ÿ‘‰ View Project on GitHub

๐ŸŽฅ Demo Video (Optional):

๐Ÿ‘‰ Watch on YouTube

๐Ÿ“ฉ Contact:

Comments

Popular posts from this blog

BJT vs. MOSFET: Understanding the Key Differences

  When it comes to semiconductor devices, BJT (Bipolar Junction Transistor) and MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor) are two of the most commonly used transistors. They both play a critical role in amplifying or switching electronic signals, but their underlying principles and applications are quite different. In this post, we’ll explore the fundamental differences between BJT and MOSFET to help you understand their unique features and decide which one to use in your project. What is a BJT? A Bipolar Junction Transistor (BJT) is a current-controlled device that has three terminals: Collector (C) , Base (B) , and Emitter (E) . BJTs can be either NPN or PNP types, depending on the arrangement of their semiconductor layers. BJTs work by using a small current at the base to control a larger current flowing between the collector and emitter. How BJT Works: Current-Controlled : In a BJT, the amount of current that flows from the collector to the emitter is cont...

Troubleshooting an EEPROM Write Issue in a Microcontroller – A Real-World Debugging Experience

 Troubleshooting an EEPROM Write Issue in a Microcontroller—A Real-World Debugging Experience ๐Ÿ”ง Problem Statement While working on an embedded system at an R&D firm, I encountered a puzzling problem with EEPROM data writing. The EEPROM write operation was perfectly simulated, but when the compiled HEX file was uploaded to the actual microcontroller, the written data became unrecognizable. ๐Ÿงช Initial Assumptions At first, I assumed there might be a logical bug in my code. However, after carefully reviewing my EEPROM write functions and re-running simulations multiple times, everything appeared to be correct. ๐Ÿ›  Step-by-Step Debugging Process 1. Verification via Custom Tool To confirm whether the EEPROM was actually writing incorrect data, I built a simple tool that could: Read the EEPROM data from the microcontroller Convert and display the raw bytes into human-readable formats like integer and character Upon reading the EEPROM content using this tool, I conf...

RFID + ESP8266 Based Web Interface System

  Project Title: RFID_ESP8266_Interface_by_ReponSheikh GitHub: View on GitHub ๐Ÿ“˜ Introduction In this project, I have built a simple yet powerful RFID-based system using the ESP8266 NodeMCU microcontroller. The system reads RFID cards using the MFRC522 module and sends the UID data to a web interface over Wi-Fi. It can be used in access control , attendance tracking , or any kind of RFID-based identification system. ๐Ÿงฐ Components Used ESP8266 NodeMCU (ESP-12E) MFRC522 RFID Reader RFID Tags or Cards (13.56 MHz) Jumper Wires USB Cable and Power Source ๐ŸŒ Features Web-based interface to view UID logs Automatic Wi-Fi configuration using WiFiManager LittleFS file system support to store configuration and logs Easy-to-understand code structure with comments Arduino IDE compatible ๐Ÿ”ง How It Works On boot, the ESP8266 tries to connect to the last used Wi-Fi. If it fails, it starts as an Access Point for WiFi setup. Once connect...