🔧 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:
🎥 Demo Video (Optional):
📩 Contact:
- Email: youremail@example.com
- LinkedIn Profile
- GitHub Profile
Comments
Post a Comment