Sound Wiring

From Rebeldroids Wiki

Most builders want their droids to be able to make some sorts of noises. There're huge threads about that on the R2-D2 Builder's Forum, and very specific applications have been built for Astromechs. However, the general concepts are reasonably straightforward.

Droid Sound Basics

In short, what we want to do is have the droid make some sort of noise when we push a button. Some people do more complex stuff than that, mixing sounds, playing automatically for certain conditions, etcetera, but the general concept is pretty simple.

Typically we need a few pieces to make this work:

  • Appropriate sound files
  • Some electronics to play back the sounds
  • An amplifier is often helpful
  • Speaker(s)
  • Some way to trigger the sound remotely.

Trivial Solution

The absolutely most trivial way to get your droid to emit sounds is to use a powered rechargeable Bluetooth speaker (like a Jambox) with a spare phone or mp3 player (or heck, even the phone in your pocket, though then your droid might ring if someone calls). You can also usually connect the phone to the speaker directly with a male-to-male 1/8" headphone cable and just skip the Bluetooth bit.

Creating a looped track for the phone to play on repeat with intermittent noises, like every 30-60 seconds, will usually last all day at a convention. You can then charge the speaker overnight, though some last all weekend. A phone on airplane mode with a wired connection to the speaker so the phone's power hogging radios are off will usually play for several days before needing charged.

Heck, just a phone itself might work fine in a "quiet" environment.

Simple Solution (MP3 Trigger)

The "traditional" solution for lots of droid builders is based on the Sparkfun MP3 Trigger and a 12 or so button home automation type remote control. Some sort of simple amplifier and speakers help. There are other systems, but this is fairly proven.

Often such a system is based on 12V circuits since 12V amps are pretty easy to come by because of cars.

More info about the Sparkfun Mp3 Trigger solution.

MP3 Player Selection

The MP3/Wav/Other controller doesn't actually have to be an MP3 Trigger for this to work, but it is a common choice. There are many other devices that provide similar functionality, but often they seem to miss bits. If choosing a different device, ensure that it does what you need it to:

  • It needs to support your file format/bitrate. Eg: MP3/Wav files.
  • It usually needs inputs to be able to play specific tracks on demand, though a simple droid could just play a single looped track.
  • It needs appropriate outputs for your amplifier or speaker.
  • You may find a player with integrated amplifier. Be warned though that conventions typically require pretty loud outputs, integrated devices may not be adequate.
  • You need to be able to provide appropriate power supply. The player itself should be pretty low current, but some may not have an onboard voltage regulator and may require an external 3.3V or 5V supply.
  • The MP3 Trigger has a regulator for 12V, but our droid 12V batteries can get higher, so use care.

Amplifier Selection

Powered speakers like a Jambox are certainly a simple solution, even when controlled with an MP3 Trigger type device. Make sure that the line levels are as expected though. They may not be powerful enough for all users though.

Alternatively, there are a number of simple 12V amplifiers like the Lepai 2020A+ and clones that are pretty cheap. 12V are common because of cars, but you'll want to make sure of a few things:

  • Cheap is good, but make sure it sounds OK. The amplifier is second to the speakers in how well your droid will sound.
  • Loud sound == power, which means it can drain your batteries, make sure you plan for that.
  • Not all amplifiers are very efficient. If your loud sound makes a lot of heat, you're just draining your battery fast.
  • Make sure it can drive the speakers you plan to use. Typically speakers are labeled as 4Ω or 8Ω (ohms).
  • My Lepai can ask for more power than my battery can provide, so then it cuts out. Test what you plan to use before sticking it in the droid.
  • My cheaper Lepai sounds horrid.
  • Make sure your droid is able to provide the right power. Some 12V boards might get touchy at higher voltages. Some "12V" batteries can run around 14V when fully charged.
  • Mono could be cheaper than stereo.

Speaker Selection

Again, the simplest method is the powered speaker type solution like a Jambox, with integrated amplification.

  • Chose mono or stereo (or more, some droids have crazy sound systems)
  • Make sure you have space for your chosen speaker(s). Doesn't make much sense to find a pair of great 6x8 speakers for your mouse droid!
  • Cheap can be good. Frankly, in a loud convention hall, as long as you don't get buzzing at the desired levels nobody'll probably notice.
  • Check the sound. On the other hand, I like a nice sounding droid. My droid plugs into the wall and doubles as my building area sound system when I'm working on projects.
  • Make sure your 4Ω or 8Ω (ohm) speakers are compatible with your amp. Otherwise they'll be too loud or quiet.
  • Droids attending conventions typically need powered (see amp above) speakers. Passive PC buzzers aren't usually going to cut it.
  • I find that an uncomfortably loud droid in the house (or elevator) is about right or perhaps a little quiet in a convention hall.

Remote Selection

There are a few ways to do remotes for an MP3 Trigger type solution. The MP3 Trigger has numerous inputs to trigger individual sounds, so a simple 12 channel (button) wireless remote with a 12 relay receiver works fine.

  • Enough buttons for your sounds
  • Can connect to your device - some of the 12 channel buttons have transistor outputs that are not directly compatible with the MP3 trigger inputs.
  • Again, be careful about the voltages for your receivers, most of the Rx relay units I've seen expect 12V power supplies.

Advanced Techniques

Some of the more advanced techniques typically add additional functionality. Feel free to elaborate if you have more to provide, but here are the types of things some folks have done:

  • PC controllers

Typically a phone or tablet type controller that controls droid systems through Bluetooth or Wifi, with custom programs to provide a pretty GUI to control the droid's movements and sounds.

  • XBee controllers

Typically also primarily for droid control, however they can provide buttons for sound signals on the receiving side as well.

  • "Fancy" control systems

Some systems provide mechanisms for decoding user inputs, such as flipping a switch on the main RC type transmitter, then making a shape (like the letter S) with a joystick, causing a particular sound to play. Those typically require a microcontroller in the receiver.

  • Microcontroller (Arduino) receiver

A microcontroller on the receiving side can provide additional functionality, such as multiplexing the transmitter inputs to provide more sounds. They can also automate when to trigger sounds or run scripts to play sounds under certain conditions. A microcontroller may also be required to decode more complex or XBee type inputs. Typically this requires something like a sound shield or MP3 trigger to actually play the sounds.

  • Mixing sounds

Some systems may choose to mix sounds, such as playing a theme song, and then overlaying droid sounds on command. Some shields do this, but other systems may use a small PC or tablet on the droid.

  • Remote sound

Sometimes sounds are transmitted from the controlling device as raw audio. That lets the droid just play the sound and leaves the complex logic to the transmitter. Phone Bluetooth to powered speaker is a simple example of that.

Parts Suppliers

MP3 Trigger can be found on Sparkfun and sometimes Pololu Ebay and Amazon carry "12 Channel Wireless Radio RF Remote Control" systems Other parts can often be found on Amazon, Ebay, and Banggood, such as 12V amplifiers and cheap speakers. Banggood is also a good source for Ardiuno compatible microcontrollers if you want more interesting behaviors.