Scaling an IoT deployment? Join our webinar on May 28th where we dive into real-world scaling pain points and how to overcome them.

Blues Developers
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Button IconHelp
Notehub StatusVisit our Forum
Button IconSign In
Sign In
Sign In
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
homechevron_rightBlogchevron_rightRouting IoT Data to Adafruit IO (and Beyond)

Routing IoT Data to Adafruit IO (and Beyond)

Routing IoT Data to Adafruit IO (and Beyond) banner

March 19, 2025

Learn how to use Notecard and Notehub to route collected sensor data for visualization (and more) on Adafruit IO.

  • Notehub
  • Cloud
Rob Lauer
Rob LauerSenior Director of Developer Relations
email

Too often in this industry we dismiss products and services that are informally labelled for use by "makers". Something about that term illicits assumptions that the product, tool, or service is simple, silly, or not enterprise-ready.

The irony is we all know this "maker" persona is in many ways the foundation of embedded development, and key for inspiring young/new developers. Sure, maybe they are building a ridiculous Rube Goldberg machines, but that can be just step one on their journeys.

I bring this up because Adafruit is a well-known brand that has a strong attachment to makers, and for good reason. They are my go-to source for high quality components when I'm building out POCs that demonstrate the value of Blues.

Now, I only recently learned more about Adafruit's cloud service, Adafruit IO , and I have to say I left impressed.

This article is a subset of a write-up I did on Adafruit Playground that demonstrates how to build a cloud-connected indoor air quality monitoring solution: Monitor Indoor Air Quality with Blues, IFTTT, Adafruit IO and a Hue LED Strip . Yes, very much a "maker" project, but it includes the potential for very practical extensions.

What is Adafruit IO?

Adafruit IO is a cloud-based platform designed for IoT applications, enabling users to collect, visualize, and interact with data from connected devices. Built with simplicity and rapid prototyping in mind, Adafruit IO supports a wide range of hardware, including Arduino, Raspberry Pi, and STM32- and ESP32-based microcontrollers.

adafruit io logo

Adafruit IO also provides MQTT and HTTP APIs, allowing for seamless integration with Blues Notehub .

Their platform offers real-time and historical data visualization through customizable dashboards, as well as automation features such as "actions" and "power-ups" for more event-driven responses.

Let's take a quick journey through setting up a Blues Notecard, Blues Notehub, and Adafruit IO to sync data from a connected device.

Again, for a complete view of this project, consult the write-up on Adafruit Playground .

Blues Notecard and Notehub Setup

If you don't know already know by now, Blues Notecard and its paired cloud service, Blues Notehub, make it incredibly easy to cloud-connect your product. Supporting cellular, Wi-Fi, LoRa, and satellite options, Notecard is your onramp for wireless connectivity.

all blues notecards

In fact, it takes only two commands to start sending data to the cloud using the Notecard API:

  1. Start with the hub.set API:

    The hub.set API tells the Notecard to which Notehub cloud project it should send data.

    After setting up a (free) Notehub project, you'll have a globally unique ProductUID:

    new notehub project

    And the supporting code in your sketch?

    {
       J *req = notecard.newRequest("hub.set");
       if (req != NULL)
       {
          JAddStringToObject(req, "product", PRODUCT_UID);
          JAddStringToObject(req, "mode", "continuous");
          notecard.sendRequest(req);
       }
    }

    TIP: If you're new to Notecard, you should know you also develop with virtually any language or RTOS (not just C!).

  2. Send data with the note.add API

    Every time we want to send data to the cloud, we call the note.add API. This creates an event (a.k.a. a Note in Blues lingo) full of sensor data.

    For example, if you were gathering temperature, humidity, and other sensor readings:

    {
       J *req = notecard.newRequest("note.add");
       if (req != NULL)
       {
         JAddStringToObject(req, "file", "sensors.qo");
         JAddBoolToObject(req, "sync", true);
         J *body = JAddObjectToObject(req, "body");
         if (body)
         {
           JAddNumberToObject(body, "temp", temp);
           JAddNumberToObject(body, "humid", humid);
           JAddNumberToObject(body, "co2", co2);
           JAddNumberToObject(body, "raw", sraw);
           JAddNumberToObject(body, "voc", vocIndex);
           JAddNumberToObject(body, "voltage", voltage);
         }
         notecard.sendRequest(req);
       }
    }

    And the resulting data appears in your Notehub project like so:

    notehub event

Adafruit IO Setup

Let's imagine at this point we are gathering sensor data locally and sending it periodically to the cloud using Notecard and Notehub.

Next, we need to do something meaningful with this data, and that's where Adafruit IO comes into play. With a generous free tier, this cloud service provides a ridiculously easy way to visualize data (dashboards), create alerts (actions), and even integrate with third-party services (power-ups).

Adafruit IO Feeds

After setting up an Adafruit IO account, head to the Feeds section to create one feed for each data element you want to use:

adafruit io feeds

Routing Data from Notehub to Adafruit IO Feeds

Next, head back to Notehub to create a route which will tell Notehub how to deliver events to the feeds.

From the Routes menu option, choose General HTTP/HTTPS Request/Response.

create notehub route

To set up the rest of the route:

  1. The URL will be: https://io.adafruit.com/api/v2/{username}/groups/{group}/data

    Where {username} is your Adafruit IO username and {group} is the name of the group that encapsulates your feeds. (This is probably default.)

  2. Under HTTP Headers you'll have to add your Adafruit IO key (which is available back in your Adafruit IO account).

    X-AIO-Key is the name and your Adafruit IO key is the value.

  3. Under Filters you'll want to send the sensor data associated with this project and ignore other session and health info that Notecard sends.

    Therefore, under the Notefiles section, choose Selected Notefiles, and then sensors.qo (or whatever name you used in your note.add request above).

  4. Lastly in the Data section, we'll need to edit or transform the JSON payload sent from the device before it's delivered to Adafruit IO. Every cloud service has a certain format of data they expect, and Adafruit IO is no different!

    In essence we need to create a set of key-value pairs, one for each data element we are sending. Something like...

    {
      "key":"co2-feed",
      "value":body.co2
    }

    How is this accomplished? Through the magic of JSONata expressions! JSONata lets you transform JSON objects on the fly.

    TIP: The JSONata Exerciser is a great way to test out JSONata expressions!

    Here's the full JSONata expression I used, with an image of this expression in the aforementioned JSONata Exerciser:

    {
      "feeds":[
         {
               "key":"bestlocation-feed",
               "value":best_location
         },
         {
               "key":"co2-feed",
               "value":body.co2
         },
         {
               "key":"humid-feed",
               "value":body.humid
         },
         {
               "key":"raw-feed",
               "value":body.raw
         },
         {
               "key":"temp-feed",
               "value":body.temp
         },
         {
               "key":"transport-feed",
               "value":transport
         },
         {
               "key":"voc-feed",
               "value":body.voc
         },
         {
               "key":"voltage-feed",
               "value":body.voltage/5*100
         }
      ],
      "created_at":$fromMillis(when * 1000),
      "location":{
         "lat":best_lat,
         "lon":best_lon
      }
    }

    jsonata exerciser

  5. Finally, save the route (making sure it's enabled) and watch as the next event comes in. You should see a little green check under the status column in the Event view, which tells you the event was successfully routed to Adafruit IO.

    notehub event routed

Adafruit IO Dashboard

Now that we have data flowing into Adafruit IO, let's create a dashboard.

adafruit io dashboard

  1. Head to the Dashboards menu option in Adafruit IO and create your first dashboard.

  2. Using the intuitive UI provided, create one or more blocks for each feed. For example, I created a gauge to show the most recent reading from a sensor and a line chart to show historical readings:

    adafruit io voc gauge

  3. Now, repeat the previous step for every data element you want to visualize. It's that simple!

Adafruit IO Actions

"Actions" are another Adafruit IO capability that lets you perform an activity on a scheduled basis, on a timer, or when a feed is updated.

adafruit io actions

A simple action is to receive an email alert when a sensor value reaches a specified threshold.

  1. Head to the Actions menu option in Adafruit IO.

  2. Create a new action using either a form or the "Blockly" editor (which feels a bit like programming in Scratch !).

  3. Here's what my email alert looks like in the Blockly editor:

    blockly email action

  4. And the alerts? Not too bad:

    adafruit io email action

note

You can also build these same alerts directly in Notehub.

Adafruit IO Power-Ups

Power-ups are Adafruit IO-provided integrations with third party services like IFTTT, Zapier, and SMS for messaging (among other services).

adafruit io power-ups

For the aforementioned Adafruit Playground project I put together, I used IFTTT to integrate with my Philips Hue LED strip and provide some more dramatic lighting feedback by changing the color when a sensor value goes above/below an arbitrary value.

  1. Choose the IFTTT from the Power-Ups menu in Adafruit IO.

  2. Log in to your IFTTT account and create an applet .

  3. The first step of the applet is to monitor a monitor a feed from Adafruit IO. Search for "Adafruit" and complete the form as needed to set the LED strip color (e.g. if the specified value is less than 100).

    ifttt adafruit io monitor

  4. Next, in the "then" section, you'll want to connect to your Hue account and select the "change color" action for your HUE light.

    ifttt hue

  5. The IFTTT applet should then be complete!

    ifttt hue green applet

warning

The free tier of IFTTT only polls your Adafruit IO feed once per hour. You can upgrade to their "Pro" tier to get more frequent polling.

Summary

This project measured VOC index levels in my office which don't change that often, so I hard-coded in some VOC values to quickly demonstrate the lights changing:

Again, check out the original Adafruit Playground write-up for the full project details.

Next steps? Get started with Adafruit IO here and get your own Blues Starter Kit .

In This Article

  • What is Adafruit IO?
  • Blues Notecard and Notehub Setup
  • Adafruit IO Setup
    • Adafruit IO Feeds
    • Routing Data from Notehub to Adafruit IO Feeds
    • Adafruit IO Dashboard
    • Adafruit IO Actions
    • Adafruit IO Power-Ups
  • Summary

Blues Developer News

The latest IoT news for developers, delivered right to your inbox.

Comments

Join the conversation for this article on our Community Forum

Blues Developer Newsletter

The latest IoT news for developers, delivered right to your inbox.

© 2025 Blues Inc.
© 2025 Blues Inc.
TermsPrivacy
Notecard Disconnected
Having trouble connecting?

Try changing your USB cable as some cables do not support transferring data. If that does not solve your problem, contact us at support@blues.com and we will get you set up with another tool to communicate with the Notecard.

Advanced Usage

The help command gives more info.

Connect a Notecard
Use USB to connect and start issuing requests from the browser.
Try Notecard Simulator
Experiment with Notecard's latest firmware on a Simulator assigned to your free Notehub account.

Don't have an account? Sign up