Building It

Phase 1:

Follow the original Wave Shield tutorial

We can’t emphasize this one enough: work through the original Wave Shield tutorial before moving on to the voice changer!

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.

Phase 2:

Adding voice effects and a sound trigger keypad

With the basic Wave Shield working, now we can add the voice changer and a sound-triggering keypad. You can complete this phase on your workbench using a breadboard…we’ll make it portable later, after confirming that it works.

Download the Adavoice sketch for Arduino. And you should already have the WaveHC library installed from the prior phase.

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.

Don’t forget the AREF connection…the circuit won’t work without it!
The Mic Amp output connects to analog pin 0, and the center leg of the potentiometer connects to analog pin 1.

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.
Upload the Adavoice sketch to the Arduino if you haven’t already done this. If everything is wired up and loaded correctly, you should head a startup chime when the sketch starts (if using an SD card with the sample WAVs). If there’s no sound, use the Arduino serial monitor and watch for diagnostic messages.
Once up and running, you can then talk into the microphone and should hear the altered result through the speaker or headphones (keep the mic away from the speaker to avoid feedback). Pressing any of the keypad buttons will stop the voice effect to play the corresponding sound, then resume afterward.

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.

Phase 3:

Making it battery-powered and portable

To simplify the wiring diagram, we’ll illustrate this next section without the keypad. But you can still include it if you want! The connections are the same as above.
Because breadboard circuits are too delicate for portable use, we’ll join components directly this time.

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).
Here we’ve mounted all the parts on a sheet of acrylic using double-stick foam tape, then fastened this to a nylon strap so it can be worn over one’s chest. We chose tape for expediency only…give some thought to making your rig more durable, using mounting screws, zip ties, etc.
You can run the microphone connection a couple feet to reach inside a mask or helmet. A servo extension cable provides a very handy 3-conductor separation point, so you can pop your head and set it down! Cut the servo cable in half, soldering one end to the mic amp board and the other side to the Arduino circuit.
This guide was first published on Oct 10, 2012. It was last updated on Oct 10, 2012. This page (Building It) was last updated on Sep 22, 2019.