Building TJBOT With Raspberry Pi
by BhaskarP6 in Circuits > Raspberry Pi
587 Views, 2 Favorites, 0 Comments
Building TJBOT With Raspberry Pi
Introduction
IBM TJBOT Course:click here
TJBot
TJBot is an open-source project, ready for the community to take and to use in whatever ways you can imagine. TJBot is one of several IBM Watson Maker Kits, which are a collection of do-it-yourself (DIY) open source templates to connect to Watson services in a fun way.
TJBot is the first maker kit in the collection and was created by Maryam Ashoori at IBM Research as an experiment to find the best practices in the design and implementation of cognitive objects. TJBot was named after Thomas J. Watson, the first Chairman and CEO of IBM. TJBot uses readily available, inexpensive hardware: Raspberry Pi, speaker, microphone, camera, LED, and a servo motor.
TJBot uses these components (and others that you can connect) to understand the environment around it and express visual and auditory cues to the user. At the heart of the intelligence of the TJBot is IBM Watson services that enable further understanding of audio and visual cues by using transcription of audio captured by the microphone, object and color classification of images captured with the camera, speech synthesis of text using the speaker, language translation, emotion and tone analysis, and natural language understanding to respond to user input. Robots have been a part of science fiction movies and television shows for many decades. However, artificial intelligence has only recently made it possible for robots to autonomously perform actions with minimal computational resources.
TJBot is a physical robot, but the capabilities can run anywhere. In this course, you'll use Node.js and a web-based simulator. Because the community has become the custodian of the open source project, new flavors of runtimes now include Swift and Node-RED.
PARTS Required
1.ELECTRONICS:
- Raspberry Pi 3
- USB microphone
- Speaker with 3.5mm audio jack.
2.3D PRINTED PARTS:
You can get STL Files from below link
Preparing Your Raspberry PI
1.Buy your Raspberry pi with 4GB RAM (Rpi-3 would also work but response is very slow)
2.Install your Raspbian OS.
3.Install Packages
Open a terminal application on the Pi and execute the following commands to install the latest version of Node.js and npm (Node Package Manager). You need these packages later to run your code.
curl -sL http://ibm.biz/tjbot-bootstrap | sudo sh -
Depending on which audio output source you are using with your Pi (HDMI, 3.5mm audio jack, Bluetooth, USB speaker), you may need to set the audio config.
HDMI/ 3.5mm Audio Jack
If you use HDMI or 3.5mm audio jack, you may need to set the audio config. To do this, go to the terminal and open up raspi-config.
sudo raspi-config
This will open up the Raspberry Pi configuration screen:
Select "Advanced Options" and press Enter, then select "Audio" and press Enter. Choose the correct channel for the output audio. If you have connected an external speaker to the audio jack, you should select 3.5mm jack.
USB Speaker If you have a USB audio, you need to update your /usr/share/alsa/alsa.config to set the USB audio as the default device.
Begin with running the following command to make sure your USB is connected and listed there.
lsusb
Next is to detect the card number of your USB audio.
aplay -l
Take a note of the card number associated with your USB Audio.
Then go to the alsa.config file to set it as default.
sudo nano /usr/share/alsa/alsa.conf
Look for
defaults. ctl.card 0
defaults.pcm.card 0
and update the card number (0 here) to the card number of your USB audio.
Different versions of Raspberry Pi OS may need a different setup. If you have problem with your USB setup, check out this guide to troubleshoot.
Github Repository
The source code is available at: https://github.com/prasadnoolu/TJBOT
sudo git clone https://github.com/prasadnoolu/TJBOT.git
cd TJBOT/recipes/conversation
sudo npm install
Pro tip: if you get an error for npm install that says npm not found, you should first install npm on your machine.
This is the command line to install npm
sudo apt-get install npm
Add Your Credentials
Add your Credentials to the following Services:
$ cp config.default.js config.js
$ nano config.js
Now, you are ready to talk to your TJBot!
Open a terminal and execute the following command:
sudo node conversation.js
Talk With Your TJBot
Watson conversation uses intents to label the purpose of a sentence. For example when you ask TJBot "Please introduce yourself", the intent is to make an introduction. You can add your own new intents in the Conversation editor, but for now, we have started you off with a few intents:
Introduction. You can say phrases such as "Watson, please introduce yourself", "Watson, who are you", and "Watson, can you introduce yourself"
Joke. You can ask "Watson, please tell me a joke" or "Watson,
I would like to hear a joke".For a complete list, check the content of workspace-sample.json
An attention word is used so TJBot knows you are talking to him.
The default attention word is 'Watson', but you can change it in config.js as follows. Update the configuration file to change the robot name in tjConfig section:
// set up TJBot's configuration<br> exports.tjConfig = {
log: { level: 'verbose' },
robot: { name: 'tee jay bot' }
};
You can change the 'name' to whatever you would like to call your TJBot. In addition, if you change the gender to 'female', TJBot will use a female voice to speak to you!
Enjoy! Don't forget to share a picture/video of your setup #TJBot! :-)
Troubleshoot
If you see TJBot's response on the terminal but don't hear TJBot talking, there is a good chance that one of these two things has happened: (1) The audio output is directed to a wrong channel (you can fix it from raspi-config), (2) your sound modules are blocked. In that case, go to /etc/modprobe.d/ and remove blacklist-rgb-led.conf Then run the following command:
sudo update-initramfs -u
Reboot and confirm the "snd" modules are running by executing the command "lsmod". This should solve the problem.
lsmod
For any Queries contact varaprasad239@gmail.com