Real-Time Weather Station Using Arduino EK Wi-Fi, DHT 11 & OLED 0.96 Inch

by rohanbarnwal in Circuits > Arduino

93 Views, 4 Favorites, 0 Comments

Real-Time Weather Station Using Arduino EK Wi-Fi, DHT 11 & OLED 0.96 Inch

ChatGPT Image May 9, 2025, 09_32_40 AM.png

Welcome to one of the simplest yet highly practical IoT projects -- a real-time weather station using Arduino Ek Wi-Fi (Made in India), a DHT11 temperature & humidity sensor, and a compact OLED 128x64 display. Whether you're a beginner stepping into the world of micro-controllers or just want a neat project for your desk or room, this project is ideal for you

Objective

Build a weather monitoring system that reads temperature and humidity from the DHT11 sensor and displays the data on an OLED screen in real-time.

Inspiration & Story

While tinkering with basic sensors. I wanted to create a minimal yet functional device that combines multiple components. I figured that instead of using big screens or Wi-Fi dashboards, a small OLED could elegantly show environmental data.

And that's where the idea for this was born. Powered by Arduino UNO (Ek) Wi-Fi, this board gives the flexibility to later expand the project into an IoT solution -- maybe even pushing data to the cloud!

Applications

  1. Room or desk climate monitor
  2. Embedded IoT dashboard
  3. Educational mini-projects
  4. Weather logging station with future upgrades




Supplies

download (16).jpeg
download (15).jpeg
download (14).jpeg
download (13).jpeg
download (12).jpeg

Components Required

  1. Arduino UNO Ek R4 Wi-Fi Board x1
  2. DHT11 Sensor x1
  3. OLED Display (128x64 I2C) x1
  4. Jumper Wires As Needed
  5. Breadboard x1

Wiring Connections

Untitled Sketch_bb.jpg

DHT11 Sensor To Arduino Uno Ek R4 Wi-Fi

  1. VCC to 5v
  2. GND to GND
  3. Data to D7

OLED Display (I2C)

  1. VCC to 5v
  2. GND to GND
  3. SDA to A4
  4. SCL to A5


Code Breakdown

//Made by Rohan Barnwal
//www.youtube.com/ArduinoBoy

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <DHT.h>

// OLED display size
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

// I2C OLED
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

// DHT sensor setup
#define DHTPIN 7 // DHT sensor connected to digital pin D7
#define DHTTYPE DHT11 // Use DHT22 if needed
DHT dht(DHTPIN, DHTTYPE);

void setup() {
Serial.begin(9600);

// Initialize OLED
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
while (true);
}

display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);

// Step 1: Show "DHT READING"
display.setCursor(0, 20);
display.println("DHT READING");
display.display();
delay(2000); // Wait 2 seconds

// Step 2: Clear and show "ROHAN BARNWAL"
display.clearDisplay();
display.setCursor(0, 20);
display.println("ROHAN BARNWAL");
display.display();
delay(2000); // Wait 2 seconds

// Start DHT
dht.begin();
}

void loop() {
float humidity = dht.readHumidity();
float temperature = dht.readTemperature();

if (isnan(humidity) || isnan(temperature)) {
Serial.println(F("Failed to read from DHT sensor!"));
return;
}

Serial.print("Temp: ");
Serial.print(temperature);
Serial.print("°C Humidity: ");
Serial.print(humidity);
Serial.println("%");

display.clearDisplay();
display.setTextSize(2);

display.setCursor(0, 0);
display.print("Temp: ");
display.print(temperature, 1);
display.println(" C");

display.setCursor(0, 32);
display.print("Hum: ");
display.print(humidity, 1);
display.println(" %");

display.display();
delay(2000);
}

The code initializes the DHT11 and OLED display, prints a couple of intro screens and then starts reading data from the sensor every 2 seconds It prints the readings on both the serial monitor and the OLED display

Key Features:

  1. Uses Adafruit_SSD1306 and Adafruit_GFX libraries
  2. Displays Temperature (°C) and Humidity (%) in large font
  3. Shows startup messages ("DHT READING", "ROHAN BARNWAL")
  4. Fully customizable


Video Demonstration

This DIY Gadget Shows Real-Time Temperature! 🔥 #shorts #arduino #tech


Watch this quick demo (under 40 seconds) to see how the OLED displays the sensor reading in action! Don’t forget to Like, Share & Subscribe to support future projects.