Build an outdoor CO₂ monitor using RAK WisBlock and Blues Notecard with LoRaWAN and NB-IoT connectivity, integrated with TTN and AWS dashboards.
Air quality directly affects respiratory health, particularly in urban, industrial, and high-occupancy indoor environments. Elevated CO₂ levels can indicate inadequate ventilation and poor air circulation, making continuous monitoring essential for maintaining safer spaces.
This tutorial outlines the process of building an outdoor CO₂ monitor using RAK products and integrating it into a professional IoT platform for data storage and visualization. The completed system collects air quality data and transmits it wirelessly using two widely adopted IoT communication protocols: LoRaWAN and NB-IoT.
This project was not developed by Blues Wireless as part of its accelerator program. It was proposed by the RAKwireless team and should not be considered an official Blues Wireless project.
- Modular WisBlock hardware simplifies prototyping without a custom PCB design
- Dual connectivity improves resilience when one network becomes unavailable.
- Proper power design is critical for stable cellular transmission.
- Payload decoding must match the firmware byte structure for readable data.
- Cloud integration requires correct routing between TTN, IoT Core, and Analytics.
- Enclosure adjustments are necessary to balance protection and airflow.
- Firmware configuration determines communication behavior and data handling.
Project Overview and Use Case
The objective of this project is to present a ready-to-use product that can be implemented in a real environment.
To achieve this, you will develop the hardware configuration and the corresponding firmware to send data from the sensor to the cloud. LoRaWAN will be our primary option, with a cellular connection provided by Blues Wireless as a backup in case the LoRaWAN connection is unavailable.
System Architecture Summary
This solution employs a layered IoT architecture that separates sensing, communication, and cloud processing. The RAK12037 sensor measures CO₂, temperature, and humidity, while the RAK4631 reads and encodes this sensor data into a structured payload for transmission.
The encoded payload is primarily transmitted over LoRaWAN through the RAK7268V2 gateway to The Things Network (TTN), which forwards the messages to AWS IoT Core and AWS IoT Analytics for processing and visualization in Amazon QuickSight.
Additionally, cellular connectivity through the Blues Notecard provides an alternative communication path, routing data via Notehub to AWS for monitoring and analysis.
Hardware Components and Requirements
Core Hardware Modules
LiPo Battery
Blues Notecard (Select one according to your location)
Blues Notecarrier A, B or F (Optional)
LoRaWAN Gateway
RAK7268V2 WisGate Edge Gateway for LoRaWAN (used in this guide)
Cloud Services and Platforms
Hardware Assembly and Power Considerations
The hardware adopts a modular approach provided by WisBlock. The complete firmware is developed and available in the official RAKwireless GitHub repository, and the IoT data visualization platforms are cloud-ready.
Connecting the WisBlock elements is straightforward:
Plug the core into the core slot and the RAK12037 WisBlock CO₂ Sensor IO slot of the card. In this guide, you will use the RAK19001 WisBlock Base Board, but you can select a different compatible WisBlock Base Board.
The Blues Notecard can be connected via the WisBlock Blues Carrier Module, which should then be plugged into the base board's IO slot.
Finally, to prepare your product for deployment, use the WisBlock enclosure, specifically designed for this purpose.
If you want to 3D print the custom enclosure for this project, you can find the RAKBox-UO150x100x45(D1)_F3D v3 enclosure design file on Thingiverse.
Now that the devices are connected, you can begin programming.
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.
Firmware Development and Configuration
The code can be downloaded from the official RAKwireless 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 PlatformIO, check the guide for setting up WisBlock on PlatformIO.
Sending Data to the Cloud
This project supports transmitting sensor data using either LoRaWAN or cellular connectivity via Blues Notecard. Both communication paths ultimately forward data to cloud dashboards for visualization and monitoring.
LoRaWAN Configuration with RAK7268V2 and TTN
End devices can communicate over LoRaWAN using either a public network, such as Helium, or a private network built with a LoRaWAN gateway. In this guide, the second approach is used by configuring a RAK7268V2 gateway connected to The Things Network (TTN).
To complete this setup, you will need:
Gateway configuration is straightforward and typically takes only a few minutes. For detailed instructions, refer to the RAK7268V2 gateway configuration guide.
Once the gateway is successfully connected to the TTN LoRaWAN Network Server (LNS), use the given payload decoder.
TTN Payload Decoder Configuration
function decodeUplink(input) {
var data = {};
var events = {
1: "setup",
2: "interval",
3: "motion",
4: "button"
};
data.event = events[input.fPort];
data.c02 = (input.bytes[0] << 8) + input.bytes[1];
data.temperature= ((input.bytes[2] << 8) + input.bytes[3])/100;
data.humidity = ((input.bytes[4] << 8) + input.bytes[5])/100;
return {
data: data,
};
}
Cellular Communication via Blues Notecard
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 Configuration
This payload decoder is used when the transmitted data is sent via the Blues Wireless hardware.
{
"device": {
"deviceId": device
},
"measurements": {
"temp": body.temp,
"humidity": body.humidity,
"co2": body.co2
},
"timestamp": $fromMillis(when * 1000)
}
AWS Cloud Integration Architecture
Connecting Notehub with AWS is straightforward. The data will be processed using AWS IoT Analytics, which creates a channel, pipeline, data store, and dataset for analysis.
A dashboard can then be created in Amazon QuickSight to visualize the data. On the Notehub side, a route must be configured to forward data to AWS. Detailed setup instructions are available in the Blues documentation, and the required JSON files are provided in the project’s GitHub repository.
Connecting TTN to AWS requires additional configuration. TTN forwards device data to AWS IoT Core, which can then route the data to AWS IoT Analytics or other AWS services for processing and visualization. The full integration procedure is described in the official TTN documentation, and the corresponding JSON files are also available in the GitHub repository.
In this implementation, AWS IoT Analytics and Amazon QuickSight are used to visualize data from both TTN and Notehub. Figure 6 shows the dataset generated in AWS IoT Analytics.
Component Responsibility Breakdown
Each component in the system performs a specific role in sensing, transmitting, processing, and visualizing environmental data:
RAK12037 → Measures CO₂, temperature, and humidity at the sensing layer.
RAK4631 → Reads sensor values and encodes the transmission payload.
RAK7268V2 → Acts as the LoRaWAN gateway, forwarding packets to TTN without processing application data.
TTN → Serves as the LoRaWAN network server, managing device connectivity and uplink routing.
Blues Notecard → Provides cellular transmission via Notehub when LoRaWAN connectivity is unavailable, or additional backhaul is required.
AWS IoT Core → Ingests device messages from either TTN or Notehub.
AWS IoT Analytics → Processes and organizes structured datasets for analysis.
Amazon QuickSight → Visualizes processed data through cloud-based dashboards.
Deployment and Environmental Considerations
This project can be deployed in both indoor and outdoor environments. For outdoor installations, additional precautions are required to protect the device from humidity and environmental exposure.
The enclosure used in this project is a modified version of the RAK unified enclosure, with added ventilation gaps. The cover design files are available on Thingiverse.
All AWS tools and supporting platforms used in this project were implemented using their free-tier offerings, allowing the system to be deployed without additional platform costs.
Additional guidance on integrating LoRaWAN with AWS services is available in the AWS Documentation and Learning resources.
System Capabilities and Platform Advantages
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.
Conclusion
Modular hardware combined with cloud services provides an efficient foundation for scalable IoT monitoring systems. The integration of the WisBlock ecosystem with LoRaWAN connectivity and AWS cloud services enables rapid prototyping and deployment while minimizing hardware and infrastructure complexity.
By leveraging WisBlock’s modular capabilities, the development effort shifts toward application logic and data analysis rather than custom hardware design and system integration.
FAQs
Why does my Blues Notecard keep resetting or failing to transmit?
The Blues Notecard requires a peak current of about 2 A during cellular transmission. The VDD pin of the WisBlock Baseboard (RAK19001) cannot supply this level of current. If the Notecard is powered only from the VDD line, the voltage may drop during transmission, which can cause resets or failed transmissions.
To prevent this, power the system using a LiPo battery or connect an additional USB cable directly to the Notecard during testing.
I see raw bytes in TTN instead of decoded CO₂, temperature, and humidity. What’s wrong?
This usually means the TTN payload decoder has not been configured. The decoder provided in this guide interprets the payload as:
● 2 bytes for CO₂
● 2 bytes for temperature
● 2 bytes for humidity
If the decoder is not applied, TTN will display only raw hexadecimal payload data instead of readable sensor values.
TTN receives uplinks, but AWS IoT Analytics shows no data. Why?
This is typically an integration issue.
- Ensure TTN is connected to AWS IoT Core
- Ensure AWS IoT Core forwards data to AWS IoT Analytics
If either step is missing, data won’t reach AWS.
How does the system switch between LoRaWAN and the Blues Notecard cellular connection?
LoRaWAN is used as the primary communication method, while the Blues Notecard provides cellular connectivity as a backup when LoRaWAN communication is unavailable.
The failover behavior is handled in the device firmware, which determines when data is transmitted over LoRaWAN or the cellular connection. The exact switching logic depends on the firmware implementation available in the project’s GitHub repository.
My RAK7268V2 gateway shows the device connected, but I’m not seeing decoded data. What should I check?
|
|
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 - CO₂ Monitor for Outdoor with RAK WisBlock and Blues Notecard
- Author: Harold Duarte
- Reviewer: Karla Jimenez
- Date Published: 30/03/2026
Updated