Make Esp8266 Weather Station

About the project

This project is a wonderful project for IoT beginners who want to learn about retrieving data from an Online Internet server to NodeMCU

Project info

Items used in this project

Hardware components

wemos d1 wemos d1 x 1
NodeMCU v2-Lua based ESP8266 development kit NodeMCU v2-Lua based ESP8266 development kit x 1
Monochrome 0.96" OLED Graphic Display Monochrome 0.96" OLED Graphic Display x 1
Jumper Wire Kit - 140pcs Jumper Wire Kit - 140pcs x 1

Software apps and online services

arduino ide arduino ide

Hand tools and fabrication machines

3d printer 3d printer x 1


IOT Weather Station with ESP8266 OLED:

In this Latest IoT project, we will learn how to make an IoT Based Simple Online Weather Station using ESP8266 NodeMCU (wemos D1) 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 an 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 and display it on SSD1306 screen.

Thank You, NextPCB:

This project is successfully completed because of the help and support from NextPCB. Guys if you have a PCB project, please visit their website and get exciting discounts and coupons.
Only 0$ for 5-10pcs PCB Prototypes

Register and Get $100 from NextPCB:

See more info about PCB Assembly Capabilities:

1: Bill of Materials

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. Wemos D1 (
  2. OLED Display (
  3. Connecting Wires (

Step 2: Block Diagram – IOT Weather Station:

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

The website provides an online service for weather data and forecast.

The data is upload on a cloud server. ESP8266 Wifi Module collects the data information online and download/retrieve the info like temperature, humidity, pressure, wind speed, and wind directional degree.

Step 3: Circuit Diagram & Connection:

Step 4: Preparation of Arduino IDE for ESP8266

The ESP8266 module isn't part of the Arduino-IDE.

1. We have to install it first. Open file / preferences in the Aduino -IDE and insert the following link in the Additional Boards Manager URLs field:

2. this window with the OK Button.

3. Open now the board manager: Tools / Board / Board Manager

4. Go to the ESP8266 board entry and install it now you can choose LOLIN(WEMOS) D1 R2 & mini.

5. Set the CPU frequency to 80MHz, Flash Size to "4MB (FS:3MB OTA:~512KB)", and the COM port.

Step 5: 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 and sign in by creating your account.

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

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.

As your device will be displaying data from OpenWeatherMap you need an "API key" from them.
1. Go to

2. note of the features in the "Free" column.

3. By using the free plan you are limited to 60 calls per minute.

4. In the "Free" column click on "Get API key and Start".

5. Once the API key is created you can come back to this page any time to edit or delete it. API key which will be required in our code in the next step.

 6: Source Code/Programs:

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

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

The electronics can be programmed as usual if you have the knowledge. Alternatively there are lot of codes in the internet when looking for: ESP8266 OLED SSD1306.
For example the weather widget I found here:

I created a forum where ideas, hints, code, hardware information etc. can be exchanged:

7: 3D Printed Enclouser

First print the project enclosure

I have used my Ender3 3D printer

It took me about 1 hours to print parts.

The enclosure has 2 parts:1. case 2. Back Cover

My settings are: Print Speed: 60 mm/s

Layer height: 0.2mm ( 0.3 also works well)

Fill Density: 20%

Extruder Temperature: 220degC

Bed Temp: 60deg 


Step 8: Install the All Parts in Enclosure

Insert the display into the enclouser.

Install the front Cover

After mounting the display and circuit board The enclosure is designed is not tight clearance, so you need any glue or screw to hold the front covers.

Step 9: Enjoy

It works great

For a quick test, just powering with powerbank The weather station should be turned ON.

Schematics, diagrams and documents


CAD, enclosures and custom parts





Leave your feedback...