ReLeaf - AIoT Urban Heat Relief Network

Published Nov 28, 2025
 12 hours to build
 Beginner

ReLeaf saves lives in overheating cities by deploying smart IoT misting stations that automatically activate when AI predicts dangerous heat stress. This data-driven network combines real-time sensing, edge computing, and generative AI insights to provide instant, targeted cooling in public spaces.

display image

Components Used

ESP32-C6- DEVKITC-1-N8
Main microcontroller for AI analysis and signal control.
1
DHT 11 Sensor
Collects local environmental telemetry.
1
5V Relay Module (1-Channel)
Switches the high-voltage misting pump (simulated).
1
LED (Red)
Indicator for "Danger/Warning" status.
1
LED (Green)
Indicator for "Normal/Safe" status.
1
Resistors (220Ω or 330Ω)
Current limiting for LEDs.
1
Jumper Wires
1
LAPTOP
The main device where the system works and also the monitoring of sensors on dashboard
1
Description

The Problem: Cities are Burning

In the heart of the city, the summer sun isn't just bright—it's brutal. Concrete absorbs heat, asphalt radiates it back, and for commuters at bus stops or workers on construction sites, the air feels heavy and dangerous. This is the Urban Heat Island effect, a silent threat that causes heat exhaustion and heatstroke.

A tragic example of this occurred during a recent incident in Karur Tamil Nadu, where extreme heat became a catalyst for a deadly stampede. As temperatures soared, members of the crowd began collapsing from heatstroke and severe dehydration. The resulting panic and chaos led to fatalities that could have been prevented. This tragedy underscores a critical reality: extreme heat is not just an environmental issue; it is a public safety hazard that can turn ordinary gatherings into disasters.

The Solution: ReLeaf

ReLeaf is an intelligent micro-climate cooling network. Unlike standard fans that run blindly on timers, a ReLeaf station listens to the environment. It uses sensors to taste the air and an AI brain to predict danger.

When the system detects that the heat stress index (WBGT) has crossed a dangerous threshold, it automatically triggers a fine cooling mist, lowering the temperature instantly. It also connects to a city-wide dashboard where AI analyzes the data to give health advice.

Detailed Feature Breakdown

We designed ReLeaf with four core features that make it smarter than a regular cooling fan.

1. Hybrid Sensing (The "Eyes")

  • What it does: The system doesn't just rely on one source of truth. It monitors the immediate area while keeping an eye on the broader weather patterns.
  • How it works: We use a physical DHT11 sensor to measure the exact temperature and humidity right next to the user. Simultaneously, the system connects to the internet to fetch hourly weather forecasts from the Open-Meteo API.
  • Why it matters: A sensor in the sun reads differently than a weather station miles away. Combining both gives us the most accurate picture of heat stress.

2. Edge AI Brain (The "Mind")

  • What it does: Instead of using simple rules (like "turn on if temp > 35°C"), ReLeaf calculates how the heat actually feels to the human body.
  • How it works: A Python script running on a nearby laptop (or Raspberry Pi) acts as an Edge Gateway. It runs a trained Machine Learning model (Decision Tree) that takes temperature, humidity, and time of day to calculate the Wet Bulb Globe Temperature (WBGT)—the gold standard for measuring heat stress.
  • Why it matters: 30°C with high humidity is far more dangerous than 35°C with dry air. Our AI understands this difference and only activates when necessary, saving water and energy.

3. Smart Actuation (The "Hands")

  • What it does: It takes immediate physical action to cool the environment without waiting for human permission.
  • How it works: When the AI predicts "Danger," it sends a signal to the ESP32 microcontroller. The ESP32 flips a Relay Switch, which turns on the water pump and misting nozzles.
  • Why it matters: In a heatstroke emergency, seconds count. Automatic activation ensures relief arrives instantly.

4. Generative AI Analyst (The "Voice")

  • What it does: It translates complex sensor data into clear, human-readable health advice.
  • How it works: The dashboard sends the raw telemetry (e.g., "Temp: 38°C, Humidity: 85%") to Google's Gemini API. The Large Language Model (LLM) analyzes this and returns a natural language report like, "Critical heat stress detected! ☀️ The air feels like 45°C. Risk of dehydration is high. Misting system active."
  • Why it matters: City officials or volunteers don't need to be meteorologists to understand the dashboard. The AI tells them exactly what is happening and what to do.

System Flow
 

PlantUML diagram

Step 1: Hardware Setup

The heart of our project is the ESP32, a powerful microcontroller with Wi-Fi capabilities. We connect it to a DHT11 sensor to monitor the immediate environment and a Relay Module to control the water pump (represented here by an LED/Pump).

Circuit Connections:

  • DHT11 Data Pin → GPIO 4
  • Mist Actuator (Relay) → GPIO 15
  • Danger Indicator (Red LED) → GPIO 5
  • Safe Indicator (Green LED) → GPIO 6
  • VCC & GND → Connected to common power rails on the breadboard.

Step 2: The Device Firmware (ESP32 C6)

  • We program the ESP32 using the Arduino IDE. The code performs three main tasks:
  • Sensing: Reads local Temperature and Humidity.
  • Forecasting: Connects to Wi-Fi and fetches hourly weather forecasts from the Open-Meteo API.
  • Communication: Sends all this data to our laptop (the Edge Gateway) via Serial for processing and waits for a command.

Step 3: The Brain (Edge Machine Learning)

  • The ESP32 is great for sensing, but for complex decision-making, we use a Python script running on a laptop as an Edge Gateway.
  • We trained a Decision Tree Classifier using scikit-learn. This model looks at multiple factors—temperature, humidity, apparent temperature, and time of day—to calculate the probability of heat stress.
  • The Python script listens to the ESP32, runs the model, and sends back a simple decision: 1 (Danger) or 0 (Safe).

 

 

Step 4: The Cloud & AI Dashboard

  • Finally, we need a way for city managers to monitor the system. The ESP32 publishes its status to an MQTT Broker.
  • We built a beautiful Command Center Web App using HTML5 and Tailwind CSS. It connects to the MQTT broker over WebSockets to show real-time data.
  • Generative AI Feature: We integrated the Google Gemini API into the dashboard. When a user clicks "Analyze Conditions," the app sends the raw sensor data to the LLM. Gemini acts as an expert analyst, explaining why the system is active and providing health recommendations.

Step 5: Testing the System

  1. Power Up: Plug the ESP32 into the laptop.
  2. Start Gateway: Run the Inference.py script.
  3. Open Dashboard: Launch index.html in a browser.
  4. Simulate Heat: Blow the dryer on the DHT11 sensor to raise the humidity and temperature.
  5. Observe:
    • The Python script detects the rise and predicts "Danger".
    • The Red LED on the breadboard lights up.
    • The Dashboard turns Red and pulses "DANGER DETECTED".
    • Gemini API reports: "High heat stress detected! Misting activated."

Platforms

  • Software: Python, VS Code,Arduino IDE
  • Cloud/API: MQTT, Open-Meteo, Google Gemini API

Bill of Materials(BOM) 

https://www.digikey.in/en/mylists/list/3QVSC1COBF

Live Dashboard

https://releaf-sandy.vercel.app/

Codes

Downloads

circuit_image Download
Comments
Ad