Pages: [1]   Go Down
Author Topic: Help needed for Arduino Drum set-up  (Read 982 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I'm totally new with Arduino and I'm stuck with something.
I've build this switchboard that wil turn on relays.
I have made connections to these relays to connect to my arduino.
Now I would like to connect these relays (which actually work as regular push buttons) to my arduino and send them to ardrumo.
Could somebody please explain me how to connect these switches (4 of them) to my board.

From there I think I can continue.

Thank you

Joey
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 178
Posts: 8064
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.arduino.cc/en/Tutorial/Button
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the information.
The set up will be used using this configuration for midi.
Is this possible as well when connected like that?
Because in this scheme below I don't see the 5v and the resistors.
(looking at the a b c buttons since i won't be using piezo's)

Thank you
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 178
Posts: 8064
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are two ways to use a "normally open" button. 

The example in the tutorial uses a "Pull Down" resistor to keep the input LOW until the button is pressed, at which time the connection through the button to +5V overrides the pull-down resistor and the input reads as HIGH.

Another method is to use a "Pull UP" resistor to keep the input HIGH until the button is pressed, at which time the connection through the button to Ground overrides the pull-up resistor and the input reads as LOW.  The diagram doesn't show a pull-up resistor because the Arduino has built-in pull-up resistors that can be enabled with digitalWrite(inputPin, HIGH);

If the button is Normally Closed, the logic is reversed.

It takes fewer parts (because of the internal pull-up resistors) to use the second method but some people don't like the fact that a closed switch gives a LOW and an open switch gives a HIGH.  To some it seems counter-intuitive.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

0
Offline Offline
Full Member
***
Karma: 0
Posts: 150
veroboaring is the new XGame - Extreme Veroboarder
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all!.
I'm working with a Arduino Drum set too.
Now i don't want to use a Arduino-to-MIDI port...because my computer don't have it.

What i found is this project: http://memeteam.net/s2midi
And this that look veeery nice !!: http://drummaster.digitalcave.ca

Some one test this using windows?

Now at traducers.. using them directly connected to the analog input is rigth? or is beter use a LOW-PASS filter to clear more the signal, using only the envelope signal ?

Best Regards
Frank
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I'm still struggling with my project.
I finally got my relays set up right and when I test them with the LED on pin 13 they all work fine.
BUT when I connect my board to ardrumo I can't figure out the code I need the get them sorted.
The relays work as push buttons so I need to get rid of all the piezo information.
This is the code for the ardrumo when using piezo's

/*
 * Ardrumo sketch
 *
 * Use with the Ardrumo software here:
 * http://code.google.com/p/ardrumo/
 * This is designed to let an Arduino act as a drum machine
 * in GarageBand (sorry, Mac OS X only).
 */

#define LEDPIN     13     // status LED pin
#define PIEZOTHRESHOLD 5  // analog threshold for piezo sensing
#define PADNUM 6          // number of pads

int val;

void setup() {
  pinMode(LEDPIN, OUTPUT);
  Serial.begin(57600);   // set serial output rate
}

void loop() {

  // Loop through each piezo and send data
  // on the serial output if the force exceeds
  // the piezo threshold
  for(int i = 0; i < PADNUM; i++) {
    val = analogRead(i);
    if( val >= PIEZOTHRESHOLD ) {
      digitalWrite(LEDPIN,HIGH);  // indicate we're sending MIDI data
      Serial.print(i);
      Serial.print(",");
      Serial.print(val);
      Serial.println();
      digitalWrite(LEDPIN,LOW);
    }
  }
}

Is there anybody that is able to adjust the ardumo code that I need to upload to use my switches instead of the piezo's?
I have got resistors between my relays so there is no need in using the internal pull up.

thank you very very much

Joey
« Last Edit: May 25, 2011, 03:00:29 pm by Joeyarduino » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everybody!
My project is taking shape as we go! I found out (thanks to Mike from ardrumo) that i'm able to use my switches.
Michael helped me writing this code below which wors perfectly.
The only thing I would like to do is add three more switches on digital pin 4, 5 and 6 (i'm using pin 7 right now)
These other switches should turn on other pads (switch 7 switches pad 1)
Hopefully somebody is able to help me writing the right code since I'm lost in my project.

#define LEDPIN     13     // status LED pin
#define SWITCHPIN   7     // switch digital pin
#define CONSVAL   120     // default value to use for trigger

int val;

void setup() {

 pinMode(LEDPIN, OUTPUT);
 pinMode(SWITCHPIN, INPUT); // assume switch is wired to SWITCHPIN
 Serial.begin(57600);       // set serial output rate
}

void loop() {

 // If a button connected to digital pin #7 is pressed
 // then trigger a sound.  Note this code should include
 // some way to make sure the sound is played just once
 // and not over and over if a button is held down.

   val = digitalRead(SWITCHPIN);
   if( val == 1 ) {
     digitalWrite(LEDPIN,HIGH);  // indicate we're sending MIDI data
     Serial.print(1);            // send signal to Ardrumo pad 1
     Serial.print(",");
     Serial.print(CONSVAL);
     Serial.println();
     digitalWrite(LEDPIN,LOW);
   }
}


(the coe I'm using right now for pin 7)
Logged

Pages: [1]   Go Up
Jump to: