Using Digital Pins to Start Tracks on MP3 Trigger

Hi all,

I’m a relative newcomer, trying to teach myself electronics and get into some fun Arduino projects.

I’ve familiarised myself with the Arduino Uno through a range of tutorials, and created basic prototype circuits & sketches such as for moving servos in relation to range sensors, etc.

As such, my current problem seems like a step backwards, but I’m absolutely stumped despite spending several hours Googling solutions.

INGREDIENTS:

Arduino Uno

MP3 Trigger WIG-11029

Simple push button

GOAL:

To use a button connected to the Arduino to trigger a track when pressed, then trigger a different track when released.

PROBLEM:

Any Arduino digital pin connected to an input on the MP3 trigger causes the relevant track to start over and over, with seemingly random timing, regardless of the state of the pin (HIGH/LOW, INPUT/OUTPUT).

Pin set using pinMode(XXX, OUTPUT): Several times a second

Pin set using pinMode(XXX, INPUT_PULLUP): Every few seconds

Pin set using pinMode(XXX, INPUT): As above

The only pins it won’t do this with are those left as analog inputs.

QUESTION:

Is there something painfully obvious I’m overlooking about the MP3 trigger?

Will I have to resort to using serial communication instead of the digital pins? (I’d hoped I wouldn’t have to since it’s even further above my current skill level)

If so, can anyone point me to a tutorial for that, because I really can’t find one!

EXAMPLE SKETCH:

const int switchPin = 6;

const int soundPin = 11;

int val;

void setup() {

pinMode(switchPin, INPUT_PULLUP);

pinMode(soundPin, INPUT);

}

void loop() {

val = digitalRead(switchPin);

if (val == LOW) {

pinMode(soundPin, OUTPUT);

delay(20);

pinMode(soundPin, INPUT);

}

}

Simple stuff, right? This is unconnected to the “GOAL” above; it’s just one of many things I’ve tried tonight.

NOTES:

*All inputs on the MP3 trigger work normally when simply connecting its onboard ground column to each input. All tracks are fine, as are the random and stop commands I’ve placed on inputs 17 and 18. The nav button also works fine. I’m getting the standard three LED blinks on startup.

*I’ve tested simple sketches changing out the MP3 trigger for LEDs, and they work fine.

*I’ve soldered socket headers onto the ground and input columns on the MP3 trigger. I think my handiwork is fine, especially since the thing works fine by itself… but I’m mentioning it for full disclosure.

Any advice or guidance you can provide would be much appreciated.

I’m tearing my hair out over here!

XRay

I’m sorry you’re having to go through this. My first suggestion probably won’t be all that helpful, but I’ll say it anyway: Use the WAV Trigger instead of the MP3 Trigger! It has none of these issues, has tons more features, as well as an Arduino serial control library.

What you’re experiencing is a result of the first 16 inputs being multiplexed through an analog switch. Because of this, the MP3 Trigger’s trigger inputs are really designed to only either float (pulled high internally) or be pulled to ground. You can try writing your code to dynamically switch the pin mode between analog input and digital output/LOW when you want to pulse the trigger. If you only need two trigger inputs, you can also try using Triggers 17 and 18, which don’t go through the analog mux.

At the risk of sounding like a salesperson, the WAV Trigger’s inputs are totally configurable in this regard and can be individually set for contact closures, active control from another microcontroller, inverted, edge/level sensitive, etc.

PROBLEM:

Any Arduino digital pin connected to an input on the MP3 trigger causes the relevant track to start over and over, with seemingly random timing, regardless of the state of the pin (HIGH/LOW, INPUT/OUTPUT).

Pin set using pinMode(XXX, OUTPUT): Several times a second

Pin set using pinMode(XXX, INPUT_PULLUP): Every few seconds

Pin set using pinMode(XXX, INPUT): As above

I had the same problem with my trigger and I did fix it, but for the life of me I can’t remember how I did it! But, thought I would post that it is possible to get around this. If I can remember how, I will post up. Now I know I’m getting old…

Thanks for the responses guys, and thanks robertsonics for being present on this forum!

That explanation of the MP3 Trigger’s trigger inputs clears things up tremendously.

When I ordered the board, for some reason I was under the impression that WAV files were of inferior quality to MP3s… now I want to slap myself for not researching enough!

I’ll definitely go for the WAV Trigger next time, but for now I’ve decided to bite the bullet and get into serial communication.

I’ve just successfully triggered a track using a digital switch and serial communication, so I’m well on the way to getting this worked out!

I used the library and guidance found at the links below (please tell me if it’s inappropriate to post these on this forum):

https://github.com/sansumbrella/MP3Trigger-for-Arduino

http://medialappi.net/lab/equipment/ard … rigger-v2/

Of course, if anyone has any other workarounds they’d like to share, I’m all ears.