Photon Weather Shield Hookup Guide

This Tutorial is Retired!

This tutorial covers concepts or technologies that are no longer current. It's still here for you to read and enjoy, but may not be as useful as our newest tutorials.

Note: V11 of the Photon Weather Shield utilizes the Si7021 for humidity and temperature sensing as opposed to the HTU21D.

View the updated tutorial: Photon Weather Shield Hookup Guide V11

Pages
Contributors: Joel_E_B
Favorited Favorite 7

Example 3: Collecting Weather Data Online

Phant is No Longer in Operation

Unfortunately Phant, our data-streaming service, is no longer in service. The system has reached capacity and, like a less-adventurous Cassini, has plunged conclusively into a fiery and permanent retirement. There are several other maker-friendly, data-streaming services and/or IoT platforms available as alternatives. The three we recommend are Blynk, ThingSpeak, and Cayenne. You can read our blog post on the topic for an overview and helpful links for each platform. The code in this tutorial will need to be adjusted to work with the other data streams.

Printing to the Serial Terminal is fun and all, but let's get this thing on the Internet! One of the most common things you'll want to do with the weather data you're collecting is to store it some place. You're in luck! With our data.sparkfun.com service, aka Phant, you can store all the weather data on the cloud, for free! You can then pull that data into a multitude of programs and websites to manipulate and visualize your weather data however you like.

This example will show you how to store your weather data on data Phant using the SparkFun Phant Particle Library.

Pushing Data to data.sparkfun.com (Phant)

This example builds off the previous two. You should have the previous three libraries added to your app, as well as a new, fourth library, the SparkFun Phant Particle Library.

alt text

If you're using Particle Dev, there is a project folder labeled SparkFun_Photon_Weather_Phant. Add it to Dev to quickly get started with this example. Open the SparkFun_Photon_Weather_Phant.ino example sketch.

Note: For those who wish to post data to Phant WITHOUT adding the extra sensors to the Weather Shield, there is an alternate skecth in the repository named SparkFun_Photon_Weather_Phant_SIMPLE. This skecth posts just the data from the on-board sensors and does not incorporate the soil moisture or temp sensors, the rain sensor, or the wind sensors.

You'll need to create a data.sparkfun.com stream if you have not done so already. Details on how to do that can be found in our tutorial. Keep track our your** public and private keys** as well as the Field labels you choose.

With that info in hand, open the sketch and find the Phant variables. You'll need to change these to match your stream's keys.

alt text

You'll also need to add each of the Fields you added when you created your stream. Make sure these match exactly.

Phant Fields

Here's what things should look like on your stream's fields.

alt text

What You Should See

With your stream created and the sketch edited accordingly, you can now upload to the Photon. Once complete, you should begin to see data populate on your stream.

Phant Data

Click for a larger view. Your data may vary depending on what Fields you chose to include.

You can now pull that data into any other device or service to organize however you see fit.

Troubleshooting

If you're having issues posting to data.sparkfun.com, we've created a demo stream to help you troubleshoot. Copy the following public and private key, and paste them in the example sketch mentioned at the beginning of this section.

  • Public Key: DJLWNrvxR0tDx190GJbg
  • Private Key: P4AlK0d51DceyBVW1m59
Please do not alter this stream in anyway. It is here to serve as a known good working example.

Upload the edited sketch to your Photon.

Now, click the button below to be taken to the test stream.

You should see fresh data coming in from your Photon and Photon Weather Shield. You should also be receiving data over the serial port as well. If things are moving too slow to troubleshoot, lower the count number that triggers the functions found in loop().

Pushing Weather Data to Wunderground

GitHub user Dan Fein wrote an example for the Photon Weather Shield that pushes the weather data to Wunderground. You can find this example in the Weather Shield Repository. It should have been included if you downloaded the entire repo as well. More information on his project can be found over on hackster.io.

Wunderground Graph

Wunderground Plot courtesy of Dan Fein.

For more information on how to setup a Wunderground account and information on what data must look like when pushed to Wunderground, you can follow along with the WIMP Weather Station tutorial.