Gunnar Forsgren

My photo
Kista, Stockholm, Sweden

Former Ericsson / Sony Ericsson development engineer.
30 years of engineering experience in telecom and mobile.
See LinkedIn:

November 14, 2010

OpenPicus FlyPort in wireless Vending Machine Demo

Hello this is the initial blog post of Mobimation AB. We are a swedish company that specialise in Mobile to Machine communication. The recent arrival of very compact hardware that can enable wireless access to physical devices is a great catalyst for innovation. The most concrete rising star is Wifi married with microcontrollers and network stacks. Very compact solutions can be developed to help access-enable physical equipment that until now lacked such access possibility.

We are happy to mention a recently initated cooperation with the OpenPicus project where we operate as retailer of the related FlyPort hardware on the Swedish market via our online shop.

We have adopted this solution as basis for demonstrating to our customers how we can develop machine/sensor access solutions using this and similar controller solutions.

This time I will tell you about what we did at the Mobilefuture 2010 conference in Kista north of Stockholm now on November 11. This conference runs on the same day as the swedish "mobile gala evening" Mobilgalan where various price winners of this years Swedish mobile market becomes announced and celebrated. So there was a lot of mobile industry people attending. So some people got to see and understand what OpenPicus can do.

Prior to the show we figured how to demonstrate the FlyPort Wifi module solution in a mobile context. A concrete physical demo is always good for leaving a mark in the visitors mind. So something at least a bit spectacular was needed. My solution was we imported a chinese origin mini Vending Machine fridge from the U.S that can serve chilled Coke bottles or similar soda cans. I modified it so it could be controlled using OpenPicus FlyPort hardware. The main change was to override the physical vending control switches using relays, and I added extra lighting inside the unit which can be turned on/off from the FlyPort for an extra visual effect.
I re-used the existing OpenPicus web server demo where I, instead of controlling LEDs, used just about the same port mapping for controlling the two relays and added lighting.

I modified the default demo code so at boot up the FlyPort module connects to a Wifi router (infrastructure mode) and with WPA2 encryption. I found out the FlyPort is capable of accomplishing a WPA2 connection within a few seconds when using a pre-shared binary key. Using a human readable passphrase is a bit too slow since in that case the conversion to binary key has to be done in the Wifi stack by the CPU which takes time. So, binary key is a recommended approach and in no means less secure than using passphrase.

Once the FlyPort is connected to the router the (initially simple) Android "VendingDemo" application I developed could connect to the FlyPort module embedded web server by connecting to its IP address via the same router.

The mobile app shown at this event simply allowed selecting what Soda can (Left or Right side) to be served. When the command is sent the FlyPort interprets the command and issues a relay pulse on the appropriate vending switch which causes ejection of the ordered refreshment..
Well not rocket science but enough to have the cans come crashing down.
Since development of the app began 6 hours before the show opened there was little room for sophistication in its feature repertoire.

This wireless control of the vending machine from the mobile phone proved popular and caused some enthusiasm. We set things up so that the conference visitor could download the vending machine app from the Android Market, install it and run it to have their own personal soda can pop out as a gift.

This demo was set up as an example to show how the very compact FlyPort wireless microcontroller solution can be used to wireless-enable a piece of machinery that normally lacks such a wireless access feature. We see a fantastic potential in this type of Wifi enabled controllers for enabling wireless equipment interaction both machine to mobile and between machines.

The demo was done to convey the message that Mobimation is able to carry out projects for customers that involve mobile/machine integration work. And also puts some attention on the potential of Wifi enabled micro controllers.

In the following section you will see some detail photos of the Vending Machine Demo implementation and how I neatly installed the FlyPort Wifi module so that it is visible on the outside of the machine for good demo impact, interconnected over a flat cable arrangement with the FlyPort Nest board and other hardware internal to the vending machine.

Enjoy photos of this "inside story section". Click up to two times on photos for magnification.

This photo shows the U.S imported vending machine that I chose as demo hardware. I found no Ebay seller willing to ship one to Sweden so I used the brilliant shipping forwarder as middleman. Then inner operations of this machine is very straightforward to understand. No intelligent processing hardware. Electronics runs solely on 12 volts. I accomplished the external 120 Volt AC feed using a 220V->120V transformer. Normally the two hardware switches on the front panel controls a timer/relay card that spins a rotating can release actuator using an electric motor per side. I used two relays to override these switches internally.

This photo shows the finished modified demo vending machine. The Flyport module has been installed in center stage position and can be viewed from the outside. It is connected to the FlyPort USB Nest board inside the box using a flat cable arrangement.
Please note the USB connector added on the side of the vending machine front door.. Using this port a PC can be connected over USB to the Openpicus Nest board and facilitates flashing of new sw and monitoring of trace printouts when needed ! Also a reset button was added close to the USB connector for easy restart and sw flashing. The photo shows the machine hooked up the a development PC that runs the Microchip MPLAB IDE and Brutus downloader for editing, compilation and flashing the PIC controller of the FlyPort. That dev PC was not present during the demo. In the photo you see the PC showing the default OpenPicus demo web server page served from the FlyPort web server over Wifi.

Placing the FlyPort module in the illuminated "showcase" area of the front panel helped increase understanding of what enables the wireless solution. A flat cable connector underneath the module connects it to the FlyPort USB Nest board inside. This worked very well.

The two stage cable arrangement switches pin arrays so that the module match up correctly with the nest even though it is mounted externally in a different orientation.

This photo shows the vending machine during wiring installation. This look pretty messy but it´s a prototype where the resulting demo functionality and exterior appearance was the end goal.

This "Breadboard Power shield" from Seeed Studios (we are an importer) was used as DC converter 12->5 volts.
Mounted on the one-off prototype lab board is also a darlington array driver chip that sink the 12 volts for the LED arrays. It is controlled using TTL level outputs of the FlyPort module.

These handy relay modules by Seeed Studio (we sell them in our shop) was used for overriding the physical vending switches of the machine using FlyPort output ports.

The Mobimation appearance at the 2010 show. The cool can service demo and a display of developer board products available from
I run this E-shop to sell the Wifi module and various Arduino related lab hardware.

If you know of an European (M2M?) conference going forward where you think this physical demo could help catch a crowd then please let me know, maybe we could show up and run some variant of this FlyPort demo. Numerous demo features could be added such as turning on/off the fridge function, sensing fridge temperature, and more. I currently work on integrating PayPal Mobile Payments with it and in particular the Express Checkout feature. Showing this in combination with a concrete physical device can get people inspired and see the potential of mobile access solutions that employ Wifi-enabled microcontrollers.

Gunnar Forsgren
Mobimation AB, Sweden
+46 733 406530


  1. great project! we'll post this in our blog in the next days! ;-)

  2. This blog entry was posted in 2010 and some of the details regarding hardware sales is no longer valid. Could serve as inspiration for those looking at what to use for demoing interaction with machinery from mobile apps. Just jump in under the hood of machinery of choice and add some IO controller logic. Practice does it.