Connecting your Cellphone to Microsoft Azure IoT Central
The term “Internet of Things” simply involves the integration of things to the internet. A thing can be anything; Refrigerator, House door, Cameras, Microwave, etc. Internet of things is incomplete without talking about various cloud platforms which allow our things to be connected to the internet. As an IoT engineer, there are lots of cloud providers that you can use in your solutions. Today, I will be giving a detailed guide on how to connect your IoT device to the Microsoft Azure IoT platform, a service offered by Microsoft Azure cloud services.
To start with, I am assuming you have your Azure account set up.
Step 1: There are different IoT development boards but for the sake of this tutorial, we will be using our mobile phone as the IoT device and to work with that we need to download an app on the Google play store or Apple store. Navigate to your play store and download “IoT Plug and Play”, after installation, you are good to go. The interface of the app looks that the screenshot below.
Step 2: On your PC, open your web browser and go to the link https://azure.microsoft.com. I have tried different browsers to access my Azure platform, and I will recommend using the Microsoft Edge browser. On the site, sign in using the Microsoft account you use to open your Azure account.
After signing in to your Azure portal, we can start building our application.
Step 3: Using the search bar, search for “IoT Central Applications” and click on it. Click on create a new application and fill in your application details. You can give a name to your resource bur note that you can only use small letters in naming your resource. Select your subscription type and pricing plan. If you already have a resource group created you can select your resource or you can create a new one. Note that creating a resource group is a must before you can run applications on Azure. On the template section, select “Custom application” and choose a location for your application.
After filling in all your details, click on “Create”, this might take a while to finish provisioning. After it is done, you will see the message “Your Deployment is complete”. On this page, click on “Go to resource” and you will be taken to your IoT central application.
Step 4: After clicking on “go-to resource”, you will be taken to a page showing your application URL. Click on the application URL to begin working on your IoT application.
The link will be open in another tab. On the page, you will see menus like Dashboard, Devices, Rules, Device template, Analytics, Administration, etc. What you will do is to click on “Devices”, Note that if you are connecting a real IoT board like the Raspberry pi or NodeMCU, you will need to set your Device template first but, in this case, where we are using our phone, there is no need. After clicking on Devices, click on “Create a Device”.
Step 5: Give your Device a name and an ID. This can be anything depending on your device. Your organization can’t be edited. On the “Device template”, select Unassigned, do not check the “Simulate this device” option, after filling in the information, click “Create”.
Step 6: After clicking on create, your device has been created. If you go back to Devices, under the “Device status”, you should see “Registered”. Click on your device name to go back to the device dashboard. On the top right corner of your device dashboard, click on “Connect”. It will now show you all the information needed to send data from your device to Azure IoT Central.
Step 7: After clicking on “Connect”, it will display some information like Device ID, Primary and Secondary key. To connect your mobile phone through the IoT plug and play app you download, click on QR code, and it will display a QR code instead of the primary and secondary key.
Step 8: Go back to your phone and open up the IoT plug-and-play app. You will see a prompt asking you to scan a QR code. Click on “Scan QR code” and scan the code displayed on your PC. After scanning the phone will be connected to your Azure IoT application. Also, some data will be displayed on your phone, these are the data Azure IoT is receiving from your phone.
Step 8: After your device has been successfully connected to IoT Central, you will see streams of data coming into IoT Central. Navigate to the “overview” tab to see your data.
Finally, you have the cloud to yourself, after sending in the data, you can use other cloud services provided by Azure to better relate with your data, you can set rules, perform analytics and so many other things. And there you have it, your device has been successfully connected to Microsoft Azure IoT central.
If you’re able to get this working, that’s a great job. One good thing with integrating your IoT device to the cloud is that other cloud services provided by the vendor can be use to further analyze your data.
If you need a step-by-step guide, check this video from Roles Academy: https://www.youtube.com/watch?v=N_MKqClW7dE
Additional Resources:
https://docs.microsoft.com/en-us/azure/iot-develop/overview-iot-plug-and-play