Arduino Uno Wireless Weather Station (Wunderground.com)

11,793

142

30

Introduction: Arduino Uno Wireless Weather Station (Wunderground.com)

In this Instructable I am going to show you how to build a Wireless Weather Station using Arduino

A Weather station is a device that collects data related to the weather and environment using many different sensors. We can measure many things like:

  • Temperature
  • Humidity
  • Wind
  • Barometric Pressure
  • UV index
  • Rain

Mine inspiration to create this weather station is Greg from www.cactus.io Davis anemometer, wind speed and rain meter Arduino code copyright rights belong to him.

I'm using Arduino Uno as main board.

ESP8266 WiFi module will send data to www.wunderground.com

Weather Underground is a commercial weather service providing real-time weather information via the Internet.

I will use these sensors:

  • Temperature - Dallas DS18B20
  • Humidity, Pressure - BME280
  • UV, Solar - ML8511
  • Anenometer and wind speed - Davis 6410
  • Rain gauge - Ventus W174

Step 1: Parts

The parts needed in order to build this project are the following:

  1. Arduino Uno
  2. ESP8266
  3. BME280
  4. ML8511
  5. Davis 6410
  6. Ventus W174

Step 2: Schematic and Wiring Diagram

Step 3: PCB Arduino Uno Weather Station Shield

Design printed circuit board (PCB), I was used ,,Sprint-Layout" software.

To create this Arduino Uno weather station shield you will need:

  1. ML8511 UVB UV Rays Sensor Breakout UV Light Sensor Analog Output for Arduino Ebay
  2. Waterproof Digital Thermal Probe or Sensor DS18B20 Arduino Sensor Ebay
  3. JST-XH Kit 4Pin 2.54mm Terminal Housing PCB Header Wire Connectors Ebay
  4. Atmospheric Pressure Sensor Temperature Humidity Sensor Breakout BME280Ebay
  5. 1x ESP8266 ESP12F Ebay
  6. 1x 1k 0805 resistor
  7. 1x 120R 0805 resistor
  8. 8x 0R 1206 jumper ( resistor)
  9. copper board
  10. 2x 4.7K resistor
  11. 1x 10k resistor
  12. 1x 3mm led
  13. 1x RJ45 socket Ebay
  14. 1x 47uF electrolytic capacitor
  15. 1x 40pins header pins Ebay
  16. 1x Voltage Regulator Sot-223 Ams1117 Ams117-3.3 3.3V 1A Ebay
  17. 1x 2.54mm Pitch Switch DIP 2 Ebay

Step 4: Arduino Sensors Libraries, Manual and Other Information

1) Arduino weather station project www.cactus.io

2) Davis 6410 anemometer manual http://www.davisnet.com/product_documents/weather...

3) Adafruit BME280 Driver (Barometric Pressure Sensor) library https://github.com/adafruit/Adafruit_BME280_Libra...

4) ML8511 UV Sensor Library https://learn.sparkfun.com/tutorials/ml8511-uv-se...

5) Arduino Library for Maxim Temperature Integrated Circuits DS18B20 DS18S20 - Please note there appears to be an issue with this series. DS1822 DS1820 MAX31820 https://github.com/milesburton/Arduino-Temperatur...

6) Library for Dallas/Maxim 1-Wire Chips https://github.com/PaulStoffregen/OneWire

7) Wunderground (Personal Weather Station Upload Protocol) http://wiki.wunderground.com/index.php/PWS_-_Uplo...

8) NodeMCU weather station http://chynehome.com/web/station-meteo-a-base-de-e...

Step 5: Soldering PCB

Weather station shield I was ad in to Raspberry Pi case. I think it looks better.

Step 6: Installing Personal Weather Station

The location weather station is the most important part of
installation. If weather station is located under a tree or an overhang, the rainfall data measured by the station will not be correct. If you place your weather station in an alley, you could very well get a wind tunnel effect on the anemometer, resulting in erroneous wind data. Weather station should have good "fetch", or distance from any other tall object.

The standard wind measurement should be taken at 10 meters above the ground. A roof-top works the best for me.

Weather station is powered from solar panel. So it is autonomous.


The most common error in installing a weather station is associated with misplacing the thermometer sensor. Meteorologists define temperature as the temperature in shade with plenty of ventilation. When placing weather station, make sure:

  • The thermometer sensor never receives direct sunlight.
  • The thermometer receives plenty of ventilation and is not blocked from the wind.
  • If the thermometer is placed on a roof-top, make sure it is at least 1.5 meters above the roof-top.
  • If the thermometer is placed above grass, again, it should be at least 1.5 meters above the grass surface.
  • The thermometer is at least 15 meters from the nearest paved surface.

So I'm using weather shelter. I made it from PVC tube. This way, weather station can be placed in direct sunlight, with the thermometer located inside the shelter.

More information about installing weather station here

Step 7: ESP8266 AT Commands

First it need prepare ESP8266 wifi modulle. Change CWMODE into 1 = Station mode(Client) and connect ESP8266 to you WiFi router.
I'm using usb to ttl serial adapter. Its need only connect 4 wire ( +3.3V, GND TX,RX)

AT commands:

AT

AT+CWMODE?

AT+CWMODE=1

AT+CWJAP="your ssd","password"

more AT commands here

Step 8: Arduino Code

  1. Before upload code into your Arduino Uno register in wunderground.com to obtain a WU station ID and key/password
  2. Change this ID and key/password into your weather station Arduino code.
  • char ID [] = "xxxxxxxx"; //wunderground weather station ID
  • String PASSWORD = "xxxxxxxx"; // wunderground weather station password
  • #define DEBUG 0 // If you want debug change it from 0 to 1

I'm using 30 second loop time sending data to Wunderground.com

25 seconds I will take to measure wind speed. Other time is for read sensor data

Step 9: Result

It is working and sending sensors data to wunderground.com. I'm very happy ;)

Share

    Recommendations

    • Tiny Home Contest

      Tiny Home Contest
    • Creative Misuse Contest

      Creative Misuse Contest
    • Water Contest

      Water Contest

    30 Discussions

    Hello! Thanks for sharing this great project. I am currently harvesting the parts and will start it soon. Question: do you have detailed information on how to use a Small Solar Panel + batteries for powering this rig up? That would help a lot. Thanks!

    2 more answers

    Hello, so you need solar charge controller, battery 12V or 6V , and solar panel. For example if you have LiPo 2200mAh battery with a load that draws 100mA. 2.2/ 0.1 = it takes 22 hours. So if you have one cloudy day your weather station discharge your battery. You will need add another battery or battery with larger capacity.

    Don't worry, stopped my hurry and did a decent research in the Net. Thanks. : )

    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}

    hi i started build your weather station and would like change it from wifi to WIZNET W5100 Ethernet shield. is this easy to do as I’m new to the Arduino. my wifi signal is poor. hope you can help. have tried to work it out my self and some pointers would help me.great instructable thanks kevin

    0
    None
    Marioca

    Question 4 months ago

    Hello, nice project I would like to make it happen, I'm not able in programming, I installed all the libraries of your project, but when I check the code it gives me error:

    WARNING: library TimerOne-master claims to run on (avr) architecture(s) and may be incompatible with your current board which runs on (esp8266) architecture(s).

    Arduino_wireless_weather_station__wunderground_:73: error: 'A3' was not declared in this scope

    int UVOUT = A3; //Output from the ML8511 sensor

    ^

    Arduino_wireless_weather_station__wunderground_:74: error: 'A2' was not declared in this scope

    int REF_3V3 = A2; //3.3V power on the Arduino board

    ^

    C:\Mario\Arduino\STAZIONE METEO WIRELESS ARDUINO UNO\Arduino_wireless_weather_station__wunderground_\Arduino_wireless_weather_station__wunderground_.ino: In function 'void setup()':

    Arduino_wireless_weather_station__wunderground_:147: error: 'class TimerOne' has no member named 'initialize'

    Timer1.initialize(500000); // Timer interrupt every 2.5 seconds

    ^

    Arduino_wireless_weather_station__wunderground_:148: error: 'class TimerOne' has no member named 'attachInterrupt'

    Timer1.attachInterrupt(isr_timer);

    ^

    Multiple libraries were found for "OneWire.h"

    Used: C:\Users\TEMP\Documents\Arduino\libraries\OneWire-master

    Not used: C:\Users\TEMP\Documents\Arduino\libraries\Arduino-Temperature-Control-Library-master

    exit status 1

    'A3' was not declared in this scope

    I do not know how to do it, you can help me


    1 more answer

    Tools > Board:Arduino Uno ? I think you select ESP8266

    Hi There! Thanks for the incredible instructable.

    I'm working on a remote weather station that will use a GSM cell module to send data to wunderground. Do you have an estimate of how much data each update uses?

    I want to figure out what kind of refresh rate would be usable and affordable over the cellular network.

    Thanks!

    1 more answer

    What did you encapsulate the UV sensor with, and did you have to
    compensate for the material you used. How well has the encapsulation
    held up, 7 months on?

    Sorry I posted this in a comment at first, then saw the "Ask Question" button.

    1 more answer

    I was used clear plastic with silicone to encapsulate UV sensor. I can't compare UV sensor value with another UV sensor. So I can't confirm that UV sensors show data is correct.

    Great Project - I'm doing something similar but with nrf24l01+ modules. What did you encapsulate the UV sensor with, and did you have to compensate for the material you used. How well has the encapsulation held up, 7 months on?

    For anyone that wants to know about re-purposing old wind and rain gagues. You need to use a meter on the pins of the cables to figure out what goes to what pin - there's some good info on sparkfun's weather station pages and a good expanation of how these devices work.

    If your wind / rain gague has been outside for some time, you may need to replace the reed switches inside it, so be prepared to get your tools out and make sure you don't lose any ball bearings when dismantling things.

    P.S. Reed switches are made of glass so don't try to bend the wires without a holding the wire near to the body with a pair of fine nosed pliers.

    0
    None
    JeffT123

    Question 5 months ago

    Hi - has anyone got Gerber files done for the board used in this article?

    1 more answer

    Hello, as I was having issues with WiFi in your project, I had to debug WU upload a bit and it seems to me that WU upload routine in your project is not working.

    At the beginning of the code you have definition for WU:
    char server [] = "weatherstation.wunderground.com";
    char WEBPAGE [] = "GET /weatherstation/updateweatherstation.php?";

    ...but it is not used in the code below. Instead of this there is manual initialization:
    String cmd1 = "AT+CIPSTART=\"TCP\",\"";
    cmd1 += "rtupdate.wunderground.com"; // wunderground
    cmd1 += "\",80";
    esp8266Module.println(cmd1);

    If I use provided code, it says "data send" in debug mode, but no data were sent at all.

    Can you please check whether provided scetch is up to date ? I would like to finish this great project.

    Thanks, Petr

    2 more answers
    0
    None
    PetrN20

    Answer 6 months ago

    WiFi initialization code I used:

    add:
    #define SSID "SSID"
    #define PASS "password"

    WiFi init:
    esp8266Module.println("AT+RST");
    delay(1000);
    esp8266Module.println("AT+CWMODE=1");
    String cmd_wifi="AT+CWJAP=\"";
    cmd_wifi+=SSID;
    cmd_wifi+="\",\"";
    cmd_wifi+=PASS;
    cmd_wifi+="\"";
    esp8266Module.println(cmd_wifi);
    Serial.println(cmd_wifi);
    delay(2000);
    if(esp8266Module.find("OK"))
    {
    Serial.println("OK, Connected to WiFi.");

    I have some problems to connect the W174. Its a wireless Rainmeter but in the tutorial you connect it with cables. Can you help me to connect the Rainmeter?

    Thanks for answers!

    1 reply

    I was used W174 rainmeter. But you can use another. You just only neeed to conect +5V, GND and 10k pull up resistor.

    About ,,wireless" I mean that WiFi modulle ESP8266 send weather station data to internet without cable.