This project has many separate parts, and a misstep with any one of them can stop the whole system from working. It would be tricky to debug the point of failure among all the possibilities. Invest a little time now to get the basic Wave Shield examples working — especially the “Pi speak” demo. This lets you know that the shield is properly assembled, the SD card properly formatted and so forth. Then we’ll add the extra features.
Start by downloading the WaveHC library for Arduino…not only for WAV playback, but the voice changer relies on this code too. We have a tutorial explaining how Arduino libraries are installed. Download this ZIP file containing WAV files for the digits of pi. Then proceed through the tutorial until your Wave Shield is speaking them.
The GND and 3.3V lines from the Arduino need to connect to several points, so you may want to a breadboard’s power rails for this. 3.3V from the Arduino should connect to the Electret Mic Amp VCC pin, one outside leg of a 10K potentiometer, and the Arduino’s AREF pin. GND from Arduino should connect to GND on the Mic Amp and the opposite outside leg of the potentiometer.
If you plan to use prerecorded sound effects (some examples are in the “wavs” folder included with the sketch), you’ll need a FAT-formatted SD card with the files placed in the root directory (similar to how the “Pi speak” sketch worked). A 12-button keypad connects to digital pins 6, 7, 8 (columns) and analog pins 2, 3, 4, 5 (rows). But with some changes to the sketch, this can be adapted to use just a few buttons or other triggers. (The keypad is great for haunted house sounds, but too cumbersome for a costume.)
A small speaker can be connected directly to the Wave Shield’s amplifier output. For more volume, we recommend using amplified speakers such as the portable type for iPods and MP3 players, or our Class D Audio Amplifier breakout.
Note that the pitch dial does not work in real time! This is normal and a limitation of the way we’re running the analog-to-digital converter at full speed. To get a new pitch reading, you need to either play back a sound or press the reset button.
The Wave Shield can drive a small speaker on its own, but this doesn’t provide a lot of “oomph.” Parties and comic conventions are loud, so you’ll probably want a boost! We’re using our Class D Audio amplifier here with a pair of 4 Ohm speakers. Alternately, there are a lot of ready-to-go battery-powered speakers designed for iPods and other MP3 players that can plug right into the Wave Shield headphone jack. Using our own amp and speakers lets us custom-tailor the placement of all the parts.
It’s best to power the Arduino and audio amplifier separately. During particularly loud moments, the audio amp can draw a lot of current, resulting in a momentary voltage “sag” causing the Arduino to reset. Giving the Arduino it’s own separate power supply prevents this. We’re using a 9 Volt battery connected to the DC barrel jack, or a 6X AA battery pack will last considerably longer. In any case, the ground connection is common between the Arduino and audio power sections, as well as the 3.3V part of the circuit (for the mic amp and trim pot).