Getting Started with Rapid IoT

This guide teaches you how to get started using the NXP Rapid IoT with Atmosphere. This includes creating your first Rapid IoT project, programming the project’s firmware into the Rapid IoT, registering the device to Atmosphere, and having its data displayed on a dashboard.

This guide demonstrates a simple project that reads the hardware’s ambient light sensor once per second, which displays that information on the Atmosphere IoT app using an analog meter, and sends the data to the cloud.

Prerequisite: You should already have an Atmosphere account.

Hardware Requirements

  • NXP Rapid IoT Prototyping Kit
  • Tablet or smartphone mobile device

Software Requirements

  • Atmosphere IoT app. The mobile app allows you to view your registered devices and display and run the project’s interface. You can download the Atmosphere IoT app from its downloads page or through the Apple App Store or Google Play Store.
  • Ensure Bluetooth is enabled on the mobile device you’ll use to interact with the Rapid IoT.

Step 1 of 9: Create a New Project

Navigate to Atmosphere IoT Studio from the side menu. When you visit IoT Studio for the first time in a session, you are brought to the IoT Studio Projects screen.

  1. Click the new project button. This displays a New Project window.
  2. Select the Rapid IoT project type and give the project a name, then click Create.

This opens a new project in IoT Studio.

This guide walks through the step-by-step process to perform actions in IoT Studio, but doesn't cover the in-depth aspects of IoT Studio itself. To learn more about using IoT Studio, its areas and features, and Studio elements, visit the Atmosphere Studio section.

Step 2 of 9: Create the Project’s Embedded Firmware

The first aspect of building this sample project is adding elements to the Embedded tab to create the project’s embedded firmware. This involves setting an interval to read embedded data, and to tell the interval to read the Rapid IoT’s ambient light sensor.

  1. Add the following elements to the canvas by clicking them in the Element Toolbox:
    • Interval Element Interval element: The interval element sets the project to run at the time set in the element’s properties, which by default is set to once per second (1000 ms).
    • TSL2572 Element TSL2572 element: The TSL2572 element reads the hardware’s ambient light sensor data.
    • BLE Characteristic Element BLE characteristic element: The BLE characteristic element creates a GATT characteristic to use in your project. This element is a coupled element that bridges the project between the Embedded tab and Application tab, meaning it’s included on both tabs.
  2. Connect the interval element to the TSL2572 element. This creates an event between them, which can be seen in either the interval element’s properties, or by clicking the connector’s Configuration Button button. The event added is within the Interval trigger, with the TSL2572 ability Read Ambient Light. This means that when the interval element is triggered (which is every second), it will read the ambient light sensor’s value.
  3. Connect the TSL2572 element to the BLE characteristic element, which ties the value of the ambient light sensor to the Application tab. This creates an event between the two elements in the Ambient Light Read trigger of Set Value, which sets a value for the project’s interface after it reads the raw sensor value.
  4. Select the BLE Characteristic element on the canvas, which displays its properties in the properties panel. Set its Read Data Type property to Unsigned Integer, so the value it reads is an unsigned integer sent from the TSL2572 element. The element’s other properties may keep their default settings.

That’s all for work in the Embedded tab. To this point, an interval has been set to run once per second after the project opens, and when run will read the ambient light sensor. The Embedded tab’s canvas should resemble the following image:

Rapid IoT Embedded Tab

Step 3 of 9: Create the Project’s Interface

The second aspect of building this sample project is adding elements to the Application tab to create the project’s visual component.

Click the Application tab to move to the application area of the project. Notice how the Element Toolbox has changed, and that the coupled BLE characteristic element is displayed on the canvas.

  1. Click the App Builder button in the Application tab’s toolbar to display the app builder. This area creates the visual interface for your project. By default this uses the smallest display size supported for an interface (320x560), but you can add an interface size by clicking the add display button. Use the display size that fits best with your mobile device.
  2. Add an Interval Element interval element to the canvas, and connect it to the existing BLE characteristic element. This creates the trigger event Read, which reads the value of the BLE characteristic element sent from the Embedded tab every time the interval triggers.
  3. Add an Analog Meter Element analog meter element to the canvas. The analog meter element displays a meter on a project’s interface to measure a value reading. Notice when the analog meter element is added to the canvas, a corresponding interface component is added to the app builder. Click the analog meter component and move it to the center of the interface. Then in the element’s properties, change its Maximum Value to 10000.
  4. Connect the BLE characteristic element to the analog meter element. This creates an event between the two elements under the Read trigger for Set Value, which sets the value to the value of the meter when the BLE characteristic is read. Then in the event’s Value field, enter Read Data. This correlates the data read from the BLE characteristic element in the Embedded tab to set the analog meter’s value on the interface.
  5. Add a Label Element label element to the canvas. The label element displays text on a project’s interface. Click and move the label component on the interface centered above the analog meter component, then change the label’s text in its properties to read “Light Sensor Value.”

This is all that needs to be done for the project’s interface. To this point, an interval has been set that will read the BLE characteristic value once per second, which will display the light sensor value on the analog meter. The Application tab’s canvas and interface should resemble the following images:

Canvas Interface
Rapid IoT Application Canvas Rapid IoT Application Interface

Step 4 of 9: Enable the Project’s Cloud Connectivity

The last aspect of building this sample project is enabling it for cloud connectivity. This is done on both the Application tab and Cloud tab.

  1. While still in the Application tab, add a Device Event Element Device Event element to the canvas. The Device Event element is a coupled element between the Application tab and Cloud tab that enables a project’s data to be sent to Atmosphere.
  2. Connect the BLE characteristic element to the Device Event element. This adds the Send Event event to the Read trigger, which sends the set value data to Atmosphere when the BLE characteristic is read.
  3. Click the Cloud tab to move to the cloud area of the project. Notice how the Element Toolbox has changed, and that the coupled Device Event element is displayed on the canvas.
  4. Add a Cloud Storage Element cloud storage element to the canvas, and connect the Device Event element to the cloud storage element. This allows Atmosphere to store data sent to it from the connected Device Event element.

That’s all for creating the project! With the added cloud connectivity, the project will send the light sensor value from the Embedded tab to the Application tab (where it’s displayed on the mobile app’s interface), which then uses a Device Event to send it to the Cloud tab, where it’s connected to a cloud storage element to store the data on Atmosphere.

The final canvas for each tab should resemble the following images:

Embedded Application Cloud
Rapid IoT Embedded Tab Rapid IoT Application Tab Rapid IoT Cloud Tab

Step 5 of 9: Compile the Project

Once the project is finished, it needs to be compiled. Compiling readies the entire project’s source code for deployment.

From any tab, click the Compile button in the project options menu on the top-right of the screen. You’ll see a loading message on the screen, and will be notified when the project is compiled.

Step 6 of 9: Program Firmware into the Rapid IoT

With the project compiled, your Rapid IoT can be programmed with the project’s embedded firmware.

Prior to programming a Rapid IoT, ensure you have the following setup configuration:

  • The device is connected to the computer via USB.
  • The Rapid IoT is in programming mode.

To put the Rapid IoT into programming mode, perform the following steps:

  1. Connect the Rapid IoT to the computer via USB.
  2. Simultaneously hold the top-left and bottom-right side buttons for five seconds until the screen goes black. Continue holding the buttons while the screen goes black.
  3. The green LED will turn on and start blinking, indicating the device is now in programming mode. The side buttons can be released. While in programming mode, the Rapid IoT displays as a mass storage USB device on your computer.

With setup complete, you can program your Rapid IoT:

  1. While the Embedded tab is active, click the Program button from the tab’s toolbar. This downloads a .bin file containing the project’s compiled firmware.
  2. Locate the downloaded file on your computer, and move it into the Rapid IoT mass storage device. This initiates programming of the Rapid IoT, which is represented by a series of blinking lights on the device.

When the lights stop blinking, programming is complete and the Rapid IoT is programmed with the project’s embedded firmware. The Rapid IoT will reboot itself and no longer display as a mass storage device, and upon startup the project is loaded on the device.

Step 7 of 9: Register the Device

With firmware installed, the Rapid IoT can now be recognized and connected to Atmosphere. From here, open the Atmosphere IoT app on your mobile device. You’ll use the mobile app to both register the device and eventually view the label data on the project’s interface.

To register a device:

  1. Navigate to the Devices area, and click the Register Device button in the top-right of the screen to display the Scan window. When the window opens it automatically starts scanning for available devices within range.
    • Ensure your Rapid IoT is within range from the device you are attempting to register from, otherwise it may not appear.
  2. The list of available devices appears. Select the Rapid IoT you just programmed and click Register.

The device is registered to Atmosphere and displayed on the page.

Step 8 of 9: View the Project Interface

Each registered device has its own dedicated console page, which displays its information and is where you access the device’s interface to interact with it. Select your newly-registered device in the Devices area to access its console.

The interface created in Studio’s Application tab is available on a device’s dashboard to interact with it. As long as the device is powered on and connected to Atmosphere, it can be interacted with.

To display the interface you created, click the Interface button at the top of the screen. This opens the project interface from within the Atmosphere IoT app.

The project’s interface displays the light sensor’s value on the analog meter, which updates once per second.

Step 9 of 9: View Device Data

Now that the data is sent to Atmosphere, it can be viewed through one of the many device dashboard widgets available. In this guide an data gauge widget can be used to display the light sensor’s value on the Dashboard similar to how it’s presented on the mobile app’s interface.

  1. To add a widget to the device’s dashboard, click the Configuration button on the right side of the screen. This displays the menu of available widgets. Select the Data Gauge data gauge widget to add a gauge to the dashboard.
  2. In the data gauge’s settings, modify the following properties:
    • Name: Give the widget a name, such as “Rapid IoT Light Sensor.” *Prefix: Give the widget a prefix label for the gauge, such as “Light.”
    • Units: Enter lux for its unit of measurement.
    • Min: Set the minimum value to 0.
    • Max: Set the maximum value to 1000.
    • Number of Splits: Set the number of split increments for the gauge to 10.
    • Middle Segment Start: Set the start value of the middle segment to 200.
    • Middle Segment End: Set the end value of the middle segment to 800.
    • Segment Colors: Select colors for each of the three segments on the gauge. Choose whichever color you think will be most appropriate for each segment.
  3. In the Data Source field, click Select, then choose the following configuration options for the widget:
    • Select Cloud Storage: Click the cloud storage that is storing the light data.
    • Select Value Select the light dataset.
  4. When finished click Save.

Like the analog meter on the app interface, the light sensor value is displayed on the data gauge widget.

Rapid IoT Dashboard

Congratulations, you just finished a complete Rapid IoT project with Atmosphere!

What’s Next

Now that you’ve created your first Rapid IoT project, you can explore more of the kit’s features, including creating projects that use the device’s display.

If you want to create a project that uses the Rapid IoT's display, visit the Rapid IoT Display Page Guide. This guide provides a complete walkthrough creating a project that uses multiple pages to display sensor data.