
robotmaker
USA
Asked
— Edited
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
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.
@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
@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
@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
@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
@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
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
hi KKEAST ,it early monday morning in china and lookat the web for MP3 board with I2C interface and found one about the same cost as the SOMO-14D board this is a true I2C interface DFROBOT MP3 BOARD
DFROBOT MP3 BOARD WIKI SITE besides dfrobot and robotshop sites ,there is one in florida that sells it too DIYBIN
DFROBOT MP3 BOARD DYBIN SITE