Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
RyanWeicker
Employee
Employee

IoT Scenarios

Imagine a scenario – you’re a manager of a large food distribution warehouse preparing for Thanksgiving - hey, you've got to start early! The nightmare is this: you're waiting for a large delivery of Thanksgiving frozen turkeys to arrive. The truck pulls up to the dock, you open up the back, and it’s just a bit too warm in the truck. All the turkeys have begun to thaw. Not good! Something went wrong during the delivery but you had no way of knowing what happened, and more importantly, when it happened.


You have no way of knowing that the temperature was a constant 0F throughout the entire delivery but only during the last part of the ride did the freezer break and the temperature began to rise. But, since all you can see is the warm temperature of the truck sitting at the dock, you have no choice but to dispose of the food. It would be too risky and unsafe to sell and serve. For all you know, the turkeys have been in the Danger Zone for too long.

Now, what if you had a way to track the temperature of the delivery in real time. Imagine that if you would be able to see not only the location of the truck but the temperature in the truck at any point in time. You can look at graph and see that everything was good for the entire duration of the delivery, the freezer broke 30 minutes before the delivery arrived, and the food is still safe to consume as long as you can get it to a freezer quickly.

Similar scenarios can be found in all sorts of different industries. Much like how the food industry has safety guidelines, the pharmaceutical industry is heavily regulated. Different drugs have different temperature ranges in which they must be kept in order to maintain their usefulness. And unlike our frozen turkeys, the tolerance for variation outside a particular range, say 2 °C and 8 °C, must be maintained throughout the entire supply chain.

Because of the importance of these regulations, as a manager in charge of manufacturing and transportation of a particular drug, you need to have complete visibility of the entire end to end process; not just in the factory but all the way to drugstore shelves. These functions would be required:

  • - Monitoring of temperature, humidity, and other metrics throughout the entire supply chain
  • - Real time access to this data
  • - Real time and periodic reporting – such as a dashboard
  • - Predictive analytics
  • - Integration with other systems – such as Quality Management within your SAP ECC system
  • - Real time alerts to exceptions via SMS and email

These are the kind of tools that are required in today’s ever connected landscape. Now, using the HANA Cloud Platform and the Internet of Things services, we can solve these business challenges and more in a way never before possible.

Architecture and Setup

To demonstrate the power of Internet of Things services within the HANA Cloud Platform (HCP), we have built a prototype to demonstrate how you could build an application to help the food warehouse manager.

The Internet of Things Services in HCP is a framework which provides an API for devices to communicate directly with HCP and persist the data in HANA. From there, applications can be built on top of the data to do all sorts of neat things.

To get started, we need to have a way to measure temperature in the truck. To do this, we used the following:

    - Raspberry Pi Model B+ V1 2

     - Dallas 18B20 Temperature Sensor

     - WiFi Hotspot

     - USB Keyboard

The Raspberry Pi is an inexpensive credit card sized computer that has various connectors to allow different devices to interface with it. It runs on a lightweight flavor of Ubuntu and connects to the internet via a USB WiFi dongle. In the picture you can see the temperature sensor wired too it, a WiFi and keyboard dongle plugged in, and a power source providing power to the device. It is connected to the internet via the Verizon Jetpack.

With these devices, we would wire the temperature sensor according to the specifics of the particular sensor. From there, we connect the Raspberry Pi to a computer monitor and make sure everything is lined up. We won’t get into the specifics of this temperature sensor because they will vary from model to model.

Once we are able to view the temperature, the next step is to publish this data to HCP. To do this, we recommend checking out Aaron Williams guide on setting up the IoT Services here: http://www.slideshare.net/saphcp/sap-hcp-iot. This does a fantastic job of walking you step by step in enabling the IoT Services and setting it up for an initial device.

Once this is done, the last step is to deploy a simply python program to your Raspberry Pi which will communicate the temperature data to HCP. We’ve attached sample code here that illustrates how you can send random temperature values to HCP via the IoT services and send actual temperature data using the Dallas 18B20 temperature sensor.

Team:

Ryan Weicker

Arush Saxena

Dhaval Desai