Internet of Things (IoT) solutions are becoming increasingly popular, with industrial and consumer applications alike. These solutions can range from simple sensor monitoring devices to complex systems with thousands of devices.
Microsoft’s Azure IoT Central is a platform that provides a simple, secure, and scalable way to create IoT solutions. In this tutorial, we will walk through the process of building an end-to-end IoT solution with Azure IoT Central.
Prerequisites
Before we begin, you will need the following:
- An Azure account
- Permissions to create an IoT Central application
- A device that can send data to your IoT Central application
- Basic knowledge of Azure IoT Central
Create an Azure IoT Central Application
- Log in to your Azure portal account.
-
Search for “Azure IoT Central” in the search box and select the “IoT Central” service from the results.
-
In the IoT Central blade, select “Create.”
-
Select a basic template that fits your IoT solution needs. For this tutorial, we will use the “Custom” template.
-
Give your IoT Central application a name, select your subscription, and create a new resource group.
-
Choose the pricing tier that best suits your needs. The “Basic” tier is the most cost-effective for this tutorial.
-
Choose whether you want a public or private application. Public should be selected if your solution needs to access data from external sources.
-
Click “Create” and wait for your application to be deployed.
Create a Device Template
-
Once your application has been created, navigate to “Device templates” in the navigation menu.
-
Select “New” to create a new device template.
-
Give your device template a name and a description.
-
Under “Telemetry,” add any telemetry data points that your devices will capture. These data points can include temperature, humidity, pressure, and more.
-
Under “Cloud-to-device messages,” add any messages that you want to send from the cloud to devices.
-
Under “Device properties,” add any properties that your devices will have.
-
Under “Commands,” add any remote commands that you want your devices to be able to receive.
-
Navigate to “Device connectivity” and select “MQTT” as the protocol for your devices.
-
Generate a primary key and a secondary key for your device template.
-
Click “Create” to create your device template.
Create a Physical Device
-
After creating your device template, navigate to “Devices” in the navigation menu.
-
Select “New” to create a new physical device.
-
Choose your device template from the list of templates.
-
Give your physical device a name and a description.
-
Enter the primary key and secondary key generated for your device template.
-
Click “Create” to create your physical device.
Send Telemetry Data from Your Device
-
Install an MQTT library on your device.
-
In your device code, create an MQTT client and connect it to your IoT Central application using the “Device connection string” found in your physical device details.
-
Create a message containing the telemetry data that you want to send.
-
Send the message to your IoT Central application.
-
Verify that the telemetry data is received in your IoT Central application.
Create a Dashboard
-
Navigate to “Dashboard” in the navigation menu.
-
Select “New” to create a new dashboard.
-
Give your dashboard a name and a description.
-
Select the type of dashboard to create.
-
Drag and drop telemetry data visualizations onto the dashboard.
-
Customize the visualizations to display the telemetry data that you want.
-
Click “Save” to save your dashboard.
Create an Alert
-
Navigate to “Rules” in the navigation menu.
-
Select “New” to create a new alert.
-
Give your alert a name and a description.
-
Choose the device template and device property that you want to monitor.
-
Define the alert condition based on the telemetry data.
-
Choose the action to perform when the alert is triggered, such as sending an email or SMS message.
-
Click “Create” to create your alert.
Conclusion
In this tutorial, we have walked through the process of building an end-to-end IoT solution with Azure IoT Central. We started by creating an IoT Central application, then created a device template and a physical device. Next, we sent telemetry data from our device and created a dashboard to visualize the data. Finally, we created an alert based on the telemetry data.
Azure IoT Central provides a simple and scalable platform to build IoT solutions. With its powerful features and easy-to-use interface, it is a great platform for both beginners and advanced users.