Arduino Weather Shield Hookup Guide V12

Pages
Contributors: Nate, santaimpersonator, SparkFro
Favorited Favorite 17

Software Overview

Note: This tutorial assumes you are using the latest version of the Arduino IDE on your desktop and that you have installed the necessary board files and drivers for your development board. If this is your first time using Arduino, please review the following tutorials.

Installing an Arduino Library

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

Installing Arduino IDE

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

How to Install FTDI Drivers

How to install drivers for the FTDI Basic on Windows, Mac OS X, and Linux.

How to Install CH340 Drivers

How to install CH340 drivers (if you need them) on Windows, Mac OS X, and Linux.

Firmware for Examples

All the example code for this tutorial, can be downloaded the GitHub Repository of the Weather shield:

Arduino Libraries

To utilize the example firmware, users will need to install and configure the Arduino libraries for the following components.

On Board Sensors

The firmware examples below rely on the SparkFun Si7021 and MPL3115A2 Arduino libraries. These libraries can be installed through the Arduino Library Manager. Search for SparkFun MPL3115 and SparkFun Si7021 to install the latest version. The libraries can also be manually downloaded from their GitHub repository:

or utilize the buttons below:

Library Versions: This tutorial and its example code were recently updated; however, this was before the lastest release of the SparkFun Si7021 Arduino library. This latest release is not backwards compatible and will create compilation issues with the existing example code for this hookup guide. Therefore, we recommend users only utilize these specific version of these libraries, until we have a more permanent fix:

  • SparkFun Si7021 Arduino Library v1.0.5
  • SparkFun External MPL3115A2 Arduino Library v1.2.4

For more details on these sensors and their Arduino libraries, please refer to the hookup guides of their breakout boards:

MPL3115A2 Pressure Sensor Hookup Guide

Getting started with the MPL3115A2 Pressure Sensor.

Si7021 Humidity and Temperature Sensor Hookup Guide

The Si7021 humidity and temperature sensor is an easy to use, digital, low-cost sensor to aid you in all your environment sensing needs.

Weather Meter Kit

We've written an Arduino library for users to easily setup and read data from the SparkFun Weather Meter Kit. The library can be installed through the Arduino Library Manager; search for SparkFun Weather Meter Kit to install the latest version. Users can also manually download the library from the GitHub repository or by clicking the button below:

Configuration

The SparkFun Weather Meter Kit Arduino library was originally written to be used with the ESP32 MicroMod Processor and MicroMod Weather Carrier board. Therefore, it assumes certain electrical and microcontroller constraints when reading the wind vane direction. To utilize this library with this tutorial, users will need to make the following modifications:

  • In the SparkFun_Weather_Meter_Kit_Arduino_Library.cpp file of the library (located in the src folder), users will need to modify the file by commenting out lines 26-41 and enabling lines 45-60. This modifies the expected ADC values for the wind vane direction.
  • The library assumes that a 12-bit ADC is connected to the weather vane. This can be modified through the library for boards like the Arduino Uno or RedBoard, which have a 10-bit ADC.

    • In the setup() loop, specify the ADC resolution; where <ADC resolution> should be an integer value of the microcontroller's ADC resolution in bits:

      setADCResolutionBits(<ADC resolution>);
      
  • Users will also need to declare the electrical connections from the Weather shield to the sensors of Weather Meter Kit

    const byte WSPEED = 3;
    const byte RAIN = 2;
    const byte WDIR = A0;
    

GPS Module

In order to interpret the NMEA sentences from the GPS module, the firmware below relies on the TinyGPSPlus Arduino library, written by Mikal Hart. The library can be installed through the Arduino Library Manager; search for TinyGPSPlus to install the latest version. Users can also manually download the library from the GitHub repository or by clicking the button below:

For more details about the TinyGPSPlus Arduino library, please refer this blog post on Arduiniana.

Configuration

When the switch on the Weather shield toggled to SW-UART, the TinyGPSPlus Arduino library will need to utilize the SoftwareSerial Arduino library. In order to parse the data, users will need to declare the electrical connections from the Weather shield to the GPS module.

  • When the switch is toggled to SW-UART, the RX and TX pins of the GP-735 GPS module are:

    language:c
    static const int RXPin = 5, TXPin = 4;
    

    Note: When the switch is toggled to HW-UART, the RX and TX pins of the GP-735 GPS module are:

    static const int RXPin = 0, TXPin = 1;
    

Users will also need to declare the baud rate of the GP-735 GPS module.

language:c
static const uint32_t GPSBaud = 9600;

In the firmware, users will need to include and create an instance for the the SoftwareSerial Arduino library. Then, the baud rate will need be configured in the setup() loop for the GPS module:

  • language:c
    #include <SoftwareSerial.h>       //Needed for GPS
    SoftwareSerial ss(RXPin, TXPin);
    
  • language:c
    ss.begin(GPSBaud);