"Alexa, I want chocolate ..."

A chocolate rewarding trivia game

About the Project.

Voice Technology is something I am really interested in and in the spirit of learning I came up with the idea of creating a game where users are rewarded with chocolate if they answer organizational culture related questions correctly.  The trivia game would be handled by Alexa and the chocolate delivery handled by a robot that communicates through Alexa.

Client
Side project of my own.
Year

2020

Deliverables
  • Script
  • Interaction Model
  • Alexa Skill
  • Python Code

The challenge

Food as reward has been regarded as one effective method to incentivize people to take action. We wanted to incentivize a thirst for knowledge within the employees at the company I work for in exchange for some tasty chocolate. Those players who get to answer the trivia correctly are rewarded with chocolate.

The Design Process

  • Scripting the trivia-like dialog between player and voice assistant
  • Create the Voice Interaction Model by defining the intents and sample utterances
  • Deploy the skill that connects to the brains of the LEGO chocolate thrower robot
  • Define the set of actions that control the robot on Python
  • Put together the LEGO robot

Design and Implementation Toolkit

The tools, technology and artifacts chosen for the task at hand.

Scripting
Alexa Developer Console
Desk Research
LEGO Mindstorms Kit
Python
VS Code

Scripting the trivia experience

The script is the starting point to design for a natural conversation or interaction between a player and the voice assistant, and that’s exactly what we are aiming for.

Interaction Model

I defined a custom interaction model. The interaction model is the first step to define the voice interface through which users would interact with the machine. To define the voice interface, I mapped users’ spoken input to intents.

Intents

The intents represent actions that fulfills a user’s spoken request.  Intents are specified in a JSON structure known as the intent schema.

Sample Utterances

Utterances are a set of most common spoken phrases mapped to the intents. Every intent should include as many phrases as possible. Given the flexibility and variation of spoken language in the real world, there will often be many different ways to express the same request, and the assistant guiding players through the trivia questions needs to understand those requests that happen on a natural basis.

Alexa Skill Logic

I then created the Alexa Skill, which is code that can handle requests sent to Alexa when the players are talking to her.  The code I wrote needed to:

  • Recognize each incoming request that Alexa sends
  • Return an appropriate response to the user (correct or wrong response to the trivia)
  • Send the right command or action to be performed by the LEGO Robot

When a user answers the questions correctly a command or action is sent to the LEGO Robot. The LEGO Robot understands code written in Python so the command needs to be translated in a way the robot understands.

Translating resulting actions into commands the robot can understand

When the player wins the trivia game, a series of events are triggered. These events are handled by the Alexa Skill and notifies the LEGO EV3 device (the brains behind the robot) to perform an action or command. This action could be something like:

  • Move the arm that pushes the chocolate out of the stack
  • Move the catapult-like arm to throw the chocolate
  • Tease the player when he tries to grab the chocolate without playing the game

Robot Design

I found a model and set of instructions to put together a chocolate-thrower robot using LEGO Mindstorms. Since I already own one LEGO Mindstorms set putting it together didn’t take long.

Model design by Jason Allemann. https://jkbrickworks.com/
A real life glimpse

Check a quick demonstration of the robot delivering a chocolate

Play Video

Do you wonder if Alexa can actually deliver chocolate?

The impact

65

employees engaged within 2 hours

46

chocolates delivered