Overview

Skill Level: Intermediate

Intermediate

PrepareGetting your device ready.Plug your boards together as shown on the quick start guide supplied with the kit.Connect to a network with internet access using an Ethernet cable.Connect to your computer using a USB cable supplied, using the connector on the board, as shown on the quick start guide.The microcontroller appears as a drive on […]

Ingredients

ARM mbed Ethernet Starter Kit containing:

  • Temperature Sensor (LM75B)
  • Accelerometer (MMA7660)
  • Potentiometer
  • Joystick

Step-by-step

  1. Prepare

    Getting your device ready:

    1. Plug your boards together as shown on the quick start guide supplied with the kit.
    2. Connect to a network with internet access using an Ethernet cable.
    3. Connect to your computer using a USB cable supplied, using the connector on the board, as shown on the quick start guide.
    4. The microcontroller appears as a drive on your computer names mbed.

    Getting the Bluemix services ready:

    This IoT Recipe makes use of the Create Toolchain button to help deploy the necessary services on to Bluemix. Click on the Create Toolchain button provided below, provide a custom name to your application and choose to click on Create button, to quickly deploy the Watson IoT Platform – Node-RED Bluemix starter app. Post successful deployment, you shall have both the above mentioned services, up & running on Bluemix along with a Cloudant NoSQL DB at your disposal.

    Toolchain-8

    Note: If you are a User using the United Kingdom Region in your Bluemix environment, then please make use of the steps mentioned in the IoT Recipe Deploy Internet of Things Platform Starter service on Bluemix to deploy the setup. Alternatively, you can also try using the Deploy to Bluemix button, to deploy the setup under your United Kingdom Region, provided your Jazzhub account is validated. Users of US South Region can ignore this step.

    deploy

  2. Connecting to IBM Watson IoT Platform Quickstart Service

    To connect your device to the IBM Watson IoT Platform Quickstart Service, you don’t need to have signed up, to the Watson IoT. The program is present on the device and is already configured, such that, when you connect it to the computer, the device will automatically run in Quickstart mode.

    1. When you plug in your device, the connection light (picture) will initially glow yellow, while the connection is established, then turn green when the connection has been made.

  3. Visualizing your data

    After connecting your device to the Quickstart, the next step is visualizing your data. Real-time visualization of device data can be achieved by visiting the IBM Watson IoT Platform web page specific to your platform.

    1. Open the IBM.HTM file on the mbed disk. This will redirect you automatically to the data feed visualization for your board.

    2. Alternatively, to view the data from any other device, simple enter the Device ID (a twelve character string) in the box here and click Go to visualize your data. The Device ID can be found by scrolling down on the LCD screen using the joystick button on the board.
  4. Accessing the application to process device data

    Access your application deployed on Bluemix, to handle the data from your ARM mbed.

    1. You have deployed the Node-RED service on to the Bluemix by clicking on the Create Toolchain button in Pre-requisites section. Access your Node-RED application by clicking on View App link and then choosing the option Go to you Node-RED flow editor, to access the editor.
    2. Parallelly, you can also access the Node-RED editor directly by accessing the following URL
        http://<your-application-name>.mybluemix.net/red
  5. Linking your Application and Device

    Using your Node-RED work flow editor, you can configure your application to work with your connected device.

    1. Double click the IBM IoT App In node in your Node-RED flow editor.
    2. In the Authentication Type field, select Quickstart from the dropdown list.
    3. Enter the Device ID of your board in the Device ID field.
      • The Device ID of your board can be found by scrolling down on the LCD screen using the joystick button on a connected board.
      • Alternatively, the device ID of your connected mbed can be derived from the MAC address. Copy the MAC address from the visualization page, and remove the colons and make sure the letters are lowercase. For example: 01:23:45:67:89:AB becomes 0123456789ab.
    4. Click the Deploy button in the upper right of the Node-RED editor to deploy the changes to your flow.
    5. Select the debug pane on the right, you should see raw data from the sensors on your connected device. The flow should be generating Temperature Status messages. If you hold your device in your hand you should see the temperature rise.
      • Note: If you can’t see both of these messages (the raw data and the temperature status messages), check that the switch on the right of both debug nodes is on.

    Your Node-RED application is now processing all data from your device and generating temperature status messages using data generated by your device.

  6. Modifying your application

    Using your Node-RED work flow editor, you can modify how your application works with your connected device. These steps will demonstrate how to change the temperature threshold values for the existing flow, and how to create a subflow which extracts the data from the potentiometer1 sensor on your connected mbed device.

    1. Double click the temp thresh node in your Node-RED flow editor. This contains the rules that are used to determine whether the temperature is in safe limits or not in the status messages. You can modify the behaviour of the flow by:
      • Changing the rules in the node, e.g. changing the threshold.
      • Click OK.
      • Click Deploy to change the running instance of your application.
    2. In order to create a new subflow that extracts the reading from the potentiometer1 sensor:
      • Drag a Function node from the function section of the node palette on the left and drop it on the sheet near the IBM IoT App In node.
      • Click and drag the output connector of the IBM IoT App In node to the input of the Funtion node to create a connection between them.
      • Double click the Function node to open the javascript editor. Replace the existing code with the following to extract the value of potentiometer1:
        return {payload:msg.payload.d.potentiometer1};
      • Rename the node “pot1”.
      • Select OK.
      • Drag a Debug node from the output nodes palette. Connect the output of your “Pot1” node to the input of the Debug node and click Deploy.
      • The value of the potentiometer1 sensor should now appear in the debug pane. Twisting the potentiometer on the device will cause the value to change in near real time.
      • Note: potentiometer1 is the bottom left potentiometer when the device is viewed with the ethernet cable at the top.

    Your flow should look similar to the following diagram.

  7. Ready to go further?

    Now that you have connected your device to Quickstart and created your first application, go to Part 2 of this recipe for details of how to register your device into a private IBM Watson IoT Platform organisation and start sending commands to it.

Expected Outcome

Have your ARM mbed connected to IoTF Quickstart with visualized data and a modified Bluemix application using your device data.

4 comments on"ARM® mbed™ IoT Starter Kit (Part 1)"

  1. […] no podía ser menos así que lanzó ARM starter kit, una especie de kit for dummies, para principiantes, que permitirá crear nuestros propios […]

  2. […] the Starter Kit than just watching it make simple charts. After a few minutes perusing the official online tutorial, I had the Starter Kit hooked into IBM’s browser-based Node-RED editor and running the […]

  3. HK7R_Colin_Westlake January 05, 2016

    The following might be re-written “(Unfortunately you will need nove to wait for the Bluemix trial account confirmation email before continuing.)” to (You should wait for the Bluemix trial account confirmation email before continuing.)

Join The Discussion