IOT Weather Station with NodeMCU OLED & OpenWeatherMap

IOT Weather Station with NodeMCU OLED & OpenWeatherMap (Last Updated On: February 22, 2019)

IOT Weather Station with NodeMCU OLED:

In this Latest IoT project, we will learn how to make a IOT Based Simple Online Weather Station using ESP8266 NodeMCU (ESP-12E) Wi-Fi development board and SSD1306 OLED display (128×64 Pixel). This project is a wonderful project for IOT beginners who want to learn about retrieving data from Online Internet server to NodeMCU board.

The NodeMCU pulls weather data like temperature, humidity, pressure, wind speed and wind directional degree from weather website called openweathermap.org and display it on SSD1306 screen.




Components Required:

As the topic is clear, i.e IOT Weather Station with NodeMCU OLED & OpenWeatherMap, we just need OLED Display and NodeMCU wifi Module for this project. You can purchase these components from Amazon.

1. NodeMCU ESP8266 12E Module – (Buy Online from Amazon)
2. 0.96″ OLED Display – (Buy Online from Amazon)


Block Diagram – IOT Weather Station:

This is a simple block diagram for IOT Weather Station which simply explains how the System works.

IOT Weather Station with NodeMCU OLED & OpenWeatherMap

The website openweathermap.org provides an online service for weather data and forecast. The data is upload on a cloud server. NodeMCU ESP8266 Wifi Module collects the data information online and download/retrieve the the info like temperature, humidity, pressure, wind speed and wind directional degree.

These data are displayed on 0.96″ SSD1306 OLED Display along with City.


Circuit Diagram & Connection:

IOT Weather Station with NodeMCU OLED & OpenWeatherMap

The SDA and SCL lines of the I2C bus come from GPIO4 (D2) and GPIO0 (D3) of the NodeMCU board (respectively), they are connected to SDA and SCL (SCK) pins of the SSD1306 display module. The OLED display module is supplied with 5V from the Vin pin of NodeMCU board.


Generating API from OpenWeatherMap:

OpenWeatherMap Access current weather data for any location including over 200,000 cities all over the world. Current weather is frequently updated from more than 40,000 weather stations. The data is available in JSON, XML, or HTML format. We will use the data in JSON format here.

Visit https://openweathermap.org and sign in by creating your account.

IOT Weather Station with NodeMCU OLED & OpenWeatherMap

Create or Generate your API Key as it is need for retrieving data.

IOT Weather Station with NodeMCU OLED & OpenWeatherMap

Select the city and country code by entering your city name. Example: Jaipur, IN here Jaipur is a city and IN is a country code for India. City name and country code need to be entered on code.

IOT Weather Station with NodeMCU OLED & OpenWeatherMap


Source Code/Programs:

Below is the code for IOT Weather Station with NodeMCU OLED & OpenWeatherMap. You need 3 different library for that, i.e Adafruit_GFX.h, Adafruit_SSD1306.h and ArduinoJson.h. You can get all these libraries from Library Manager.

Enter the WIFI SSID, Password and City Name with Country Code. Now you can upload this code to NodeMCU Board.


Video Tutorial & Explanation:

Recommended For You

About the Author: Alex Newton

1 Comment

  1. Hello Sir,
    The video shows you using a I2C oled, but the circuit diagram shows it’s a SPI oled. I am a bit confused as I made the connections using the circuit diagram and the oled doesn’t show anything. Please help.

Ask A Question .......

Close