Skip to content

Andy4495/Wireless-Sensor-Receiver-Hub

Repository files navigation

Wireless Sensor Receiver Hub

Arduino Compile Sketches Check Markdown Links

Fully assembled Hub: Ethernet Shield (bottom), Shield-LaunchPad Interface (middle-bottom), MSP-EXP430FR6989 LaunchPad (middle-top), and CC110L BoosterPack (top).

This sketch is an example of a wireless receiver hub which receives sensor readings from various low-power, battery-operated remote sensors. These sensors use a short-range, low-power communication protocol implemented with CC110L BoosterPack from Texas Instruments. The hub receives periodic readings from the remote sensors and forwards the data using MQTT to the ThingSpeak IoT platform over ethernet.

The sketch is specifically designed to run on an MSP-EXPFR6989 LaunchPad, CC110L BoosterPack, and W5200-based ethernet shield. It will probably run on other MSP430-based lauchpads with sufficient program memory and minor code changes.

The code is not very generic and is currently written to support two types of sensors with specific data structures:

  • An outdoor weather sensing station based on the SENSORS BoosterPack
  • Simple, low-power MSP430 module using its internal temperature sensor

The current design sends the received sensor readings to the ThingSpeak IOT platform. Previous iterations used Adafruit's and Cayenne's platforms.

The built-in LCD display on the LaunchPad is used to display current temperature and battery level from the weather station sensor, plus connection status with the MQTT server (the antenna symbol).

An external OLED display is also supported, and can be used to print miscellaneous status information. This OLED display is optional and not necessary for basic receiver hub operation.

Additional sensors and changes to the data structures of the existing sensors would require changes to this sketch. Feel free to use this as a starting point, but do not expect it to work as-is for your application.

See the Hardware folder for specific hardware details.

Please read the sketch comments for details on the software operation.

Header Files for User-Specific Info

In order to compile the code, an additional header file is needed: MQTT_private_config.h.

A template of the file named MQTT_private_config-template is included in the repo. This file should be updated with data specific to your configuration and then copied to MQTT_private_config.h.

In addition, MQTT_publishing_feeds.h should be updated with channel information specific to your application.

Thingspeak API updates

ThingSpeak updated their MQTT interface in July 2021 with release R2021a, which changed how MQTT API authentication works.

Instead of authenticating using your ThingSpeak username and MQTT API key, the updated method uses a separate MQTT device client ID and password. In addition, the ThingSpeak MQTT server is now named mqtt3.thingspeak.com.

The code and header files have been updated with these changes.

External Libraries

  • Modified version of Adafruit MQTT Library version 1.3.0
  • Modified version of the WIZnet Ethernet Library
  • NewhavenOLED
    The NewhavenOLED library is only needed if you plan to use an external OLED display as mentioned above.

Supported Remote Sensors

References

License

The software and other files in this repository are released under what is commonly called the MIT License. See the file LICENSE.txt in this repository.