0% found this document useful (0 votes)
190 views

FZ2691-ESP8266 Weather Station DIYMall With Picture of Wiring-Revised

This document provides instructions for setting up an ESP-8266 weather station that displays data from online weather APIs and a DHT sensor on an OLED screen. It involves getting API keys from Weather Underground and Thingspeak, installing required Arduino libraries, and modifying the code to include the correct API keys and location settings. The ESP-8266, OLED screen, and DHT sensor are then wired together on a breadboard to complete the weather station hardware.

Uploaded by

Nice2cUagn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
190 views

FZ2691-ESP8266 Weather Station DIYMall With Picture of Wiring-Revised

This document provides instructions for setting up an ESP-8266 weather station that displays data from online weather APIs and a DHT sensor on an OLED screen. It involves getting API keys from Weather Underground and Thingspeak, installing required Arduino libraries, and modifying the code to include the correct API keys and location settings. The ESP-8266, OLED screen, and DHT sensor are then wired together on a breadboard to complete the weather station hardware.

Uploaded by

Nice2cUagn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

www.diymalls.com sales@diymalls.

com

Formatted: Font: 24 pt

ESP-8266 WEMOS Weather Station

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.

So first get a weather underground account (wWunderground.cCom) and go to developer


weather API (https://www.wunderground.com/weather/api/ ) and input your name and
project and request an API key and write it down. Tips for sign up; You can use facebook or
other site as website for signup, Click Other for 1st question, NO for 2nd question and NO for 3rd
question, Agree to TOS and Click purchase Key (No Cost at all do dont worry)
www.diymalls.com [email protected]

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.

ESP8266 Weather station

WiFi manager for esp8266

Simple DST adjust (If you are in a daylight savings country!)

ESP8266 OLED SSD1306 Library

Json Streaming parser

DHT Sensor library

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.

Choose WeatherStationDemoExtendedDST and open it.


www.diymalls.com [email protected]

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

const boolean IS_METRIC = true;

const String WUNDERGRROUND_API_KEY = "<8ec10f9d0a89f122>";

const String WUNDERGRROUND_LANGUAGE = "EN";

const String WUNDERGROUND_COUNTRY = "AU";

const String WUNDERGROUND_CITY = "Sydney";

#endif

//Thingspeak Settings

const String THINGSPEAK_CHANNEL_ID = "240056";

const String THINGSPEAK_API_READ_KEY = "XRC1ZJGCJQUCL2C4";

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

// Example Locales (uncomment only 1)

#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.

#ifdef Mytown Put the same as you entered above!

//DST rules for US Eastern Time Zone (New York, Boston)

#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

// Uncomment for 24 Hour style clock

//#define STYLE_24HR

#define NTP_SERVERS "us.pool.ntp.org", "time.nist.gov", "pool.ntp.org"

// Wunderground Settings

const boolean IS_METRIC = false;

const String WUNDERGRROUND_API_KEY = "Put your own weatherunderground api key here";

const String WUNDERGRROUND_LANGUAGE = "EN";

const String WUNDERGROUND_COUNTRY = "STate"; //Put state abbreviation here!

const String WUNDERGROUND_CITY = "Yourcity"; //Put your city name 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.

Next wire the ESP-8266 as follows to the breadboard

D2 pin to SDA pin of OLED Screen

D3 pin to SCL pin of OLED Screen

3v3 pin to VCC pin of OLED Screen

G pin to GND pin of OLED Screen

D4 pin to Data pin of DHT-22 sensor (2nd pin from left)

5 Volt pin to VCC of DHT-22 sensor (1st pin from left)

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]

You might also like