ESP8266 Colored Weather Station

16,800

55

13

Introduction: ESP8266 Colored Weather Station

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.

1 Person Made This Project!

Recommendations

  • Pocket-Sized Speed Challenge

    Pocket-Sized Speed Challenge
  • Audio Challenge 2020

    Audio Challenge 2020
  • Maps Challenge

    Maps Challenge

13 Discussions

1
pierpa63
pierpa63

2 months ago

Fantastic project, works smoothly! I just had to change PIN reference with PIN numbers (5 instaed of D1, for instance...)
I'm planning to implement it to read settings from an SD card, so that you can change configiration without reflashing the sketch. Will keep you posted!
Cheers

1
martink69
martink69

Question 3 months ago

Hello, after powering it up it write on display connecting to wifi, but it dont connect to router. where can be problem? Thank you Martin

0
rudimunchen
rudimunchen

6 months ago

Hallo ich habe es geschafft
so geht es
Info: Ändere in esp8266 station master /SCR / OpenWeatherMapCurent.h die "id"
****Lese diese aus der Datei city.list.json herraus***
Viele Grüsse aus Bayern
Rüdiger

0
rudimunchen
rudimunchen

6 months ago

Hallo
Bei mir kommt die Meldung
Time difference for DST: 7200Getting url: http://api.openweathermap.org/data/2.5/weather?id..._ID&units=metric&lang=de
[HTTP] GET...
[HTTP] GET... code: 404
start document
Getting url: http://api.openweathermap.org/data/2.5/forecast?i...
[HTTP] GET...
[HTTP] GET... code: 404
start document
xxx= meine API Key
Ich habe alles so gemacht wie es beschrieben habe, mein Standort, ist München.
Vielleicht können Sie mir helfen bzw. ein Update der Software zu senden.
Mfg
Rüdiger

0
voiron38
voiron38

Question 6 months ago on Step 1

Bonjour.impossible de trouver les lib:OpenWeather(les2)
Astronomy.Comment faire .cette application c'est pour une classe de 4eme.à vous lire.Salutations

0
MyTechRock
MyTechRock

Question 7 months ago

i'm from india my utc +5.30 but show 30 min late time how to fix it

0
danielssonl50
danielssonl50

8 months ago

Hi
Just an reminder that you have forgott to tell wich display it is with SPI or I2C
and the size and model.
Thanks I love this clock

0
Zihatec
Zihatec

1 year 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

0
dancopy
dancopy

Reply 1 year 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
dancopy
dancopy

1 year ago

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

0
dancopy
dancopy

1 year 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
Zihatec
Zihatec

1 year ago

Yes, it based on openweathermap

0
KarlS97
KarlS97

Question 1 year ago

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