Connect Intel Edison to Azure IoT Hub (Node.js)

In this tutorial, you begin by learning the basics of working with Intel Edison. You then learn how to seamlessly connect your devices to the cloud by using Azure IoT Hub.

Don't have a kit yet? Start here

What you do

  • Setup Intel Edison and Grove modules.
  • Create an IoT hub.
  • Register a device for Edison in your IoT hub.
  • Run a sample application on Edison to send sensor data to your IoT hub.

Connect Intel Edison to an IoT hub that you create. Then you run a sample application on Edison to collect temperature and humidity data from a Grove temperature sensor. Finally, you send the sensor data to your IoT hub.

What you learn

  • How to create an Azure IoT hub and get your new device connection string.
  • How to connect Edison with a Grove temperature sensor.
  • How to collect sensor data by running a sample application on Edison.
  • How to send sensor data to your IoT hub.

What you need

What you need

  • The Intel Edison board
  • Arduino expansion board
  • An active Azure subscription. If you don't have an Azure account, create a free Azure trial account in just a few minutes.
  • A Mac or a PC that is running Windows or Linux.
  • An Internet connection.
  • A Micro B to Type A USB cable
  • A direct current (DC) power supply. Your power supply should be rated as follows:
    • 7-15V DC
    • At least 1500mA
    • The center/inner pin should be the positive pole of the power supply

The following items are optional:

  • Grove Base Shield V2
  • Grove - Temperature Sensor
  • Grove Cable
  • Any spacer bars or screws included in the packaging, including two screws to fasten the module to the expansion board and four sets of screws and plastic spacers.


These items are optional because the code sample support simulated sensor data.

Create an IoT hub

  1. Sign in to the Azure portal.

  2. Select Create a resource > Internet of Things > IoT Hub.

    Screenshot of Azure portal navigation to IoT Hub

  3. In the IoT hub pane, enter the following information for your IoT hub:

    • Subscription: Choose the subscription that you want to use to create this IoT hub.

    • Resource group: Create a resource group to host the IoT hub or use an existing one. For more information, see Use resource groups to manage your Azure resources.

    • Region: Select the closest location to you.

    • Name: Create a name for your IoT hub. If the name you enter is available, a green check mark appears.


    The IoT hub will be publicly discoverable as a DNS endpoint, so make sure to avoid any sensitive information while naming it.

    IoT Hub basics window

  4. Select Next: Size and scale to continue creating your IoT hub.

  5. Choose your Pricing and scale tier. For this article, select the F1 - Free tier if it's still available on your subscription. For more information, see the Pricing and scale tier.

    IoT Hub size and scale window

  6. Select Review + create.

  7. Review your IoT hub information, then click Create. Your IoT hub might take a few minutes to create. You can monitor the progress in the Notifications pane.

Now that you have created an IoT hub, locate the important information that you use to connect devices and applications to your IoT hub.

In your IoT hub navigation menu, open Shared access policies. Select the iothubowner policy, and then copy the Connection string---primary key of your IoT hub. For more information, see Control access to IoT Hub.


You do not need the iothubowner connection string for this set-up tutorial. However, you may need it for some of the tutorials or different IoT scenarios after you complete this set-up.

Get your IoT hub connection string

Register your device in the IoT hub

  1. In your IoT hub navigation menu, open IoT devices, then click Add to register a device in your IoT hub.

    Add a device in the IoT Devices of your IoT hub

  2. Enter a Device ID for the new device. Device IDs are case sensitive.


    The device ID may be visible in the logs collected for customer support and troubleshooting, so make sure to avoid any sensitive information while naming it.

  3. Click Save.

  4. After the device is created, open the device from the list in the IoT devices pane.

  5. Copy the Connection string---primary key to use later.

    Get the device connection string

Setup Intel Edison

Assemble your board

This section contains steps to attach your Intel® Edison module to your expansion board.

  1. Place the Intel® Edison module within the white outline on your expansion board, lining up the holes on the module with the screws on the expansion board.

  2. Press down on the module just below the words What will you make? until you feel a snap.

    assemble board 2

  3. Use the two hex nuts (included in the package) to secure the module to the expansion board.

    assemble board 3

  4. Insert a screw in one of the four corner holes on the expansion board. Twist and tighten one of the white plastic spacers onto the screw.

    assemble board 4

  5. Repeat for the other three corner spacers.

    assemble board 5

Now your board is assembled.

assembled board

Connect the Grove Base Shield and the temperature sensor

  1. Place the Grove Base Shield on to your board. Make sure all pins are tightly plugged into your board.

    Grove Base Shield

  2. Use Grove Cable to connect Grove temperature sensor onto the Grove Base Shield A0 port.

    Connect to temperature sensor

    Edison and sensor connection

Now your sensor is ready.

Power up Edison

  1. Plug in the power supply.

    Plug in power supply

  2. A green LED(labeled DS1 on the Arduino* expansion board) should light up and stay lit.

  3. Wait one minute for the board to finish booting up.


    If you do not have a DC power supply, you can still power the board through a USB port. See Connect Edison to your computer section for details. Powering your board in this fashion may result in unpredictable behavior from your board, especially when using Wi-Fi or driving motors.

Connect Edison to your computer

  1. Toggle down the microswitch towards the two micro USB ports, so that Edison is in device mode. For differences between device mode and host mode, please reference here.

    Toggle down the microswitch

  2. Plug the micro USB cable into the top micro USB port.

    Top micro USB port

  3. Plug the other end of USB cable into your computer.

    Computer USB

  4. You will know that your board is fully initialized when your computer mounts a new drive (much like inserting a SD card into your computer).

Download and run the configuration tool

Get the latest configuration tool from this link listed under the Installers heading. Execute the tool and follow its on-screen instructions, clicking Next where needed

Flash firmware

  1. On the Set up options page, click Flash Firmware.
  2. Select the image to flash onto your board by doing one of the following:
    • To download and flash your board with the latest firmware image available from Intel, select Download the latest image version xxxx.
    • To flash your board with an image you already have saved on your computer, select Select the local image. Browse to and select the image you want to flash to your board.
  3. The setup tool will attempt to flash your board. The entire flashing process may take up to 10 minutes.

Set password

  1. On the Set up options page, click Enable Security.
  2. You can set a custom name for your Intel® Edison board. This is optional.
  3. Type a password for your board, then click Set password.
  4. Mark down the password, which is used later.

Connect Wi-Fi

  1. On the Set up options page, click Connect Wi-Fi. Wait up to one minute as your computer scans for available Wi-Fi networks.
  2. From the Detected Networks drop-down list, select your network.
  3. From the Security drop-down list, select the network's security type.
  4. Provide your login and password information, then click Configure Wi-Fi.
  5. Mark down the IP address, which is used later.


Make sure that Edison is connected to the same network as your computer. Your computer connects to your Edison by using the IP address.

Connect to temperature sensor

Congratulations! You've successfully configured Edison.

Run a sample application on Intel Edison

Prepare the Azure IoT Device SDK

  1. Use one of the following SSH clients from your host computer to connect to your Intel Edison. The IP address is from the configuration tool and the password is the one you've set in that tool.

    • PuTTY for Windows.
    • The built-in SSH client on Ubuntu or macOS.
  2. Clone the sample client app to your device.

    git clone
  3. Then navigate to the repo folder to run the following command to install all packages, it may take serval minutes to complete.

    cd iot-hub-node-intel-edison-client-app
    npm install

Configure and run the sample application

  1. Open the config file by running the following commands:

    nano config.json

    Config file

    There are two macros in this file you can configurate. The first one is INTERVAL, which defines the time interval between two messages that send to cloud. The second one simulatedData,which is a Boolean value for whether to use simulated sensor data or not.

    If you don't have the sensor, set the simulatedData value to true to make the sample application create and use simulated sensor data.

  2. Save and exit by pressing Control-O > Enter > Control-X.

  3. Run the sample application by running the following command:

    sudo node index.js '<your Azure IoT hub device connection string>'


    Make sure you copy-paste the device connection string into the single quotes.

You should see the following output that shows the sensor data and the messages that are sent to your IoT hub.

Output - sensor data sent from Intel Edison to your IoT hub

Next steps

You’ve run a sample application to collect sensor data and send it to your IoT hub.

To continue to get started with Azure IoT Hub and to explore other IoT scenarios, see the following: