temperature and humidity monitor with rak wisblock and blues notecard

In this tutorial, you will learn how to measure and transmit temperature and humidity data using both LoRaWAN® and NB-IoT technologies. These communication methods are ideal for long-range and low-power data transmission, making them perfect for IoT applications.

In environments like laboratories and industrial facilities, maintaining proper temperature and humidity is essential for the safety of the equipment. Additionally, rapid changes in temperature and humidity can negatively impact people's health, cause physical discomfort, and promote the growth of mold and dust mites.

Monitoring temperature and humidity also contributes to energy efficiency by optimizing the use of HVAC systems. Furthermore, it is crucial for preserving sensitive objects such as artwork and electronics. By the end of this tutorial, you will be able to collect environmental data and transmit it wirelessly using two of the most widely used IoT communication protocols: LoRaWAN and NB-IoT.


Figure 1: Temperature and Humidity Solution

Use Case

Temperature and humidity monitoring systems have various applications, ranging from the pharmaceutical industry to food processing and packaging. In this context, we will focus on the cold drying process in the food industry.

Precise monitoring of humidity and temperature is essential during food preservation processes, achieved through accurate temperature control via ramps.

This process allows the refrigeration plant to facilitate freeze-drying and sterilization.

Requirements

1. Necessary Hardware

Figure 2: Necessary Hardware

2. Gateway

3. Back-End Services 

Hardware Connection

The hardware adopts a modular approach provided by WisBlock. The complete firmware is developed and available in the official GitHub repository, and the IoT data visualization platforms are cloud-ready. Additionally, we will replicate the project developed by Blues Wireless by using JSON data to access the information.

Connecting the WisBlock elements is straightforward:

  1. Plug the core into the core slot and the CAN Bus Interface IO slot of the card. In this instance, you will use the RAK19007 motherboard, but you can select a different compatible base board.
  2. The Blues Notecard can be connected via the WisBlock Blues Carrier Module, which should then be plugged into the baseboard's IO slot.
  3. Finally, to prepare your product for deployment, you can use the WisBlock enclosure designed for this purpose.

Figure 3: Final project installation view 

Now that the devices are connected, you can begin programming.

⚠️
IMPORTANT

The Notecard requires a peak current of 2 A to send data. The VDD pin of the WisBlock cannot provide this current, so it is recommended to use a battery or connect an additional USB cable to the Notecard during your project testing.

Blues Hardware Assembly

After completing the instructions outlined in the hardware configuration and uploading the code provided by Blues on GitHub to the notecard, the final assembly is shown in Figure 4.

Figure 4: Final Result Blues Wireless Version

Firmware Development 

The code can be downloaded from our official GitHub repository. It was developed using Visual Studio Code and PlatformIO, which are two widely used tools for programming firmware. 

In case the libraries are not available on PlatformIO, you can find them from the following sources:

If you need more information about how to configure and code your WisBlock setup with Platform IO, check the following guide for setting up WisBlock on PlatformIO.

Sending Data to the Cloud 

LoRaWAN Communication

The process of communicating with end devices via LoRaWAN networks can be accomplished through a public network like Helium or by setting up your network using a LoRaWAN gateway. In this instance, configure the second option. For this process, you will need:

This process is straightforward and can be completed in just a few minutes. For a step-by-step configuration guide, refer to the RAK7268V2 gateway documentation.

After the successful configuration and connection of the gateway to the TTN LNS, use the given payload decoder.

TTN Payload Decoder

function Decoder(bytes, port)
{  var decoded = {};
  if (bytes[0] == 1)
  {   decoded.Temperature = ((bytes[1] << 8) | (bytes[2]));
      decoded.Humidity = ((bytes[3] << 8) | (bytes[4]));
      return decoded;
  }
 else if (bytes[0] == 5) {
// add more sensor data formats here
//        } else if (bytes.[0] == xx) {
    }
}

Blues Communication

Just create an account on the Notehub page and then create a new project. For a detailed guide, you can review the Blues documentation to see the process step by step.

Blues Payload Decoder

🗒️
NOTE

This payload decoder is used when the transmitted data is sent via the Blues Wireless hardware.

 

function Decoder(request) {
    var data = JSON.parse(request.body);
    var device = data.device;
    var file = data.file;
    var decoded = {};
    if (file === "locations.qos") {
    decoded.voltage = data.body.voltage;
    decoded.motion = data.body.motion;
    decoded.seconds = data.body.seconds;
    } else if (file === "_session.qo") {
    decoded.voltage = data.voltage;
    }
    else if (file === "data.qo") {
    decoded.temperature = data.body.sensortemperature;
    decoded.humidity = data.body.sensorhumidity;
    }
    if (("tower_lat" in data) && ("tower_lon" in data)) {
    decoded.tower_location = "(" + data.tower_lat + "," + data.tower_lon + ")";
    }
    if (("where_lat" in data) && ("where_lon" in data)) {
    decoded.device_location = "(" + data.where_lat + "," + data.where_lon + ")";
    }
    decoded.rssi = data.rssi;
    decoded.bars = data.bars;
    decoded.temp = data.temp;
    decoded.orientation = data.orientation;
    return [
         {
    device: device,
    field: "Temperature",
    value: decoded.temperature
    },
     {
    device: device,
    field: "Humidty",
    value: decoded.humidity
    },
    {
    device: device,
    field: "TOWER_LOCATION",
    value: decoded.tower_location
    },
    {
    device: device,
    field: "DEVICE_LOCATION",
    value: decoded.device_location
    },
    {
    device: device,
    field: "RSSI",
    value: decoded.rssi
    },
    {
    device: device,
    field: "BARS",
    value: decoded.bars
    },
    {
    device: device,
    field: "VOLTAGE",
    value: decoded.voltage
    },
    {
    device: device,
    field: "CARD_TEMPERATURE",
    value: decoded.temp
    },
    {
    device: device,
    field: "ORIENTATION",
    value: decoded.orientation
    }
    ];
    }

Datacake Connection

The connection to Datacake will be established by integrating the TTN and Notehub with the platform. You can create two devices in DataCake or configure a single device to receive data from multiple platforms. 

1. After configuring your device on the Datacake platform, check if the payload fields are being received correctly. If so, start configuring the field with the appropriate name and variable.

Figure 5: Datacake Fields Configuration

2. If everything has been set up correctly, you should see a data history display similar to the following image:

Figure 6: Datacake History of Data

3. After completing the Notehub and TTN integration using Datacake’s official guides, your dashboard should look similar to Figure 7:

Figure 7: Datacake Dashboard Result

You can now send data to DataCake using LoRaWAN or NB-IoT/BLE/Cat-1. Next, let’s implement the complete Blues application.

Strengths of Working with WisBlock

Figure 8: Comparison RAKwireless vs Blues Wireless

  • Production-Ready: Not just a prototype, this is a finished product ready for real-world use.
  • Modular Design: Easy and fast to set up thanks to WisBlock’s plug-and-play modular architecture.
  • Clean & Professional: Results in a polished and compact final product with minimal assembly.
  • Developer-Friendly Firmware: Compatible with Arduino and PlatformIO, no need for complex IDEs.
  • Multi-Network Communication: Supports LoRaWAN and cellular (NB-IoT, LTE-M, CAT-1) connectivity.
  • Quick Integration with Dashboards: Easily connected to IoT platforms, no advanced front-end/backend coding required.
  • Space-Efficient: Small form factor ideal for installations with limited space.
  • Stock Notice: Some components used in Blues' reference solution may no longer be available.

Summary 

As presented in this tutorial, WisBlock is a modular hardware solution developed by RAKwireless that simplifies the development of industrial-grade IoT applications. When paired with Blues Wireless components, it enables rapid deployment without the need for custom PCB design and offers some good features like:

  • Plug-and-Play Hardware: There's no need to design your PCBs—just stack the modules and go.
  • Industrial Application Ready: Designed for reliable use in professional and commercial environments.
  • Prebuilt Firmware: Core functionality is already developed and ready for deployment, saving time and effort.
  • Developer-Friendly: Works seamlessly with platforms like Arduino and PlatformIO.

 


harold-duarte.png

Harold Duarte

Harold is an electronics engineer and senior technical content writer at RAKwireless. He is passionate about learning and developing new solutions for IoT, making it #IoTMadeEasy.


Changelog

  • Version 1 - Temperature and Humidity Monitor with RAK WisBlock and Blues Notecard
    • Author: Harold Duarte
    • Reviewer: Caryl Enanor
    • Date Published: 06/30/2025

 

 

Updated