What goes together better than the Internet and food? But there’s more to this delicious combination than just posting photos of last night’s meal on Instagram. Continuing our theme around the “Internet of Things,” we present another possibility from this game-changing technology. This time, it is a use case on IoT for inventory management. In this blog post, we’re going to use IBM Bluemix and PubNub to build an application that will transform any dumb kitchen by enabling automatic inventory tracking. You’ll never run out of bacon again!
Note: This post was originally published in IBM Bluemix Blog.
This application relies on sensing the weight of a kitchen storage container to track food consumption. This data can provide valuable insights around consumption patterns and help chefs predict and replenish their inventory just in time. There are three components of this application:
The reference architecture of the entire application is shown below:
Communication between the components of this application is handled by PubNub’s real-time Data Stream Network.
In order to produce the desired strain for determining the container’s weight, the load cell needs to be mounted between two flat surfaces (such as plywood) with the help of the two threaded holes on each side of it. Once mounted, the flat surface can act as a scale for measuring the weight of a storage container.
For a restaurant or large hotel, tracking kitchen inventory is one of those tasks that are crucial to their business. It can be quite inefficient and error prone due to human intervention. In such cases, having such inventory tracking application makes perfect sense. There are three main use cases for this application:
Now it’s time to discuss the detailed hardware, software setup and the complete functionality of this inventory management system.
If you would like to build this application yourself, then you can access the complete source code on GitHub. All the steps for setting up and building the project’s components are listed in the README file.
Before building, you need to sign up with IBM Bluemix and PubNub. Visit the Bluemix registration page and PubNub service page to create your respective accounts. Both services offer a free tier account to play around with their offerings.
The Inventory Tracking Server (ITS) is written in Python and can be installed as an IBM Bluemix hosted app. IBM Bluemix provides the computing horsepower for the ITS to monitor hardware devices and manages automatic inventory tracking. Additionally, you will need to associate the PubNub service with your Bluemix account for the ITS to work with PubNub. Refer to these deployment steps to understand how to setup and host a Python application under Bluemix with PubNub. As noted earlier, the source code for ITS is located under the kitchen_tracker directory in the GitHub repository.
The hardware has two parts:
The master controller plays a crucial role in stabilizing the weight value of the containers. This is to avoid sending transient or spurious weight values while, for example, the container is being refilled gradually.
The schematic diagram of the sensor controller hardware is shown below:
Refer to these build and install steps for configuring the hardware. The source code for hardware setup is available under the hardware directory (for the sensor controller) and the linkitble/pubnub_linkit directory (for the master controller), under the GitHub repository.
Calibrate the load cells to avoid errors is weight measurement.
Look at all that bacon!
PubNub acts as the communication middleware for the entire system. It provides a cloud-based realtime Data Stream Network that supports over 70 SDKs, such that it can enable any device to communicate with any other device on the Internet. This application uses three of PubNub’s SDKs for all components to seamlessly communicate with each other. They are:
PubNub uses the ubiquitous publish/subscribe mechanism to stream data in real-time, from one device to another. This is achieved by the use of channels which provide a secure bidirectional messaging layer between the devices. This application uses several PubNub channels for enabling communication between the hardware, ITS and mobile app. Refer to this tutorial to learn more about how to build a small publish/subscribe demo using PubNub.
There are three main use cases for this application:
Before we can start using the mobile app for tracking inventory, we need to perform some container specific settings and register them with the server. Those setting are:
These parameters can be set for every container.
Once submitted, these settings are sent to the ITS application server via a PubNub channel.
Once the container settings are registered with the ITS, the app can receive current weight measurements of the containers. Every time a container weight changes, either due to consumption or replenishment, the application performs the following steps:
Step 2 – If the server detects that there has been an increase in the weight, then this means that the inventory has been replenished on the container. In this case, the ITS performs the following steps
This use case is also an alternative flow of the previous use case. If a container has not been refilled before the expiry date, then the ITS can sense this during step 2 and alert the user whenever it detects a consumption to warn against expired food.
In this case the sequence of steps from step 2 will be as follows:
When the mobile app receives the notification for consumption with the expiry set to zero, it updates the container icon in a way to alert the user that the inventory being consumed has expired.
The ITS is supported by a backend data warehousing service powered by IBM DashDB. Daily inventory data for consumption and replenishment is updated on dashDB database which can provide some basic analytics on historical inventory usage for the last 7 days.
To display the historical inventory usage, the user has the option to either display a graph or a table by tapping on the “Graph” or “History” button.
The request is honoured by ITS by sending the consumption and replenishment data in two separate PubNub channels. The flow of information is as follows:
The mobile analytics look something like this:
This application demonstrates how easily one can leverage IoT to eliminate human intervention and automate manual processes. For a restaurant or large hotel, this can make a big difference.
A further enhancement of this app would be to automatically place an order with suppliers when inventory falls below a critical level. The possibilities are endless, and with IBM Bluemix’s state of the art data warehousing and the 99.999% reliable messaging infrastructure of PubNub, building such solutions is fast, secure, and highly scalable.
Stay tuned for more demos and application use cases using IBM Bluemix & PubNub Data Stream Network!
Shyam is the Creator-in-Chief at RadioStudio. He is a technology buff and is passionate about bringing forth emerging technologies to showcase their true potential to the world. Shyam guides the team at RadioStudio, a bunch of technoholiks, to imagine, conceptualize and build ideas around emerging trends in information and communication technologies.
Model IoT Application For Tracking Kitchen Inventory
Understanding Raspberry Pi UART Communication
IoT Testing Tools & Methodologies for Building Resilient IoT Platforms
Kitchen Inventory Management with Smart Jar
IoT Intelligent Transportation Systems with Twilio Sync
Please log in again. The login page will open in a new window. After logging in you can close it and return to this page.