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
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.print("V3A"); #play all files
delay(5000); #wait five seconds
Serial.print("VST"); #stop playing
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.