Saturday, August 18, 2007

VMUSIC2 on Arduino



I've long been seeking the "Holy Grail" of audio systems for interactive art installations:

1) High quality audio
2) Doesn't depend on a PC
3) Inexpensive
4) Uses some kind of standard flash memory (like SD), preferably with MP3 files.
5) Easy to interface to

So finally this showed up as the Vinculum VMUSIC2. This module takes a standard USB Flash drive for storage, can playback MP3 files, is controlled with a rich set of commands over a serial connection, and costs $41 from Mouser. The only challenge is that the Vinculum documentation is a little unclear whether the VMUSIC2 is DTE or DCE, and it also needs RTS and CTS to work the serial connections.

With some helpful hints from SurplusGizmos, I was able to get the VMUSIC2 to work with the Arduino.

Arduino TX to VMUSIC2 RX
Arduino GND to VMUSIC2 GND and VMUSIC2 CTS#
Arduino 5V to VMUSIC2 5V

This provides a way to write commands to the VMUSIC2 from the Arduino. If you want to hook up the VMUSIC2 TX and get sneakier with CTS# you can have bi-directional communication, but at first I just wanted to see if I could play any files.

On the Arduino side, the key code is:

Serial.begin(9600);
Serial.print("V3A"); #play all files
Serial.print(13,BYTE);
delay(5000); #wait five seconds
Serial.print("VST"); #stop playing
Serial.print(13,BYTE);

Note that there is only one serial port on the Arduino, which is shared between the serial pins and the USB connector. So when you program the Arduino, disconnect the VMUSIC2 RX connection so the programming effort doesn't confuse it, then when the programming is done, hook the VMUSIC2 RX back up to the Arduino TX pin.

Also note that Serial.println("V3A") doesn't quite work, I think it must send carriage return and linefeed, and the linefeed confuses the VMUSIC2.

Finally, while the VMUSIC2 doesn't draw too much power, I noticed that if I plugged it into the Arduino +5V while the Arduino was running that it reset the Arduino. So you may need to add an external +5V regulator for the VMUSIC2 to make sure it runs dependably.

7 comments:

dr said...

do you mind sharing the pde file? also is it just the 3 lines connected to the arduino?

t11s said...

This thread has a bit more of my full experience:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1187669098

You may also want to look at:

http://www.arduino.cc/playground/Main/VMUSIC

I've got to admit that I never quite got it working as well as I wanted to, and set it aside.

Anonymous said...

Thanks for sharing!
I'm wondering if this MP3 player responds quickly (I mean can give you sound with no big latency between the command sending and the sound playing). I'm also wondering if it's possible to start playing a file at a specific time (like start playing the file at sample X to sample Y).

Anonymous said...

im confused, you want hign quality audio AND mp3 format, contradiction in terms mr thinks

intellijel said...

I am considering integrating this into a project. Can you please tell me how long the delay is between sending a command to play a certain audio file and then hearing audio?

e.g. 10ms? 200ms?

thanks!

j.c.karich said...

does anyone knows how to use de VSV function? thanks.

Anonymous said...
This comment has been removed by a blog administrator.