Here is a super-SEO, premium rewrite of the post.
Same technical substance, cleaner structure, modern terminology, and written to rank while still feeling like a real engineer’s notebook, not marketing copy.


Connecting a SensorTag to the IBM Watson IoT Platform Using a Raspberry Pi as a Gateway

In an earlier experiment, I connected a SensorTag to the Watson IoT Platform using my MacBook as a temporary IoT gateway. That approach worked well for development, but it was never meant to be a production-style setup.

This post shows how to move one step closer to a real IoT architecture by using a Raspberry Pi as a dedicated Bluetooth Low Energy (BLE) gateway between the SensorTag and the cloud.

The goal is simple:
collect sensor data locally via BLE and publish it reliably to Watson IoT using Node.js.


Architecture Overview

The setup is intentionally minimal:

  • SensorTag communicates via Bluetooth LE
  • Raspberry Pi acts as the BLE gateway
  • Node.js application reads sensor data and publishes it
  • Watson IoT Platform ingests and visualizes telemetry
  • Node-RED handles flows, dashboards, and integrations

This mirrors a common real-world IoT pattern: constrained devices, a lightweight edge gateway, and a managed cloud platform.


Using Node.js as the IoT Gateway Runtime

My Bluemix colleagues originally developed a Node.js application called iot-sensor-tag.
The app:

  • Reads SensorTag data via Bluetooth LE
  • Normalizes sensor values
  • Publishes events to Watson IoT

Because it only requires Node.js and Bluetooth LE, it can run on anything that supports both, including a Raspberry Pi.


Preparing the Raspberry Pi for Bluetooth LE

Before running the application, the Raspberry Pi must be configured with a proper Bluetooth stack.

Download BlueZ

BlueZ is the official Linux Bluetooth protocol stack.

wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.32.tar.xz

Installing Required Dependencies

Update the system and install the required libraries:

sudo apt-get install libglib2.0-0 libglib2.0-dev
sudo apt-get install libdbus-1-dev
sudo apt-get install libudev-dev
sudo apt-get install libical-dev
sudo apt-get install libreadline-dev
sudo apt-get install libusb-1.0-0-dev

These dependencies are required for Bluetooth LE support and proper system integration.


Configuring and Building BlueZ

Extract the archive and enter the directory:

tar -xf bluez-5.32.tar.xz
cd bluez-5.32

Run the configuration step:

sudo ./configure \
  --prefix=/usr \
  --mandir=/usr/share/man \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --with-systemdsystemunitdir \
  --with-systemduserunitdir \
  --enable-library

Compile and install:

sudo make

During the build, I monitored CPU utilization live from a Watson IoT dashboard.
Yes, the Raspberry Pi was already sending its own performance metrics to the platform while compiling Bluetooth drivers. Edge computing irony fully embraced.


Running the SensorTag Gateway Application

Once BlueZ is installed:

  1. Install Node.js on the Raspberry Pi
  2. Deploy the iot-sensor-tag application
  3. Start the Node.js process

At this point, the Raspberry Pi becomes a fully autonomous BLE-to-cloud gateway.


Registering the Device in Watson IoT

As with any Watson IoT setup:

  • Register the Raspberry Pi as a device
  • Configure authentication credentials
  • Define event types and payload schema

Once registered, data flows naturally into the platform.


Visualizing Data with Node-RED

To complete the pipeline:

  • Create a Node-RED flow
  • Subscribe to SensorTag events
  • Route data to dashboards, alerts, or storage

This turns raw sensor telemetry into something immediately observable and useful.


Final Thoughts

This setup replaces a laptop-based gateway with a low-power, always-on edge device, which is how IoT systems are meant to behave.

It is not flashy.
It is not complicated.
It is correct.

The architecture still holds.

Sensor Tag to Watson IoT
IoT data for Raspberry make command

Further Reading and References

  • Raspberry Pi Official Documentation
    Hardware setup, operating system configuration, and performance considerations for Raspberry Pi devices.
    https://www.raspberrypi.com/documentation/
  • Node.js Official Website
    Runtime environment used to implement the SensorTag gateway application.
    https://nodejs.org/
  • Node-RED Documentation
    Visual flow-based programming tool commonly used with Watson IoT for device orchestration and dashboards.
    https://nodered.org/docs/
  • TI SensorTag Overview
    Technical overview of the Texas Instruments SensorTag, including supported sensors and BLE capabilities.
    https://www.ti.com/tool/CC2650STK

Suggested Reading