New to Dream to Learn? Check out our Quick Start guide!  

0COMMENTS0RECOMMENDS

Cognitive Bartender

40
POSTED IN: Building Bridges from R to IBM Watson

Thirsty?

IBM has a pretty cool app for suggesting cocktail drinks called IBM Chef Watson TWIST - https://twist.ibmchefwatson.com/ - it's pretty neat - and introduced me to the concept of having hot flavors in my cocktails.  Now, nearly every drink I order has spice in it :)

It's a great app for suggesting drinks....

But what if you want IBM Watson to actually mix your drink?

I was curious if I could build some downstream gear to pull the ingredients together... blend them and make a drink

 

 

Parts List:

  • DOSING PUMPS (X5) - i used these from amazon - Sican DC 12V Dosing Food Pump Peristaltic Dosing Head + 2pcs 0.5meter Silicone Tube  - they came with the tubes which was handy.   $15 each.   I wish I had ordered a couple of more - as the combinations rapidly increase once you get the basics taken care of (Spirit, Mix, and usually Lime/Syrup) //  Mine had 'red' positive terminal on top for 3 and bottom for 2.  well marked , but a bit strange.

  • ARDUINO - like the Arduino UNO R3 board with DIP ATmega328P, A000066  for $13 - this controls the relays and listens to your code (e.g. R Studio sending Serial commands over USB from Python Library)
  • RELAY MODULE - like this one - J-Deal® 8-channel 5V Relay Module Shield with Optocoupler for Arduino UNO 2560 1280 DSP ARM PIC AVR STM32 Raspberry Pi  - for $8 - robust, simple interface, plays nice wiht Raspberry pi and Arduinos
  • POWER / BATTERY - I was going to use an old Dell Laptop 12V power supply to drive motors, but for speed, just yanked the battery out of my cordless drill and alligator clipped to it.  Be a little careful of shorts if working with these batteries - or fuse - as current can be large and unforgiving (Melts stuff)
  • BOARD - Something to mount the dosing pumps to.  I used thin ply.
  • WIRES - Soldering iron helps, but not required.  Pretty basic circuits at back.  Joined up all the grounds together - and used relays to switch in 12 volts to any/all pumps to be active
  • PC/MAC with USB Cable - I'm using Arduino Software, and R Studio (with PythonR to send serial comms to my Arduino) - SerialTerminal helpful for testing - manually send a character down to bleed pumps or test.
  • JARS AND TEST FLUID - I started with food coloring - a few drops to mix/test - visible.  Did not seem to stain tube once dilluted.

 

Code:

GITHUB - Will post it here - https://github.com/rustyoldrake/R_Scripts_for_Watson - I basically used the ROBOT Arm code and retrofitted

ARDUINO - https://github.com/rustyoldrake/R_Scripts_for_Watson/blob/master/Watson-Cognitive_Bartender.ino

R - https://github.com/rustyoldrake/R_Scripts_for_Watson/blob/master/Watson-Cognitive_Bartender_V1.R

 

IBM Watson Services:

You'll need to stand up a few APIs of your own to run this - good news is - BLUEMIX offers a free 30 day trial - https://console.ng.bluemix.net/

  • Speech To Text (as you will be sending WAV packets up for transcription)
  • Text To Speech (if you want the bartender to talk back to you)
  • NLC NL Classifier - later - if you'd like it to get a bit fancier in understanding different drinks or types of drinks

 

Basic Circuit Diagram:

Shows the signal flow from MAC running R Studio, PythonR, Arduino, DIgital Outputs, Relay Inputs (active low), Relays switching power to dosing pumps

 

Video - Early Test #2

 

Work remaining to do - Natural Language Classifier (NLC) & Stock the Bar

Next up. I need to do some Googling to find good combinations of ingredients - and then program in to NLC - use the NLC Service to provide examples of 'drink requests" and then map them into the CLASSES.  Then, map the classes into the combinations.  For example if somone orders a "Vodka Gimlet" then provide 2 ounces of Vodka, Syrup and Lime Juice.

  1. SPIRIT - VODKA
  2. SYRUP - simple syrup  (or GIN for a second Spirit base)
  3. MIX - Tonic Water
  4. LEMON Juice (Fresh)
  5. LIME Juice (Fresh)

Extras & Garnishes on Side - Lime / Olives / Ice / Cherries - get Robot Arm to drop them in...

 

 

 

 

 

 

Interested in more content by this author?

Before you can comment, you need to sign-up or login

About the Author

Ryan Anderson

Ryan Anderson

Hi! I like to play with data, analytics and hack around with robots and gadgets in my garage. Lately I've been learning about machine learning.

About this blog

This is an informal blog that explores tools, code and tricks that group members have developed to engage IBM Watson cognitive computing services - from the R Programming Language. Packages include RCURL to access Watson APIs - for services that include Natural Language Classifier and Speech to Text. THIS IS MY PERSONAL BLOG - it does not represent the views of my employer. Code is presented as 'use at your own risk' (it has lots of bugs)

Created: September 13, 2015

English

Up Next