In this instructable I want to show you how to build a nice ESP8266 weather station for wall mount with weather forecast and coloured tft screen.
Step 1: Tools and Materials
Step 2: Assembly of the ArduiTouch Kit
You have to assemble the ArduiTouch kit first. Please have a look in the enclosed construction manual.
Step 3: Installing the USB Drivers
The NodeMCU module includes a CP2102 chip for the USB interface. Usually the driver will be installed automaticaly if the NodeMCU is connected the first time with the PC. Sometimes this procedure failed. In this case you have to install the driver
If you want to use the Wemos D1 you have to install the drivers for the CH340 USB interface instead:
Step 4: Preparation of Arduino IDE for ESP8266
- The ESP8266 module isn't part of the Arduino-IDE. 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: http://arduino.esp8266.com/stable/package_esp8266..
- Close this window with the OK Button.Open now the board manager: Tools / Board / Board Manager
- Go to the ESP8266 entry and install it
- Now you can choose NodeMCU 1.0 (ESP-12E Module) or WeMos D1 R2 & mini. Set the CPU frequency to 80MHz, Flash Size to „4M (3M SPIFFS)“ , the baud rate of your choice and the COM port. 4 of
Step 5: Installation of Additional Libraries
Install the following libraries through Arduino Library Manager
- Mini Grafx by Daniel Eichhorn: https://github.com/ThingPulse/minigrafx
- ESP8266 WeatherStation by Daniel Eichhorn: https://github.com/ThingPulse/esp8266-weather-stat...
- Json Streaming Parser by Daniel Eichhorn: https://github.com/squix78/json-streaming-parser/b...
- simpleDSTadjust by neptune2: https://github.com/neptune2/simpleDSTadjust
You can also download the library also directly as ZIP file and uncompress the folder under yourarduinosketchfolder/libraries/
After installing the libraries, restart the Arduino IDE.
Step 6: Source Code
The source code for the weather-station based on the awesome sources by Daniel Eichhorn
We have made some small changes to made code compatible for ArduiTouch. You have to unpack the Zip archive in a new directory with the same name.
Step 7: Custom Settings in Settings.h
In the source code you will find a file named settings.h. Some changes in this file are required for customisation:
Please enter the SSID and pasword in the lines 25 and 26 of settings.h
#define WIFI_SSID "yourssid"
#define WIFI_PASS "yourpassw0rd"
Account for OpenWeatherMap:
To receive later data by the platform OpenWeatherMap you will need an own account. Sign up here to get an API key: https://docs.thingpulse.com/how-tos/openweatherma...
Enter your API key in line 38 of settings.h
String OPEN_WEATHER_MAP_APP_ID = "your_api_key";
Go to https://openweathermap.org/find?q= and search for a location. Go through the result set and select the entry closest to the actual location you want to display data for. It'll be a URL like https://openweathermap.org/city/2657896. The number at the end is what you assign to the constant below.
Enter the number and name of your location in line 45 and 46 of settings.h
String OPEN_WEATHER_MAP_LOCATION_ID = "2804279";
String DISPLAYED_CITY_NAME = "Ziesar";
Please choose your timezone in line 65 of settings.h
#define UTC_OFFSET +1
Step 8: Run the Code
Please open this sample in the Arduino IDE. After compilation and upload you will see the current time and temperature of your location. Further more an weather forecast for the next few days is displayed. The touch has only one function. You can choose the displayed time format by touching in the upper part of the screen.