Introduction: ESP8266 Weather Station
We made another weather station, this time using a Feather HUZZAH ESP8266 WiFi module and uploading our own actual data to Dweet and Wunderground. Right now we only have temperature and humidity thanks to a SHT31 sensor but plan on adding more sensors later. From temperature and humidity we can calculate dew point as well. The weather station updates every 6 minutes and uses a 3D printed Stevenson Shield to protect it from the elements. To power this setup, we are using a 6v solar panel and a 2500MaH lipo battery. We use Dweet so we can also monitor our battery level.
Step 1: Parts
Here is our parts list:
Male JST connector
1 M resistor
1 220k resistor
Scrap proto board
Hookup Wire
Step 2: 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.
You could also design our own case.
Step 3: Breadboard 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.
Step 4: Software
See the attached 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.
WiFi
WiFi Login const char* ssid = “xxxxxx”;
const char* password = “xxxxxx”;
Dweet
http.begin("http://dweet.io/dweet/for/xxxxxx?”);
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 https://dweet.io/dweet/follow/YOURUNIQENAMEHERE.
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.
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.
Sign up for an account here. Wunderground expects text based data.
See all the different data you can send to it here - PWS Protocol.
Once your have updated the software plug the ESP8266 into your computer and upload the code.
Attachments
Step 5: Protoboard Soldering
Once you have the breadboard 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.
See the 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.
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 wall with velcro and connected the solar panel and battery.
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, happy making and check us out at The Soldering Station.
Step 6: Putting It All Together
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 wall with velcro and connected the solar panel and battery. 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, happy making and check us out at The Soldering Station or follow us @Solder_Station.