You are on page 1of 10

For more products visit our website http://www.sunrom.

com

Document: Datasheet Date: 29-Nov-12 Model #: 1200 Products Page: www.sunrom.com/p-1157.html






Wav Audio Player from SD Memory Card, CD Quality 44.1Khz
Board plays wav files from memory
card giving CD quality sound output.
The board is controlled from an
external microcontroller or PC which
sends simple ASCII string telling board
what to play.

The board is a tiny Audio-Sound
module that can play back pre-stored
audio files such as voice and music
from a micro-SD memory card. The
module supports 8 bit mono
uncompress audio files having sampling rate of 44100Hz(44.1Khz). By using the free available
software tool, any audio file(WAV, MP3, PCM, etc) can be easily converted to supported format.
The compact board takes minimal board space of just 3x6cm and is ideal for any application that
required embedded audio.

The board is controlled through simple serial commands. Board is a very flexible, compact and low
cost embedded audio solution for any applications.

Accepts any micro SD memory card from 128MB to 32GB. These memory cards are available at
very low cost due to wide use in mobile phones. For example a 4GB card would cost around 350/-
($7 USD).

Features
Low cost module for all embedded audio-sound applications
Plays high quality audio of 44.1 Khz
Can interface with any microcontroller or PC Serial port
Accepts any Micro SD Card from 128MB to 32GB which is FAT16 or FAT32 formatted
Simple to use and low cost
Play indicating Status LED
Compact size measuring only 3cm x 6cm



S u n ro m Te ch n o lo gie s Yo u r S o u rce fo r E m b e d d e d S yste m s Visit u s a t www.su n ro m .co m

2
Applications
General purpose embedded audio and sound applications
All voice annunciator systems.
Automobile, Parking radar, GPS navigation systems
Elevator, Security, Access-Control and Warning devices.
Intelligent home automation and domestic applications
Robotics and Industrial Control
Traffic facilities: Toll gates, parking lots.
Toys, learning tools, talking books and all gaming sound effects.
MP3 player like simple devices
Specifications
Name Typ Unit
Working Voltage 5 V DC Regulated
Current Consumption 100mA Peak(20mA Avg)
UART Level 3-5V Can work directly with 3V or 5V MCU pins
UART baud rate (8 bit data, no parity, 1 stop bit) 9600 bps
Pinouts
Pin Pin Name Details
RX-I Receive Input Input serial data of 3-5V logic level, Usually connected to TXD pin of
microcontrollers/PC/RS232.
TX-O Transmit Output Output serial data of 5V logic level, Usually connected to RXD pin of
microcontrollers/PC/RS232.
+5V Power Supply Regulated 5V supply input. Board has LM1117-3.3V regulator to
power all parts.
GND Ground Ground level of power supply. Must be common ground with
microcontroller / USB / MAX232 board.










Status LED
Push the card to insert.

Push card again to eject.
Memory card is shown above for
illustration, We do not provide
memory card with product.
Standard 3.5mm
Stereo Audio
Socket
Power input pins
+5V/GND

Serial control
TX-O/RX-I
Onboard 3.3V
regulator
LM1117-3.3

S u n ro m Te ch n o lo gie s Yo u r S o u rce fo r E m b e d d e d S yste m s Visit u s a t www.su n ro m .co m

3
Control Commands
Following are the commands you can use to control the board, Commands and response are simple
ASCII strings you can send from microcontroller or write directly in terminal.

Command Name Response Details
Pxxx<Enter Key> Play audio file K or E Plays a wav file. Where xxx is the name of audio file
without extension. For Ex. If you want to play test.wav
Then send Ptest followed by Enter key ( '\r', 0x0D, 13 in
decimal). The file name is not case sensitive.

If play back was started the board responds with ASCII
character K.

On Error the board returns E as error.

Note: board supports wav files with format of 44.1 Khz, 8
bit mono only
S Stop playback K Stop playing whatever it is currently playing.
Always returns K, as acknowledgement of the command
? Query if playing Y or N If board is busy playing a file it return Y else N
L Loop on K Default behavior at power up, Once you give file play
command it keeps playing from start once it finish
playing.
Always returns K, as acknowledgement of the command
X Loop off K Once you give file play command it stop playback when
the file ends.
Always returns K, as acknowledgement of the command

LED behavior
There is a red led on board which has following meaning

LED Status Details
LED Blink once
Power on
Normal behavior, When you power on board it checks for memory card, and if found it
blinks once for 100ms and becomes OFF indicating everything is ok.
LED blinks fast
rate, always
Card Error, It means that the memory card is not present or wrong format. Try
inserting correctly formatted SD Card.
LED steady ON Board is playing audio file.
LED off Board is not playing any audio file and is ready to accept any serial command.
LED steady ON
always when
power on
If the board has found auto.wav file on the card. It immediately starts playing that file
and LED comes on steady upon power on. It keeps looking the same auto.wav file so
LED always is on unless you send Stop command to it.



S u n ro m Te ch n o lo gie s Yo u r S o u rce fo r E m b e d d e d S yste m s Visit u s a t www.su n ro m .co m

4
PC side Terminal software
To connect to PC you can use either a simple MAX232 circuit to convert displays TTL level of 5V to
RS232 level of +12/-12V or you can use a USB to TTL UART board. Either way you can get a serial
port on PC to connect to and send commands.

We recommend this software which can be used test display by sending serial data from PC side.

Download it from http://www.sunrom.com/files/Terminal.exe



Just to test,
Here we are writing in this window, text to
play file called B44.WAV on memory card

Then ? to query status

Then S to stop playing

Response from board is
shown here as ASCII

Response in HEX


S u n ro m Te ch n o lo gie s Yo u r S o u rce fo r E m b e d d e d S yste m s Visit u s a t www.su n ro m .co m

5
Interfacing with microcontroller
Its very easy to interface with microcontroller having UART at 3V or 5V level. Configure your
microcontroller to communicate at 9600 baud rate.
To play a particular wav file send Ascii string in following format. Note the string starts with
command character(P) and end with CR (Carriage return, '\r', 0x0D, 13 in decimal).

printf("Ptest\r"); // Play test.wav file from SD memory card

Before approaching to this, we recommend you try on PC first with terminal software.



The source code for this demo application is on next page.

C9
33p
R1
10K
U2
AT89S52
P3.1/TXD
11
P3.2/INT0
12
P3.3/INT1
13
P3.4/T0
14
P3.5/T1
15
P3.6/WR
16
P3.7/RD
17
X
T
A
L
2
1
8
X
T
A
L
1
1
9
G
N
D
2
0
P2.0/A8
21
P2.1/A9
22
P2.2/A10
23
P2.3/A11
24
P2.4/A12
25
P2.5/A13
26
P2.6/A14
27
P2.7/A15
28
PSEN
29
ALE/PROG
30
EA/VPP
31
P0.7/AD7
32
P0.6/AD6
33
P0.5/AD5
34
P0.4/AD4
35
P0.3/AD3
36
P0.2/AD2
37
P0.1/AD1
38
P0.0/AD0
39
V
C
C
4
0
P1.0/T2
1
P1.1/T2EX
2
P1.2
3
P1.3
4
P1.4/SS
5
P1.5/MOSI
6
P1.6/MISO
7
P1.7/SCK
8
RST
9
P3.0/RXD
10
+
C8
10uF 16V
VCC
U4
Sunrom Wav Player Model#1200
T
X
-
O
U
T
3
G
N
D
1
+
5
V
2
R
X
-
I
N
4
VCC
TTL UART INTERFACING
VCC
Y1
11.0592
C1
100n
C10
33p

S u n ro m Te ch n o lo gie s Yo u r S o u rce fo r E m b e d d e d S yste m s Visit u s a t www.su n ro m .co m

6
In Keil C51 compiler you can write simple code as below to play test.wav file

#include <REGX51.H>
#include <stdio.h> // for printf

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=- Setup Serial port for printf -=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void init_serial( void )
{
//9600 bps @ 11.059 MHz
SCON = 0x50; /* Setup serial port control register */
/* Mode 1: 8-bit uart var. baud rate */
/* REN: enable receiver */
PCON &= 0x7F; /* Clear SMOD bit in power ctrl reg */
/* This bit doubles the baud rate */
TMOD &= 0xCF; /* Setup timer/counter mode register */
/* Clear M1 and M0 for timer 1 */
TMOD |= 0x20; /* Set M1 for 8-bit autoreload timer */
TH1 = 0xFD; /* Set autoreload value for timer 1 */
/* 9600 baud with 11.0592 MHz xtal */
TR1 = 1; /* Start timer 1 */
TI = 1; /* Set TI to indicate ready to xmit */
}

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=- Delay x ms -=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void delay_ms(int x) // delays x msec (at fosc=11.0592MHz)
{
int j=0;
while(x>=0)
{
for (j=0; j<100; j++);
x--;
}
}

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=- Main -=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void main()
{
delay_ms(100); // power stabilize

init_serial(); // setup C51 serial port

printf("Ptest\r"); // Play test.wav file

while(1)
{
}
}

S u n ro m Te ch n o lo gie s Yo u r S o u rce fo r E m b e d d e d S yste m s

7
Interfacing with RS232
If you wish to interface the module with RS232 level like a PC serial port or any other device you
need a level convertor such as MAX232 as shown below.



Interfacing to USB Port and Powering from USB Port


Our USB to Serial TLL will appear as virtual serial port on PC to
which you can communicate through any software which can
transmit receive by this serial port like hyperterminal or
custom made software.






VCC
RS232 INTERFACING
+
C13
10uF 16V
+
C14
10uF 16V
11
10
1
3
2
12
9
VCC
U5
Sunrom Wav Player Model#1200
T
X
-
O
U
T
3
G
N
D
1
+
5
V
2
R
X
-
I
N
4
U9
Sunrom Wav Player Model#1200
T
X
-
O
U
T
3
G
N
D
1
+
5
V
2
R
X
-
I
N
4
USB INTERFACING
U8
USB to Serial Board SUNROM#1151/1192
Yo u r S o u rce fo r E m b e d d e d S yste m s Visit u s a t www.su n ro m .co m
If you wish to interface the module with RS232 level like a PC serial port or any other device you
convertor such as MAX232 as shown below.

Interfacing to USB Port and Powering from USB Port

Our USB to Serial TLL will appear as virtual serial port on PC to
which you can communicate through any software which can
transmit receive by this serial port like hyperterminal or
C16
100n
P2
DB9-CONN-F
5
9
4
8
3
7
2
6
1
+
C12
10uF 16V
+
C15
10uF 16V
U6
MAX232
R1IN
13
R2IN
8
T1IN
T2IN
C+
C1-
C2+
4
C2-
5
V+ V-
6
R1OUT
R2OUT
T1OUT
14
T2OUT
7
V
C
C
1
6
G
N
D
1
5
VCC
U8
USB to Serial Board SUNROM#1151/1192
R
X
-
I
N
1
T
X
-
O
U
T
2
G
N
D
3
+
5
V
4
You can also use our
Max232 Board Model 1104
http://www.sunrom.com/p

You can use our
USB to Serial Board
Model 1151 or 1192

1151 model plugs in directly to USB
port of PC

http://www.sunrom.com/p

Similar model to above but needs a
USB A-B Type cable
http://www.sunrom.com/p

www.su n ro m .co m
If you wish to interface the module with RS232 level like a PC serial port or any other device you
You can also use our
Max232 Board Model 1104

http://www.sunrom.com/p-245.html
You can use our
USB to Serial Board
Model 1151 or 1192
1151 model plugs in directly to USB

http://www.sunrom.com/p-244.html
Similar model to above but needs a
B Type cable

http://www.sunrom.com/p-1145.html

S u n ro m Te ch n o lo gie s Yo u r S o u rce fo r E m b e d d e d S yste m s Visit u s a t www.su n ro m .co m

8
Managing wav files on memory card
To manage wav files on memory card you can get any low cost memory card reader available in IT
or mobile spares shop. Insert card into it and plug it into PC like pen drive. When you insert your SD
card into memory reader on PC you can view the files. Once you have put all required WAV files.
Note: board supports wav files with format of 44.1 Khz, 8 bit mono only.


We also have a memory card reader at sunrom.com if you wish to buy online
Micro SD Memory Card Reader/Writer like USB Pen Drive

Insert a Micro SD Card and Plug to PC's USB Port. It
becomes just like your USB Pen Drive. Now you can
access files and folders or format cards easily.
Reader URL: http://www.sunrom.com/p-1092.html
4GB Memory Card: http://www.sunrom.com/p-1091.html

Wav files on memory
card.

Since auto.wav is
present, it will be played
automatically when
board is powered on.

Rest all files can be
played only through
serial commands.

S u n ro m Te ch n o lo gie s Yo u r S o u rce fo r E m b e d d e d S yste m s Visit u s a t www.su n ro m .co m

9
Supported Wav file format
Please note that the board supports playback of WAV file having format of 8 bit mono with sampling
rate of 44.1 Khz

To perform conversion to supported format, you can use following software which is free
http://www.nch.com.au/switch/index.html

Add files or folder, Set output to WAV and Encoder options as 44100Hz, 8 bit mono


Frequently Asked Questions
How to play MP3 files?
MP3 is a compress format and it will be required to be converted to uncompress WAV files. There
will be no loss of quality during this. You can use any free software to do this conversion. Note:
board supports wav files with format of 44.1 Khz, 8 bit mono only

How to amplify Audio
The audio from board is at headphone level only. You should add a external audio amplifier like
LM386 or best way is to use a easily available PC Desktop Speaker system. The stereo pin from
that can go to the player board instead of PC giving excellent sound output.


S u n ro m Te ch n o lo gie s Yo u r S o u rce fo r E m b e d d e d S yste m s Visit u s a t www.su n ro m .co m

10
Board Dimensions


Here is bottom view of board. You can see the 4 pin interfacing header and 3x mounting holes and
the stereo socket.

You might also like