Print Friendly, PDF & Email

Introduction:

This kit explains how to make an online weather station using the Wi-Fi module. It is a stand-alone weather station that collects weather updates from openweathermap.org and displays the retrieved information on I2C 16x2LCD.

Software Required:

Arduino IDE – https://www.arduino.cc/en/main/software

Additional Links:

Hardware Required:

  • NodeMCU – buy
  • Breadboard – buy
  • I2C Board – buy
  • 16×2 LCD – buy
  • Jumper wires M-F – buy
  • Micro USB cable – buy

Circuit Connections:

S.No.

NodeMCU

I2C

1

Vin

VCC

2

GND

GND

3

D2

SDA

4

D1

SCL

Circuit Diagram:

Installation:

Getting API Key and City Code:

  • Go to openweathermap.org and create an account if you do not have one.
  • Log in to your account you will find API Key in Home > Setup tab.
  • Copy and paste this key to a separate notepad file will need it later.
  • You can call by City ID to get API response with exact result.
  • List of city id city.list.json.gz can be downloaded here http://bulk.openweathermap.org/sample/
  • Extract .gz file using 7-Zip and open .json file using Notepad++
  • Search your City ID and paste it in notepad file will need it later.

Programming:

Once the circuit part is done, NodeMCU is needed to be programmed. Here is the code to run on NodeMCU.

Make changes in ssid, password, APIKEY, CityID inside “    “ and input your data.

Before uploading select NodeMCU as Board and a valid port.

 

Get the code from here