Skip to content

A recipe to build a simple robot which can turn on / turn off the light following voice commands

Notifications You must be signed in to change notification settings

dnguyenv/lightup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thien An Bot Lightup

This recipe guides you through how to connect your Raspberry Pi to IBM Watson services and make a simple robot which can listen to your commands and turn on, turn off a lamp.

Click here or on the picture below to see the demo:

Architecture overview

images

Hardware requirements

  • A Raspberry Pi B. I use Raspberry 3 for this tutorial, which has built-in wifi. If you have other models, need to make sure you have Wifi dongle or other ways to get your Pi connected to the internet (eg: sharing through ethernet, etc)
  • Male-female and male-male jumpers, Breadboard
  • BC547 transistor.
  • Songle SRD-05VDC-SL-C relay and 1n4001 diode.
  • Speaker. I use an Anker A7910 mini speaker
  • Lamp and power strip

Other requirements

  • IBM Bluemix account, free
  • Refer to this to know how to setup your Pi. Try to get the latest OS version.
  • Git, Node.js, npm on your Raspberry: sudo apt-get install nodejs npm node-semver

Steps to cook the recipe

Wire up the parts

Here is the circuit diagram for the example

images

Create Watson text to speech service

Follow this instruction to create a text to speech service in Bluemix

Create Watson speech to text service

Login to Bluemix with your registered ID, Go to Catalog, Search for speech to text , or click here and select the service.

images

Name the service and credential if you want, or just leave them by default, Select Create

Once the service is created, go to Service credentials , View credentials section to record the username and password information. You will need it later for the app. You can always create a new credential to access the service as needed, by selecting New credential

images

Clone the code and install dependencies

Clone the source code:

Get into your Pi using SSH or VNC client. From the terminal in your Raspberry Pi, perform this command to get the source code:

sudo git clone https://github.com/dnguyenv/lightup.git

Put your Watson services credentials (both Text to speech and Speech to text service) into the config.js file. You also can configure other values in the file to meet your need.

Run the code:

cd lightup
sudo npm install
sudo npm start

Enjoy!

About

A recipe to build a simple robot which can turn on / turn off the light following voice commands

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published