User Tools

Site Tools



The Vmusic2 is a standalone MP3-player which you can control using serial commands. The setup is a bit clumpsy, but when it's up you have a lot of possibilities to build interactive stuff with sound.

Here are the basics on connecting, serial communication and commands.

Since we can use the standard serial port on the arduino to check on status, it's worth getting into how to create an extra serial port for sending commands to the Vmusic2.

An example of a bare minimum program to play a sound once, with no interaction:

#include <SoftwareSerial.h>
//establishing digital pin 6 and 7 to be the extra serial port
#define VMUSIC_RX 6
#define VMUSIC_TX 7
// set up a new serial port
SoftwareSerial mySerial =  SoftwareSerial(VMUSIC_RX, VMUSIC_TX);
void setup() {
  Serial.begin(9600);	// opens serial port, sets data rate to 9600 bps
  mySerial.begin(9600); // set the data rate for the SoftwareSerial port
  // define pin modes for tx, rx pins:
  pinMode(VMUSIC_RX, INPUT);
  Serial.println("Start");  //Sending statusinfo back through the standard serial port
   //Sending the command to play a sound through the new serial port   
   mySerial.print("VPF kettle.mp3"); //kettle.mp3 is my soundfile, what is your?
void loop() {

Start to connect the Arduino to the Vmusic2 with a memorystick with the sounds of your choice and get it working with the basic example. From there, go on by connecting buttons, sensors, servos and have them work with sounds. The possibilities are endless! When are the sounds played? Why? Is it an alarm when someone comes to close, or is it a verification that you put the toilet seat down?

courses/intro.prototyping.fall.2011.dec09.txt · Last modified: 2011/12/08 06:46 by