So, I'm struggling a bit with making this design decision. And I thought I would post my embarrassment here so that it can haunt me forever on the internet even after I've mastered the electronics of this. Right now I'm between the choice of switching to a digital mux chip that supports interrupts (as graciously suggested above) or using the analog mux board that I have and try to make the reads to it more frequent. After a lot of reading on different sites I'm beginning to think that what I really need to do is condition the output of the piezo sensors to accomodate the analog mux a little better. I found some great resources about this at the following links:http://leucos.lstilde.org/wp/2009/06/pi ... ditioning/http://www.ti.com/lit/an/sloa033a/sloa033a.pdf
I'm sad to say that I don't have a scope to measure what is really going on with the piezo inputs. (And frankly reading the detail in these links really shocked me considering how simply put the demo code and explanation are on the arduino.cc site.) What I can say is this... my existing code can read one sensor (and do a lot of other stuff) every 80ms. A fully stripped down script can read the piezo around every 20ms.
But even at 20ms polls on the target I'm only getting a reading from the piezo on one of the polls when there's a hit. That is to say that the piezo probably excites and settles within around 30ms. That leaves lots of time for my full script to miss lots of hits. That's with 20mm raw piezos (no casing) and a 1m resistor between the leads.
Now I think I made a rookie mistake connecting these sensors as well. Each sensor has been wired to the end of a 10' length of CAT 5 cable (one pair) with the resistor at the far end from the piezo (i.e. piezo... cable... resistor... arduino port) I'm guessing that's probably not right. I'll bet the resistor need to be close to the piezo, right? Is cable capacitance attenuating my signal a little? (Can CC really have that much of an affect at the voltages these things put out... although I know it is a very small current.)
I'm hoping that I can adjust the piezo signal to be less spikey and last longer so that I have a better chance of sensing it. I gather that a capacitor across the positive and negative leads would help adjust this... although it will attenuate the signal a bit. Or... some of the schematics I've seen show a capacitor in-line on the positive lead. Would this be better?
The scope traces on the first link above show a large negative current spike on the signal. What does the arduino ADC do with negative current? Does it just ignore it? Should I be concerned with filtering it? I assume I could put a diode across the piezo leads to handle that right? Does anyone have any hints about how to go about sizing these components? Or am I just way off?