Skip to content

deepjyotiD/Weather_monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌑️ ESP32 DHT Sensor Web Server

This project creates a web-based monitoring system using an ESP32 microcontroller to display temperature and humidity data from a DHT sensor. The interface is styled with modern UI elements and updates data dynamically using JavaScript.

πŸ“Œ Features

  • 🌐 Web-based UI – Displays real-time temperature and humidity readings.
  • πŸ”„ Auto-Refresh – Updates data every 2 seconds via AJAX.
  • 🎨 Responsive Design – Works on desktops, tablets, and mobile devices.
  • ⚑ Minimal & Aesthetic UI – Uses Poppins & Roboto fonts with a clean layout.

πŸš€ How It Works

1️⃣ The ESP32 hosts a webpage that retrieves DHT sensor readings.
2️⃣ JavaScript fetches /readings endpoint every 2 seconds to update the UI.
3️⃣ CSS styles the dashboard with a modern, clean look.

πŸ“œ Code Overview

πŸ“„ HTML Structure

  • Main container: Divided into a logo section and a content section.
  • Readings display: Two boxes for temperature & humidity values.

🎨 CSS Styling

  • Uses a gradient background with a card-style UI.
  • Responsive layout adapts to different screen sizes.

πŸ”„ JavaScript (Dynamic Data Fetching)

  • Fetches temperature & humidity data every 2 seconds:
    function updateData() {
        fetch('/readings')
          .then(response => response.json())
          .then(data => {
            document.getElementById('temperature').innerText = data.temp + " Β°C";
            document.getElementById('humidity').innerText = data.hum + " %";
          });
    }
    setInterval(updateData, 2000);

πŸ“¦ Setup & Deployment

1️⃣ Hardware Requirements

  • ESP32 microcontroller
  • DHT11 or DHT22 temperature & humidity sensor
  • Wi-Fi connectivity

2️⃣ ESP32 Firmware Setup

  • Upload Arduino code to ESP32 to serve the webpage.
  • Ensure /readings endpoint returns JSON data.

3️⃣ Run the Web Dashboard

  • Open the ESP32 IP address in a web browser.
  • Monitor real-time temperature & humidity.

🎯 Future Improvements

  • πŸ“Š Add historical data logging.
  • πŸ“± Create a mobile app version.
  • πŸ”” Implement email or SMS alerts.

πŸ“œ License

This project is open-source and free to use.

About

This Project was presented on Trekkathon Finals 2025

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages