Quickstart - Use your smartphone as a device to send telemetry to an IoT Central application

Get started with an Azure IoT Central application and connect your first device. To get you started quickly, you install an app on your smartphone to act as the device. The app sends telemetry, reports properties, and responds to commands:

Overview of quickstart scenario connecting a smartphone app to IoT Central.

In this quickstart, you:

  • Create an IoT Central application.
  • Register a new device in the application.
  • Connect a device to the application and view the telemetry it sends.
  • Control the device from your application.

Prerequisites

  • An Azure account with an active subscription. Create an account for free.

    You should have at least Contributor access in your Azure subscription. If you created the subscription yourself, you're automatically an administrator with sufficient access. To learn more, see What is Azure role-based access control?

  • An Android or iOS smartphone on which you're able to install a free app from one of the official app stores.

Create an application

Navigate to the Azure IoT Central Build site. Then sign in with the Microsoft personal, work, or school account associated with your Azure subscription.

IoT Central provides various industry-focused application templates to help you get started. This quickstart uses the Custom application template to create an application from scratch:

  1. Navigate to the Build page and select Create app in the Custom app tile:

    Build your IoT application page

    If you're prompted to sign in, use the Microsoft account associated with your Azure subscription.

  2. On the New application page, make sure that Custom application is selected under the Application template.

  3. Azure IoT Central automatically suggests an Application name based on the application template you've selected. Enter your own application name such as Contoso quickstart app.

  4. Azure IoT Central also generates a unique URL prefix for you, based on the application name. You use this URL to access your application. Change this URL prefix to something more memorable if you'd like. This URL must be unique.

    Azure IoT Central Create an application page

  5. For this quickstart, leave the pricing plan set to Standard 2.

  6. Select your subscription in the Azure subscription drop-down.

  7. Select your closest location in the Location drop-down.

  8. Review the Terms and Conditions, and select Create at the bottom of the page. After a few seconds, your IoT Central application is ready to use:

    Azure IoT Central application

Register a device

To connect a device to your IoT Central application, you need some connection information. An easy way to get this connection information is to register your device.

To register your device:

  1. In IoT Central, navigate to the Devices page and select Add a device:

    Screenshot that shows create a device in IoT Central.

  2. On the Create a new device page, accept the defaults, and then select Create.

  3. In the list of devices, click on the device name:

    A screenshot that shows the highlighted device name that you can select.

  4. On the device page, select Connect and then QR Code:

    Screenshot that shows the QR code you can use to connect the smartphone app.

Keep this page open. In the next section, you scan this QR code using the smartphone app to connect it to IoT Central.

Tip

The QR code contains the information, such as the registered device ID, your device needs to establish a connection to your IoT Central application. It saves you from the need to enter the connection information manually.

Connect your device

To get you started quickly, this article uses the IoT Plug and Play smartphone app as an IoT device. The app sends telemetry collected from the smartphone's sensors, responds to commands invoked from IoT Central, and reports property values to IoT Central.

Install the app on your smartphone from one of the app stores:

Get the app for your Android phone on Google Play. Download the app for your phone from the the App Store.

To connect the IoT Plug and Play app to your Iot Central application:

  1. Open the IoT PnP app on your smartphone.

  2. On the welcome page, select Scan QR code. Point the smartphone's camera at the QR code. Then wait for a few seconds while the connection is established.

  3. On the telemetry page in the app, you can see the data the app is sending to IoT Central. On the logs page, you can see the device connecting and several initialization messages.

To view the telemetry from the smartphone app in IoT Central:

  1. In IoT Central, navigate to the Devices page.

  2. In the list of devices, click on the device name, then select Overview:

    Screenshot of the overview page with telemetry plots.

Tip

The smartphone app only sends data when the screen is on.

Control your device

To send a command from IoT Central to your device, select the Commands view for your device. The smartphone app can respond to three commands:

Screenshot that shows the three commands the smartphone app responds to.

To make the light on your smartphone flash, use the LightOn command. Set the duration to three seconds, the pulse interval to five seconds, and the number of pulses to two. Select Run to send the command to the smartphone app. The light on your smartphone app flashes twice.

To see the acknowledgment from the smartphone app, select command history.

Clean up resources

If you don't plan to complete any further IoT Central quickstarts or tutorials, you can delete your IoT Central application:

  1. In your IoT Central application, navigate to Application > Management.
  2. Select Delete and then confirm your action.

Next steps

In this quickstart, you created an IoT Central application and connected device that sends telemetry. Then you used a smartphone app as the IoT device that connects to IoT Central. Here's the suggested next step to continue learning about IoT Central: