Coffee Capsules Vending Machine Gamification (1) – Overview

This is the first of two blog posts by Barbara, a working student at Hybris Labs in the first half of 2017, summarizing her work.


In this blog post I would like to share with you the experience I gained in my gamification project for the Coffee Capsule Vending Machine. The idea was about developing an IoT project for vending coffee capsules by adopting the Claw Crane Game to have a User Interactive Machine for Marketing Purposes.

The vending machine allows customers to pick up Coffee capsules either manually through a Play-with-a-joystick mode or through an auto-play mode. The stock is monitored to keep track of the capsules that are being purchased and restocking order requests are sent via Wi-Fi to the vendors. In addition, a screen shows the user the specifications of the picked up capsule (ex: name, concentration of coffee, etc.).

The above picture shows how the Box of the Game should look like.

Vending Machine Modes

As a user you can choose between two modes to play the game. Play-with-a-joystick mode and Auto-play mode.

  • Play-with-a-joystick mode: In this mode you would use a joystick and buttons to control a gripper and grab the capsule you want.
  • Auto-play mode: In this mode you would choose the kind of capsule you would like to be picked up via a screen and the gripper will move on its own and grab the capsule for you.

In both cases, The capsule you chose will be detected and its specifications would be displayed on the screen, and eventually you would pay by through a coin acceptor.

Project Components

The above picture depicts the components diagram

The components could be split into two parts

  • The Hardware part that includes all the mechanics of the Box (the X,Y,Z axes motion and the gripping).
  • The Software part that includes the Capsule detection(using image processing), User interface and placing the restocking requests.

For experimenting the idea and learning more about it, we decided to go with rapid prototyping and started with a very basic prototype using a cardboard box. By learning through trial and error and rapid prototyping, the project was spilt into several milestones as follows.

The first milestone (mechanics part):

  • The motion of the Axes using an Arduino as a controller and the needed motors plus using a 3D printer to build some other necessary components.
  • The grabber which was also 3D printed.

The second milestone (Capsule detection):
A Raspberry Pi and a Camera to take photos of all the capsules in the box and do some image processing based on color detection of every capsule as each one has its own unique color.

The Third milestone (The Serial Connection):
The connection between the Arduino and Raspberry Pi to the User interface (Screen Code).

Glimpse on how it works

In case of play-with-a-joystick mode:

  1. The Arduino would give orders to the motors according to motion of the joystick and the buttons.
  2. A pictured is captured before gripping the capsule
  3. After gripping another picture is taken and then both pictures are compared to detect the difference.
  4. Finally the color of the changed area is detected to identify the capsule

In case of auto-play mode:

  1. Once this mode is selected, an image of all the capsules is taken
  2. Then color detection is applied to all the capsules to identify the color of each of them and the coordinates are stored
  3. The Arduino would get the specific coordinates serially from the Raspberry Pi and accordingly gives orders to the motors.

Hope this blog post grabbed your attention and if you would like to know more details about the first and second milestones please have a look at the Tech Details blog post.

Tell us what you think:

2 thoughts on “Coffee Capsules Vending Machine Gamification (1) – Overview

Leave a Reply

Your email address will not be published. Required fields are marked *