Weather Shield Hookup Guide

Contributors: Nate
Favorited Favorite 2

Example Firmware

To get started immediately here is a Codebender example that uses the MPL3115A2 and HTU21D libraries.

Hit connect once you’ve uploaded the example code to see the output from the Weather Shield

Arduino Files

If you are using the Arduino IDE the Weather Shield example relies on the HTU21D and MPL3115A2 libraries. Download the libraries here then install them into your Documents/Arduino folder.

Grab the example sketch, and load it onto your Arduino. Open the serial monitor at 9600bps.

You should see an output string every second containing the current weather information:





The $ and # are start and stop characters. These types of bytes are used to make it easy to parse out the data. For example, you could have an Electric Imp listen for a $ and record the data until you see a #. Once you have the string then split on the commas (also known as comma delimited), and start recording the next string.