Asked — Edited

About The Mp3 Trigger Board

since it uses serial ,can any MP3 board work ,one from sparkfun is almost $50 and bought one for another project about the same it uses serial SOMO-14D by 4D systems for $25 and uses SD card too somo-14d mp3 board


ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

PRO
Canada
#1  

Me too! I was hoping more people would find out about this module! I used it on my Optimus Prime bot. I ended up getting my module from Solarbotics as I usually do :). Now the communication interface isn't true serial (as I found out the hard way) it is actually Two wire serial or TWI (Two Wire Interface) better known as I2C. I had a bit of a tricky time getting the TWI interface to work (even with DJ's I2C commands in ARC) but I eventually was able to trigger different sound clips using a bit banging method like this:

Set(D2, ON) #Set up initial clock pulse Sleep(300) Set(D2, OFF) sleep(2) Set(D2, ON) #Start the 16 High-Low transition clock signal Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D3,ON) #First Data bit clocked in High Set(D2, ON) Set(D2, OFF) Set(D3,OFF) #Second bit Low Set(D2, ON) Set(D2, OFF) Set(D3,ON) #Third bit High Set(D2, ON) Set(D2, OFF) Set(D2, ON) #Fourth Bit not entered because data pin is left high therefore fourth bit is High Set(D2, OFF) Set(D2,ON) Set(D3,OFF)
Sleep(500)

I set this code segment up in different scripts and called the script to run at certain trigger point such as a joystick button press. So port D2 set up my clock signal and I clocked in the data bits on D3, so 16 high-low transitions with the last 4 clock signals clocking in the data bits which incorporate the track number you'd like to play. In the example above the data bits represent 1011. In decimal that is the number 11, so it's actually plays one number before the track number on the SD card, track 12, odd but it works. Other examples (excluding the 12 previous bits):

Set(D2, ON) #First Bit not available so it's low Set(D2, OFF) Set(D2, ON) #Second bit also mia so it's low too Set(D2, OFF) Set(D3,ON) #third bit high Set(D2, ON) Set(D2, OFF) Set(D3,OFF) #Fourth bit low Set(D2,ON) Sleep(500)

That's 0010 = 2 for track 3

Set(D2, ON) Set(D2, OFF) Set(D3,ON) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D3,OFF) Set(D2,ON) Sleep(500)

That's 0110 = 6 for track 7

Set(D2, ON) Set(D2, OFF) Set(D3, OFF) Set(D2, ON) Set(D2, OFF) Set(D3,ON) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2,ON) Set(D3,OFF) Sleep(500)

That's 0111 = 7 for track 8

Set(D2, ON) Set(D2, OFF) Set(D3, ON) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D3,OFF) Set(D2, ON) Set(D2, OFF) Set(D2,ON) Sleep(500)

That's 1100 = 12 for track 13

I also found that the module didn't like current spikes very much because when connected power to my EZ-B and all the servos turned on the sound module wouldn't work until I reset it. I would have to unplug it and plug it back in or short the reset pin to Gnd to get it to operate again. Turns out that if you use a reset button to Gnd from the reset pin on the SOMO it works quite well to get you back up and running quicker :)

I think I may revisit the ARC I2C commands as I think things may have changed since I first tried, and I may have not been sending the correct commands in the first place. Please let me know if you can get this module working using some easier commands, as I am quite interested.

#2  

@skater_j10 , Wow....great job slamming those bits out! There has GOT to be an easier way!.....any luck with the I2C? I would really love to find a lower cost MP3 sound player. $50 is really steep for the MP3 Trigger that lots of folks currently have....Radio Shack (usually very expensive) has one that is only $30. I am going to stop by the mall and get the name of it and spec it out to see if that would work.

v/r

Kevin

#3  

@kkeast check out the somo-14d module its only $25 an would check many websites selling some $10 shipping some $4.95 sparkfun has it for $26.95 + $3.64 mostly i check the lowest price,but unless buying other stuff,some better to add it to the order because can save on shipping

#4  

@robotmaker , Thanks, that looks pretty good. Data sheet has all the commands in it too. I am not sure why Sparkfun does not advertise this as I2C compliant vice TWI? I would hate to fall into the script nightmare skater_j10 did above.

v/r

kevin

#5  

@kkeast TWI meens Two Wire Interface or called I2C,has a data and clock there is software to convert MP3 files for it too from 3D systems

i got it in a week ago,but havent tested it yet,my main robot design comes first brookstone ROVER hack and then my ROOMBA hack,lucky i only work as a support and design person part time,pay very good and travel even better,china a few times

#6  

@robotmaker , I did not know why Sparkfun was not calling TWI, I2C....did a little more research and it turns out it is a trademark issue. Looking forward to hearing about the device and how it works after you clear your project plate a bit. Sounds like you have a sweet job!

v/r

Kevin

#7  

I received my nearly identical device this weekend and have been going through the docs.

As skater_j10 points out above this is TWI, but that does not necessarily mean I2C. Don't be fooled. I think you can say I2C is TWI but not vice versa.

The device I got and the SOMO-14D do not have an I2C address. The devices discussed here also use 16 bit commands where I2C is 8.

This note I found in a forum on the SOMO summs it up pretty good:

'The SERIAL-MODE (of the SOMO) provides a simple 2-wire interface via its DATA and CLK lines but this is simple slower serial interface and more akin to SPI. It is not a bi-directional i2c comms bus.'

It seems that using the I2C script commands might be able to work...I have not had any luck....so far..... skater_j10s bit banging script is looking better and better.

I hope robotmaker has better luck than I am having

v/r

Kevin

#9  

@robotmaker, Nice find. I am thinking I may go with that one. While the ones like the SOMO and the one I got from Elechouse are cheaper but certainly not as simple to work with. Besides I would have to use up 2 I/O ports doing the scripting above....would much rather set up the I2C bus.

Hope your China trip is going well.

v/r

kevin

#10  

making very good money,when i get back looking to get the board too SOMO will look at using it for another project

#11  

@robotmaker,

Have you had a chance to look at the dfrobot MP3 sound board yet? It looks like it should hook right up to the I2C interface on the EZB. I have not bought one yet but want to get one if it works. Cheaper than the MP3 Trigger from Sparkfun.

v/r

Kevin

#12  

no trying to post photos of my roomba project first,hope this saterday then next week getting a few cabbles for IR sensor and another IR sensor i forgot hope to wrap it up next weekend got camera mounted all sensors 10 of them mounted,this weekend mounting EZB and ITX board

then after next weekend i can work on the MP3 board board looks very good,not great at making I2C commands but will try with your examples you have so many robot not enought time in the day

#13  

@kkeast & robotmaker Here is another MP3 Trigger you might want to look at from Endurance Robotics. Don't know if it has what you are looking for but I figured you might like to look it over.

MP3 Trigger

Oh well guess this the one from Sparkfun anyway. Saw it after I looked at data sheet :)

Data Sheet

#14  

@rgordon IT TAKES serial ,need I2C bus

#15  

@rgordon,

This should work with EZB....I am pretty sure EZB will do 38.4kbps.

Simply send the signal line from any Digi port into the RX on the board...you would not have RX back to the EZB...but you don't need it to send commands.

This one from robotmaker's post is still the best deal I have found using I2C though....

DIYBIN

@robotmaker...I just ordered one that you found.....price is down to $25....$35 to the door with shipping....

v/r

Kevin

Portugal
#16  

I hope you are all right,

Skater J10 I'm trying to connect the EZB to the SOMO 14D audio module. I'm having problems as you mentioned to control it using I2C commands as the manufacturer suggests. I did try your method using D2 (clock) and D3 (Data) to simulate I2C, however I'm still unable to get it working (I tried your script on EZB and also convert it to the EZB SDK).

  1. I have 18 songs .ad4 format on the SD card
  2. My connections are EZB D2 (1 wire connects to the SOMO 14D Clock input (3)); EZB D3 (1 wire connects to the SOMO 14D Data input (4)).
  3. VCC and Ground (3.3V) are connected to the SOMO 14D (pins 8 and 9 respectively)
  4. On the electrical scheme the manufacturer still uses a Reset pin to SOMO 14D (pin 10) (I think we just need it to reset the audio module and it's not relevant for I2C).
  5. Speaker 8 Ohm, 0,25W connected to SOMO 14D (pins 12, 11).

(Note: I can control the unit by key Mode, however I'm much more interested in controlling it through the EZB) I would like to use your method to play any songs in my robot. Any help would much appreciated.

PRO
Canada
#17  

Hi Robotez!

So it sounds like you have everything built correctly if you can make it work in Key mode. All I can suggest is having a quick reset switch to GND (from reset pin) as I had a lot of trouble with the module locking up upon power up of my bot, one reset push allowed it to work until the bot was powered down again.

Otherwise just make sure you have the whole script from my first example, the partial scripts afterward where just to illustrate the changes needed to activate a different numbered track.

You could swap D2 and D3 lines and see if it's just a wiring issue.

Hope that helps!

Portugal
#18  

Hi Skater J10,

Hope you are OK. I have tried your script however I am still not successful. Nevertheless when I play the script (on ARC) I can hear two low tones coming from the speaker (just like the SOMO 14D wanted to start playing something) but it can't for some reason (maybe the timing on the clock isn't right or something is wrong with the data I'm sending). Here's the script I'm sending to play track 2 through the ARC Script (I click Config then Start). Note I have only seven tracks on my Scandisk 2GB micro sim card (this refers to track 2).

Set(D2, ON) #Set up initial clock pulse Sleep(300) Set(D2, OFF) sleep(2) Set(D2, ON) #Start the 16 High-Low transition clock signal Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) Set(D2, OFF) Set(D2, ON) #First Bit not available so it's low Set(D2, OFF) Set(D2, ON) #Second bit also mia so it's low too Set(D2, OFF) Set(D3,ON) #third bit high Set(D2, ON) Set(D2, OFF) Set(D3,OFF) #Fourth bit low Set(D2,ON) Sleep(500)

Another question but now related with the wiring connections: I'm using the D2 EXT PWR wire to simulate the clock and connect it to SOMO 14D pin 3. Similarly I'm using D3 EXT PWR to simulate the data and connect it to the SOMO 14D pin4. I should be using the EXT PWR wire not 5V or GND from each digital output right? In terms of EZB hardware I'm trying on EZB V3 chip, with firmware V16 and through ARC 2012.08.08.00. As you might know, following the SOMO14D protocol in terms of commands "0xfffe" to play or send other instructions such as selecting the track number "0002" are not working with the C# SDK (I think you share the same opinion). I'm very interested in your method as it proves to be very helpful.

Regards, Robotez

PRO
Canada
#19  

So the D2 and D3 connections should be connected to outer pins on D2 & D3. Other things to keep in mind are:

  • to power the SOMO off the 3.3V regulator on the EZ-B, you risk damaging it at 5V.
  • make sure you have your files labelled correctly on your SD card (ex: 0007.ad4)
  • you can either reset the module with a brief LOW signal with another I/O line or use a push button connected reset pin on the somo and to GND on the other side.

I can hook up my setup again and try out the code segment to see if there are any issues maybe with speed changes in EZ-B versions since I got it working a while ago.

Otherwise I would suggest going back to key mode and making sure everything works still.