IoT with Visual Basic

by Hannes DuPreez
IoT with Visual Basic

Exciting things are happening in our lifetimes, and a lot of them are due to IoT and its influence.


My friend and I had an interesting conversation a couple of weeks ago. We spoke about the advancement of technology and how we are so fortunate to live in this day and age. Who would have thought that Back to the Future 2 and the Terminator franchise would be playing out during our lifetime? Okay, perhaps that's a bit far fetched, but is it really?

Maybe I am too excited about the prospects of living in a 100% percent connected world where every electric appliance can communicate with one other. Add to this fact that the Microsoft Bot Framework knows your online activities better than what you may realize.


A bot, or Web robot, is the most common bot system. A Web robot is an application that can run automated tasks. These tasks are usually structurally repetitive and bots can perform these tasks much faster than humans. Because of the speed at which bots can perform tasks, they also can be implemented where response speed is faster than how a human can respond and process information.

Bots also can be used to emulate human activity. An example of this is a chat bot similar to IRC and IM. Bots also have the ability to mimic human conversation. Wikipedia explains bots much better than I can…

The Microsoft Bot Framework

The Microsoft Bot Framework is a communication service that helps connect your Bots with different communication channels, such as SMS and email. If you, for example, write a conversational Bot that exposes a Microsoft Bot Framework-compatible API on the Internet, the Microsoft Bot Framework Connector will forward messages from your Bot to a user, and also send user messages back to your Bot.


A month or so ago, I was 1200 Kilometers from home, for work purposes, with colleagues. About half way home, we stopped and had something to eat. I had an application on my smartphone called 'Allo' from Google. I demonstrated to one of my colleagues how it worked: Basically, I opened it up and typed in how many kilometers to go to my home. It immediately told me the number of kilometers, which was 604. I did another test and requested where the closest restaurant was in this strange place. It not only gave the restaurant's name, it also gave me directions.

Now, how did 'Allo' know these facts? Because of my search preferences in Google as well as my location setting were active on my Android phone. Okay, I know Google and Android are not the topic here, but I thought it would be a good explanation of how Bots work.


Ever noticed how Facebook also knows which Web sites you have visited? That's quite easy to prove: Go on Google and search for a guesthouse, for example. A day (give or take) later, you will be greeted with either a Page Suggestion for the guesthouse you have searched for, or the guesthouse's ad will pop up.

This is the magic of Bots!

Apart from Bots, Virtual Reality and Augmented Reality are becoming more and more popular. The first thought that comes to my mind when I hear Virtual Reality is a move named Demolition Man starring Sylvester Stallone, Wesley Snipes, and Sandra Bullock—that was my first 'encounter' with VR.

Look at Pokemon Go. Although the craze has settled, the benchmark has been set by Nintendo. It is just a matter of time when AR and VR will be as common as cell phones.

Look at me going on and enjoying the sound of my smooth baritone voice. Today's topic is IoT with Visual Basic and I will try to make your progression into it a bit easier.

Internet of Things

In a nutshell: The Internet of things (IoT) is the internetworking of any physical devices (including vehicles and buildings) simply called smart devices. These devices are embedded with electronics, software, sensors, actuators, and network connectivity that enable these objects to collect and exchange data. More information on IoT can be found here:



Visual Studio and the IoT

To develop apps for the IoT, you will need to use the Universal Windows Platform (UWP). Visual Studio 2015 and upwards can develop apps using the UWP.

Universal Windows Platform

The Universal Windows Platform (UWP) is an application architecture that can create universal apps that run on both Windows 10 and Windows 10 Mobile and even Xbox without the need to be re-written for each one.



Intro to the Universal Windows Platform

Getting Started with UWP and Visual Studio

You will need the following:

  • Windows 10
  • Visual Studio 2015

Don't despair if you do not have Windows 10, because Windows 7 and Windows 8.1 are still supported, but with the following restrictions:

Windows 7:

  • You cannot run the app locally—you can only run it on a remote Windows 10 device.
  • You cannot use the emulators or the simulator in Visual Studio.

Windows 8.1:

  • You cannot run the app locally—you can only run it on a remote Windows 10 device.
  • You can use the emulators available in Visual Studio, but not the simulator.

Visual Studio 2015 Platform Targeting and Compatibility

Irrespective of which Windows platform you will be using, you will still need Visual Studio 2015. You can find and download Visual Studio 2015 Community here.

Installing Visual Studio 2015

For Windows 8.1, ensure that you select the displayed options in Figure 1:

Figure 1: Windows 8.1 Visual Studio 2015 installation options

To further set up your Windows 10 IoT Core development PC, follow the next steps:

  1. Install Visual Studio 2015 Update 1.
  2. Install Windows IoT Core Project Templates.
  3. Enable your device for development.

Windows 10 IoT Core Templates

Windows 8.1 has the following UWP Project templates:

  • Class Library
  • Windows Runtime Component
  • Unit Test App

Figure 2: Windows 8.1 IoT Templates

For a full list of Windows 8.1 and Windows 10 UWP Project templates, have a look here:

Go beyond "Blank App" with these Windows 10 VS 2015 Project Templates

15 Visual Studio Project Templates To Jump Start Your Code

Deployment: Deploying an App with Visual Studio

Raspberry: Building Visual Studio Code on a Raspberry Pi 3


This article's purpose was to introduce you to the world of IoT with Visual Studio 2015 as well as all the options available to you.

This article was originally published on Wednesday Dec 14th 2016
Mobile Site | Full Site