Step 3: Adding Piezos

Now that I have the off/on micro switches working the mid inputs I switched them out for 12mm piezo that i found on ebay.  Same wiring diagram.  I experimented with several ways to mount and actuate the piezos.   Simply  mounting them on a flat surface and touching with your fingers does a reasonably good job.  I experimented with a number of different configurations for mounting the piezos.   I found that having a simple test jig allowed me to more reliably measure the response.  Hot gluing them to 1/2" foam is good too.  Cut holes in the foam, drop the wires through and you are done.

The piezo generates electricity based on the amount of deflection in the crystal.   Some piezos used in instrumentation are gripped on the side (a cantilever mount).  I chose to make  small indentations in the backing material that would allow the piezos to bend and flex.  So mounting the piezos is an important consideration when your goal is to read the current from individual keystrokes.  It's not like using a piezo as a pickup on a guitar.  

One must be careful when attaching devices to the analog pins. The piezos can generate voltages from -20vdc to +60vdc.  I put them on a scope and it's quite an interesting wave form.  The clamping diodes  on the ATmel allow up to 1 milliamp (1000 microamps).   So the 1M ohm pull down resistor helps protect the analog inputs on the arduino.  

In the end the  piezos worked fine - but getting the analog inputs on the board to recognize and turn them reliably into a midi signal  is a work in progress.    This is why I like working with Tom.  He's already come up with some different designs for my unique needs.     So the next task is figuring out how to add some subtle circuitry that will make the arduino a little more responsive. 

I've tried implementing this simple circuit (below) to the output and I think that with some changes in the code and tuning of the circuit I will have a good basic design.


Now onto the next step - adding a mux.  Which again - Tom Scarff cranked out in short order.  There is still quite a bit of design work left but i'm very pleased with the initial product; a six note midi controller (soon to be expanded).

how to you plan to expand this to 100 inputs?
http://mayhewlabs.com/products/arduino-mux-shield <br> <br>snap on two of these to two separate arduino boards (or stack on one board). communication between the two boards can be via I2C. Which I am trying to learn about right now. (https://www.instructables.com/id/I2C-between-Arduinos/ ) <br> <br>I've thought about having six mux's each with an input to an analog pin - but i don't think it will save that much with speed and probably what i have will suffice.

About This Instructable




More by daveclark5:arduino mayhew mux shield - cable connections solutions (techshop) Arduino MIDI controller - techshop using scarff boarduino Using the TechShop Canon iPF 750 oversized printer to make high res color vinyl signs! 
Add instructable to: