Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.
Hovig Ohannessian edited this page Sep 12, 2018 · 19 revisions

Short Name

Coffee Brewing IoT

Short Description

Use microphone to control devices and have responses back using the latest IBM's technologies.

Offering Type

IoT Audio IFTTT Events

Introduction

The idea behind this project is to provide a hands-on fun workshop using Node-RED and Watson's cognitive solutions for audio conversations. Audio tends to have its own challenges and this step-by-step tutorial hopefully can help you enjoy coding and also target your goals through this experience.

This pattern uses the Speech to Text, Text to Speech and IoT Platform to take in audio sentence and translate that into a command to be sent to a registered device. A registered device is a device that is connected to the IoT Platform and is ready to send topics and receive commands. This device can be at your choice of design, I chose to use a Nodemcu v2 (ESP8266 WiFi based) with MQTT. You can choose to use any other device with mqtt or http communications. Between the audio sentence and the command process, there's IFTTT to Slack messaging going through. Every time a command is sent to the device, this same command will be displayed on Slack channel and after the command will take place, like brewing coffee or turn an led on/off and etc. The device will send sentence that it started the process when it turns on and otherwise when it turns off.

After the completion of this simple steps, this pattern will give you an idea and hands-on on how to build an application with multiple services to send commands and receive responses through a conversation. You can take this pattern to design it differently to do different tasks, for example, to turn lights on/off or to play a music and many more. Then IFTTT will trigger events each time there's a request coming from the microphone and it will be posted on the Slack the specific event made.

Author

By Hovig Ohannessian

Code

Demo

Video

Overview

The idea was have through a voice command start a coffee machine to brew coffee and get the team together at work for a five minutes break. A notification will be sent to a Slack channel shared by the team. After getting done with brewing you can turn the coffee machine off through voice commands.

This tutorial will help you create that application that will take in an audio by recording your speech, then converts this audio into a text. The Internet of Things platform receives this text and assigns it to an existing device, which in its turn, it sends it back to be process the commands into IFTTT and back to the IoT Platform to perform hardware controls.

The IoT node in the Node-RED editor will send back a response that it performed the task requested. That sentence will be read out loud by the audio player. This project will take in the brew coffee or stop brewing commands for now, for anything else the user will be asked to say the mentioned commands.

You can always choose the voice, the language and the gender of the reader for this pattern's Text-To-Speech WAV audio reader.

Flow

  1. Audio will be recorded by the microphone in Node-RED and be converted to a text through Speech-to-Text

  2. The text then is sent to the Internet of Things Platform and gets associated to a device

  3. The text will be received back from the IoT Platform and passes the request to IFTTT to trigger an event to display the performed task message on Slack

  4. That same specific command is passed to IoT Platform carrying a payload of an action, then sent to the device and comes back a response and IoT Platform injects it into the Text-to-Speech

  5. The Text-to-Speech will receive the payload & will be sent to the audio player which it will read the incoming sentence out loud

Included components

Featured technologies

  • [Node-RED]
  • [Speech-To-Text]
  • [Text-To-Speech]
  • [Weather Insights]
  • [Tone Analyzer]
  • [Conversation]
  • [Internet of Things]

Blog

Links

Related links:

  1. Watson IoT Platform

  2. IBM Watson