ESP8266 Colored Weather Station

5,780

25

6

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

Materials:

Tools:

  • soldering iron
  • screw driver
  • side cutting pliers
  • voltmeter (optional)

Software:

  • Arduino IDE

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

http://www.silabs.com/products/development-tools/s...

If you want to use the Wemos D1 you have to install the drivers for the CH340 USB interface instead:

http://www.wch.cn/download/CH341SER_ZIP.html

Step 4: Preparation of Arduino IDE for ESP8266

  1. 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..
  2. Close this window with the OK Button.Open now the board manager: Tools / Board / Board Manager
  3. Go to the ESP8266 entry and install it
  4. 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

  1. Mini Grafx by Daniel Eichhorn: https://github.com/ThingPulse/minigrafx
  2. ESP8266 WeatherStation by Daniel Eichhorn: https://github.com/ThingPulse/esp8266-weather-stat...
  3. Json Streaming Parser by Daniel Eichhorn: https://github.com/squix78/json-streaming-parser/b...
  4. 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

https://blog.squix.org

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:

WiFi:

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";

Your location:

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";

Time:

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.

Share

    Recommendations

    • Classroom Science Contest

      Classroom Science Contest
    • Fandom Contest

      Fandom Contest
    • Pets Challenge

      Pets Challenge

    6 Discussions

    0
    None
    harty123

    12 days ago

    Dear Dan,
    sorry for this delay, but I'm visiting this page from time to time only.
    About your questions:

    ArduiTouch is not available on eBay

    You can use other ILI9341 based displays too.

    Question 1 and 2: Looks like your display have no touchscreen. In this case the program detects permanently touch events. You have to use a display with touch.

    Question 3: #define UTC_OFFSET -3

    BR
    Hartmut

    1 reply
    0
    None
    dancopyharty123

    Reply 11 days ago

    Thank you Hartmut,
    I have now purchased by ebay a Display ili9341 3.2" with Touch.
    I contacted 'hwhardsoft.de' about Enclosure for screens 3.2" but they told me they did not manufacture it. I really liked Enclosure for 2.4".
    In question 3, because it is a Brazilian time, would not it have to be another rule, in "struct dstRule StartRule =" ?
    And now in Brazil there is no Daylight Saving Time.
    Thanks again

    0
    None
    dancopy

    13 days ago

    I would like an answer, kindly!
    I can send you a little video on youtube. Thanks

    0
    None
    dancopy

    16 days ago

    I have some questions:
    1) The clock numbers do not stop, for example, 23:07:35, the first two digits change between 23 and 11, 23 and 11, always blinking.
    2) How to fix the format from 12 to 24 hours in the sketch? (without the Touch function?)
    3) How to define a specific 'UTC_OFFSET' rule for Brazil? (it's -3 hours)
    Thank you

    PS. The main thing is question 1

    0
    None
    harty123

    7 months ago

    Yes, it based on openweathermap

    0
    None
    KarlS97

    Question 7 months ago

    Does this report conditions based on the openeeathermap data or does it have local sensors to report conditions as well?