FZ2691-ESP8266 Weather Station DIYMall With Picture of Wiring-Revised
FZ2691-ESP8266 Weather Station DIYMall With Picture of Wiring-Revised
com
Formatted: Font: 24 pt
This weather station allows you to gather data from the web (weather, plane, Stock market)
and the DHT sensor data and displays it on the screen. It will also display the time and date.
This is a tutorial for the weather station so most of this will be in regard to that!
You will need to get a few extra libraries for your Arduino IDE and open up an account on
Weather underground and Thingspeak to get API keys for the weather station. The accounts are
free accounts and do not cost anything unless you query the weather underground website
more for quicker updates than what is set with this code.
Formatted: Font: 12 pt
Formatted: Font: 12 pt
www.diymalls.com [email protected]
Formatted: Font: 12 pt
Formatted: Font: 12 pt
www.diymalls.com [email protected]
Formatted: Font: 12 pt
www.diymalls.com [email protected]
Formatted: Font: 12 pt
Then sign up for Thingspeak account (thingspeak.cCom) and get API key from there, Really only
need to write down the read API key and the Channel number.
Formatted: Font: 12 pt
www.diymalls.com [email protected]
Formatted: Font: 12 pt
www.diymalls.com [email protected]
Formatted: Font: 12 pt
Next you will need to open up Arduino IDE and go to Include Library under the Sketch tab and
then go to Manage Libraries and install the latest libraries listed here if you already dont have
them. Click in the search bar and enter the names and then click install.
Once you have all those libraries installed restart Arduino IDE and then you can bring up the
ESP-8266 Weather station sketch under the Examples tab.
Here is where you will need your API keys and your weather underground info.
Go to the settings tab on the right and where you see WU settings in the code, Input your API
key from weather underground.
Then where the Thingspeak channel # is put the one you wrote down and then enter in your
Read API key replacing the ones that are there.
This is mostly for if you want to add on another DHT sensor in another room, But it is easy to
setup now and just leave it in there.
// Wunderground Settings
#endif
//Thingspeak Settings
You will need to add your location for the Time zone locale and to retrieve the correct weather
data, Comment out the one that is uncommented and add in your location in the same format
#define Zurich Comment out this one unless you are in Zurich!
//#define Boston
www.diymalls.com [email protected]
//#define Sydney
So you would put #define Mytown except of course put your closest big city
Then you will have to add your city in the next bit of code in the same format As the example.
#define UTC_OFFSET -5
struct dstRule StartRule = {"EDT", Second, Sun, Mar, 2, 3600}; // Eastern Daylight time =
UTC/GMT -4 hours
struct dstRule EndRule = {"EST", First, Sun, Nov, 1, 0}; // Eastern Standard time = UTC/GMT -
5 hour
//#define STYLE_24HR
// Wunderground Settings
const String WUNDERGRROUND_API_KEY = "Put your own weatherunderground api key here";
#endif
www.diymalls.com [email protected]
The thingspeak settings will be below this section and you will just replace your channel and
your API key with the ones that are there.
Then connect ground of DHT-22 sensor (4th pin from left) to the breadboard where OLED and
ESP-8266 connect to ground!
www.diymalls.com [email protected]