Ganzbot: A talking robot which reads Twitter
I've added the video of Steve's reaction to the robot. Also, here are more details about the robot, construction and software:
This robot has eyes, eyebrows and a mouth and will verbally read the latest Twitter status to you. It uses an Arduino Decima to control the head actions and receives the latest Twitter status information over USB from a host computer.
You can also send it something to say directly from the command line with a few moods to choose from
A couple months ago a few people at the office decided to create a Twitter account called “Ganzbot”, named after Steve Ganz, as a joke. Then when Steve left to compete in the PDGA World Championships we decided to build a “real” Ganz Robot to occupy his cube when he returns.
How it works
At a high level, there is a Java program on the host computer which retrieves the latest Twitter status, passes facial and word data to the head and then speaks the Twitter status through the computer speakers using FreeTTS, an open source Java text-to-speech synthesis library. I would have liked to put a speech synthesis chip in the head instead, but didn’t have the time.
LED Lips — how to make them talk
Getting the LED lips to be synchronized with the words was a bit tricky. Unfortunately FreeTTS doesn’t implement 100% of the JSAPI, so when it’s speaking there is no way to know when one word ends and another begins. Instead, the Java program on the computer splits up the text into individual words, sets the volume to zero and speaks each one to figure out how long it takes to say. Then the program passes the word times to the head and starts speaking the entire sentence with the volume at the normal level. The lip synchronization isn’t perfect, but it’s pretty good.
Another option might be to light up the LED lips from an audio spectrum analyzer.
To keep it simple I took a standard perf board from Radio Shack and added header pins to turn it into an Arduino shield. This makes it really easy to connect it to the Arduino and ensures all the pins are in the correct sockets. The circuit below was created to show the pins and voltage source as they appear on the board. More details on the circuit after the diagram.
Unfortunately there wasn’t enough juice coming from the Arduino chip to power the LEDs very bright, so I had to use standard NPN transistors to feed the LEDs power directly from the board.
Lips and Eyes
I only included half of the lips and eyes in the circuit diagram since the other halves are simply connected in parallel and I didn’t want to clutter it up. I’m sure you can figure it out. If you have trouble, leave a comment below.
The eyes are simple multi-color LEDs I picked up from Radio shack. They can output red, green and blue, but the Ganzbot only uses red and blue. The longest pin is positive and the color depends on which pin you put to ground. I suggest testing it on a breadboard before soldering it into place.
On the host computer a Java program retrieves the Twitter information (or command line message) and sends the word times to Arduino over the USB cable. All the robot needs to know is the mood it should be in (neutral, sad, angry) and how many milliseconds each word takes the speech synthesis program to say. If the program is started in “-twitter” mode, it’ll continue checking Twitter for updates every 2 minutes until you stop it.