Guide for sound module please!

xtech007

Senior Member
Morning all!
Would like adventure towards learning how to use sound modules with picaxe 28x1, 18x, 28x2!

From what I have read on the forum picaxe would not be able to play mp3 or wave format files out of any media card with out the need of external chip.

So I would like to ask anyone who have used this modules for any input or guidence on how to approach a working model!
What module, media format, setup with the picaxe, that sorta stuff.

Thanks!
 

Jeff Haas

Senior Member
The most commonly discussed MP3 card is the Tenda TDB380 - there are examples and plenty of discussion on the forum, just search for "Tenda". It works great, takes an SD card with the MP3 files on it, and is inexpensive.
 

xtech007

Senior Member
Will do !

Jeff tnks for the reply!
I will look further on the forum for the module mentioned.

I do not find it on ebay, amazon, or web. Did see the manual.
Anyone has a link where i can buy it here in the States?
 

MurrayJ

Senior Member
I use the Catalex Serial MP3 Player. It is cheap, less than 10 dollars, is 5v compatible for Picaxe use, and has simple serial commands for playback, volume etc. Also it uses a micro SD card (on the other side of the board pictured) for sound files in standard MP3 format. It has a standard 3.5mm headphone socket which I have used with an external powered speaker as well as headphones.

Just name your MP3's 001.mp3, 002.mp3 or even 001SongName.mp3, as long as the numbers go first, it even supports folders of different sounds of you would like to sort them.

To show how simple it is to use, this is a program to play soundfile 003FavoriteSongHere.mp3 from directory 02.

serout s.1,t9600,($7E,$FF,$06,$09,$00,$00,$02,$EF) 'select TF socket
pause 1000
serout s.1,t9600,($7E,$FF,$06,$0F,$00,$02,$03,$EF) 'play the song: /02/003FavoriteSongHere.mp3
 

Attachments

premelec

Senior Member
There seem to be a variety of inexpensive modules on Ebay and SparkFun... don't know how easy they are to use in practice...
 

Jeff Haas

Senior Member
I've had the Tendas run all day, all weekend in an exhibit at the Maker Faire here in California, as well as other shorter events, and they have worked 100%. Easy to code for, too. I've heard the Sparkfun boards work great, but they're much more expensive (and have more capabilities).
 

xtech007

Senior Member
thanks guys!

Order one of each!
1 from mdfly (sd card) out of stock
1 from catalex sd version aswell.
Let's see which one gets here firs.
Will downlad manuals and read a bit.

Mean while, has anyone tried to move a servo with sound/audio with a picaxe?
Like a talking skull. I do know servocity sell a board for around $39 but for only one servo.

I was thinking to use a sound module to output to a 28x1 read adc and according to the reading move the servo with servopost.

Have anyone tried?
Thanks!
 

Jeff Haas

Senior Member
xtech,

There is a lot of work on how to use a Picaxe to animate a talking skull. Check these links out:

http://www.hauntforum.com/showthread.php?t=30601
http://www.hauntforum.com/showthread.php?t=36427&highlight=halstaff
http://www.hauntforum.com/showthread.php?t=26536&highlight=halstaff
http://haunthackers.com/

And here's my Instructable on the small circuit needed to animate one of those off-the-shelf skulls with a DC motor in it:
http://www.instructables.com/id/Modify-A-Talking-Skull-To-Say-Anything-You-Want/#intro
 

Jeff Haas

Senior Member
I got one of these Catalex boards and the code above didn't work for me immediately. It turns out there are a few tweaks it needed to run reliably, the main one being a couple of pauses needed after cycling the power. Also, I was trying it out on an old 08M - it seems because you need to use 9600 baud to communicate with the Catalex board, you must have an M2 part. A quick swap of the 08M for an 08M2 and that was fixed! The Catalex board will sometimes act odd, it can miss some of the commands to pause and resume. Turning it off and waiting a moment before powering up will fix that.

Here's heavily commented code:

Code:
; *******************************
;    Filename: Catalex MP3 board test		
;    Date: 7/7/2015			
;    File Version: 	
;    Written by: Jeff Haas	
;    Function:  08M2, Catalex test
;    Last Revision: 7/7/2015
;    Target PICAXE: 08M2	
; ******************************* 
; Using 08M Protoboard
; Requires an M2 part!  Required to give 9600 baud commands.
; Catalex VCC -> 5V on Picaxe
; Catalex GND -> GND on Picaxe
; Catalex RX -> Pin on Picaxe (C.2 in this example)
; On micro SD card, format with Fat16 or Fat32 per manual, then make two folders
; named 01 and 02.  Put MP3s into folders, following this naming format:
; 001XXX.mp3, 002XXX.mp3, etc.  The "XXX" can be anything but the MP3s must start with
; "001" etc. in each folder.  For rest of commands, see PDF manual.

#Picaxe 08M2
SetFreq m8  'Must be set to 8mhz or 16mhz for Serout command to work at 9600 baud

Init:  

pause 1000	'Required for proper operation after power-up
serout C.2,T9600_8,($7E,$FF,$06,$09,$00,$00,$02,$EF) 'Select TF socket on Catalex
pause 500	'Required for proper operation after power-up

Main:

serout C.2,T9600_8,($7E,$FF,$06,$0F,$00,$02,$01,$EF) 'Play the song: /02/001XXX.mp3 
pause 12000	'Frequency is 8mhz, so this is actually 6 seconds

serout C.2,T9600_8,($7E,$FF,$06,$0E,$00,$00,$00,$EF) 'Pause playback 
pause 8000	'This is 4 seconds

serout C.2,T9600_8,($7E,$FF,$06,$0D,$00,$00,$00,$EF) 'Resume playback 
pause 10000	'This is 5 seconds

serout C.2,T9600_8,($7E,$FF,$06,$0E,$00,$00,$00,$EF) 'Pause playback 
pause 8000	'This is 4 seconds

serout C.2,T9600_8,($7E,$FF,$06,$0F,$00,$02,$02,$EF) 'play the song: /02/002XXX.mp3
 

1968neil

Senior Member
I've used the Tenda modules in commercial products and they perform faultlessly, if you buy 10 or more you can order directly from china.
Price is around the £6 mark plus shipping from memory.
Audio quality is great but does require amplification and good psu filtering for 100% reliability.

Neil
 

edmunds

Senior Member
I've done plenty of research recently in this area, traces of it are easy to find on the forum.

The ones not yet mentioned on this thread, seem to be SOMO-14D and WTV020SD, which are (albeit arguably) the same thing. The latter is also available as a 20-pin SSOP package IC, so you could put it into your own project. These do work and work well with picaxe, but you will struggle to produce any complex sound effects, so it is really up to the application.

I also tried to take apart one of those 0.99usd MP3 players and connect it to picaxe pins instead of buttons - works like a charm if you only need to play a file or a few.

I have recently been introduced to the aP23682. This seems a lot more promising in many ways apart from the fact it cannot read external memory - no usb sticks, no sd cards, not even an eeprom. However, it seems to have no problem looping a small sample continuously without any gaps, which eliminates the need for massive storage for many projects. The clever memory management and access to it, seems to imply immediate switching without any gap to the next or any other sample in fact would be possible. It is probable the smallest SoC for sound on the market available in terms of package. The down-side for many hobbyist projects, however, will be the OTP (one-time-programmable) feature and the need for a programmer (inexpensive, I'm told). I have a few on order, let's see what comes out of it.

Edmunds
 

xtech007

Senior Member
finally folks!
Got around to play with this module from MDfly (TENDA TDB380) it took for ever to get here due to out of stock.
followed different guides from the forum on how to load mp3 files to the sd card, easiest way for my case was to format card with fat16 and then load the files and rename them A001.mp3, A002.mp3 and so forth.

The code I used is :
Code:
' 28X1 & TDB380 TEST
'** skips to next track**''

wait 1 'allow module to wake up and initialize(might not need that long)

start:
do
if pin1 = 1 and pin2=0 and pin3=0 then gosub play001
if pin1 = 0 and pin2=1 and pin3=0 then gosub play002
if pin1 = 0 and pin2=0 and pin3=1 then gosub play003
loop

play001:
serout 1,T4800,($01) 'out1 from 28x1 to RX of module
return

play002:
serout 1,T4800,($02)
return

play003:
serout 1,T4800,($03)
return


stopmp3:
serout 1,T4800,($EF)
return
Will try to control it next with an infrain!
please feel free to comment and hopefully this can help someone else!
 

barneydog

Member
thanks for your reply 1968neil. shame its recommended voltage is 12v. as most the circuit will work on is 7.2v.

had a search through ebay and found some not controlled by the LM386 but by PAM8406, would there be no noticeable difference?

heres a link to what i found

http://www.ebay.co.uk/itm/Hot-PAM8406-Digital-Amplifier-Board-5Wx2-Volume-Adjustable-D-Class-Board-module-/281669717403?hash=item4194d2cd9b

and

http://www.ebay.co.uk/itm/10x-2-Channel-3W-DC-2-5-5V-PAM8403-Digital-Class-D-Audio-Amplifier-Board-FUS-/291517432526?hash=item43dfcb02ce
 

john2051

New Member
Hi,
am I the only one who bought the tech supplies mp3 player? Is there a problem with these or something?, the only difference I can see
is that they use usb stick instead of an sd card. No doubt there are others, but are they ok? I have not got round to playing with these yet.
regards john
 
Top