MP3 Audio Shield with DTMF Support

Overview

This shield is designed for audio playback and recording. A pair of 3.5mm audio connectors are used for connecting earphone/speaker and microphone for audio playback and recording, respectively. Another pair of 3.5mm audio connectors can be used with e.g. an external GSM modules. This audio shield can work as an answer machine for recording voice messages. Further more, it supports DTMF decoding, which provides the possibilities for interactive control functionality. (e.g. “Dial 6 to switch off the light in living room.”) All functionality can be controlled via I2C, which includes audio playback and recording, DTMF decoding, channel switching etc. An Arduino library is provided for every function that is supported by this shield. The audio playback and recording function is performed by the WT2000 chip and the DTMF decoding is done by MT8870.

Features

WAV, WMA and MP3 playback

Recording at 48KHz sample rate

Recording at 32-128Kbps MP3 format

TF card support (up to 32GB)

32 levels volume control

DTFM decoding support

Plug and play design for Arduino Uno

Fully controlled via I2C

I2C clock up to 400KHz

Pin Configuration

5V: +5V

3V3: +3.3V

GND: GND

SDA: I2C Data

SCL: I2C Clock

INT: Optional Interrupt output to Arduino

Breakout Header Pin Configuration

SDA: I2C Data

SCL: I2C Clock

D+: USB Data Plus

D-: USB Data Minus

+5V: 5V voltage output

WTXD: WT2000 UART Tx OUT

WRXD: WT2000 UART Rx IN

SRX: SC16IS750 UART Rx IN

STX: SC16IS750 UART Tx OUT

Q1-Q4: MT8870 DTMF Digital Output

TOE: MT8870 Three state output enable pin

INT: SC16IS750 interrupt request output. Open drain, pulled-up to 5V

PWDN: MT8870 Power down

INH: MT8870 Inhabit

Audio Connectors

The upper lime connector, noted by an earphone symbol, is the main audio output. It could be connected to an earphone or speaker.

The upper pink connector, noted by a microphone symbol, is the main audio input. It could be connected to a microphone.

The lower lime connector, noted by a circle with an outgoing arrow, is the auxiliary output. It could be connected to an external GSM module’s audio input (pink).

The lower pink connector, noted by a circle with an incoming arrow, is the auxiliary input. It could be connected to an external GSM module’s audio output (lime).

DTMF Decoder

The STD pin on MT8870 which is connected to the GPIO4 on the SC16IS750 will change to HIGH after a valid tone pair has been detected. It stays HIGH for a specific amount of time and then turns LOW. Once STD turns HIGH, the decoded key are ready for read on pin Q1-Q4 on MT8870. GPIO0-GPIO3 of the SC16IS750 which are connected to Q1-Q4 MT8870 should be used for reading the decoded DTMF key value. The library comes with this shield deals with all the complexity of digital states and time sequence.

18 thoughts on “MP3 Audio Shield with DTMF Support”

Thanks for your interest.
If you meant that you want to play and record mp3 files, you need an earphone and a microphone. If you meant you want to use it as an answer machine, you need an GSM shield. Please be more specific about the “function”, so I can give you correct answer.

The audio decoder/encoder chip, WT2000, accesses the micro SD card in sdio mode. so the micro SD card only serves the audio feature. Besides, Arduino uses only I2C protocol to control the shield, which also eliminates the possbility to access the micro SD in SPI mode.

Thanks for you interest Jeff.
As the decoder/encoder chip, WT2000, does not support the “busy” signal in current version. We didn’t breakout the “busy” pin. You need to set a timer interrupt in Arduino to deliver a singal indicating the end of the playing of a mp3 file.

Hi,
I am interested in playing MP3 sounds in response to an Arduino activity. For example , PIN 8 goes high in response to an input then the MP3 sound plays .
I have looked at your DEMO code “ArduinoPlayRecord” and can’t workout what makes the sound play.

The serial monitor brings up a command menu. What do I do ? Type PLAY then send ?

Can you help with an example of how I might use your example to interface with playing sound on the occurrence of an Arduino event ?

just a question to “INT: Optional Interrupt output to Arduino”. Which interrupt is used and when is the interrupt set (e.q. when playing finished)? Does the library support an interrupt handler for this?

So in curren version, the INT pin is only used by DTMF decoding. It is driven LOW when a valid DTMF code is detected.

As the WT2000 chip does not support “busy” status indication when I was designing the shield, I didn’t route the “busy” pin to one of SC16IS750’s GPIOs. I think I will add this feature in the future after the WT2000 chip support the “busy” signal.

I have just tried the “WT2000_MODE_SINGLE_CYCLE” mode, and it seems it has some problem if you are playing the track by its name. Play by “index” will work with no problem. “Index” means a number starts from 1 and ends at 65535. For example, if you have three files under the root directory of your TF card and they name of the files are 1.mp3, A.mp3, and B.mp3. The index will be assigned to each file according to the alphabetical order of their names. So in the example, you will get the index to file name map as shown below:

1.mp3 1
A.mp3 2
B.mp3 3

If you want to play B.mp3 endlessly, you need to set the play mode to “myaudioshield.mode(WT2000_MODE_SINGLE_CYCLE);” and then “myaudioshield.play(3)”;

By the way, you don’t need to set the play mode everytime before you play a track. So the code clip more looks like something as below:

void setup()
{
…
myaudioshield.mode(WT2000_MODE_SINGLE_CYCLE);
…
}

void loop()
{
myaudioshield.play(3);
while(1);
}

Also, you can play a track inside a folder by calling “play(index, “foldername”)”. The folder name must be all capital letters or numbers and the length of the folder name should be fixed to 5 characters.

Sorry for the late reply. In curren version, the I2C address of this device is fixed, which means, by default, all your devices will have the same address. This problem could be solved by desolering the address setting resistors and using wire to solder the address pad to some other pins of the IC(4 status for each address setting pin). Another prolbem is, even after above modification, you can only have 16 different addresses, which means, you need two I2C masters to run 32 nodes in total. So it is possible for the project you mentioned, I am just not sure whether it worth to try with so many work. :)

If possible, could you please send all your files(tracks, sketches) to our support email address. So I can try it myself and see if I can find the root cause of this problem. By the way, you can find the email address on http://sandboxelectronics.com/?page_id=369 . I am so sorry for the trouble and I will try my best to help you.

Contents

About us

Sandbox Electronics is a studio that design electronics and sell these bits and pieces worldwide. We are proud of our geeky culture at Sandbox Electronics and would love to share our experiences and fun stories online.