Weather report on LCD using NodeMCU and openweathermap.org
Libraries to be installed:
- LiquidCrystal
- Arduino_JSON
Components required:
- NodeMCU
- LCD 16x2
- jumpwires
- openweather API key
NOTE: Install NodeMCU drivers for arduino IDE.
Procedure:
- Goto sketch -> include library -> manage libraries.
- Search for "LiquidCrystal" by Arduino, then click on install.
- Search for "Arduino_JSON" by Arduino, then click on install.
- Replace "WIFI_SSID" with your wifi name and replace "WIFI_PSWD" with your wifi password.
- In line 12 of code, Enter your API key from the openweathermap.org.
- In line 13 and 14, Enter your city name and country code as per your location in openweathermap.org respectively.
- Now upload the program by selecting the correct board and port.
How to get an API key from openweather map:
- goto the site -> https://openweathermap.org/
- create and account.
- goto homepage -> click your name on the top right -> select My API keys.
- Here you can see your cityname and country code of your location.
- In the "MY API keys" section, we can use the default API key or we can generate a new API key.
- Now use this API key in your program.
Connections:
LCD --> NodeMCU
- VSS --> GND
- VDD --> vin
- VO --> from pot
- RS --> D1
- RW --> GND
- E --> D2
- D0 --> No connection
- D1 --> No connection
- D2 --> No connection
- D3 --> No connection
- D4 --> D3
- D5 --> D5
- D6 --> D6
- D7 --> D7
- A --> 3.3v
- K --> GND