DIY Weather Globe 🌦️ESP32 WiFi Weather Robot Project for Kids

DIY Weather Globe 🌦️ESP32 WiFi Weather Robot Project for Kids
🌦️ ROBOTICS FOR KIDS · LEVEL: INTERMEDIATE

Build a Weather Globe That Checks the Sky for You!

Meet Gale — an ESP32-powered globe that connects to WiFi, downloads real live weather data, and smoothly rotates a servo-powered arrow to point at Sunny, Cloudy, Rainy, or Stormy — while a bright OLED screen shows the exact temperature.

⏱️ 3–4 hours 🎂 Ages 10+ (with an adult) 📡 Real Live Weather Data
24°C

🌤️ Say hi to Gale, your WiFi weather globe!

What Is a WiFi Weather Globe, Anyway?

Gale is an IoT (Internet of Things) project — a device that connects to the internet to do something useful in the real world. Using its built-in WiFi, the ESP32 microcontroller downloads live weather data from a weather service, figures out if it's sunny, cloudy, rainy, or stormy, and moves a servo-powered arrow to point at the matching symbol while showing the exact temperature on a small screen.

📶 Live WiFi Weather Data 🧭 Servo-Powered Weather Arrow 🖥️ Live OLED Readout ⛈️ Storm Alert Buzzer
🧰

What You'll Need

Gather these parts before you start building Gale!

x1

ESP32 Development Board

Has built-in WiFi to download live weather data.

x1

SG90 Micro Servo

Rotates the weather arrow to the correct symbol.

x1

0.96" I2C OLED Display

Shows the live temperature and weather condition.

x1

Small Buzzer (optional)

Sounds a short alert if a thunderstorm is detected.

x1

Clear Plastic or Glass Globe/Dome

Houses the arrow and weather symbols.

x1

Printed Weather Symbols

Sun, cloud, rain, and storm icons arranged in a circle.

x1

Breadboard

For connecting everything without soldering.

x1

Free OpenWeatherMap API Key

Lets your ESP32 request real weather data online.

~8

Jumper Wires

Male-to-male and male-to-female.

🔌

The Circuit Diagram

The OLED, servo, and buzzer connect to the ESP32's GPIO pins — WiFi itself needs no extra wiring, since it's built into the board.

ESP32 Dev Board WiFi Built-In 📶 GPIO 21 (SDA) — OLED GPIO 22 (SCL) — OLED GPIO 13 — Servo Signal GPIO 12 — Buzzer 3.3V/5V GND OLED Display (I2C) Weather Arrow Servo Buzzer
OLED → GPIO 21 (SDA), GPIO 22 (SCL) Servo → GPIO 13 Buzzer → GPIO 12 WiFi is built into the ESP32 — no extra wiring needed!
🛠️

Step-by-Step Build Instructions

Ask an adult to help you sign up for a free weather API key. Let's build Gale!

1

Get a free weather API key

Sign up for a free account at OpenWeatherMap.org and copy your personal API key — you'll need to paste it into the code.

💡 Tip: New API keys can take up to an hour to activate, so grab yours early before you start testing!
2

Wire the OLED, servo, and buzzer

Connect the OLED's SDA and SCL to GPIO 21 and 22, the servo's signal wire to GPIO 13, and the buzzer to GPIO 12, exactly as shown in the circuit diagram.

3

Build the weather symbol ring

Print or draw sun, cloud, rain, and storm symbols and arrange them evenly in a circle around where the arrow will point, inside your clear globe or dome.

4

Mount the arrow on the servo

Attach a light arrow shape to the servo horn, positioned at the center of your weather symbol ring.

5

Install the libraries

In the Arduino IDE, install ESP32Servo, ArduinoJson, Adafruit_SSD1306, and Adafruit_GFX from the Library Manager.

6

Update the code with your details

Edit the code below with your WiFi name, WiFi password, API key, and city name, then upload it to your ESP32.

7

Watch Gale check the weather!

Once connected, the OLED will show the temperature and condition, and the arrow will smoothly rotate to point at today's weather.

💻

The ESP32 Code

This code needs the ESP32Servo, ArduinoJson, and Adafruit_SSD1306 libraries. Fill in your WiFi details and API key, then click Upload.

weather_globe.ino
// 🌦️🤖 Gale the WiFi Weather Globe — ESP32 Robotics Project
// Downloads live weather data and points a servo arrow at Sunny, Cloudy, Rainy, or Stormy

#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <ESP32Servo.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// ---- Fill in your own details here ----
const char* ssid     = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";
String apiKey  = "YOUR_OPENWEATHERMAP_API_KEY";
String city    = "London";

Servo weatherArrow;
const int servoPin  = 13;
const int buzzerPin = 12;

Adafruit_SSD1306 display(128, 64, &Wire, -1);

unsigned long lastUpdate = 0;
const unsigned long updateInterval = 600000;  // check every 10 minutes

void setup() {
  Serial.begin(115200);
  weatherArrow.attach(servoPin);
  pinMode(buzzerPin, OUTPUT);

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  showMessage("Connecting WiFi...");

  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
  }
  showMessage("WiFi Connected!");
  delay(1000);

  fetchWeather();   // get the weather immediately on startup
}

void loop() {
  if (millis() - lastUpdate > updateInterval) {
    fetchWeather();
    lastUpdate = millis();
  }
}

// Downloads the latest weather and updates the arrow + display
void fetchWeather() {
  if (WiFi.status() != WL_CONNECTED) return;

  HTTPClient http;
  String url = "http://api.openweathermap.org/data/2.5/weather?q=" + city +
               "&appid=" + apiKey + "&units=metric";
  http.begin(url);
  int httpCode = http.GET();

  if (httpCode == 200) {
    String payload = http.getString();
    StaticJsonDocument<1024> doc;
    deserializeJson(doc, payload);

    float temperature = doc["main"]["temp"];
    String condition = doc["weather"][0]["main"].as<String>();

    moveArrowToCondition(condition);
    showWeather(temperature, condition);

    if (condition == "Thunderstorm") {
      tone(buzzerPin, 1000, 500);
    }
  } else {
    showMessage("Weather fetch failed");
  }

  http.end();
}

// Rotates the arrow servo to match the current weather condition
void moveArrowToCondition(String condition) {
  int angle = 90;   // default middle position
  if (condition == "Clear") angle = 0;
  else if (condition == "Clouds") angle = 60;
  else if (condition == "Rain" || condition == "Drizzle") angle = 120;
  else if (condition == "Thunderstorm") angle = 180;

  weatherArrow.write(angle);
}

// Shows the temperature and condition on the OLED
void showWeather(float temp, String condition) {
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 10);
  display.print(temp, 1);
  display.println(" C");
  display.setTextSize(1);
  display.setCursor(0, 40);
  display.println(condition);
  display.display();
}

// Shows a short status message on the OLED
void showMessage(String msg) {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 25);
  display.println(msg);
  display.display();
}
🧠

How Does Gale Actually Work?

Here are the big ideas hiding inside this project:

📡

Making a Web Request

HTTPClient lets the ESP32 act like a tiny web browser, requesting a page of weather data from the internet and reading back the response.

📦

Parsing JSON

Weather services send data in a format called JSON — ArduinoJson unpacks that text into values your code can actually use, like doc["main"]["temp"].

⏱️

Checking on a Timer

Using millis() instead of delay() lets Gale check the weather every 10 minutes without freezing or blocking anything else in the meantime.

🎯

Turning Words into Angles

moveArrowToCondition() matches text like "Rain" to a specific servo angle — a simple but powerful way to turn data into physical motion.

🧑‍🔬 Safety First!

  • Build with an adult, especially when setting up WiFi credentials and API keys.
  • Never share your WiFi password or API key publicly, including in photos of your code.
  • Keep fingers clear of the servo arrow while it's moving.
  • This project simply displays weather information — never rely on it alone for real safety decisions during severe weather.

Frequently Asked Questions

Why do I need ESP32Servo instead of the regular Servo library?

The ESP32 handles timing signals differently from a classic Arduino, so the standard Servo library doesn't work reliably on it — ESP32Servo is a version built specifically to work correctly on ESP32 boards.

My display shows "Weather fetch failed" — what's wrong?

Double-check your WiFi name and password, confirm your API key has finished activating (this can take up to an hour), and make sure your city name is spelled correctly.

Can I add more weather conditions?

Yes! Add more else if checks in moveArrowToCondition() for conditions like "Snow" or "Mist", and add a matching symbol and servo angle for each.

What age group is this project good for?

This project is great for kids around age 10+ working with an adult, especially as an introduction to WiFi, web requests, and real-world data.

🎉 Fantastic work — you just built a real internet-connected weather robot! Check back throughout the day and watch Gale's arrow update with the real sky outside.

⬆️ Back to Materials List

Comments

Product Cards
Buddy Bot eBook
⭐ New 2026 Release
Build Your
Own Robot!
3D design, wiring &
Arduino coding.
Young inventors love it!
🖨️
3D Print
All parts
Wire it
Circuit guide
💻
Code it
Arduino IDE
🤖
Watch it
Walk & react
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Website Offer
₹499 300
🌍 International: $5 USD
One-time · Instant digital delivery
🔒 Secured by Razorpay · Your data is safe
📄 Download Free Sample Copy
🔒 Secured by Razorpay · Your data is safe
🍓
Raspberry Pi Pico Mastery
21 Projects
⚡ Launch Price — 80% OFF
Learn Pico
Build 21 Projects!
MicroPython · Wokwi
IoT · Certificate
Perfect for beginners!
🖥️
Wokwi
No hardware
🐍
MicroPy
From zero
🔨
21 Projects
IoT + sensors
📄
Certificate
Verified cert
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Launch Offer
₹999 200 80% OFF
🌍 International: $5 USD
One-time · Lifetime access · No subscription
🔒 Secured by Razorpay · UPI · Cards · NetBanking
🎉

You're in!

Payment successful! Your Buddy Bot eBook is ready. Time to build!

📖 Access Your eBook Now
🎉

Enrolled!

Payment successful! Lifetime access to all 21 Pico Projects is yours!

🍓 Go to My Course