really need help!!

i have seen this project and would like to make it as well. however, i am new to arduino and cant seem to tell what pins to connect my piezos too neither the sensor for the hi hat pedal.

here is the project:

if anyone can help then it would be really really appreciated.
the code is:

please if anyone can help me get a working schematic i would be eternally grateful.

many thanks

marc

Wouldn't that be obvious from the code?

how so? this project uses the a Mux shield and that has a lot of inputs but as still new im not sure how to locate them.

any input??

thanks

marc

Just as a simple button needs a pin defined for an input, so does any other sensor. Look at the top of the code to find out which ones.

but doesnt it differ with multiplexers???

Then the code will tell you which pins the multiplexers are connected to.

i still dont see how it does, i am still very new so please ignore my lack of knowledge, would you mind taking a look and seeing if you could help??

many thanks
marc

It doesn't really matter what inputs you connect them to. The code just scans all of them anyway. You connect the channels to instruments in your MIDI software on the computer.

A piezo generates electricity when pressure is applied to it, so you would connect one end to gnd on the shield and the other end into an input.

I can't promise that would work, because normally you would want a preamp on a piezo to condition the signal (the voltage output is likely in microvolts), but he didn't give any indication in his project that he was doing that.

Something like this. If your piezo does output millivolts, then you can probably just read it directly with the arduino.

http://itp.nyu.edu/physcomp/sensors/Schematics/LM358OpAmp

so effectively i could just connect them all up and put them in ascending order???

However you want. You map them in your midi software. Ascending order makes sense so that you can know what channel is what when you set up the software.

so effectively the MUX shield is just looking for any kind of input voltage from the piezo and connecting them to any of the pins means that they would get read ???

Yes. The code you linked to just scans all of the multiplexed channels and dumps them all to the computer as MIDI channel data. So, in your MIDI software you map the channels that you have populated to instruments. It looks like it reads 48 inputs on the mux shield and 4 from the rest of the analog input pins (A1-A5.) So 52 MIDI channels are sent.

To keep things logical, start with channel 1 when you hook them up so you know which channels are connected when you go to map them.

any idea what the A0 is being used for from looking at the code??

A0 is the analog pin that all those 48 pins on the muxshield are being sent to. So, the mux shield works by addressing a channel (one of the 48 inputs.) This connects that input to A0.

cool i think i get it now on that sense, one last question, any ideas on the connection of the infared sensor or is that done in ht e same way just read as another analogue input from any of the MUX shields inputs???

I would assume so. But I think he is connecting the IR sensors directly to the Arduino on A1-A5 inputs.