Skip to content

ESP8266 Weather Station

Weather Station & Cat

Make a weather station using the Feather Huzzah ESP8266 WiFi Microcontroller. Upload your own actual data to Dweet and Wunderground.  Right now we only have temperature and humidity thanks to a SHT31 sensor.

Weather Station & Cat-Side View

Here is our parts list:

      1. Feather Huzzah ESP8266
      2. Feather Proto Shield
      3. 2500MaH Lipo Battery
      4. Solar Charger
      5. Female  JST connector breakout
      6. Male JST connector
      7. 1 M resistor
      8. 1 220k resistor
      9. Scrap proto board
      10. Velcro tabs
      11. 3D printed case
      12. 6 V Solar panel
      13. Hookup Wire
      14. Screws & Nuts
      15. Female Header Pins
      16. SHT31 Sensor
      17. Another sensor that could also work. SeeedStudio-Temp & Humidity Sensor
    Enclosure

    We found our enclosure on thingiverse and had it 3D printed.  If you sign up for an account, you can have it printed through 3D Hubs from that page.  Or you can just download the files and print them yourself.

    Hardware

    Start with a breadboard and the Feather Huzzah ESP8266 .  We soldered female header pin sockets on the ESP8266 so we could add the proto shield on top later. Add a wire from 3V to the positive rail on the side of the breadboard and do the same for GND. Add a wire connecting pin 16 to the reset or rst pin.  This will make the microcontroller wake up from sleeping.

    Next make your voltage divider to measure battery level.  Have a wire going from pin A to in between the two resistors.  The 1M resistor should go to +V and the 220k resistor should go to GND.  This brings the voltage level down so you can read it through the analog pin.

    Now add the SHT31 sensor to measure temperature and humidity.  Pin left to right are +V, GND, SCL, SDA.  The other pins are not used.  Connect +V to 3V, GND to GND, SCL to SCL and SDA to SDA.

     

    Software

    Here is the Arduino code – ESP8266 Weather Station. 

    Copy and paste this into a new sketch in the Arduino IDE. There are a few lines you will need to change. You will need to put in your Wifi username and password, your Dweet unique name and your Wunderground login details.  Change all the xxxs in the lines below.

     

    Dweet

    http.begin(“http://dweet.io/dweet/for/xxxxxx?”);

    WiFi Login
    const char* ssid = “xxxxxx”;
    const char* password = “xxxxxx”;

    Wunderground Login
    char ID [] = “xxxxxxx”;
    char PASSWORD [] = “xxxxxx”;

    We have also commented out the line senddataWU();, which sends the data to Wunderground.  We suggest playing around with Dweet first until that works and then work on getting data to Wunderground.  Uncomment out the line senddataWU(); when you are ready to send data to Wunderground.

    If you have never used Dweet it is very easy to use.  Just make up a unique username and send your data to

    https://dweet.io/dweet/for/YOURUNIQENAMEHERE.

    To see your Dweet, go to

    http://dweet.io/follow/YOURUNIQENAME.

    Just remember Dweet will expect data in the JSON format.

    Wunderground is also easy to use.  You can easily add other sensors later if you wish.   Sign up for an account here.

    Wunderground expects text based data.  See all the different data you can send to it here  – PWS Protocol.

    Next Steps

    Once you have the hardware and software working leave the breadboard setup alone as much as you can and start soldering the resistor divider and SHT31 sensor onto the protoboard.

    Below are some pictures of the proto board.  Some connections need to be made on the underside like connecting the resistors to the battery line and connecting both resistors to the wire going to the analog pin.

    The hardest part I had soldering this was the JST wires which are stranded.

    I would tin them first or even solder to a solid core wire and cover with heat shrink next time.

    Proto HUZZAH ESP8266

    Proto Shield ESP8266

    Once your are done soldering the proto board together test that it works and fix any soldering errors.  Once you have it working properly you can put it inside the case or Stevenson Shield . 

    We attached it to a piece of scrap proto board with screws. We then  attached the proto board assembly to the inside back with velcro and connected the solar panel and battery.  In the image below we have everything connected except the battery and solar panel.

    ESP8266-&-Battery-Check

    Now you need to site it or find a good place to put your newly made weather station.  See the Wunderground Installation Guide.  I was limited by my WiFi range and need to get a taller pole.

    Good luck and happy making!

    Weather Station

ESP8266 Weather Station

Weather Station & Cat

Weather Station & CatWe made yet another weather station, this time uploading our own actual data to Dweet and Wunderground.  Right now we only have temperature and humidity thanks to a SHT31 sensor.  From this we also calculate dew point as well.

We hope to add rain and wind speed sensors as well.  The reason we use Dweet is that it is a quick way to check that everything is working.  We also upload our battery level to Dweet so we can check on it.

Currently we have the weather station set to sleep for 6 minutes,  wake up and upload the data, then go back to sleep.  Along with the 6V solar panel recharging the 2500 MaH battery, this setup should last a very long time.

We needed to connect pin 16 with the reset pin on the  Feather HUZZAH With ESP8266 to make sure we wake up after going to sleep.

Weather Station & Cat-Side View   Weather Station Inside

Enclosure

We found our enclosure on thingiverse and had it 3D printed.  If you sign up for an account, you can have it printed through 3D Hubs from that page.  Or you can just download the files and print them yourself.

Weather Station

See all the detail ons our how to page ESP8266 Weather Station.

Tags: