Connected Drinks Dispenser
Cashless Operation and Smart Replenishment
The connected drinks dispenser gives an example of a concrete, simple Internet of Things (IoT) application.
Adds value for both customers and suppliers by updating an everyday process - buying a drink from a vending machine - and providing the basis for a wide range of powerful new features.
A customer Web interface is accessed via QR code.
The inferface displays the current fill levels of the dispenser and is used to trigger a purchase or request of a drink.
- cashless payment - never dig around for coins again
- smarter refills mean drinks are never out of stock
- remote checking whether the desired drink is in stock
- reserve a drink before going to the machine
The supplier interface shows more detailed machine state, the purchase history, and an estimated time for a necessary refill.
- real-time data on fill levels allows smart replenishment
- purchasing history allows analytics on customers' demands
- change prices in real-time to create flexible pricing models
- less maintenance because of fewer moving parts on the dispenser (no order buttons, display or coin validator)
How Does It Work?
The dispenser, customer frontend, supplier frontend and the coordinating backend are connected via Crossbar.io and the WAMP protocol.
The drink dispenser is a neat machine from GastroCool which stores 96 drinks cans in a small volume and can be refilled very quickly.
We've added a locking mechanism and sensors for the addition and dispensing of cans.
Our additions are controlled via a Rasperry Pi, using our Crossbar.io IoT Starter Kit.
The version shown is for display and the electronics can easily be scaled down to fit within the dispenser itself.
The Rasperry Pi runs the control logic for the dispenser itself. It offers procedures for requesting the dispensation of a can, getting general machine info and the current fill levels. It also publishes dispensing and refilling events to interested (and authorized) subscribers. It is written in Python and uses Autobahn|Python, our WAMP client library for Python.
All components connect to Crossbar.io. The outgoing connections are possible from anywhere with Web access, so there are no problems with NATs and there is no necessity to have open ports e.g. on the dispenser.
The components communicate using the two communication patterns which WAMP provides. As examples:
Routed Remote Procedure Calls (rRPC)
The dispenser registers a procedure which triggers dispensing a product with Crossbar.io. This is called by the backend when a request from a customer is authorized by it. The call is routed via Crossbar.io. If authorized, any other component in the application could similarly call the procedure, all without a direct connection between the calling component and the registering component.
Publish & Subscribe (PubSub)
A change in the can count in the dispenser is published to Crossbar.io, and this then dispatches the event to all current subscribers. This allows any number of authorized components to receive and react to this change simultaneously, e.g. large numbers of customer frontends.
Crossbar.io provides the routing logic, authentication and authorization mechanisms and also includes a static Web server which can serve the browser frontends. It is run by the supplier, with full flexibility regarding deployment (cloud, own hardware) and with full control over the data.
Crossbar.io is commercial open source software and the WAMP protocol is open with a growing ecosystem of implementations. The Autobahn libraries are open source and under a liberal license, as are many third-party libraries for a total of 13 supported languages.
It's a demo
For the demo a cookie is set in the user's browser which is used for determining the number of remaining free drinks.
For offices, workshops or conferences, with limited customer groups, custom QR codes for each customer can be used to track the number of dispensed drinks. These contain login information which authenticates the customer for an individual account.
For deployments in public places, a cashless payment solution needs to be used. Integration of a NFC reader for current contactless payment methods is easily possible.
This is just a basic demo and proof-of-concept and easily extensible. A few examples:
- native apps as frontends
- alert about projected necessary refills via email to the supplier
- alerts about special promotions to customers via Android or iOS notifications
- storage and analytics of data in third-party services
More images of the dispenser can be found in this gallery
If you're interested in more information, then contact us.
If you're in Southern Germany and would like to offer a temporary home for the dispenser (e.g. at a FabLab, coworking space, company canteen, trade show) then tell us!