Home‎ > ‎

Projects

Adding a SpeakJet TTS Shield to an Arduino Mega...
4-6-2010

I recently picked up an Arduino Mega for compatibility testing and future projects. My research indicated the Mega should be compatible with with my SpeakJet TTS
Shield ; but until now I haven't had one to actually try. I can now say it has been tried, tested, and it works fine!

For those of you who have not played with a Mega - the first thing you notice, compared to a
Diecimila or Duemilanove, is the Mega is bigger! But with much more I/O, I would expect that. So how do you stack a standard sized Arduino shield on a Mega?


The trick is to carefully align the pins - the 6-pin power connector is the key! Align the power pins of the shield on top of the Mega power connector. The shield analog pins should take up the first 6 pins of the Mega analog connector (note in the photo below the two "empty" connections on the first Mega analog connector). Check that the digital pins are properly lined up with the ones on the Mega (they should already be nearly perfectly aligned). Once you have checked everything is aligned; press the two boards together.


Plug your USB uploading cable into the Mega, start up the Arduino IDE, and select the "Tools" menu to check the Serial Port setting. Also be sure to change the "board" setting for "Arduino Mega"! At this point you can load in a sketch and you are ready to compile and upload to the Mega.


The first program I loaded was my sample "TTS_HelloWorld.pde" sketch, just to be sure the Mega was happy with my SpeakJet TTS Shield. The sound of success!

SpeakJet Shield TTS PC Boards are in!
11-3-2009

The first batch of production SpeakJet Shield boards arrived from China. They came well-packed and survived the flight.



A closer look at the boards themselves.


SpeakJet text-to-speech with the AdaFruit Boarduino

I recreated my SpeakJet TTS prototype text-to-speech technology to introduce it to my friends at LetsMakeRobots. I used the AdaFruit Boarduino as it is a smaller, less expensive version of the Arduino that is popular with many robot builders (including me). Initially, this was posted in my LMR blog, but I later put it in the "Tips" section so it would be easier to find. To read the article, just visit http://letsmakerobots.com/node/13210. Since then, it has also shown up in Make Magazine's Make Blog!

Click on photo to enlarge..

Below is the YouTube video I made for the post on LetsMakeRobots.



SpeakJet Shield TTS ProtoType 1.0

After building the SpeakJet and TTS prototypes on a breadboard, and having them work as I expected, I got busy working with Eagle CAD. I had much to learn about Eagle, and worked on a LCD shield as practice before attempting the SpeakJet Shield. After having good results laying out the PC board for the SpeakJet Shield, I sent the board design to BatchPCB to be manufactured. Though they are slow (not quite a month turn-around), the resulting board turned out very nice. I discovered a few minor things that I needed to fix if I wanted to give or sell these boards to someone...

Click on photo to enlarge...

My biggest mistake was in the self-test feature. You can't see it in this photo, but underneath the board are a few cuts in it and a few jumper wires I added to get the self-test feature properly working. Oops! In the production version, I changed the component spacing slightly, rotated the speaker connector 90 degrees and added more labels. For the most part, this prototype is fairly close to the board I finally made.

SpeakJet Shield TTS ProtoType 0.2

This was the second revision of my SpeakJet project. This is where I added the TTS256 text-to-speech code IC.

Click on photo to enlarge..

This was also about the time I decided I should make this into an Arduino shield. I never made a video of this prototype before I tore it apart. Something to remember for future projects!

SpeakJet Shield ProtoType 0.1

In the past, I worked with an SPO256 speech synthesizer IC and it was rather fun to play with, but they are no longer available (except sometimes on EBay). If you are into building robots, it is sometimes helpful to have the robots talk to you! Several years ago, I heard about the SpeakJet, that it was similar but more flexible than the old SPO256, but I never got around to playing with one. Then, in February 2009, I saw this post about the SpeakJet on the LetsMakeRobots website. Although the post was about using it with a PicAxe, I had already built a Freeduino kit (an Arduino clone) and thought that it should be pretty easy to get started. That was the little nudge that got me going. I ordered a SpeakJet IC from Speechchip.com. After looking at the LetsMakeRobots code and modifying it just a bit to get it to run on the Arduino, it "came to life!" Pretty easy, really!

Click on photo to enlarge...



The following code is pasted almost directly from my original code used to make this video. Although, I added some comments and made the code in general look a bit nicer than the original. :-)

// letsmakerobots demo
// a demo sketch written for the SpeakJet
// http://www.droidbuilder.com

// set up a new software serial port
//rxPin: the pin on which to receive serial data
//txPin: the pin on which to transmit serial data
#include <SoftwareSerial.h>
#define txPin 2
#define rxPin 3
// set up the SoftwareSerial port to connect to the SpeakJet
SoftwareSerial SpeakJetSerial =  SoftwareSerial(rxPin, txPin);

void setup()
{
  // define pin modes for tx, rx pins:
  //pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  SpeakJetSerial.begin(9600);
 
  // char array holding the 'lets make robots' string we want to speak
  char SayIt[] = {20, 96, 21, 114, 22, 88, 23, 5, 145, 131, 193, 6, 140, 154, 196, 6, 148, 7, 137, 7, 164, 18, 171, 136, 193};
  SpeakJetSerial.println(SayIt); // send it to the SpeakJet
}

void loop()
{
  // infinite do-nothing loop
}

I also blogged about this project on LetsMakeRobots if you wish to find out a bit more...



The code samples given in this document are released into the public domain.

© 2010 Galen Raben/DroidBuilder.com
Comments