This project is a series of enhancements made to the original color weather station for the ESP8266 created by Daniel Eichorn, with contributions by several others. Though the original display layout came from squix78, I've made substantial changes to add additional information.
This version of the project was written specifically for the WeMos Mini D1 with the 2.8" or 3.2" color LCD display based on the ILI9341 and XPT2046 touchscreen controller that squix78 used. These can be had very inexpensively from sources such as AliExpress (<$10, shipped to the US, or slightly more for the 3.2" version). You may also want to pick up a cheap stylus for the screen if it doesn't come with one.
This edition (v15) has been in development for almost a year now and I have been running this code for several months now; it seems to be pretty stable despite the large number of changes.
Note that the wiring for this version is somewhat different from prior releases in order to support the touchscreen functions. I have also attempted to deal with some instability issues that occurred with the prior releases. First, I added a short delay following the TFT initialization, which seemed to eliminate some issues with periodic "white screen" displays at power-up. Second, I added a 1000uF capacitor between the VCC and GND pins on the WeMos mini, in order to avoid sags in the voltage during WiFi operations. Third, I soldered jumper J1 on the TFT board to bypass the on-board regulator since the board is being powered directly from the WeMos 3.3V supply. (The additional regulator in-line was causing the voltage to drop below specifications for the TFT display.) All of these changes seem to have resulted in a much more stable station.
This release contains significant changes over prior releases, including support for touchscreen functions. (You may want to review the README files for v8 and v11d in my other repositories, as this version builds on those enhancements.) (Note: As a result of prior changes to the Weather Underground client library to support corrections to the weather icons, I've submitted a pull request to merge these changes into the original master. This is still pending, so I've included a copy of the changed library in the "/Weather Underground Client Library" folder. Replace your copy in your libraries folder for the IDE with this copy (both the .cpp and .h files). Note that this library version does not include squix78's most recent updates he made for the MiniGrafx library, including improvements in memory used.)
Some of the touchscreen functions added:
All of these touch displays return to the normal "rotating" screens by touching the screen again.
A few of the other changes / enhancements:
( Added 04/06/18 )
ILI9341 | NodeMCU | WeMos D1 Mini | ESP8266 Pin |
---|---|---|---|
T_IRQ | D4 | D4 | GPIO2 |
T_DO | D6 | D6 | GPIO12 |
T_DIN | D7 | D7 | GPIO13 |
T_CS | D3 | D3 | GPIO0 |
T_CLK | D5 | D5 | GPIO14 |
SDO/MISO | D6 | D6 | GPIO12 |
LED | D8 | D8 | GPIO15 |
SCK | D5 | D5 | GPIO14 |
SDI/MOSI | D7 | D7 | GPIO13 |
DC/RS | D2 | D2 | GPIO4 |
RESET | RST | RST | RST |
CS | D1 | D1 | GPIO5 |
GND | GND | GND | GND |
VCC | 3V3 | 3V3 | 3V3 |
Note that I have not tested the NodeMCU pin references, but from what I understand these are the same as for the WeMos D1 mini. Verify and test these at your own risk! Also, note that some of these require more than one connection to the same pin. Though this can be accomplished a number of ways, I highly recommend get some of the WeMos prototyping boards (if you are using this ESP variant) and soldering the connections directly to this board, then slipping it over the pin headers on the WeMos itself. This also allows a good location for soldering the capacitor if you elect to use it.
( As noted from the v8 README, with the removal of the double-reset detector library, no longer used in this version )
After several requests, I have added a summary of the contributed libraries with links below to make it easier to find and include these. Most all of these come from the original examples on squix's site, but I admit that the list has become somewhat long and it took me some time to find all of these originally.
Library Referenced | Description | Link |
---|---|---|
Part of ESP8266 core, SPIFFS filesystem support | ||
Adafruit's core graphics library | https://github.com/adafruit/Adafruit-GFX-Library | |
Adafruit's ILI9341 LCD hardware-specific library | https://github.com/adafruit/Adafruit_ILI9341 | |
XPT2046 library for touch-screen controller by Paul Stoffregen | https://github.com/PaulStoffregen/XPT2046_Touchscreen | |
WiFi Manager library by Tzapu | https://github.com/tzapu/WiFiManager | |
JSON library by Bblanchon | https://github.com/bblanchon/ArduinoJson | |
JSON streaming parser by Squix78 | https://github.com/squix78/json-streaming-parser | |
Weather Underground client library by Squix78 (Note (1) ) | https://github.com/squix78/esp8266-weather-station | |
Simple daylight-savings time adjustment by Neptune | https://github.com/neptune2/simpleDSTadjust | |
"TimeZone.h" | Time zone conversion library by JChristensen | https://github.com/JChristensen/Timezone |
"DHT.h" | Adafruit's DHT sensor library | https://github.com/adafruit/DHT-sensor-library |
Adafruit's Unified Sensor library | https://github.com/adafruit/Adafruit_Sensor |
(Note that though I included the SPIFFS library in the list above, I elected not to document all of the other core libraries.) Also note that though I do not use the DHT sensor in my setup (nor Thinkspeak as in the original code), I've maintained the bulk of this code in order to make it easier for those that elect to use it. As a result, the Adafruit libraries for the DHT sensors and their Unified Sensor library are required for compilation.
Note 1: Until my customizations are merged, replace the library contents with my changes located in the Weather Underground Client Library folder
( Added 04/06/18 )