A long tradition at Atos Consulting is to conduct regularly the so called Geek Night. It is a get-together of different people to see, learn and get its own hands dirty on trendy topics. One of this year’s topic is the Internet of Things (IoT) and our goal is to demonstrate to people not familiar with it how easy it is to set up a simple prototype that sends data from a thing to the cloud.
First of all we need an idea
There is a big hype around IoT and many companies desperately try to implement it … saying “we do IoT”. But if you look at it a bit closer you will see that in most of the cases IoT alone won’t solve your problems. It is the business case and the ideas behind it that really matter and generate business value. So first of all think about your idea and then how to realize it. After that you will see if the Internet of Things is the right thing to use and if it enables you to realize the idea.
We will explore business cases in a later blog post and see how IoT influenced them. But as we are focusing in this post on the technical aspects of the solution and want to demonstrate how easy it is to implement a showcase, we keep the idea simple and describe our goal as follows:
“The owner of a car installed some sensors to monitor the driving behavior of the person that rents the car. The data from these sensors should be permanently stored and available in real-time to the owner.”
Now we have an idea … what else do we need?
Before we can start implementing something, we need an overview of the architecture. There are many different options and they can easily be exchanged with products from other vendors. We decided to go with the following set-up:
- Our car is a BB-8 robot. We can “drive” it and have some already built in sensors which can be accessed through an API.
- The connectivity of our BB-8 is limited to Bluetooth Low Energy (BLE). That’s why we use a Raspberry Pi 3 to act as the Gateway that sends the BB-8’s telemetry data to the cloud.
- There are many clouds available and they all offer similar functionalities (especially for our simple use case). We use Microsoft Azure and its IoT Suite. For those who don’t have access to Azure yet, there are developer- and trial subscriptions.
- To display the data we use a mobile phone and Microsoft’s Power BI. It can be used to display a report in a browser or in the Power BI app (available for iOS, Android and Windows phones).
Let’s get OUR hands dirty
Having all components we can start to put the single pieces together. We have two key steps to go through: First we will handle the cloud topics and then we will deal with the gateway and BB-8.
1. Cloud setup
The four components shown in the picture are enough to get our use case implemented. So we just have to create an IoT Hub, Stream Analytics, Data Lake and a Power BI component.
The IoT Hub is the entry door to Azure. It is a highly available component and responsible for connectivity and security between an IoT device (or gateway) and Azure.
The data from IoT Hub can be forwarded to Stream Analytics. This is a component for the so called “hot” or “real time” analytics. An SQL like query language can be used to search for special indicators (alarms, outliners, …) or filter the incoming data stream and forwarding it to other Azure components like Data Lake or Power BI.
In order to persistently store the received data we use a Data Lake. We actually don’t need it for this demo and every other storage would do the same job but it is an easy way so see what data has been received.
Power BI is a powerful tool to create graphs from different sources and it can display the streaming data coming from Stream Analytics (with a small delay).
Read the post Building an End-to-End Analytics Solution Using Azure Cloud Components for further information about Power BI.
Many tutorials and how-tos are available online. I would recommend Microsoft’s Azure IoT Hub get started tutorials. You will find everything you need including detailed screenshots how to set up the mentioned components.
2. Gateway setup
There are several options to set up the gateway. One that would certainly work well is to use Microsoft’s Windows IoT Core. However we decided to use the Linux distribution Raspbian.
At this point we need some programming skills. We want to use the BB-8 libraries to retrieve the telemetry, do some logic and forward it to Azure using the libraries provided by Microsoft. See the links below to get some sample codes.
- Descriptions and source code in different programming languages (like C#, Java, Python and others) are provided by Microsoft on Azure IoT Hub get started tutorials.
One last thing not to forget is that the newly implemented device needs to be registered in Azure Device Manager. This can be done with some lines of code by the device itself or manually in the Azure portal.
Taking all components together the control and data flow would look like this:
As you can see it is not rocket science to get a simple demo working within a short time. There are many tutorials and sample codes available to get quickly ramped up. Simply start with a small project and extend it later on to a more sophisticated product. By doing so you will learn a lot and get new ideas how to solve a particular problem and what other challenges you could tackle next.
Another important aspect of an IoT solution is the diversity of skills needed. Depending on the project you need developers and architects (with embedded, connectivity, cloud and security skills), data scientists (to make sense out of the data you have) and business analysts (to define clear business requirements). They all have to interact with each other and share their concepts and thoughts to get a working end to end solution.
In our next posts we will extend the presented solution with some further Azure IoT topics. How about a howling siren whenever the BB-8 is hitting a wall or a prediction if we have to expect a crash by just monitoring the current driving behavior (using machine learning)? Stay tuned!
Don’t miss the next IoT articles and subscribe to Snapshot, our monthly email digest!
Ah, here are some pictures from our last Geek Night from our Facebook Page 🙂