Skip to content

Dayonixe/WeatherStation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guide manual

Team : Théo Pirouelle

laguage-arduino

Table of contents


Materials


Requirements

OpenWeatherMap

  1. Sign up new account at https://home.openweathermap.org/users/sign_in
  2. Get the API keys at https://home.openweathermap.org/api_keys

OpenWeatherMap

ThingSpeak

  1. Sign up new account at https://www.mathworks.com/mwaccount/register
  2. Create a new channel and configure it:

ThingSpeak

  1. Set the channel to public:

ThingSpeak

  1. Get the API keys of the channel:

ThingSpeak


Installation guides

Install USB-to-Serial

If, when you connect your ESP8266 card to your computer via USB, you do not see it in the Device Manager, you need to install the USB-to-Serial driver.

Device Manager

Install Arduino IDE for ESP8266

Warning

For this project, I used version 1.8.4 of the Arduino IDE, other versions may not work with my source code.

  1. Open Arduino IDE
  2. File > Preferences
  3. Insert the following link in the "Additional Boards Manager URLs" text box: http://arduino.esp8266.com/stable/package_esp8266com_index.json

Arduino Preferences

  1. Click on "OK" to close the dialog box.
  2. Go to Tools > Board > Board Manager and click on this option.
  3. Type "ESP8266" in the text box, and install the "ESP8266 by ESP8266 Community" option.

Arduino Board Manager

  1. Once the installation process is complete (it may take 1 minute or more), you can close the dialog box by clicking on the "Close" button.
  2. Go back to Tools > Board and you should see some new board choices appear at the bottom of the list.
  3. Select NodeMCU 1.0 (ESP-12E Module).
  4. Go to Tools > Port and select the correct port (as seen in the Device Manager, in my case it's COM3).

Burning Firmware to ESP8266

  1. The ESP8266 card must be properly connected to the computer via the data cable.
  2. Use ESP8266Flasher.exe burning Ai-Thinker_ESP8266_DOUT_8Mbit_v1.5.4.1-a_20171130.bin for the ESP8266.
  3. Operation as shown (as before, make sure you select the correct port and click on the "Flash" button):

Flasher

Flasher

Adding Library

  1. In Sketch > Include Library > Add .ZIP Library..., import the esp8266-weather-station-master.zip library.
  2. In Sketch > Include Library > Add .ZIP Library..., import the json-streaming-parser-master.zip library.
  3. In Sketch > Include Library > Add .ZIP Library..., import the esp8266-oled-ssd1306-master.zip library.
  4. In Sketch > Include Library > Manage Libraries..., type "Adafruit_BMP085" in the text box, and install the "Adafruit BMP085 Library by Adafruit" option:

Arduino Library Manager

Code customisation

  1. Open the main code.
  2. Update the WIFI_SSID and the WIFI_PWD.
  3. Update the OpenWeatherMap API key OPEN_WEATHER_MAP_APP_ID.
  4. Update the ThingSpeak API key api_key.

Connecting components

Connecting Components

It is preferable to carry out the wiring with the power off.


Results

ThingSpeak Channel

Arduino Serial Monitor

Screen


Errors

If the following error occurs in the Arduino IDE:

C:\Users\Admin\Documents\Arduino\libraries\esp8266-weather-station-master\src\TimeClient.cpp: In member function 'long int TimeClient::getCurrentEpochWithUtcOffset()':
C:\Users\Admin\Documents\Arduino\libraries\esp8266-weather-station-master\src\TimeClient.cpp:124:67:
error: invalid operands of types 'double' and 'long int' to binary 'operator%'
  return round(getCurrentEpoch() + 3600 * myUtcOffset + 86400L) % 86400L;
Using library Adafruit_BMP085_Library at version 1.0.0 in folder:
C:\Users\Admin\Documents\Arduino\libraries\Adafruit_BMP085_Library
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
  • Recommended configuration for Arduino IDE version 1.8.4 for Windows
  • In Sketch > Include Library > Manage Libraries..., as "Type" select Installed, type "weather" in the text box, update "ESP8266 Weather Station by ThingPulse" to at least version 1.6.5, and click the "Update" button.

About

Building a weather station using Arduino.

Resources

Stars

Watchers

Forks