Quick Links:

BeatVox

The BeatVox Shield for Arduino is one of the least expensive ways to add sounds to your project. It can use only 1 or 2 I/O pins to make sound (depending on whether you want mono or stereo output) and leaves SPI and I2C free for other shields -- shields that easily stack on top of the BeatVox stacking headers. Sounds can be stored either on a 512Kbyte NAND FLASH on the BeatVox or right in the FLASH memory of the Arduino itself.

This is not a “kit”, there is nothing to solder, and no extra connectors or components to buy. It is fully assembled and ready to work right out of the box. Compatible with Arduino Uno, Duemilanove, Mega/Mega2560, Ruggeduino, or other Arduino-compatible boards.

 

  • The BeatVox Shield

    ../assets/images/AD120_01.gif

    The BeatVox Shield is an inexpensive and compact way to generate sounds from your Arduino. The shield includes 512kbyte NAND FLASH for storing sounds, 3.5mm stereo headphone output, general-purpose potentiometer and pushbutton, and reset button.

    BeatVox Shield
  • Compact and Stacking-Friendly

    ../assets/images/AD120_02.gif

    The BeatVox Shield uses only 2 output pins (only 1 if you want mono output) and leaves SPI and I2C free for other shields. Nothing sticks up or sticks out so it's easy to stack other shields on top.

    BeatVox Shield
  • MIDI+Audio

    ../assets/images/AD120_03.gif

    Combine the BeatVox shield with our Flexible MIDI Shield for a simple and flexible MIDI-based synthesizer. See the BeatVoxMIDI sample sketch below for a quick start.

    BeatVox Shield

 

 

$14.95

Features

The BeatVox includes the following features:

  • Stereo 3.5mm headphone output
  • 512Kbyte SPI NAND FLASH for extra sound storage beyond Arduino FLASH memory
  • Plays up to 6 sounds simultaneously (3 on each audio channel)
  • Compatibility with Arduino Uno, Duemilanove, Mega/Mega2560, Ruggeduino, or other Arduino-compatible boards.
  • Stacking headers so other shields can plug in on top
  • Reset switch included to reset the Arduino
  • General-purpose thumbwheel potentiometer (can be used as a volume control or for any other purpose)
  • General-purpose pushbutton
  • Operation at either 5V or 3.3V (jumper selectable)
  • 2-pin terminal pads included (terminals not included) for easily providing external Vin power

Sample Code

Here are some sample programs for making sounds with the BeatVox shield.

  • The Basic Sketch
  • This sketch shows the basic method of making sounds with BeatVox. It includes 8 sounds stored right in the Arduino’s FLASH memory and just plays them out in sequence, then plays two sounds at a time, then 4 at a time to demonstrate multi-voice playback.

  • Volume Control
  • This sketch demonstrates how to use the BeatVox potentiometer to implement a volume control.

  • MIDI Note Player
  • This sketch demonstrates how to control the BeatVox shield using incoming MIDI note events. You can use our Flexible MIDI Shield together with the BeatVox on a single Arduino to make this work.

How it Works

The heart of the BeatVox shield is two high-quality low-pass filters (one for each audio channel) that are used to filter the two 16-bit timer PWM outputs of the Arduino. Sounds are generated by modifying the PWM duty cycle. The low-pass filters smooth out the signal and remove most of the switching noise so all that is left is the audio.

By leaving the sound synthesis to the Arduino you do not have to tie up the SPI or I2C lines constantly sending data to a D/A converter. Only the 16-bit timer PWM outputs (D9/D10 on an Arduino Uno/Duemilanove, D6/D7 on a Mega) are used to make sounds.

This method of sound synthesis is good for percussive sounds or speech samples (it was conceived as a synthesizer add-on to our Beat707 drum sequencer). The sampling rate is fixed at 22039 Hz (the standard 22050 Hz rate works just fine) and each sample is stored in 8 bits.

Pins D9/D10 are used on boards based on the ATmega328P (these are the 16-bit Timer 1 outputs). On the ATmega1280/2560 devices, pins D6/D7 are used (this is 16-bit Timer 4). You can either just use wires to connect D6 to D9 and D7 to D10 (on the stacking headers) or modify the jumpers on the BeatVox shield for permanent wiring (see below).

512Kbyte SPI FLASH

The BeatVox includes 512Kbytes of SPI FLASH. The FLASH is accessed over the standard SPI pins (D11-D13) and is enabled by a low level on pin D2. The FLASH device is an SST25VF040B (datasheet).

On boards based on the ATmega1280/2560, the SPI pins are on pins D50-D52. You will need to connect these pins with wires to the 3-pin jumper J20 on the BeatVox to make use of the SPI FLASH.

Storing Sounds in FLASH

Sounds are stored either in the Arduino’s on-chip FLASH memory (that is, compiled in as part of your sketch) or in the SPI FLASH on the BeatVox shield. Here we look at the steps needed to take a standard audio file and convert it to the format needed to play on a BeatVox.

  1. Get a WAV file
    • Whatever format your sound is in, you will need to convert it to a monophonic WAV file at a sampling rate of 22039 Hz (22050 Hz is OK too). You can play stereo sounds but each sound must be a separate monophonic WAV file and stored separately in FLASH. You can then play just the left channel, just the right channel, or both channels together.

      Our favorite program for sound file manipulation is SoX. It is a free, cross-platform program that can do just about anything to your audio files. Here is an example command-line call to SoX to convert just about any type of WAV file to the format needed by BeatVox:

        sox InputFile.wav --channels 1 --rate 22039 OutputFile.wav

      SoX will also convert from other file formats to the WAV file format -- just give it an input audio file and it will auto-detect the format.

  2. Get more WAV files
    • After you’ve converted all the WAV files you want to play to be monophonic and 22039 Hz, put them all in one directory.

  3. Generate the Sounds.h header file
    • To compile the sounds into your sketch, you will process all of the audio files through our free voxheader.py Python program. Chances are good you already have Python installed, but if not then it’s a simple and free installation (works on all platforms) from http://www.python.org.

      Assuming you’ve got all the WAV files in the current directory you just type:

        python voxheader.py *.wav

      This will generate a Sounds.h file that you can then put into your sketch directory. This file is included in your PDE sketch file and the sounds then become part of your program.

Methods for storing sounds in the SPI FLASH are in the works.

Jumpers

The BeatVox has several jumpers to control its behavior. Refer to the schematic for more details. Here is a top view of the shield showing all of the jumper locations.

Audio Outputs

Jumpers J16 and J17 are connected by default and connect pins D9 and D10 to the left and right audio channels, respectively. These are the outputs of the two Timer 1 PWM channels on the ATmega328P.

Jumpers J12 and J13 are not connected by default -- when connected the left and right audio channels are driven by D6 and D7, respectively. These are the outputs of the two Timer 4 PWM channels on the ATmega1280/2560.

Only connect one set of jumpers. If both J12 and J16 are connected, for example, then pins D6 and D9 are shorted together which can damage the Arduino.

If you know you are always going to use the BeatVox on an ATmega1280/2560 it makes sense to cut jumpers J16 and J17 and install jumpers J12 and J13. You can always make a temporary connection by just using wires on the stacking headers to connect D6 to D9 and D7 to D10, but then you must ensure that your code does not enable D9/D10 to be outputs else they will short out to D6/D7.

Pushbutton Input

The general-purpose pushbutton on the BeatVox shield is connected to pin D8 by default (through jumper J14) but can also be connected to pin D5 through jumper J10, D4 through jumper J8, or D3 through jumper J6.

Jumper J14 is connected by default, while all other jumpers are not connected by default.

Analog Input

The thumbwheel analog potentiometer is connected to analog input A0 through jumper J11 by default. Any other analog pin can instead be used by installing the appropriate jumper (J9 for A1, J7 for A2, J5 for A3, J4 for A4, or J3 for A5).

System Voltage

The BeatVox shield can be made compatible with +3.3V microcontroller boards by cutting jumper J2 and installing jumper J1. Do not ever allow both jumpers to be connected!

Using the Mega1280/2560

There are two main differences between Arduino boards based on the ATmega328P and those based on the ATmega1280/2560:

  1. The audio outputs on the ATmega1280/2560 come from D6 and D7 (Timer 4) instead of D9 and D10 (Timer 1)
  2. The SPI pins used to communicate with the NAND FLASH are on pins D50 (MISO), D51 (MOSI), and D52 (SCK) on the ATmega1280/2560 instead of D11, D12, and D13.

Here is how  to work with these differences.

Audio Outputs

As described in the Jumpers section above, you can permanently cut jumpers J16 and J17 to disconnect D9/D10 from the audio outputs and install jumpers J12 and J13. You can also make temporary connections just by hooking up wires on the stacking headers, but then you must be careful to not make D9/D10 output pins else they can short out to D6/D7.

SPI Pins

A 3-pin header (J20) is provided for making SPI connections to pins D50 through D52. You can either solder in a 3-pin header or just solder in bare wires and connect them to the socket headers on the Mega (as shown below). This is only needed if you want to use the BeatVox SPI 512Kbyte FLASH.

External Power Input

For standalone or battery-powered operation, the two-pin terminal pads (next to the reset switch on the shield) allow you to make a sturdy connection to a battery or other power source. These terminal pads can have bare wires soldered in, or you can solder in a 3.5mm two-pin terminal block (not included).

This power input is essentially the same as the DC power jack on the Arduino. Provide a DC power source of the same voltage and current that is required by your Arduino board (e.g., 7-12VDC for an Arduino Uno, at least 100mA is recommended). Power you apply to the two-pin terminal block is available at the Vin pin on the stacking headers.

5V/3.3V Operation

The BeatVox shield is compatible with both 5V and 3.3V Arduino-compatible boards. By default jumper J2 is connected (see the schematic) for 5V operation. For 3.3V operation, cut this jumper using a small hobby knife or other sharp tool and short jumper J1. Do not ever allow both jumpers to be connected!

Technical Data

Here is the schematic of the BeatVox.

 

The BeatVox was designed in the USA and is assembled in the USA using lead-free components and lead-free manufacturing and assembly processes.

Proudly located in Michigan, USA

Copyright © 2013 Rugged Circuits LLC