Overview

Skill Level: Any Skill Level

All developers and system integrators

Connect the SensorTile platform to IBM Watson IoT cloud using a mobile phone as a gateway. SensorTile is a tiny, square-shaped module that can fit snugly in your IoT hub or sensor network node and become the core of your solution.

Ingredients

  • SensorTile development kit (available on st.com:¬†STEVAL-STLKT01V01).¬†The SensorTile is a tiny, square-shaped IoT module that packs powerful processing capabilities leveraging an 80 MHz STM32L476JGY microcontroller and Bluetooth low energy connectivity based on BlueNRG network processor as well as a wide spectrum of motion and environmental MEMS sensors, including a digital microphone.
  • an Android or iOS device with bluethooth low energy capability and an internet connection
  • ST BlueMS mobile application¬†

Step-by-step

  1. Assemble the SensorTile

    Follow detailed instructions provided in the Getting Started user manual of the STEVAL-STLKT01V01 development kit to learn how to assemble the SensorTile.

    assembleSensorTile

     

    SensorTile module comes with a default firmware which is now deprecated; please update the firmware (named FP-SNS-ALLMEMS1) with the last version available for download on st.com at this link.

    This recipe uses version v3.0.0 of the FP-SNS-ALLMEMS1 firmware.

     

  2. Install the ST BlueMS application in your mobile phone

    Install the ST BlueMS application in your mobile phone. The application is available for Android and iOS.

    This recipe uses version 3.4 of the ST BlueMS application.

  3. Connect the mobile phone to SensorTile via Bluetooth using BlueMS app

    1. Switch on the SensorTile
    2. Open the ST BlueMS app in your mobile phone
    3. Click on the “Start scanning” button
    4. Select the device to start the connection.

     

    iOS Scanning Android Scanning
  4. Select the Cloud Logging Demo in BlueMS app

    Android

    • do a swipe left gesture until the Cloud Logging page is shown
    • or do a right swipe from the border to display the demo list, then¬†select Cloud Logging demo

    iOS

    • do a left swipe until you reach the Cloud Logging page
    • use the bottom bar to jump to the Cloud Logging demo

     

    Note:

    The list of availabe demos can be different, due to a different firmware version or different embedded algorithms enabled.

    iOS Select Demo Android Select Demo
  5. Connect to IBM Watson IoT

    Android

    Select the “IBM Watson IoT – Quickstart” provider.

    Click on the icon button at the bottom right of your mobile screen to open the connection.

      

    iOS

    Select¬† “IBM Watson IoT – Quickstart” provider.

    Click on the connect button to open the connection

     

    Note:

    The Device Id will contain an unique string created using the SensorTile MAC address.

    The value can be changed if needed, but it must be unique.

    iOS Set DeviceId Android set Device Id
  6. Transmit SensorTile data to IBM Watson IoT via BlueMS app

    Select which sensor data set received from the SensorTile will be trasnmitted to the cloud.

    Note:

    Only one data sample each second will be sent to the cloud.

     iOS Select Data Android SelectData
  7. Display SensorTile data on IBM Watson Quickstart webpage

    To visualize data from SensorTile in IBM Watson IoT Quickstart page, simply¬†click on¬†the “View Data on Cloud” button in the BlueMS mobile application

    To open the webpage from any other device:

    iOS Show data page Android  Show Data Page
  8. Connect SensorTile as registered device in your IBM Watson IoT account

    If you need need to store or do computation with the data received from SensorTile, you need first to create an IBM Watson IoT account and register the device. To create the account and register the device you can follow instructions provided in this recipe: How to Register Devices in IBM Watson IoT Platform

    Once registered the device, you need to keep note of the following information:

    • Organization Id: is organization name used to register in the IBM platform
    • Authentication Token: is the secret token shared between the device and the IBM platform
    • Device Type: is the type of device that generate the data¬†
    • Device Id: is the unique name of the device¬†

    In the BlueMS mobile application, select IBM Watson IOT as cloud provider and fill the form with the requested data.

    After connection the application will transmit data to the topic: iot-2/evt/[data set]/fmt/json with the same json format used to connect with QuickStart.

     

    iOS Show data page Android Show Data Page
  9. STM32 Open Development Environment

    SensorTile and BlueMS mobile application for IBM Watson IoT Platform are part of the STM32 Open Development Environment (STM32 ODE). STM32 ODE is an open, flexible, easy and affordable way to develop innovative devices and applications based on the STM32 32-bit microcontroller family combined with other state-of-the-art ST components connected via expansion boards.

    More information on STM32 ODE can be found at www.st.com/stm32ode

Join The Discussion