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.
- π 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.
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.
- Main container: Divided into a logo section and a content section.
- Readings display: Two boxes for temperature & humidity values.
- Uses a gradient background with a card-style UI.
- Responsive layout adapts to different screen sizes.
- 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);
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.
- π Add historical data logging.
- π± Create a mobile app version.
- π Implement email or SMS alerts.
This project is open-source and free to use.